@aws-amplify/core 6.7.4-graphql-multi-client.e61d28d.0 → 6.7.4-unstable.29b6c3f.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/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/storage/SyncKeyValueStorage.js +55 -0
- package/dist/cjs/storage/SyncKeyValueStorage.js.map +1 -0
- package/dist/cjs/storage/SyncSessionStorage.js +18 -0
- package/dist/cjs/storage/SyncSessionStorage.js.map +1 -0
- package/dist/cjs/storage/index.js +3 -1
- package/dist/cjs/storage/index.js.map +1 -1
- package/dist/esm/Platform/version.d.ts +1 -1
- package/dist/esm/Platform/version.mjs +1 -1
- package/dist/esm/Platform/version.mjs.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/storage/SyncKeyValueStorage.d.ts +34 -0
- package/dist/esm/storage/SyncKeyValueStorage.mjs +54 -0
- package/dist/esm/storage/SyncKeyValueStorage.mjs.map +1 -0
- package/dist/esm/storage/SyncSessionStorage.d.ts +7 -0
- package/dist/esm/storage/SyncSessionStorage.mjs +16 -0
- package/dist/esm/storage/SyncSessionStorage.mjs.map +1 -0
- package/dist/esm/storage/index.d.ts +2 -0
- package/dist/esm/storage/index.mjs +3 -1
- package/dist/esm/storage/index.mjs.map +1 -1
- package/dist/esm/types/storage.d.ts +6 -0
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/index.ts +1 -0
- package/src/storage/SyncKeyValueStorage.ts +59 -0
- package/src/storage/SyncSessionStorage.ts +14 -0
- package/src/storage/index.ts +2 -0
- package/src/types/storage.ts +7 -0
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.version = void 0;
|
|
5
5
|
// generated by genversion
|
|
6
|
-
exports.version = '6.10.4-
|
|
6
|
+
exports.version = '6.10.4-unstable.29b6c3f.0+29b6c3f';
|
|
7
7
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.10.4-
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.10.4-unstable.29b6c3f.0+29b6c3f';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,mCAAmC;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;
|
|
6
|
+
exports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;
|
|
7
7
|
/*
|
|
8
8
|
This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
|
|
9
9
|
*/
|
|
@@ -26,6 +26,7 @@ var storage_1 = require("./storage");
|
|
|
26
26
|
Object.defineProperty(exports, "CookieStorage", { enumerable: true, get: function () { return storage_1.CookieStorage; } });
|
|
27
27
|
Object.defineProperty(exports, "defaultStorage", { enumerable: true, get: function () { return storage_1.defaultStorage; } });
|
|
28
28
|
Object.defineProperty(exports, "sessionStorage", { enumerable: true, get: function () { return storage_1.sessionStorage; } });
|
|
29
|
+
Object.defineProperty(exports, "syncSessionStorage", { enumerable: true, get: function () { return storage_1.syncSessionStorage; } });
|
|
29
30
|
Object.defineProperty(exports, "sharedInMemoryStorage", { enumerable: true, get: function () { return storage_1.sharedInMemoryStorage; } });
|
|
30
31
|
// Cache exports
|
|
31
32
|
var Cache_1 = require("./Cache");
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.\n*/\n// Hub exports\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"Hub\", { enumerable: true, get: function () { return Hub_1.Hub; } });\nvar utils_1 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_1.decodeJWT; } });\nvar singleton_1 = require(\"./singleton\");\nObject.defineProperty(exports, \"Amplify\", { enumerable: true, get: function () { return singleton_1.Amplify; } });\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return singleton_1.fetchAuthSession; } });\nObject.defineProperty(exports, \"AmplifyClassV6\", { enumerable: true, get: function () { return singleton_1.AmplifyClass; } });\nObject.defineProperty(exports, \"clearCredentials\", { enumerable: true, get: function () { return singleton_1.clearCredentials; } });\n// AWSClients exports\nvar cognitoIdentity_1 = require(\"./awsClients/cognitoIdentity\");\nObject.defineProperty(exports, \"getCredentialsForIdentity\", { enumerable: true, get: function () { return cognitoIdentity_1.getCredentialsForIdentity; } });\nObject.defineProperty(exports, \"getId\", { enumerable: true, get: function () { return cognitoIdentity_1.getId; } });\n// Storage helpers\nvar storage_1 = require(\"./storage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return storage_1.CookieStorage; } });\nObject.defineProperty(exports, \"defaultStorage\", { enumerable: true, get: function () { return storage_1.defaultStorage; } });\nObject.defineProperty(exports, \"sessionStorage\", { enumerable: true, get: function () { return storage_1.sessionStorage; } });\nObject.defineProperty(exports, \"sharedInMemoryStorage\", { enumerable: true, get: function () { return storage_1.sharedInMemoryStorage; } });\n// Cache exports\nvar Cache_1 = require(\"./Cache\");\nObject.defineProperty(exports, \"Cache\", { enumerable: true, get: function () { return Cache_1.Cache; } });\n// Internationalization utilities\nvar I18n_1 = require(\"./I18n\");\nObject.defineProperty(exports, \"I18n\", { enumerable: true, get: function () { return I18n_1.I18n; } });\n// Logging utilities\nvar Logger_1 = require(\"./Logger\");\nObject.defineProperty(exports, \"ConsoleLogger\", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });\n// Service worker\nvar ServiceWorker_1 = require(\"./ServiceWorker\");\nObject.defineProperty(exports, \"ServiceWorker\", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServiceWorker = exports.ConsoleLogger = exports.I18n = exports.Cache = exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = exports.getId = exports.getCredentialsForIdentity = exports.clearCredentials = exports.AmplifyClassV6 = exports.fetchAuthSession = exports.Amplify = exports.decodeJWT = exports.Hub = void 0;\n/*\nThis file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.\n*/\n// Hub exports\nvar Hub_1 = require(\"./Hub\");\nObject.defineProperty(exports, \"Hub\", { enumerable: true, get: function () { return Hub_1.Hub; } });\nvar utils_1 = require(\"./singleton/Auth/utils\");\nObject.defineProperty(exports, \"decodeJWT\", { enumerable: true, get: function () { return utils_1.decodeJWT; } });\nvar singleton_1 = require(\"./singleton\");\nObject.defineProperty(exports, \"Amplify\", { enumerable: true, get: function () { return singleton_1.Amplify; } });\nObject.defineProperty(exports, \"fetchAuthSession\", { enumerable: true, get: function () { return singleton_1.fetchAuthSession; } });\nObject.defineProperty(exports, \"AmplifyClassV6\", { enumerable: true, get: function () { return singleton_1.AmplifyClass; } });\nObject.defineProperty(exports, \"clearCredentials\", { enumerable: true, get: function () { return singleton_1.clearCredentials; } });\n// AWSClients exports\nvar cognitoIdentity_1 = require(\"./awsClients/cognitoIdentity\");\nObject.defineProperty(exports, \"getCredentialsForIdentity\", { enumerable: true, get: function () { return cognitoIdentity_1.getCredentialsForIdentity; } });\nObject.defineProperty(exports, \"getId\", { enumerable: true, get: function () { return cognitoIdentity_1.getId; } });\n// Storage helpers\nvar storage_1 = require(\"./storage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return storage_1.CookieStorage; } });\nObject.defineProperty(exports, \"defaultStorage\", { enumerable: true, get: function () { return storage_1.defaultStorage; } });\nObject.defineProperty(exports, \"sessionStorage\", { enumerable: true, get: function () { return storage_1.sessionStorage; } });\nObject.defineProperty(exports, \"syncSessionStorage\", { enumerable: true, get: function () { return storage_1.syncSessionStorage; } });\nObject.defineProperty(exports, \"sharedInMemoryStorage\", { enumerable: true, get: function () { return storage_1.sharedInMemoryStorage; } });\n// Cache exports\nvar Cache_1 = require(\"./Cache\");\nObject.defineProperty(exports, \"Cache\", { enumerable: true, get: function () { return Cache_1.Cache; } });\n// Internationalization utilities\nvar I18n_1 = require(\"./I18n\");\nObject.defineProperty(exports, \"I18n\", { enumerable: true, get: function () { return I18n_1.I18n; } });\n// Logging utilities\nvar Logger_1 = require(\"./Logger\");\nObject.defineProperty(exports, \"ConsoleLogger\", { enumerable: true, get: function () { return Logger_1.ConsoleLogger; } });\n// Service worker\nvar ServiceWorker_1 = require(\"./ServiceWorker\");\nObject.defineProperty(exports, \"ServiceWorker\", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,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AAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SyncKeyValueStorage = void 0;
|
|
7
|
+
const errors_1 = require("../errors");
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
class SyncKeyValueStorage {
|
|
12
|
+
constructor(storage) {
|
|
13
|
+
this._storage = storage;
|
|
14
|
+
}
|
|
15
|
+
get storage() {
|
|
16
|
+
if (!this._storage)
|
|
17
|
+
throw new errors_1.PlatformNotSupportedError();
|
|
18
|
+
return this._storage;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* This is used to set a specific item in storage
|
|
22
|
+
* @param {string} key - the key for the item
|
|
23
|
+
* @param {object} value - the value
|
|
24
|
+
* @returns {string} value that was set
|
|
25
|
+
*/
|
|
26
|
+
setItem(key, value) {
|
|
27
|
+
this.storage.setItem(key, value);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This is used to get a specific key from storage
|
|
31
|
+
* @param {string} key - the key for the item
|
|
32
|
+
* This is used to clear the storage
|
|
33
|
+
* @returns {string} the data item
|
|
34
|
+
*/
|
|
35
|
+
getItem(key) {
|
|
36
|
+
return this.storage.getItem(key);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This is used to remove an item from storage
|
|
40
|
+
* @param {string} key - the key being set
|
|
41
|
+
* @returns {string} value - value that was deleted
|
|
42
|
+
*/
|
|
43
|
+
removeItem(key) {
|
|
44
|
+
this.storage.removeItem(key);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* This is used to clear the storage
|
|
48
|
+
* @returns {string} nothing
|
|
49
|
+
*/
|
|
50
|
+
clear() {
|
|
51
|
+
this.storage.clear();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SyncKeyValueStorage = SyncKeyValueStorage;
|
|
55
|
+
//# sourceMappingURL=SyncKeyValueStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncKeyValueStorage.js","sources":["../../../src/storage/SyncKeyValueStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncKeyValueStorage = void 0;\nconst errors_1 = require(\"../errors\");\n/**\n * @internal\n */\nclass SyncKeyValueStorage {\n constructor(storage) {\n this._storage = storage;\n }\n get storage() {\n if (!this._storage)\n throw new errors_1.PlatformNotSupportedError();\n return this._storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n this.storage.clear();\n }\n}\nexports.SyncKeyValueStorage = SyncKeyValueStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACtC;AACA;AACA;AACA,MAAM,mBAAmB,CAAC;AAC1B,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAChC,KAAK;AACL,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;AAC1B,YAAY,MAAM,IAAI,QAAQ,CAAC,yBAAyB,EAAE,CAAC;AAC3D,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC;AAC7B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACrC,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AAC7B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SyncSessionStorage = void 0;
|
|
7
|
+
const SyncKeyValueStorage_1 = require("./SyncKeyValueStorage");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
class SyncSessionStorage extends SyncKeyValueStorage_1.SyncKeyValueStorage {
|
|
13
|
+
constructor() {
|
|
14
|
+
super((0, utils_1.getSessionStorageWithFallback)());
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SyncSessionStorage = SyncSessionStorage;
|
|
18
|
+
//# sourceMappingURL=SyncSessionStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncSessionStorage.js","sources":["../../../src/storage/SyncSessionStorage.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncSessionStorage = void 0;\nconst SyncKeyValueStorage_1 = require(\"./SyncKeyValueStorage\");\nconst utils_1 = require(\"./utils\");\n/**\n * @internal\n */\nclass SyncSessionStorage extends SyncKeyValueStorage_1.SyncKeyValueStorage {\n constructor() {\n super((0, utils_1.getSessionStorageWithFallback)());\n }\n}\nexports.SyncSessionStorage = SyncSessionStorage;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,MAAM,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC;AACA;AACA;AACA,MAAM,kBAAkB,SAAS,qBAAqB,CAAC,mBAAmB,CAAC;AAC3E,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,OAAO,CAAC,6BAA6B,GAAG,CAAC,CAAC;AAC5D,KAAK;AACL,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;
|
|
6
|
+
exports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;
|
|
7
7
|
const DefaultStorage_1 = require("./DefaultStorage");
|
|
8
8
|
const InMemoryStorage_1 = require("./InMemoryStorage");
|
|
9
9
|
const KeyValueStorage_1 = require("./KeyValueStorage");
|
|
10
10
|
const SessionStorage_1 = require("./SessionStorage");
|
|
11
|
+
const SyncSessionStorage_1 = require("./SyncSessionStorage");
|
|
11
12
|
var CookieStorage_1 = require("./CookieStorage");
|
|
12
13
|
Object.defineProperty(exports, "CookieStorage", { enumerable: true, get: function () { return CookieStorage_1.CookieStorage; } });
|
|
13
14
|
exports.defaultStorage = new DefaultStorage_1.DefaultStorage();
|
|
14
15
|
exports.sessionStorage = new SessionStorage_1.SessionStorage();
|
|
16
|
+
exports.syncSessionStorage = new SyncSessionStorage_1.SyncSessionStorage();
|
|
15
17
|
exports.sharedInMemoryStorage = new KeyValueStorage_1.KeyValueStorage(new InMemoryStorage_1.InMemoryStorage());
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/storage/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sharedInMemoryStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;\nconst DefaultStorage_1 = require(\"./DefaultStorage\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst SessionStorage_1 = require(\"./SessionStorage\");\nvar CookieStorage_1 = require(\"./CookieStorage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return CookieStorage_1.CookieStorage; } });\nexports.defaultStorage = new DefaultStorage_1.DefaultStorage();\nexports.sessionStorage = new SessionStorage_1.SessionStorage();\nexports.sharedInMemoryStorage = new KeyValueStorage_1.KeyValueStorage(new InMemoryStorage_1.InMemoryStorage());\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/storage/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sharedInMemoryStorage = exports.syncSessionStorage = exports.sessionStorage = exports.defaultStorage = exports.CookieStorage = void 0;\nconst DefaultStorage_1 = require(\"./DefaultStorage\");\nconst InMemoryStorage_1 = require(\"./InMemoryStorage\");\nconst KeyValueStorage_1 = require(\"./KeyValueStorage\");\nconst SessionStorage_1 = require(\"./SessionStorage\");\nconst SyncSessionStorage_1 = require(\"./SyncSessionStorage\");\nvar CookieStorage_1 = require(\"./CookieStorage\");\nObject.defineProperty(exports, \"CookieStorage\", { enumerable: true, get: function () { return CookieStorage_1.CookieStorage; } });\nexports.defaultStorage = new DefaultStorage_1.DefaultStorage();\nexports.sessionStorage = new SessionStorage_1.SessionStorage();\nexports.syncSessionStorage = new SyncSessionStorage_1.SyncSessionStorage();\nexports.sharedInMemoryStorage = new KeyValueStorage_1.KeyValueStorage(new InMemoryStorage_1.InMemoryStorage());\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC9I,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACrD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACvD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACvD,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACrD,MAAM,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC7D,IAAI,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,eAAe,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;AAClI,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE,CAAC;AAC/D,OAAO,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE,CAAC;AAC/D,OAAO,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,CAAC;AAC3E,OAAO,CAAC,qBAAqB,GAAG,IAAI,iBAAiB,CAAC,eAAe,CAAC,IAAI,iBAAiB,CAAC,eAAe,EAAE,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.10.4-
|
|
1
|
+
export declare const version = "6.10.4-unstable.29b6c3f.0+29b6c3f";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.10.4-
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.10.4-unstable.29b6c3f.0+29b6c3f';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, APIC
|
|
|
6
6
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
7
7
|
export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './awsClients/cognitoIdentity';
|
|
8
8
|
export { UserProfile } from './types';
|
|
9
|
-
export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
|
|
9
|
+
export { CookieStorage, defaultStorage, sessionStorage, syncSessionStorage, sharedInMemoryStorage, } from './storage';
|
|
10
10
|
export { KeyValueStorageInterface } from './types';
|
|
11
11
|
export { Cache } from './Cache';
|
|
12
12
|
export { CacheConfig } from './Cache/types';
|
package/dist/esm/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export { fetchAuthSession } from './singleton/apis/fetchAuthSession.mjs';
|
|
|
5
5
|
export { clearCredentials } from './singleton/apis/clearCredentials.mjs';
|
|
6
6
|
export { getId } from './awsClients/cognitoIdentity/getId.mjs';
|
|
7
7
|
export { getCredentialsForIdentity } from './awsClients/cognitoIdentity/getCredentialsForIdentity.mjs';
|
|
8
|
-
export { defaultStorage, sessionStorage, sharedInMemoryStorage } from './storage/index.mjs';
|
|
8
|
+
export { defaultStorage, sessionStorage, sharedInMemoryStorage, syncSessionStorage } from './storage/index.mjs';
|
|
9
9
|
export { Cache } from './Cache/index.mjs';
|
|
10
10
|
export { I18n } from './I18n/index.mjs';
|
|
11
11
|
export { ConsoleLogger } from './Logger/ConsoleLogger.mjs';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SyncStorage } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class SyncKeyValueStorage implements SyncStorage {
|
|
6
|
+
_storage?: Storage;
|
|
7
|
+
constructor(storage?: Storage);
|
|
8
|
+
get storage(): Storage;
|
|
9
|
+
/**
|
|
10
|
+
* This is used to set a specific item in storage
|
|
11
|
+
* @param {string} key - the key for the item
|
|
12
|
+
* @param {object} value - the value
|
|
13
|
+
* @returns {string} value that was set
|
|
14
|
+
*/
|
|
15
|
+
setItem(key: string, value: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* This is used to get a specific key from storage
|
|
18
|
+
* @param {string} key - the key for the item
|
|
19
|
+
* This is used to clear the storage
|
|
20
|
+
* @returns {string} the data item
|
|
21
|
+
*/
|
|
22
|
+
getItem(key: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* This is used to remove an item from storage
|
|
25
|
+
* @param {string} key - the key being set
|
|
26
|
+
* @returns {string} value - value that was deleted
|
|
27
|
+
*/
|
|
28
|
+
removeItem(key: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* This is used to clear the storage
|
|
31
|
+
* @returns {string} nothing
|
|
32
|
+
*/
|
|
33
|
+
clear(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PlatformNotSupportedError } from '../errors/PlatformNotSupportedError.mjs';
|
|
2
|
+
import '../errors/errorHelpers.mjs';
|
|
3
|
+
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
class SyncKeyValueStorage {
|
|
10
|
+
constructor(storage) {
|
|
11
|
+
this._storage = storage;
|
|
12
|
+
}
|
|
13
|
+
get storage() {
|
|
14
|
+
if (!this._storage)
|
|
15
|
+
throw new PlatformNotSupportedError();
|
|
16
|
+
return this._storage;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* This is used to set a specific item in storage
|
|
20
|
+
* @param {string} key - the key for the item
|
|
21
|
+
* @param {object} value - the value
|
|
22
|
+
* @returns {string} value that was set
|
|
23
|
+
*/
|
|
24
|
+
setItem(key, value) {
|
|
25
|
+
this.storage.setItem(key, value);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This is used to get a specific key from storage
|
|
29
|
+
* @param {string} key - the key for the item
|
|
30
|
+
* This is used to clear the storage
|
|
31
|
+
* @returns {string} the data item
|
|
32
|
+
*/
|
|
33
|
+
getItem(key) {
|
|
34
|
+
return this.storage.getItem(key);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This is used to remove an item from storage
|
|
38
|
+
* @param {string} key - the key being set
|
|
39
|
+
* @returns {string} value - value that was deleted
|
|
40
|
+
*/
|
|
41
|
+
removeItem(key) {
|
|
42
|
+
this.storage.removeItem(key);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* This is used to clear the storage
|
|
46
|
+
* @returns {string} nothing
|
|
47
|
+
*/
|
|
48
|
+
clear() {
|
|
49
|
+
this.storage.clear();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { SyncKeyValueStorage };
|
|
54
|
+
//# sourceMappingURL=SyncKeyValueStorage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncKeyValueStorage.mjs","sources":["../../../src/storage/SyncKeyValueStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PlatformNotSupportedError } from '../errors';\n/**\n * @internal\n */\nexport class SyncKeyValueStorage {\n constructor(storage) {\n this._storage = storage;\n }\n get storage() {\n if (!this._storage)\n throw new PlatformNotSupportedError();\n return this._storage;\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n setItem(key, value) {\n this.storage.setItem(key, value);\n }\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n getItem(key) {\n return this.storage.getItem(key);\n }\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n removeItem(key) {\n this.storage.removeItem(key);\n }\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n clear() {\n this.storage.clear();\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAEA;AACA;AACA;AACO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AAChC,KAAK;AACL,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ;AAC1B,YAAY,MAAM,IAAI,yBAAyB,EAAE,CAAC;AAClD,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC;AAC7B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE;AACxB,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,GAAG,EAAE;AACjB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACzC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACrC,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;AAC7B,KAAK;AACL;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SyncKeyValueStorage } from './SyncKeyValueStorage.mjs';
|
|
2
|
+
import { getSessionStorageWithFallback } from './utils.mjs';
|
|
3
|
+
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
class SyncSessionStorage extends SyncKeyValueStorage {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(getSessionStorageWithFallback());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { SyncSessionStorage };
|
|
16
|
+
//# sourceMappingURL=SyncSessionStorage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncSessionStorage.mjs","sources":["../../../src/storage/SyncSessionStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SyncKeyValueStorage } from './SyncKeyValueStorage';\nimport { getSessionStorageWithFallback } from './utils';\n/**\n * @internal\n */\nexport class SyncSessionStorage extends SyncKeyValueStorage {\n constructor() {\n super(getSessionStorageWithFallback());\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,MAAM,kBAAkB,SAAS,mBAAmB,CAAC;AAC5D,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC;AAC/C,KAAK;AACL;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { DefaultStorage } from './DefaultStorage';
|
|
2
2
|
import { KeyValueStorage } from './KeyValueStorage';
|
|
3
3
|
import { SessionStorage } from './SessionStorage';
|
|
4
|
+
import { SyncSessionStorage } from './SyncSessionStorage';
|
|
4
5
|
export { CookieStorage } from './CookieStorage';
|
|
5
6
|
export declare const defaultStorage: DefaultStorage;
|
|
6
7
|
export declare const sessionStorage: SessionStorage;
|
|
8
|
+
export declare const syncSessionStorage: SyncSessionStorage;
|
|
7
9
|
export declare const sharedInMemoryStorage: KeyValueStorage;
|
|
@@ -2,13 +2,15 @@ import { DefaultStorage } from './DefaultStorage.mjs';
|
|
|
2
2
|
import { InMemoryStorage } from './InMemoryStorage.mjs';
|
|
3
3
|
import { KeyValueStorage } from './KeyValueStorage.mjs';
|
|
4
4
|
import { SessionStorage } from './SessionStorage.mjs';
|
|
5
|
+
import { SyncSessionStorage } from './SyncSessionStorage.mjs';
|
|
5
6
|
export { CookieStorage } from './CookieStorage.mjs';
|
|
6
7
|
|
|
7
8
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
8
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
9
10
|
const defaultStorage = new DefaultStorage();
|
|
10
11
|
const sessionStorage = new SessionStorage();
|
|
12
|
+
const syncSessionStorage = new SyncSessionStorage();
|
|
11
13
|
const sharedInMemoryStorage = new KeyValueStorage(new InMemoryStorage());
|
|
12
14
|
|
|
13
|
-
export { defaultStorage, sessionStorage, sharedInMemoryStorage };
|
|
15
|
+
export { defaultStorage, sessionStorage, sharedInMemoryStorage, syncSessionStorage };
|
|
14
16
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/storage/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DefaultStorage } from './DefaultStorage';\nimport { InMemoryStorage } from './InMemoryStorage';\nimport { KeyValueStorage } from './KeyValueStorage';\nimport { SessionStorage } from './SessionStorage';\nexport { CookieStorage } from './CookieStorage';\nexport const defaultStorage = new DefaultStorage();\nexport const sessionStorage = new SessionStorage();\nexport const sharedInMemoryStorage = new KeyValueStorage(new InMemoryStorage());\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/storage/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DefaultStorage } from './DefaultStorage';\nimport { InMemoryStorage } from './InMemoryStorage';\nimport { KeyValueStorage } from './KeyValueStorage';\nimport { SessionStorage } from './SessionStorage';\nimport { SyncSessionStorage } from './SyncSessionStorage';\nexport { CookieStorage } from './CookieStorage';\nexport const defaultStorage = new DefaultStorage();\nexport const sessionStorage = new SessionStorage();\nexport const syncSessionStorage = new SyncSessionStorage();\nexport const sharedInMemoryStorage = new KeyValueStorage(new InMemoryStorage());\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AAOY,MAAC,cAAc,GAAG,IAAI,cAAc,GAAG;AACvC,MAAC,cAAc,GAAG,IAAI,cAAc,GAAG;AACvC,MAAC,kBAAkB,GAAG,IAAI,kBAAkB,GAAG;AAC/C,MAAC,qBAAqB,GAAG,IAAI,eAAe,CAAC,IAAI,eAAe,EAAE;;;;"}
|
|
@@ -15,3 +15,9 @@ export interface CookieStorageData {
|
|
|
15
15
|
secure?: boolean;
|
|
16
16
|
sameSite?: SameSite;
|
|
17
17
|
}
|
|
18
|
+
export interface SyncStorage {
|
|
19
|
+
setItem(key: string, value: string): void;
|
|
20
|
+
getItem(key: string): string | null;
|
|
21
|
+
removeItem(key: string): void;
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/core",
|
|
3
|
-
"version": "6.7.4-
|
|
3
|
+
"version": "6.7.4-unstable.29b6c3f.0+29b6c3f",
|
|
4
4
|
"description": "Core category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"uuid": "^9.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@aws-amplify/react-native": "1.1.7-
|
|
63
|
+
"@aws-amplify/react-native": "1.1.7-unstable.29b6c3f.0+29b6c3f",
|
|
64
64
|
"@types/js-cookie": "3.0.2",
|
|
65
65
|
"genversion": "^2.2.0",
|
|
66
66
|
"typescript": "5.0.2"
|
|
@@ -192,5 +192,5 @@
|
|
|
192
192
|
]
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
|
-
"gitHead": "
|
|
195
|
+
"gitHead": "29b6c3fd373e394d30950b9f238fcb9c6bd48a03"
|
|
196
196
|
}
|
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '6.10.4-
|
|
2
|
+
export const version = '6.10.4-unstable.29b6c3f.0+29b6c3f';
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { PlatformNotSupportedError } from '../errors';
|
|
5
|
+
import { SyncStorage } from '../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class SyncKeyValueStorage implements SyncStorage {
|
|
11
|
+
_storage?: Storage;
|
|
12
|
+
|
|
13
|
+
constructor(storage?: Storage) {
|
|
14
|
+
this._storage = storage;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get storage() {
|
|
18
|
+
if (!this._storage) throw new PlatformNotSupportedError();
|
|
19
|
+
|
|
20
|
+
return this._storage;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This is used to set a specific item in storage
|
|
25
|
+
* @param {string} key - the key for the item
|
|
26
|
+
* @param {object} value - the value
|
|
27
|
+
* @returns {string} value that was set
|
|
28
|
+
*/
|
|
29
|
+
setItem(key: string, value: string) {
|
|
30
|
+
this.storage.setItem(key, value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This is used to get a specific key from storage
|
|
35
|
+
* @param {string} key - the key for the item
|
|
36
|
+
* This is used to clear the storage
|
|
37
|
+
* @returns {string} the data item
|
|
38
|
+
*/
|
|
39
|
+
getItem(key: string) {
|
|
40
|
+
return this.storage.getItem(key);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This is used to remove an item from storage
|
|
45
|
+
* @param {string} key - the key being set
|
|
46
|
+
* @returns {string} value - value that was deleted
|
|
47
|
+
*/
|
|
48
|
+
removeItem(key: string) {
|
|
49
|
+
this.storage.removeItem(key);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* This is used to clear the storage
|
|
54
|
+
* @returns {string} nothing
|
|
55
|
+
*/
|
|
56
|
+
clear() {
|
|
57
|
+
this.storage.clear();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { SyncKeyValueStorage } from './SyncKeyValueStorage';
|
|
5
|
+
import { getSessionStorageWithFallback } from './utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class SyncSessionStorage extends SyncKeyValueStorage {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(getSessionStorageWithFallback());
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/storage/index.ts
CHANGED
|
@@ -5,9 +5,11 @@ import { DefaultStorage } from './DefaultStorage';
|
|
|
5
5
|
import { InMemoryStorage } from './InMemoryStorage';
|
|
6
6
|
import { KeyValueStorage } from './KeyValueStorage';
|
|
7
7
|
import { SessionStorage } from './SessionStorage';
|
|
8
|
+
import { SyncSessionStorage } from './SyncSessionStorage';
|
|
8
9
|
|
|
9
10
|
export { CookieStorage } from './CookieStorage';
|
|
10
11
|
|
|
11
12
|
export const defaultStorage = new DefaultStorage();
|
|
12
13
|
export const sessionStorage = new SessionStorage();
|
|
14
|
+
export const syncSessionStorage = new SyncSessionStorage();
|
|
13
15
|
export const sharedInMemoryStorage = new KeyValueStorage(new InMemoryStorage());
|
package/src/types/storage.ts
CHANGED
|
@@ -21,3 +21,10 @@ export interface CookieStorageData {
|
|
|
21
21
|
secure?: boolean;
|
|
22
22
|
sameSite?: SameSite;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface SyncStorage {
|
|
26
|
+
setItem(key: string, value: string): void;
|
|
27
|
+
getItem(key: string): string | null;
|
|
28
|
+
removeItem(key: string): void;
|
|
29
|
+
clear(): void;
|
|
30
|
+
}
|