@smithy/core 1.3.0 → 1.3.2

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 CHANGED
@@ -446,35 +446,48 @@ function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenNam
446
446
  }
447
447
  yield page;
448
448
  const prevToken = token;
449
- token = page[outputTokenName];
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:
468
+
457
469
  0 && (module.exports = {
458
- DefaultIdentityProviderConfig,
459
- EXPIRATION_MS,
460
- HttpApiKeyAuthSigner,
461
- HttpBearerAuthSigner,
462
- NoAuthSigner,
463
- RequestBuilder,
464
- createIsIdentityExpiredFunction,
465
470
  createPaginator,
466
- doesIdentityRequireRefresh,
467
- getHttpAuthSchemeEndpointRuleSetPlugin,
468
- getHttpAuthSchemePlugin,
469
- getHttpSigningPlugin,
470
- getSmithyContext,
471
- httpAuthSchemeEndpointRuleSetMiddlewareOptions,
472
471
  httpAuthSchemeMiddleware,
472
+ httpAuthSchemeEndpointRuleSetMiddlewareOptions,
473
+ getHttpAuthSchemeEndpointRuleSetPlugin,
473
474
  httpAuthSchemeMiddlewareOptions,
475
+ getHttpAuthSchemePlugin,
474
476
  httpSigningMiddleware,
475
477
  httpSigningMiddlewareOptions,
478
+ getHttpSigningPlugin,
479
+ DefaultIdentityProviderConfig,
480
+ HttpApiKeyAuthSigner,
481
+ HttpBearerAuthSigner,
482
+ NoAuthSigner,
483
+ createIsIdentityExpiredFunction,
484
+ EXPIRATION_MS,
476
485
  isIdentityExpired,
486
+ doesIdentityRequireRefresh,
477
487
  memoizeIdentityProvider,
488
+ getSmithyContext,
478
489
  normalizeProvider,
479
- requestBuilder
490
+ requestBuilder,
491
+ RequestBuilder
480
492
  });
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[outputTokenName];
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.0",
3
+ "version": "1.3.2",
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.0",
27
- "@smithy/middleware-retry": "^2.1.0",
28
- "@smithy/middleware-serde": "^2.1.0",
29
- "@smithy/protocol-http": "^3.1.0",
30
- "@smithy/smithy-client": "^2.3.0",
31
- "@smithy/types": "^2.9.0",
32
- "@smithy/util-middleware": "^2.1.0",
26
+ "@smithy/middleware-endpoint": "^2.4.1",
27
+ "@smithy/middleware-retry": "^2.1.1",
28
+ "@smithy/middleware-serde": "^2.1.1",
29
+ "@smithy/protocol-http": "^3.1.1",
30
+ "@smithy/smithy-client": "^2.3.1",
31
+ "@smithy/types": "^2.9.1",
32
+ "@smithy/util-middleware": "^2.1.1",
33
33
  "tslib": "^2.5.0"
34
34
  },
35
35
  "engines": {