Skip to content

Commit 2b92c85

Browse files
Get DeltaLink link support added
1 parent 477f3f0 commit 2b92c85

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

lib/graph-js-sdk-core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/graph-js-sdk-web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/tasks/PageIterator.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Client } from "../index";
1111
export interface PageCollection {
1212
value: any[];
1313
"@odata.nextLink"?: string;
14+
"@odata.deltaLink"?: string;
1415
[Key: string]: any;
1516
}
1617
/**
@@ -39,6 +40,11 @@ export declare class PageIterator {
3940
* Member variable referring to nextLink of the page collection
4041
*/
4142
private nextLink;
43+
/**
44+
* @private
45+
* Member variable referring to deltaLink of the request
46+
*/
47+
private deltaLink;
4248
/**
4349
* @private
4450
* Holding callback for Iteration.
@@ -64,6 +70,7 @@ export declare class PageIterator {
6470
* @return A promise that resolves to a response data with next page collection
6571
*/
6672
private fetchAndUpdateNextPageData;
73+
getDeltaLink(): string | undefined;
6774
/**
6875
* @async
6976
* Iterates over the collection and kicks callback for each item on iteration. Fetches next set of data through nextLink and iterates over again

lib/src/tasks/PageIterator.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/tasks/PageIterator.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tasks/PageIterator.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Client } from "../index";
1313
export interface PageCollection {
1414
value: any[];
1515
"@odata.nextLink"?: string;
16+
"@odata.deltaLink"?: string;
1617
[Key: string]: any;
1718
}
1819

@@ -47,6 +48,12 @@ export class PageIterator {
4748
*/
4849
private nextLink: string | undefined;
4950

51+
/**
52+
* @private
53+
* Member variable referring to deltaLink of the request
54+
*/
55+
private deltaLink: string | undefined;
56+
5057
/**
5158
* @private
5259
* Holding callback for Iteration.
@@ -65,6 +72,7 @@ export class PageIterator {
6572
self.client = client;
6673
self.collection = pageCollection.value;
6774
self.nextLink = pageCollection["@odata.nextLink"];
75+
self.deltaLink = pageCollection["@odata.deltaLink"];
6876
self.callback = callback;
6977
}
7078

@@ -95,14 +103,19 @@ export class PageIterator {
95103
private async fetchAndUpdateNextPageData(): Promise<any> {
96104
try {
97105
let self = this,
98-
response = await self.client.api(self.nextLink).get();
106+
response: PageCollection = await self.client.api(self.nextLink).get();
99107
self.collection = response.value;
100108
self.nextLink = response["@odata.nextLink"];
109+
self.deltaLink = response["@odata.deltaLink"];
101110
} catch (error) {
102111
throw error;
103112
}
104113
}
105114

115+
getDeltaLink(): string | undefined {
116+
return this.deltaLink;
117+
}
118+
106119
/**
107120
* @async
108121
* Iterates over the collection and kicks callback for each item on iteration. Fetches next set of data through nextLink and iterates over again

0 commit comments

Comments
 (0)