@smithy/core 1.3.1 → 1.3.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.
- package/dist-cjs/index.js +26 -15
- package/dist-es/pagination/createPaginator.js +12 -1
- package/package.json +8 -8
package/dist-cjs/index.js
CHANGED
|
@@ -446,37 +446,48 @@ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenNam
|
|
|
446
446
|
}
|
|
447
447
|
yield page;
|
|
448
448
|
const prevToken = token;
|
|
449
|
-
token = page
|
|
449
|
+
token = get(page, outputTokenName);
|
|
450
450
|
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
451
451
|
}
|
|
452
452
|
return void 0;
|
|
453
453
|
}, "paginateOperation");
|
|
454
454
|
}
|
|
455
455
|
__name(createPaginator, "createPaginator");
|
|
456
|
+
var get = /* @__PURE__ */ __name((fromObject, path) => {
|
|
457
|
+
let cursor = fromObject;
|
|
458
|
+
const pathComponents = path.split(".");
|
|
459
|
+
for (const step of pathComponents) {
|
|
460
|
+
if (!cursor || typeof cursor !== "object") {
|
|
461
|
+
return void 0;
|
|
462
|
+
}
|
|
463
|
+
cursor = cursor[step];
|
|
464
|
+
}
|
|
465
|
+
return cursor;
|
|
466
|
+
}, "get");
|
|
456
467
|
// Annotate the CommonJS export names for ESM import in node:
|
|
457
468
|
|
|
458
469
|
0 && (module.exports = {
|
|
459
|
-
DefaultIdentityProviderConfig,
|
|
460
|
-
EXPIRATION_MS,
|
|
461
|
-
HttpApiKeyAuthSigner,
|
|
462
|
-
HttpBearerAuthSigner,
|
|
463
|
-
NoAuthSigner,
|
|
464
|
-
RequestBuilder,
|
|
465
|
-
createIsIdentityExpiredFunction,
|
|
466
470
|
createPaginator,
|
|
467
|
-
doesIdentityRequireRefresh,
|
|
468
|
-
getHttpAuthSchemeEndpointRuleSetPlugin,
|
|
469
|
-
getHttpAuthSchemePlugin,
|
|
470
|
-
getHttpSigningPlugin,
|
|
471
|
-
getSmithyContext,
|
|
472
|
-
httpAuthSchemeEndpointRuleSetMiddlewareOptions,
|
|
473
471
|
httpAuthSchemeMiddleware,
|
|
472
|
+
httpAuthSchemeEndpointRuleSetMiddlewareOptions,
|
|
473
|
+
getHttpAuthSchemeEndpointRuleSetPlugin,
|
|
474
474
|
httpAuthSchemeMiddlewareOptions,
|
|
475
|
+
getHttpAuthSchemePlugin,
|
|
475
476
|
httpSigningMiddleware,
|
|
476
477
|
httpSigningMiddlewareOptions,
|
|
478
|
+
getHttpSigningPlugin,
|
|
479
|
+
DefaultIdentityProviderConfig,
|
|
480
|
+
HttpApiKeyAuthSigner,
|
|
481
|
+
HttpBearerAuthSigner,
|
|
482
|
+
NoAuthSigner,
|
|
483
|
+
createIsIdentityExpiredFunction,
|
|
484
|
+
EXPIRATION_MS,
|
|
477
485
|
isIdentityExpired,
|
|
486
|
+
doesIdentityRequireRefresh,
|
|
478
487
|
memoizeIdentityProvider,
|
|
488
|
+
getSmithyContext,
|
|
479
489
|
normalizeProvider,
|
|
480
|
-
requestBuilder
|
|
490
|
+
requestBuilder,
|
|
491
|
+
RequestBuilder
|
|
481
492
|
});
|
|
482
493
|
|
|
@@ -19,9 +19,20 @@ export function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputT
|
|
|
19
19
|
}
|
|
20
20
|
yield page;
|
|
21
21
|
const prevToken = token;
|
|
22
|
-
token = page
|
|
22
|
+
token = get(page, outputTokenName);
|
|
23
23
|
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
24
24
|
}
|
|
25
25
|
return undefined;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
const get = (fromObject, path) => {
|
|
29
|
+
let cursor = fromObject;
|
|
30
|
+
const pathComponents = path.split(".");
|
|
31
|
+
for (const step of pathComponents) {
|
|
32
|
+
if (!cursor || typeof cursor !== "object") {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
cursor = cursor[step];
|
|
36
|
+
}
|
|
37
|
+
return cursor;
|
|
38
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline core",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@smithy/middleware-endpoint": "^2.4.
|
|
27
|
-
"@smithy/middleware-retry": "^2.1.
|
|
28
|
-
"@smithy/middleware-serde": "^2.1.
|
|
29
|
-
"@smithy/protocol-http": "^3.
|
|
30
|
-
"@smithy/smithy-client": "^2.
|
|
31
|
-
"@smithy/types": "^2.
|
|
32
|
-
"@smithy/util-middleware": "^2.1.
|
|
26
|
+
"@smithy/middleware-endpoint": "^2.4.2",
|
|
27
|
+
"@smithy/middleware-retry": "^2.1.2",
|
|
28
|
+
"@smithy/middleware-serde": "^2.1.2",
|
|
29
|
+
"@smithy/protocol-http": "^3.2.0",
|
|
30
|
+
"@smithy/smithy-client": "^2.4.0",
|
|
31
|
+
"@smithy/types": "^2.10.0",
|
|
32
|
+
"@smithy/util-middleware": "^2.1.2",
|
|
33
33
|
"tslib": "^2.5.0"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|