@aws-amplify/core 6.0.1-console-preview.5a31ca1.0 → 6.0.1-console-preview.8d88eef.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/lib/Platform/types.d.ts +18 -8
- package/lib/Platform/types.js +10 -2
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/ServiceWorker/ServiceWorker.js +69 -17
- package/lib/ServiceWorker/index.d.ts +0 -12
- package/lib/ServiceWorker/index.js +0 -12
- package/lib/errors/errorHelpers.d.ts +2 -0
- package/lib/errors/errorHelpers.js +20 -0
- package/lib/errors/index.d.ts +1 -0
- package/lib/errors/index.js +3 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -1
- package/lib/libraryUtils.d.ts +4 -6
- package/lib/libraryUtils.js +9 -15
- package/lib/parseAWSExports.js +27 -18
- package/lib/providers/pinpoint/apis/record.d.ts +1 -1
- package/lib/providers/pinpoint/apis/record.js +5 -21
- package/lib/providers/pinpoint/index.d.ts +2 -2
- package/lib/providers/pinpoint/index.js +4 -2
- package/lib/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib/providers/pinpoint/types/errors.js +15 -0
- package/lib/providers/pinpoint/types/index.d.ts +1 -0
- package/lib/providers/pinpoint/types/index.js +3 -0
- package/lib/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib/providers/pinpoint/utils/index.d.ts +1 -0
- package/lib/providers/pinpoint/utils/index.js +3 -1
- package/lib/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
- package/lib/providers/pinpoint/utils/resolveEndpointId.js +85 -0
- package/lib/singleton/Auth/types.d.ts +2 -2
- package/lib/singleton/Notifications/PushNotification/types.d.ts +2 -0
- package/lib/singleton/Notifications/PushNotification/types.js +4 -0
- package/lib/singleton/Notifications/types.d.ts +3 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/errors.d.ts +1 -0
- package/lib/types/errors.js +1 -0
- package/lib-esm/Platform/types.d.ts +18 -8
- package/lib-esm/Platform/types.js +10 -2
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/ServiceWorker/ServiceWorker.js +69 -17
- package/lib-esm/ServiceWorker/index.d.ts +0 -12
- package/lib-esm/ServiceWorker/index.js +0 -12
- package/lib-esm/errors/errorHelpers.d.ts +2 -0
- package/lib-esm/errors/errorHelpers.js +17 -0
- package/lib-esm/errors/index.d.ts +1 -0
- package/lib-esm/errors/index.js +1 -0
- package/lib-esm/index.d.ts +2 -0
- package/lib-esm/index.js +4 -0
- package/lib-esm/libraryUtils.d.ts +4 -6
- package/lib-esm/libraryUtils.js +3 -6
- package/lib-esm/parseAWSExports.js +27 -18
- package/lib-esm/providers/pinpoint/apis/record.d.ts +1 -1
- package/lib-esm/providers/pinpoint/apis/record.js +6 -22
- package/lib-esm/providers/pinpoint/index.d.ts +2 -2
- package/lib-esm/providers/pinpoint/index.js +2 -1
- package/lib-esm/providers/pinpoint/types/errors.d.ts +9 -0
- package/lib-esm/providers/pinpoint/types/errors.js +12 -0
- package/lib-esm/providers/pinpoint/types/index.d.ts +1 -0
- package/lib-esm/providers/pinpoint/types/index.js +1 -0
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib-esm/providers/pinpoint/utils/index.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/index.js +1 -0
- package/lib-esm/providers/pinpoint/utils/resolveEndpointId.d.ts +8 -0
- package/lib-esm/providers/pinpoint/utils/resolveEndpointId.js +81 -0
- package/lib-esm/singleton/Auth/types.d.ts +2 -2
- package/lib-esm/singleton/Notifications/PushNotification/types.d.ts +2 -0
- package/lib-esm/singleton/Notifications/PushNotification/types.js +3 -0
- package/lib-esm/singleton/Notifications/types.d.ts +3 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/errors.d.ts +1 -0
- package/lib-esm/types/errors.js +1 -0
- package/package.json +3 -3
- package/src/Platform/types.ts +20 -11
- package/src/Platform/version.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +20 -17
- package/src/ServiceWorker/index.ts +0 -12
- package/src/errors/errorHelpers.ts +20 -0
- package/src/errors/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/libraryUtils.ts +11 -11
- package/src/parseAWSExports.ts +19 -14
- package/src/providers/pinpoint/apis/record.ts +11 -25
- package/src/providers/pinpoint/index.ts +6 -2
- package/src/providers/pinpoint/types/errors.ts +12 -0
- package/src/providers/pinpoint/types/index.ts +1 -0
- package/src/providers/pinpoint/types/pinpoint.ts +3 -2
- package/src/providers/pinpoint/utils/index.ts +1 -0
- package/src/providers/pinpoint/utils/resolveEndpointId.ts +46 -0
- package/src/singleton/Auth/types.ts +2 -2
- package/src/singleton/Notifications/PushNotification/types.ts +6 -0
- package/src/singleton/Notifications/types.ts +3 -1
- package/src/types/errors.ts +1 -0
- package/lib/Amplify.d.ts +0 -29
- package/lib/Amplify.js +0 -118
- package/lib-esm/Amplify.d.ts +0 -29
- package/lib-esm/Amplify.js +0 -115
- package/src/Amplify.ts +0 -106
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
+
function step(op) {
|
|
17
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
+
switch (op[0]) {
|
|
22
|
+
case 0: case 1: t = op; break;
|
|
23
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
+
default:
|
|
27
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
+
if (t[2]) _.ops.pop();
|
|
32
|
+
_.trys.pop(); continue;
|
|
33
|
+
}
|
|
34
|
+
op = body.call(thisArg, _);
|
|
35
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
import { assert } from '../../../errors';
|
|
40
|
+
import { AmplifyErrorCode } from '../../../types';
|
|
41
|
+
import { updateEndpoint } from '../apis';
|
|
42
|
+
import { getEndpointId } from './getEndpointId';
|
|
43
|
+
/**
|
|
44
|
+
* Resolves an endpoint id from cache or prepare via updateEndpoint if one does not already exist,
|
|
45
|
+
* which will generate and cache an endpoint id between calls.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export var resolveEndpointId = function (_a) {
|
|
50
|
+
var address = _a.address, appId = _a.appId, category = _a.category, channelType = _a.channelType, credentials = _a.credentials, identityId = _a.identityId, region = _a.region, userAgentValue = _a.userAgentValue;
|
|
51
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
52
|
+
var endpointId;
|
|
53
|
+
return __generator(this, function (_b) {
|
|
54
|
+
switch (_b.label) {
|
|
55
|
+
case 0: return [4 /*yield*/, getEndpointId(appId, category)];
|
|
56
|
+
case 1:
|
|
57
|
+
endpointId = _b.sent();
|
|
58
|
+
if (!!endpointId) return [3 /*break*/, 4];
|
|
59
|
+
return [4 /*yield*/, updateEndpoint({
|
|
60
|
+
address: address,
|
|
61
|
+
appId: appId,
|
|
62
|
+
category: category,
|
|
63
|
+
channelType: channelType,
|
|
64
|
+
credentials: credentials,
|
|
65
|
+
identityId: identityId,
|
|
66
|
+
region: region,
|
|
67
|
+
userAgentValue: userAgentValue,
|
|
68
|
+
})];
|
|
69
|
+
case 2:
|
|
70
|
+
_b.sent();
|
|
71
|
+
return [4 /*yield*/, getEndpointId(appId, category)];
|
|
72
|
+
case 3:
|
|
73
|
+
endpointId = _b.sent();
|
|
74
|
+
_b.label = 4;
|
|
75
|
+
case 4:
|
|
76
|
+
assert(!!endpointId, AmplifyErrorCode.NoEndpointId);
|
|
77
|
+
return [2 /*return*/, endpointId];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
@@ -63,12 +63,12 @@ export type AuthIdentityPoolConfig = {
|
|
|
63
63
|
Cognito: CognitoIdentityPoolConfig & {
|
|
64
64
|
userPoolClientId?: never;
|
|
65
65
|
userPoolId?: never;
|
|
66
|
+
userPoolEndpoint?: never;
|
|
66
67
|
loginWith?: never;
|
|
67
68
|
signUpVerificationMethod?: never;
|
|
68
69
|
userAttributes?: never;
|
|
69
70
|
mfa?: never;
|
|
70
71
|
passwordFormat?: never;
|
|
71
|
-
endpoint?: never;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
export type CognitoIdentityPoolConfig = {
|
|
@@ -84,6 +84,7 @@ export type AuthUserPoolConfig = {
|
|
|
84
84
|
export type CognitoUserPoolConfig = {
|
|
85
85
|
userPoolClientId: string;
|
|
86
86
|
userPoolId: string;
|
|
87
|
+
userPoolEndpoint?: string;
|
|
87
88
|
signUpVerificationMethod?: 'code' | 'link';
|
|
88
89
|
loginWith?: {
|
|
89
90
|
oauth?: OAuthConfig;
|
|
@@ -104,7 +105,6 @@ export type CognitoUserPoolConfig = {
|
|
|
104
105
|
requireNumbers?: boolean;
|
|
105
106
|
requireSpecialCharacters?: boolean;
|
|
106
107
|
};
|
|
107
|
-
endpoint?: string;
|
|
108
108
|
};
|
|
109
109
|
export type OAuthConfig = {
|
|
110
110
|
domain: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InAppMessagingConfig } from './InAppMessaging/types';
|
|
2
|
+
import { PushNotificationConfig } from './PushNotification/types';
|
|
2
3
|
export type NotificationsConfig = {
|
|
3
|
-
InAppMessaging
|
|
4
|
+
InAppMessaging?: InAppMessagingConfig;
|
|
5
|
+
PushNotification?: PushNotificationConfig;
|
|
4
6
|
};
|