@fonoster/sipnet 0.17.0 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,9 +33,9 @@ type PaginatedListOptions<TInput, TOutput = TInput> = {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare function normalizePageToken(pageToken?: string): string | undefined;
|
|
35
35
|
/**
|
|
36
|
-
* Normalizes empty string
|
|
36
|
+
* Normalizes nextPageToken from response; returns empty string when there are no more pages.
|
|
37
37
|
*/
|
|
38
|
-
export declare function normalizeNextPageToken(nextPageToken?: string): string
|
|
38
|
+
export declare function normalizeNextPageToken(nextPageToken?: string): string;
|
|
39
39
|
/**
|
|
40
40
|
* Filters items by accessKeyId from extended field.
|
|
41
41
|
*/
|
|
@@ -21,10 +21,10 @@ function normalizePageToken(pageToken) {
|
|
|
21
21
|
return pageToken === "" ? undefined : pageToken;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Normalizes empty string
|
|
24
|
+
* Normalizes nextPageToken from response; returns empty string when there are no more pages.
|
|
25
25
|
*/
|
|
26
26
|
function normalizeNextPageToken(nextPageToken) {
|
|
27
|
-
return nextPageToken && nextPageToken !== "" ? nextPageToken :
|
|
27
|
+
return nextPageToken && nextPageToken !== "" ? nextPageToken : "";
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Filters items by accessKeyId from extended field.
|
|
@@ -48,7 +48,7 @@ function paginateWithFiltering(options) {
|
|
|
48
48
|
const { pageSize, pageToken, fetchPage, filterItems, maxIterations = 10 } = options;
|
|
49
49
|
const normalizedPageToken = normalizePageToken(pageToken);
|
|
50
50
|
const items = [];
|
|
51
|
-
let nextPageToken;
|
|
51
|
+
let nextPageToken = "";
|
|
52
52
|
let currentPageToken = normalizedPageToken;
|
|
53
53
|
let hasMorePages = true;
|
|
54
54
|
let iterations = 0;
|
|
@@ -61,7 +61,7 @@ function paginateWithFiltering(options) {
|
|
|
61
61
|
const response = yield fetchPage(currentPageToken, backendRequestedSize);
|
|
62
62
|
if (!response || !response.items) {
|
|
63
63
|
hasMorePages = false;
|
|
64
|
-
nextPageToken =
|
|
64
|
+
nextPageToken = "";
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
const filteredItems = filterItems(response.items);
|
|
@@ -70,7 +70,7 @@ function paginateWithFiltering(options) {
|
|
|
70
70
|
// If we got no items from backend or no nextPageToken, we're done
|
|
71
71
|
if (response.items.length === 0 || !backendNextPageToken) {
|
|
72
72
|
hasMorePages = false;
|
|
73
|
-
nextPageToken =
|
|
73
|
+
nextPageToken = "";
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
76
|
// Check if backend returned fewer items than requested (indicating last page)
|
|
@@ -80,7 +80,7 @@ function paginateWithFiltering(options) {
|
|
|
80
80
|
if (items.length >= pageSize) {
|
|
81
81
|
// We filled the page, so there might be more items
|
|
82
82
|
// Only return nextPageToken if backend indicates there are more items
|
|
83
|
-
nextPageToken = backendHasMoreItems ? backendNextPageToken :
|
|
83
|
+
nextPageToken = backendHasMoreItems ? backendNextPageToken : "";
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
// If we got filtered items in this iteration, return them
|
|
@@ -91,7 +91,7 @@ function paginateWithFiltering(options) {
|
|
|
91
91
|
nextPageToken = backendNextPageToken;
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
|
-
nextPageToken = backendHasMoreItems ? backendNextPageToken :
|
|
94
|
+
nextPageToken = backendHasMoreItems ? backendNextPageToken : "";
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/sipnet",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "Routr-based SIP stack",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"fonoster": "./dist/index.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@fonoster/common": "^0.17.
|
|
24
|
-
"@fonoster/identity": "^0.17.
|
|
25
|
-
"@fonoster/logger": "^0.17.
|
|
26
|
-
"@fonoster/types": "^0.17.
|
|
23
|
+
"@fonoster/common": "^0.17.1",
|
|
24
|
+
"@fonoster/identity": "^0.17.3",
|
|
25
|
+
"@fonoster/logger": "^0.17.1",
|
|
26
|
+
"@fonoster/types": "^0.17.1",
|
|
27
27
|
"@grpc/grpc-js": "~1.10.6",
|
|
28
28
|
"@routr/sdk": "2.13.1",
|
|
29
29
|
"zod": "^3.23.8"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"bugs": {
|
|
42
42
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "7dc514223ea328efb5a4a6b15d92ebbf048e1f73"
|
|
45
45
|
}
|