@aws-amplify/core 6.0.1-console-preview.d807e55.0 → 6.0.1-console-preview.a1c533e.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/internals/aws-clients/pinpoint/package.json +4 -4
- package/lib/Hub/index.d.ts +7 -0
- package/lib/Hub/index.js +8 -1
- package/lib/Platform/customUserAgent.d.ts +16 -0
- package/lib/Platform/customUserAgent.js +70 -0
- package/lib/Platform/index.js +10 -1
- package/lib/Platform/types.d.ts +59 -4
- package/lib/Platform/types.js +26 -35
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.d.ts +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.js +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts +0 -0
- package/lib/clients/middleware/signing/signer/signatureV4/polyfills/index.js +4 -0
- package/lib/clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/polyfills/index.native.js +6 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/libraryUtils.d.ts +4 -3
- package/lib/libraryUtils.js +6 -4
- package/lib/parseAWSExports.js +70 -14
- package/lib/providers/pinpoint/apis/updateEndpoint.js +2 -2
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +2 -2
- package/lib/singleton/Auth/types.d.ts +27 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/globalHelpers/index.native.d.ts +2 -3
- package/lib/utils/globalHelpers/index.native.js +3 -3
- package/lib-esm/Hub/index.d.ts +7 -0
- package/lib-esm/Hub/index.js +7 -0
- package/lib-esm/Platform/customUserAgent.d.ts +16 -0
- package/lib-esm/Platform/customUserAgent.js +65 -0
- package/lib-esm/Platform/index.js +10 -1
- package/lib-esm/Platform/types.d.ts +59 -4
- package/lib-esm/Platform/types.js +26 -35
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.d.ts +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/polyfills/index.d.ts +0 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/polyfills/index.js +4 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/polyfills/index.native.d.ts +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/polyfills/index.native.js +4 -0
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/index.js +1 -1
- package/lib-esm/libraryUtils.d.ts +4 -3
- package/lib-esm/libraryUtils.js +3 -2
- package/lib-esm/parseAWSExports.js +70 -14
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.js +1 -1
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +1 -1
- package/lib-esm/singleton/Auth/types.d.ts +27 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/utils/globalHelpers/index.native.d.ts +2 -3
- package/lib-esm/utils/globalHelpers/index.native.js +2 -2
- package/package.json +4 -4
- package/src/Hub/index.ts +8 -0
- package/src/Platform/customUserAgent.ts +75 -0
- package/src/Platform/index.ts +14 -1
- package/src/Platform/types.ts +69 -35
- package/src/Platform/version.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/index.ts +2 -0
- package/src/clients/middleware/signing/signer/signatureV4/polyfills/index.native.ts +5 -0
- package/src/clients/middleware/signing/signer/signatureV4/polyfills/index.ts +4 -0
- package/src/index.ts +1 -1
- package/src/libraryUtils.ts +13 -8
- package/src/parseAWSExports.ts +54 -13
- package/src/providers/pinpoint/apis/updateEndpoint.ts +1 -1
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +1 -1
- package/src/singleton/Auth/types.ts +49 -0
- package/src/utils/globalHelpers/index.native.ts +2 -2
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -4
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +0 -16
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -4
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +0 -9
- package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +0 -12
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
- /package/lib/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/base.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/errorHelpers.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/errorHelpers.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +0 -0
- /package/lib/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.js +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.d.ts +0 -0
- /package/lib-esm/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/base.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/base.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/errorHelpers.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/errorHelpers.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/index.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/types.js +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.d.ts +0 -0
- /package/lib-esm/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.js +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/base.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getCredentialsForIdentity.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/getId.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/index.ts +0 -0
- /package/src/{AwsClients/CognitoIdentity → awsClients/cognitoIdentity}/types.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/base.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/errorHelpers.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/getInAppMessages.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/index.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/putEvents.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/types.ts +0 -0
- /package/src/{AwsClients/Pinpoint → awsClients/pinpoint}/updateEndpoint.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { encode, decode } from 'base-64';
|
|
2
1
|
export declare const getCrypto: () => Crypto;
|
|
3
|
-
export declare const getBtoa: () => typeof encode;
|
|
4
|
-
export declare const getAtob: () => typeof decode;
|
|
2
|
+
export declare const getBtoa: () => typeof import("base-64").encode;
|
|
3
|
+
export declare const getAtob: () => typeof import("base-64").decode;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.getAtob = exports.getBtoa = exports.getCrypto = void 0;
|
|
6
6
|
var react_native_1 = require("@aws-amplify/react-native");
|
|
7
|
-
var base_64_1 = require("base-64");
|
|
8
7
|
var errors_1 = require("../../errors");
|
|
9
8
|
(0, react_native_1.loadGetRandomValues)();
|
|
9
|
+
var _a = (0, react_native_1.loadBase64)(), encode = _a.encode, decode = _a.decode;
|
|
10
10
|
var getCrypto = function () {
|
|
11
11
|
if (typeof crypto !== 'undefined' &&
|
|
12
12
|
typeof crypto.getRandomValues === 'function') {
|
|
@@ -19,10 +19,10 @@ var getCrypto = function () {
|
|
|
19
19
|
};
|
|
20
20
|
exports.getCrypto = getCrypto;
|
|
21
21
|
var getBtoa = function () {
|
|
22
|
-
return
|
|
22
|
+
return encode;
|
|
23
23
|
};
|
|
24
24
|
exports.getBtoa = getBtoa;
|
|
25
25
|
var getAtob = function () {
|
|
26
|
-
return
|
|
26
|
+
return decode;
|
|
27
27
|
};
|
|
28
28
|
exports.getAtob = getAtob;
|
package/lib-esm/Hub/index.d.ts
CHANGED
|
@@ -37,3 +37,10 @@ export declare class HubClass {
|
|
|
37
37
|
private _toListeners;
|
|
38
38
|
}
|
|
39
39
|
export declare const Hub: HubClass;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*
|
|
43
|
+
* Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare const HubInternal: HubClass;
|
package/lib-esm/Hub/index.js
CHANGED
|
@@ -146,3 +146,10 @@ export { HubClass };
|
|
|
146
146
|
pseudo Singleton for the main messaging bus, however you can still create
|
|
147
147
|
your own instance of HubClass() for a separate "private bus" of events.*/
|
|
148
148
|
export var Hub = new HubClass('__default__');
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*
|
|
152
|
+
* Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
|
|
153
|
+
*
|
|
154
|
+
*/
|
|
155
|
+
export var HubInternal = new HubClass('internal-hub');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdditionalDetails, SetCustomUserAgentInput } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
|
|
4
|
+
* clean up any custom state set with this API.
|
|
5
|
+
*
|
|
6
|
+
* @note
|
|
7
|
+
* This API operates globally. Calling this API multiple times will result in the most recently set values for a
|
|
8
|
+
* particular API being used.
|
|
9
|
+
*
|
|
10
|
+
* @note
|
|
11
|
+
* This utility IS NOT compatible with SSR.
|
|
12
|
+
*
|
|
13
|
+
* @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setCustomUserAgent: (input: SetCustomUserAgentInput) => (() => void);
|
|
16
|
+
export declare const getCustomUserAgent: (category: string, api: string) => AdditionalDetails | undefined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
// Maintains custom user-agent state set by external consumers.
|
|
15
|
+
var customUserAgentState = {};
|
|
16
|
+
/**
|
|
17
|
+
* Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
|
|
18
|
+
* clean up any custom state set with this API.
|
|
19
|
+
*
|
|
20
|
+
* @note
|
|
21
|
+
* This API operates globally. Calling this API multiple times will result in the most recently set values for a
|
|
22
|
+
* particular API being used.
|
|
23
|
+
*
|
|
24
|
+
* @note
|
|
25
|
+
* This utility IS NOT compatible with SSR.
|
|
26
|
+
*
|
|
27
|
+
* @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
|
|
28
|
+
*/
|
|
29
|
+
export var setCustomUserAgent = function (input) {
|
|
30
|
+
var _a;
|
|
31
|
+
// Save custom user-agent state & increment reference counter
|
|
32
|
+
// TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373
|
|
33
|
+
customUserAgentState[input.category] = input.apis.reduce(function (acc, api) {
|
|
34
|
+
var _a;
|
|
35
|
+
var _b;
|
|
36
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[api] = {
|
|
37
|
+
refCount: ((_b = acc[api]) === null || _b === void 0 ? void 0 : _b.refCount) ? acc[api].refCount + 1 : 1,
|
|
38
|
+
additionalDetails: input.additionalDetails,
|
|
39
|
+
}, _a)));
|
|
40
|
+
}, (_a = customUserAgentState[input.category]) !== null && _a !== void 0 ? _a : {});
|
|
41
|
+
// Callback that cleans up state for APIs recorded by this call
|
|
42
|
+
var cleanUpCallbackCalled = false;
|
|
43
|
+
var cleanUpCallback = function () {
|
|
44
|
+
// Only allow the cleanup callback to be called once
|
|
45
|
+
if (cleanUpCallbackCalled) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
cleanUpCallbackCalled = true;
|
|
49
|
+
input.apis.forEach(function (api) {
|
|
50
|
+
var apiRefCount = customUserAgentState[input.category][api].refCount;
|
|
51
|
+
if (apiRefCount > 1) {
|
|
52
|
+
customUserAgentState[input.category][api].refCount = apiRefCount - 1;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
delete customUserAgentState[input.category][api];
|
|
56
|
+
// Clean up category if no more APIs set
|
|
57
|
+
if (!Object.keys(customUserAgentState[input.category]).length) {
|
|
58
|
+
delete customUserAgentState[input.category];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
return cleanUpCallback;
|
|
64
|
+
};
|
|
65
|
+
export var getCustomUserAgent = function (category, api) { var _a, _b; return (_b = (_a = customUserAgentState[category]) === null || _a === void 0 ? void 0 : _a[api]) === null || _b === void 0 ? void 0 : _b.additionalDetails; };
|
|
@@ -19,6 +19,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
19
19
|
import { Framework } from './types';
|
|
20
20
|
import { version } from './version';
|
|
21
21
|
import { detectFramework, observeFrameworkChanges } from './detectFramework';
|
|
22
|
+
import { getCustomUserAgent } from './customUserAgent';
|
|
22
23
|
var BASE_USER_AGENT = "aws-amplify";
|
|
23
24
|
var PlatformBuilder = /** @class */ (function () {
|
|
24
25
|
function PlatformBuilder() {
|
|
@@ -52,6 +53,14 @@ export var getAmplifyUserAgentObject = function (_a) {
|
|
|
52
53
|
userAgent.push([category, action]);
|
|
53
54
|
}
|
|
54
55
|
userAgent.push(['framework', detectFramework()]);
|
|
56
|
+
if (category && action) {
|
|
57
|
+
var customState = getCustomUserAgent(category, action);
|
|
58
|
+
if (customState) {
|
|
59
|
+
customState.forEach(function (state) {
|
|
60
|
+
userAgent.push(state);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
55
64
|
return userAgent;
|
|
56
65
|
};
|
|
57
66
|
export var getAmplifyUserAgent = function (customUserAgentDetails) {
|
|
@@ -59,7 +68,7 @@ export var getAmplifyUserAgent = function (customUserAgentDetails) {
|
|
|
59
68
|
var userAgentString = userAgent
|
|
60
69
|
.map(function (_a) {
|
|
61
70
|
var _b = __read(_a, 2), agentKey = _b[0], agentValue = _b[1];
|
|
62
|
-
return "".concat(agentKey, "/").concat(agentValue);
|
|
71
|
+
return agentKey && agentValue ? "".concat(agentKey, "/").concat(agentValue) : agentKey;
|
|
63
72
|
})
|
|
64
73
|
.join(' ');
|
|
65
74
|
return userAgentString;
|
|
@@ -43,7 +43,30 @@ export declare enum ApiAction {
|
|
|
43
43
|
Head = "7"
|
|
44
44
|
}
|
|
45
45
|
export declare enum AuthAction {
|
|
46
|
-
|
|
46
|
+
SignUp = "1",
|
|
47
|
+
ConfirmSignUp = "2",
|
|
48
|
+
ResendSignUpCode = "3",
|
|
49
|
+
SignIn = "4",
|
|
50
|
+
FetchMFAPreference = "6",
|
|
51
|
+
UpdateMFAPreference = "7",
|
|
52
|
+
SetUpTOTP = "10",
|
|
53
|
+
VerifyTOTPSetup = "11",
|
|
54
|
+
ConfirmSignIn = "12",
|
|
55
|
+
DeleteUserAttributes = "15",
|
|
56
|
+
DeleteUser = "16",
|
|
57
|
+
UpdateUserAttributes = "17",
|
|
58
|
+
FetchUserAttributes = "18",
|
|
59
|
+
ConfirmUserAttribute = "22",
|
|
60
|
+
SignOut = "26",
|
|
61
|
+
UpdatePassword = "27",
|
|
62
|
+
ResetPassword = "28",
|
|
63
|
+
ConfirmResetPassword = "29",
|
|
64
|
+
FederatedSignIn = "30",
|
|
65
|
+
RememberDevice = "32",
|
|
66
|
+
ForgetDevice = "33",
|
|
67
|
+
FetchDevices = "34",
|
|
68
|
+
SendUserAttributeVerificationCode = "35",
|
|
69
|
+
SignInWithRedirect = "36"
|
|
47
70
|
}
|
|
48
71
|
export declare enum DataStoreAction {
|
|
49
72
|
Subscribe = "1",
|
|
@@ -71,12 +94,13 @@ export declare enum PushNotificationAction {
|
|
|
71
94
|
None = "0"
|
|
72
95
|
}
|
|
73
96
|
export declare enum StorageAction {
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
UploadData = "1",
|
|
98
|
+
DownloadData = "2",
|
|
76
99
|
List = "3",
|
|
77
100
|
Copy = "4",
|
|
78
101
|
Remove = "5",
|
|
79
|
-
GetProperties = "6"
|
|
102
|
+
GetProperties = "6",
|
|
103
|
+
GetUrl = "7"
|
|
80
104
|
}
|
|
81
105
|
type ActionMap = {
|
|
82
106
|
[Category.Auth]: AuthAction;
|
|
@@ -102,4 +126,35 @@ export type CustomUserAgentDetails = (CustomUserAgentDetailsBase & {
|
|
|
102
126
|
category?: never;
|
|
103
127
|
action?: never;
|
|
104
128
|
}) | UserAgentDetailsWithCategory<Category.API> | UserAgentDetailsWithCategory<Category.Auth> | UserAgentDetailsWithCategory<Category.Analytics> | UserAgentDetailsWithCategory<Category.DataStore> | UserAgentDetailsWithCategory<Category.Geo> | UserAgentDetailsWithCategory<Category.Interactions> | UserAgentDetailsWithCategory<Category.InAppMessaging> | UserAgentDetailsWithCategory<Category.Predictions> | UserAgentDetailsWithCategory<Category.PubSub> | UserAgentDetailsWithCategory<Category.PushNotification> | UserAgentDetailsWithCategory<Category.Storage>;
|
|
129
|
+
/**
|
|
130
|
+
* `refCount` tracks how many consumers have set state for a particular API to avoid it being cleared before all
|
|
131
|
+
* consumers are done using it.
|
|
132
|
+
*
|
|
133
|
+
* Category -> Action -> Custom State
|
|
134
|
+
*/
|
|
135
|
+
export type CategoryUserAgentStateMap = Record<string, {
|
|
136
|
+
refCount: number;
|
|
137
|
+
additionalDetails: AdditionalDetails;
|
|
138
|
+
}>;
|
|
139
|
+
export type CustomUserAgentStateMap = Record<string, CategoryUserAgentStateMap>;
|
|
140
|
+
export type AdditionalDetails = [string, string?][];
|
|
141
|
+
type StorageUserAgentInput = {
|
|
142
|
+
category: Category.Storage;
|
|
143
|
+
apis: StorageAction[];
|
|
144
|
+
};
|
|
145
|
+
type AuthUserAgentInput = {
|
|
146
|
+
category: Category.Auth;
|
|
147
|
+
apis: AuthAction[];
|
|
148
|
+
};
|
|
149
|
+
type InAppMessagingUserAgentInput = {
|
|
150
|
+
category: Category.InAppMessaging;
|
|
151
|
+
apis: InAppMessagingAction[];
|
|
152
|
+
};
|
|
153
|
+
type GeoUserAgentInput = {
|
|
154
|
+
category: Category.Geo;
|
|
155
|
+
apis: GeoAction[];
|
|
156
|
+
};
|
|
157
|
+
export type SetCustomUserAgentInput = (StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput) & {
|
|
158
|
+
additionalDetails: AdditionalDetails;
|
|
159
|
+
};
|
|
105
160
|
export {};
|
|
@@ -53,40 +53,30 @@ export var ApiAction;
|
|
|
53
53
|
})(ApiAction || (ApiAction = {}));
|
|
54
54
|
export var AuthAction;
|
|
55
55
|
(function (AuthAction) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// CurrentUserPoolUser = '19',
|
|
75
|
-
// CurrentAuthenticatedUser = '20',
|
|
76
|
-
// CurrentSession = '21',
|
|
77
|
-
// VerifyUserAttribute = '22',
|
|
78
|
-
// VerifyUserAttributeSubmit = '23',
|
|
79
|
-
// VerifyCurrentUserAttribute = '24',
|
|
80
|
-
// VerifyCurrentUserAttributeSubmit = '25',
|
|
81
|
-
// SignOut = '26',
|
|
82
|
-
// ChangePassword = '27',
|
|
83
|
-
// ForgotPassword = '28',
|
|
84
|
-
// ForgotPasswordSubmit = '29',
|
|
56
|
+
AuthAction["SignUp"] = "1";
|
|
57
|
+
AuthAction["ConfirmSignUp"] = "2";
|
|
58
|
+
AuthAction["ResendSignUpCode"] = "3";
|
|
59
|
+
AuthAction["SignIn"] = "4";
|
|
60
|
+
AuthAction["FetchMFAPreference"] = "6";
|
|
61
|
+
AuthAction["UpdateMFAPreference"] = "7";
|
|
62
|
+
AuthAction["SetUpTOTP"] = "10";
|
|
63
|
+
AuthAction["VerifyTOTPSetup"] = "11";
|
|
64
|
+
AuthAction["ConfirmSignIn"] = "12";
|
|
65
|
+
AuthAction["DeleteUserAttributes"] = "15";
|
|
66
|
+
AuthAction["DeleteUser"] = "16";
|
|
67
|
+
AuthAction["UpdateUserAttributes"] = "17";
|
|
68
|
+
AuthAction["FetchUserAttributes"] = "18";
|
|
69
|
+
AuthAction["ConfirmUserAttribute"] = "22";
|
|
70
|
+
AuthAction["SignOut"] = "26";
|
|
71
|
+
AuthAction["UpdatePassword"] = "27";
|
|
72
|
+
AuthAction["ResetPassword"] = "28";
|
|
73
|
+
AuthAction["ConfirmResetPassword"] = "29";
|
|
85
74
|
AuthAction["FederatedSignIn"] = "30";
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
AuthAction["RememberDevice"] = "32";
|
|
76
|
+
AuthAction["ForgetDevice"] = "33";
|
|
77
|
+
AuthAction["FetchDevices"] = "34";
|
|
78
|
+
AuthAction["SendUserAttributeVerificationCode"] = "35";
|
|
79
|
+
AuthAction["SignInWithRedirect"] = "36";
|
|
90
80
|
})(AuthAction || (AuthAction = {}));
|
|
91
81
|
export var DataStoreAction;
|
|
92
82
|
(function (DataStoreAction) {
|
|
@@ -122,10 +112,11 @@ export var PushNotificationAction;
|
|
|
122
112
|
})(PushNotificationAction || (PushNotificationAction = {}));
|
|
123
113
|
export var StorageAction;
|
|
124
114
|
(function (StorageAction) {
|
|
125
|
-
StorageAction["
|
|
126
|
-
StorageAction["
|
|
115
|
+
StorageAction["UploadData"] = "1";
|
|
116
|
+
StorageAction["DownloadData"] = "2";
|
|
127
117
|
StorageAction["List"] = "3";
|
|
128
118
|
StorageAction["Copy"] = "4";
|
|
129
119
|
StorageAction["Remove"] = "5";
|
|
130
120
|
StorageAction["GetProperties"] = "6";
|
|
121
|
+
StorageAction["GetUrl"] = "7";
|
|
131
122
|
})(StorageAction || (StorageAction = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.a1c533e.0+a1c533e";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-console-preview.
|
|
2
|
+
export var version = '6.0.1-console-preview.a1c533e.0+a1c533e';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
|
|
|
3
3
|
export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, CognitoUserPoolConfig, } from './singleton/Auth/types';
|
|
4
4
|
export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, GeoConfig, } from './singleton/types';
|
|
5
5
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
6
|
-
export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './
|
|
6
|
+
export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './awsClients/cognitoIdentity';
|
|
7
7
|
export { UserProfile } from './types';
|
|
8
8
|
export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
|
|
9
9
|
export { KeyValueStorageInterface } from './types';
|
package/lib-esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ This file maps top-level exports from `@aws-amplify/core`. These are intended to
|
|
|
7
7
|
export { Hub } from './Hub';
|
|
8
8
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
9
9
|
// AWSClients exports
|
|
10
|
-
export { getCredentialsForIdentity, getId, } from './
|
|
10
|
+
export { getCredentialsForIdentity, getId, } from './awsClients/cognitoIdentity';
|
|
11
11
|
// Storage helpers
|
|
12
12
|
export { CookieStorage, defaultStorage, sessionStorage, sharedInMemoryStorage, } from './storage';
|
|
13
13
|
// Cache exports
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
|
|
2
2
|
export { parseAWSExports } from './parseAWSExports';
|
|
3
3
|
export { LegacyConfig } from './singleton/types';
|
|
4
|
-
export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, } from './singleton/Auth/types';
|
|
5
4
|
export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
|
|
6
5
|
export { isTokenExpired } from './singleton/Auth';
|
|
7
6
|
export { APIAuthMode, DocumentType } from './singleton/API/types';
|
|
8
7
|
export { Signer } from './Signer';
|
|
8
|
+
export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, AuthStandardAttributeKey, AuthVerifiableAttributeKey, } from './singleton/Auth/types';
|
|
9
9
|
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
10
10
|
export { ClientDevice } from './ClientDevice';
|
|
11
11
|
export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
|
|
12
|
-
export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
|
|
12
|
+
export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, SetCustomUserAgentInput, } from './Platform/types';
|
|
13
|
+
export { setCustomUserAgent } from './Platform/customUserAgent';
|
|
13
14
|
export { ServiceWorker } from './ServiceWorker';
|
|
14
15
|
export { BackgroundProcessManager } from './BackgroundProcessManager';
|
|
15
16
|
export { Mutex } from './Mutex';
|
|
@@ -21,4 +22,4 @@ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
|
|
|
21
22
|
export { AMPLIFY_SYMBOL } from './Hub';
|
|
22
23
|
export { base64Decoder, base64Encoder } from './utils/convert';
|
|
23
24
|
export { getCrypto } from './utils/globalHelpers';
|
|
24
|
-
export {
|
|
25
|
+
export { HubInternal } from './Hub';
|
package/lib-esm/libraryUtils.js
CHANGED
|
@@ -13,10 +13,11 @@ export { isTokenExpired } from './singleton/Auth';
|
|
|
13
13
|
export { Signer } from './Signer';
|
|
14
14
|
// Logging utilities
|
|
15
15
|
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
16
|
-
// Platform &
|
|
16
|
+
// Platform & user-agent utilities
|
|
17
17
|
export { ClientDevice } from './ClientDevice';
|
|
18
18
|
export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
|
|
19
19
|
export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
|
|
20
|
+
export { setCustomUserAgent } from './Platform/customUserAgent';
|
|
20
21
|
// Service worker
|
|
21
22
|
export { ServiceWorker } from './ServiceWorker';
|
|
22
23
|
// Other utilities & constants
|
|
@@ -31,4 +32,4 @@ export { AMPLIFY_SYMBOL } from './Hub';
|
|
|
31
32
|
export { base64Decoder, base64Encoder } from './utils/convert';
|
|
32
33
|
export { getCrypto } from './utils/globalHelpers';
|
|
33
34
|
// Hub
|
|
34
|
-
export {
|
|
35
|
+
export { HubInternal } from './Hub';
|
|
@@ -9,6 +9,31 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
+
if (!m) return o;
|
|
15
|
+
var i = m.call(o), r, ar = [], e;
|
|
16
|
+
try {
|
|
17
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
+
}
|
|
19
|
+
catch (error) { e = { error: error }; }
|
|
20
|
+
finally {
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
+
}
|
|
24
|
+
finally { if (e) throw e.error; }
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
+
if (ar || !(i in from)) {
|
|
31
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
+
ar[i] = from[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
|
+
};
|
|
12
37
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
13
38
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
39
|
import { ConsoleLogger as Logger } from './Logger';
|
|
@@ -30,9 +55,9 @@ var authTypeMapping = {
|
|
|
30
55
|
* @returns A {@link ResourcesConfig} object.
|
|
31
56
|
*/
|
|
32
57
|
export var parseAWSExports = function (config) {
|
|
33
|
-
var _a;
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
34
59
|
if (config === void 0) { config = {}; }
|
|
35
|
-
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
60
|
+
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_username_attributes = config.aws_cognito_username_attributes, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
36
61
|
var amplifyConfig = {};
|
|
37
62
|
// Analytics
|
|
38
63
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -46,7 +71,7 @@ export var parseAWSExports = function (config) {
|
|
|
46
71
|
// Notifications
|
|
47
72
|
if (Notifications) {
|
|
48
73
|
if ((_a = Notifications.InAppMessaging) === null || _a === void 0 ? void 0 : _a.AWSPinpoint) {
|
|
49
|
-
var
|
|
74
|
+
var _p = Notifications.InAppMessaging.AWSPinpoint, appId = _p.appId, region = _p.region;
|
|
50
75
|
amplifyConfig.Notifications = {
|
|
51
76
|
InAppMessaging: {
|
|
52
77
|
Pinpoint: {
|
|
@@ -73,12 +98,45 @@ export var parseAWSExports = function (config) {
|
|
|
73
98
|
};
|
|
74
99
|
}
|
|
75
100
|
// Auth
|
|
101
|
+
var mfaConfig = aws_cognito_mfa_configuration ? {
|
|
102
|
+
status: aws_cognito_mfa_configuration && aws_cognito_mfa_configuration.toLowerCase(),
|
|
103
|
+
totpEnabled: (_b = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('TOTP')) !== null && _b !== void 0 ? _b : false,
|
|
104
|
+
smsEnabled: (_c = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('SMS')) !== null && _c !== void 0 ? _c : false
|
|
105
|
+
} : undefined;
|
|
106
|
+
var passwordFormatConfig = aws_cognito_password_protection_settings ? {
|
|
107
|
+
minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
|
|
108
|
+
requireLowercase: (_e = (_d = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _d === void 0 ? void 0 : _d.includes('REQUIRES_LOWERCASE')) !== null && _e !== void 0 ? _e : false,
|
|
109
|
+
requireUppercase: (_g = (_f = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _f === void 0 ? void 0 : _f.includes('REQUIRES_UPPERCASE')) !== null && _g !== void 0 ? _g : false,
|
|
110
|
+
requireNumbers: (_j = (_h = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _h === void 0 ? void 0 : _h.includes('REQUIRES_NUMBERS')) !== null && _j !== void 0 ? _j : false,
|
|
111
|
+
requireSpecialCharacters: (_l = (_k = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _k === void 0 ? void 0 : _k.includes('REQUIRES_SYMBOLS')) !== null && _l !== void 0 ? _l : false,
|
|
112
|
+
} : undefined;
|
|
113
|
+
var mergedUserAttributes = Array.from(new Set(__spreadArray(__spreadArray([], __read((aws_cognito_verification_mechanisms !== null && aws_cognito_verification_mechanisms !== void 0 ? aws_cognito_verification_mechanisms : [])), false), __read((aws_cognito_signup_attributes !== null && aws_cognito_signup_attributes !== void 0 ? aws_cognito_signup_attributes : [])), false)));
|
|
114
|
+
var userAttributesConfig = mergedUserAttributes.map(function (s) {
|
|
115
|
+
var _a;
|
|
116
|
+
return (_a = {},
|
|
117
|
+
_a[s.toLowerCase()] = {
|
|
118
|
+
required: true // All user attributes generated by the CLI will be required
|
|
119
|
+
},
|
|
120
|
+
_a);
|
|
121
|
+
});
|
|
122
|
+
var loginWithEmailEnabled = (_m = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('EMAIL')) !== null && _m !== void 0 ? _m : false;
|
|
123
|
+
var loginWithPhoneEnabled = (_o = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('PHONE_NUMBER')) !== null && _o !== void 0 ? _o : false;
|
|
76
124
|
if (aws_cognito_identity_pool_id || aws_user_pools_id) {
|
|
77
125
|
amplifyConfig.Auth = {
|
|
78
|
-
Cognito:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
126
|
+
Cognito: {
|
|
127
|
+
identityPoolId: aws_cognito_identity_pool_id,
|
|
128
|
+
allowGuestAccess: aws_mandatory_sign_in !== 'enable',
|
|
129
|
+
signUpVerificationMethod: aws_cognito_sign_up_verification_method,
|
|
130
|
+
userAttributes: userAttributesConfig,
|
|
131
|
+
userPoolClientId: aws_user_pools_web_client_id,
|
|
132
|
+
userPoolId: aws_user_pools_id,
|
|
133
|
+
mfa: mfaConfig,
|
|
134
|
+
passwordFormat: passwordFormatConfig,
|
|
135
|
+
loginWith: __assign({ username: (loginWithEmailEnabled || loginWithPhoneEnabled) ? false : true, email: loginWithEmailEnabled, phone: loginWithPhoneEnabled }, (oauth &&
|
|
136
|
+
Object.keys(oauth).length > 0 && {
|
|
137
|
+
oauth: getOAuthConfig(oauth),
|
|
138
|
+
})),
|
|
139
|
+
},
|
|
82
140
|
};
|
|
83
141
|
}
|
|
84
142
|
// Storage
|
|
@@ -116,12 +174,10 @@ var getRedirectUrl = function (redirectStr) {
|
|
|
116
174
|
var getOAuthConfig = function (_a) {
|
|
117
175
|
var domain = _a.domain, scope = _a.scope, redirectSignIn = _a.redirectSignIn, redirectSignOut = _a.redirectSignOut, responseType = _a.responseType;
|
|
118
176
|
return ({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
responseType: responseType,
|
|
125
|
-
},
|
|
177
|
+
domain: domain,
|
|
178
|
+
scopes: scope,
|
|
179
|
+
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
180
|
+
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
181
|
+
responseType: responseType,
|
|
126
182
|
});
|
|
127
183
|
};
|
|
@@ -49,7 +49,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
};
|
|
50
50
|
import { v4 as uuidv4 } from 'uuid';
|
|
51
51
|
import { ClientDevice } from '../../../ClientDevice';
|
|
52
|
-
import { updateEndpoint as clientUpdateEndpoint, } from '../../../
|
|
52
|
+
import { updateEndpoint as clientUpdateEndpoint, } from '../../../awsClients/pinpoint';
|
|
53
53
|
import { cacheEndpointId, getEndpointId } from '../utils';
|
|
54
54
|
/**
|
|
55
55
|
* @internal
|
|
@@ -73,7 +73,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
73
73
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
74
74
|
};
|
|
75
75
|
import { ConsoleLogger as Logger } from '../../../Logger';
|
|
76
|
-
import { putEvents, } from '../../../
|
|
76
|
+
import { putEvents, } from '../../../awsClients/pinpoint';
|
|
77
77
|
import { isAppInForeground } from './isAppInForeground';
|
|
78
78
|
var logger = new Logger('PinpointEventBuffer');
|
|
79
79
|
var RETRYABLE_CODES = [429, 500];
|
|
@@ -50,6 +50,11 @@ export type AuthTokens = {
|
|
|
50
50
|
idToken?: JWT;
|
|
51
51
|
accessToken: JWT;
|
|
52
52
|
};
|
|
53
|
+
export type AuthStandardAttributeKey = 'address' | 'birthdate' | 'email_verified' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number_verified' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo' | AuthVerifiableAttributeKey;
|
|
54
|
+
export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
|
|
55
|
+
export type AuthConfigUserAttributes = Partial<Record<AuthStandardAttributeKey, {
|
|
56
|
+
required: boolean;
|
|
57
|
+
}>>;
|
|
53
58
|
export type AuthConfig = StrictUnion<AuthIdentityPoolConfig | AuthUserPoolConfig | AuthUserPoolAndIdentityPoolConfig>;
|
|
54
59
|
type UnionKeys<T> = T extends T ? keyof T : never;
|
|
55
60
|
type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
|
|
@@ -59,6 +64,11 @@ export type AuthIdentityPoolConfig = {
|
|
|
59
64
|
userPoolClientId?: never;
|
|
60
65
|
userPoolId?: never;
|
|
61
66
|
loginWith?: never;
|
|
67
|
+
signUpVerificationMethod?: never;
|
|
68
|
+
userAttributes?: never;
|
|
69
|
+
mfa?: never;
|
|
70
|
+
passwordFormat?: never;
|
|
71
|
+
endpoint?: never;
|
|
62
72
|
};
|
|
63
73
|
};
|
|
64
74
|
export type CognitoIdentityPoolConfig = {
|
|
@@ -77,7 +87,24 @@ export type CognitoUserPoolConfig = {
|
|
|
77
87
|
signUpVerificationMethod?: 'code' | 'link';
|
|
78
88
|
loginWith?: {
|
|
79
89
|
oauth?: OAuthConfig;
|
|
90
|
+
username?: boolean;
|
|
91
|
+
email?: boolean;
|
|
92
|
+
phone?: boolean;
|
|
80
93
|
};
|
|
94
|
+
userAttributes?: AuthConfigUserAttributes;
|
|
95
|
+
mfa?: {
|
|
96
|
+
status?: 'on' | 'off' | 'optional';
|
|
97
|
+
totpEnabled?: boolean;
|
|
98
|
+
smsEnabled?: boolean;
|
|
99
|
+
};
|
|
100
|
+
passwordFormat?: {
|
|
101
|
+
minLength?: number;
|
|
102
|
+
requireLowercase?: boolean;
|
|
103
|
+
requireUppercase?: boolean;
|
|
104
|
+
requireNumbers?: boolean;
|
|
105
|
+
requireSpecialCharacters?: boolean;
|
|
106
|
+
};
|
|
107
|
+
endpoint?: string;
|
|
81
108
|
};
|
|
82
109
|
export type OAuthConfig = {
|
|
83
110
|
domain: string;
|