@aws-sdk/credential-provider-cognito-identity 3.721.0 → 3.726.0

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
@@ -71,13 +71,9 @@ __name(resolveLogins, "resolveLogins");
71
71
  // src/fromCognitoIdentity.ts
72
72
  function fromCognitoIdentity(parameters) {
73
73
  return async (awsIdentityProperties) => {
74
- var _a;
75
- (_a = parameters.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
74
+ parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
76
75
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
77
- const fromConfigs = /* @__PURE__ */ __name((property) => {
78
- var _a2, _b, _c;
79
- return ((_a2 = parameters.clientConfig) == null ? void 0 : _a2[property]) ?? ((_b = parameters.parentClientConfig) == null ? void 0 : _b[property]) ?? ((_c = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _c[property]);
80
- }, "fromConfigs");
76
+ const fromConfigs = /* @__PURE__ */ __name((property) => parameters.clientConfig?.[property] ?? parameters.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property], "fromConfigs");
81
77
  const {
82
78
  Credentials: {
83
79
  AccessKeyId = throwOnMissingAccessKeyId(parameters.logger),
@@ -125,10 +121,13 @@ __name(throwOnMissingSecretKey, "throwOnMissingSecretKey");
125
121
 
126
122
  // src/IndexedDbStorage.ts
127
123
  var STORE_NAME = "IdentityIds";
128
- var _IndexedDbStorage = class _IndexedDbStorage {
124
+ var IndexedDbStorage = class {
129
125
  constructor(dbName = "aws:cognito-identity-ids") {
130
126
  this.dbName = dbName;
131
127
  }
128
+ static {
129
+ __name(this, "IndexedDbStorage");
130
+ }
132
131
  getItem(key) {
133
132
  return this.withObjectStore("readonly", (store) => {
134
133
  const req = store.get(key);
@@ -191,14 +190,15 @@ var _IndexedDbStorage = class _IndexedDbStorage {
191
190
  });
192
191
  }
193
192
  };
194
- __name(_IndexedDbStorage, "IndexedDbStorage");
195
- var IndexedDbStorage = _IndexedDbStorage;
196
193
 
197
194
  // src/InMemoryStorage.ts
198
- var _InMemoryStorage = class _InMemoryStorage {
195
+ var InMemoryStorage = class {
199
196
  constructor(store = {}) {
200
197
  this.store = store;
201
198
  }
199
+ static {
200
+ __name(this, "InMemoryStorage");
201
+ }
202
202
  getItem(key) {
203
203
  if (key in this.store) {
204
204
  return this.store[key];
@@ -212,8 +212,6 @@ var _InMemoryStorage = class _InMemoryStorage {
212
212
  this.store[key] = value;
213
213
  }
214
214
  };
215
- __name(_InMemoryStorage, "InMemoryStorage");
216
- var InMemoryStorage = _InMemoryStorage;
217
215
 
218
216
  // src/localStorage.ts
219
217
  var inMemoryStorage = new InMemoryStorage();
@@ -241,14 +239,11 @@ function fromCognitoIdentityPool({
241
239
  logger,
242
240
  parentClientConfig
243
241
  }) {
244
- logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
242
+ logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
245
243
  const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : void 0;
246
244
  let provider = /* @__PURE__ */ __name(async (awsIdentityProperties) => {
247
245
  const { GetIdCommand: GetIdCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
248
- const fromConfigs = /* @__PURE__ */ __name((property) => {
249
- var _a;
250
- return (clientConfig == null ? void 0 : clientConfig[property]) ?? (parentClientConfig == null ? void 0 : parentClientConfig[property]) ?? ((_a = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _a[property]);
251
- }, "fromConfigs");
246
+ const fromConfigs = /* @__PURE__ */ __name((property) => clientConfig?.[property] ?? parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property], "fromConfigs");
252
247
  const _client = client ?? new CognitoIdentityClient2(
253
248
  Object.assign({}, clientConfig ?? {}, {
254
249
  region: fromConfigs("region"),
@@ -1,4 +1,5 @@
1
1
  export class InMemoryStorage {
2
+ store;
2
3
  constructor(store = {}) {
3
4
  this.store = store;
4
5
  }
@@ -1,5 +1,6 @@
1
1
  const STORE_NAME = "IdentityIds";
2
2
  export class IndexedDbStorage {
3
+ dbName;
3
4
  constructor(dbName = "aws:cognito-identity-ids") {
4
5
  this.dbName = dbName;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-cognito-identity",
3
- "version": "3.721.0",
3
+ "version": "3.726.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline credential-provider-cognito-identity",
@@ -24,14 +24,14 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/client-cognito-identity": "3.721.0",
28
- "@aws-sdk/types": "3.714.0",
29
- "@smithy/property-provider": "^3.1.11",
30
- "@smithy/types": "^3.7.2",
27
+ "@aws-sdk/client-cognito-identity": "3.726.0",
28
+ "@aws-sdk/types": "3.723.0",
29
+ "@smithy/property-provider": "^4.0.0",
30
+ "@smithy/types": "^4.0.0",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "engines": {
34
- "node": ">=16.0.0"
34
+ "node": ">=18.0.0"
35
35
  },
36
36
  "typesVersions": {
37
37
  "<4.0": {
@@ -54,6 +54,6 @@
54
54
  "concurrently": "7.0.0",
55
55
  "downlevel-dts": "0.10.1",
56
56
  "rimraf": "3.0.2",
57
- "typescript": "~4.9.5"
57
+ "typescript": "~5.2.2"
58
58
  }
59
59
  }