@aws-amplify/core 6.0.1-console-preview.5a31ca1.0 → 6.0.1-console-preview.8f82e46.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/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/index.d.ts +1 -0
- package/lib/index.js +4 -1
- package/lib/libraryUtils.d.ts +0 -1
- package/lib/libraryUtils.js +2 -5
- package/lib/providers/pinpoint/types/pinpoint.d.ts +1 -1
- package/lib/singleton/Auth/types.d.ts +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- 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/index.d.ts +1 -0
- package/lib-esm/index.js +2 -0
- package/lib-esm/libraryUtils.d.ts +0 -1
- package/lib-esm/libraryUtils.js +0 -2
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +1 -1
- package/lib-esm/singleton/Auth/types.d.ts +2 -2
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +20 -17
- package/src/ServiceWorker/index.ts +0 -12
- package/src/index.ts +3 -0
- package/src/libraryUtils.ts +0 -3
- package/src/providers/pinpoint/types/pinpoint.ts +1 -0
- package/src/singleton/Auth/types.ts +2 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.8f82e46.0+8f82e46";
|
package/lib/Platform/version.js
CHANGED
|
@@ -1,13 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
14
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
15
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
16
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17
|
+
function step(op) {
|
|
18
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
19
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
20
|
+
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;
|
|
21
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22
|
+
switch (op[0]) {
|
|
23
|
+
case 0: case 1: t = op; break;
|
|
24
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
25
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
27
|
+
default:
|
|
28
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
29
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
30
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
31
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
32
|
+
if (t[2]) _.ops.pop();
|
|
33
|
+
_.trys.pop(); continue;
|
|
34
|
+
}
|
|
35
|
+
op = body.call(thisArg, _);
|
|
36
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
37
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
4
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
41
|
exports.ServiceWorkerClass = void 0;
|
|
6
42
|
var Logger_1 = require("../Logger");
|
|
7
43
|
var utils_1 = require("../utils");
|
|
8
|
-
var Amplify_1 = require("../Amplify");
|
|
9
44
|
var errors_1 = require("../errors");
|
|
10
45
|
var errorHelpers_1 = require("./errorHelpers");
|
|
46
|
+
var pinpoint_1 = require("../providers/pinpoint");
|
|
47
|
+
var singleton_1 = require("../singleton");
|
|
11
48
|
/**
|
|
12
49
|
* Provides a means to registering a service worker in the browser
|
|
13
50
|
* and communicating with it via postMessage events.
|
|
@@ -176,19 +213,37 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
176
213
|
**/
|
|
177
214
|
ServiceWorkerClass.prototype._setupListeners = function () {
|
|
178
215
|
var _this = this;
|
|
179
|
-
this.serviceWorker.addEventListener('statechange', function (event) {
|
|
180
|
-
var currentState
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
216
|
+
this.serviceWorker.addEventListener('statechange', function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
217
|
+
var currentState, _a, appId, region, credentials;
|
|
218
|
+
var _b, _c;
|
|
219
|
+
return __generator(this, function (_d) {
|
|
220
|
+
switch (_d.label) {
|
|
221
|
+
case 0:
|
|
222
|
+
currentState = this.serviceWorker.state;
|
|
223
|
+
this._logger.debug("ServiceWorker statechange: ".concat(currentState));
|
|
224
|
+
_a = (_c = (_b = singleton_1.Amplify.getConfig().Analytics) === null || _b === void 0 ? void 0 : _b.Pinpoint) !== null && _c !== void 0 ? _c : {}, appId = _a.appId, region = _a.region;
|
|
225
|
+
return [4 /*yield*/, (0, singleton_1.fetchAuthSession)()];
|
|
226
|
+
case 1:
|
|
227
|
+
credentials = (_d.sent()).credentials;
|
|
228
|
+
if (appId && region && credentials) {
|
|
229
|
+
// Pinpoint is configured, record an event
|
|
230
|
+
(0, pinpoint_1.record)({
|
|
231
|
+
appId: appId,
|
|
232
|
+
region: region,
|
|
233
|
+
category: 'Core',
|
|
234
|
+
credentials: credentials,
|
|
235
|
+
event: {
|
|
236
|
+
name: 'ServiceWorker',
|
|
237
|
+
attributes: {
|
|
238
|
+
state: currentState,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return [2 /*return*/];
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}); });
|
|
192
247
|
this.serviceWorker.addEventListener('message', function (event) {
|
|
193
248
|
_this._logger.debug("ServiceWorker message event: ".concat(event));
|
|
194
249
|
});
|
|
@@ -196,6 +251,3 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
196
251
|
return ServiceWorkerClass;
|
|
197
252
|
}());
|
|
198
253
|
exports.ServiceWorkerClass = ServiceWorkerClass;
|
|
199
|
-
function isAmplifyWithAnalytics(amplify) {
|
|
200
|
-
return amplify.Analytics && typeof amplify.Analytics.record === 'function';
|
|
201
|
-
}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
13
1
|
export { ServiceWorkerClass as ServiceWorker } from './ServiceWorker';
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
/**
|
|
5
|
-
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
8
|
-
* the License. A copy of the License is located at
|
|
9
|
-
*
|
|
10
|
-
* http://aws.amazon.com/apache2.0/
|
|
11
|
-
*
|
|
12
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
13
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
14
|
-
* and limitations under the License.
|
|
15
|
-
*/
|
|
16
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
5
|
exports.ServiceWorker = void 0;
|
|
18
6
|
var ServiceWorker_1 = require("./ServiceWorker");
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
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.Hub = void 0;
|
|
5
|
+
exports.ServiceWorker = 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.Hub = void 0;
|
|
6
6
|
/*
|
|
7
7
|
This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
|
|
8
8
|
*/
|
|
@@ -30,3 +30,6 @@ Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { r
|
|
|
30
30
|
// Internationalization utilities
|
|
31
31
|
var I18n_1 = require("./I18n");
|
|
32
32
|
Object.defineProperty(exports, "I18n", { enumerable: true, get: function () { return I18n_1.I18n; } });
|
|
33
|
+
// Service worker
|
|
34
|
+
var ServiceWorker_1 = require("./ServiceWorker");
|
|
35
|
+
Object.defineProperty(exports, "ServiceWorker", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });
|
package/lib/libraryUtils.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
|
12
12
|
export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
|
|
13
13
|
export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, SetCustomUserAgentInput, } from './Platform/types';
|
|
14
14
|
export { setCustomUserAgent } from './Platform/customUserAgent';
|
|
15
|
-
export { ServiceWorker } from './ServiceWorker';
|
|
16
15
|
export { BackgroundProcessManager } from './BackgroundProcessManager';
|
|
17
16
|
export { Mutex } from './Mutex';
|
|
18
17
|
export { Reachability } from './Reachability';
|
package/lib/libraryUtils.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AmplifyErrorCode = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.
|
|
6
|
-
exports.HubInternal = exports.getCrypto = exports.base64Encoder = exports.base64Decoder =
|
|
5
|
+
exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AmplifyErrorCode = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.setCustomUserAgent = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.Logger = exports.ConsoleLogger = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.AmplifyUrlSearchParams = exports.AmplifyUrl = exports.amplifyUuid = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
|
|
6
|
+
exports.HubInternal = exports.getCrypto = exports.base64Encoder = exports.base64Decoder = void 0;
|
|
7
7
|
/*
|
|
8
8
|
This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
|
|
9
9
|
utils for use throughout the library.
|
|
@@ -62,9 +62,6 @@ Object.defineProperty(exports, "PushNotificationAction", { enumerable: true, get
|
|
|
62
62
|
Object.defineProperty(exports, "StorageAction", { enumerable: true, get: function () { return types_1.StorageAction; } });
|
|
63
63
|
var customUserAgent_1 = require("./Platform/customUserAgent");
|
|
64
64
|
Object.defineProperty(exports, "setCustomUserAgent", { enumerable: true, get: function () { return customUserAgent_1.setCustomUserAgent; } });
|
|
65
|
-
// Service worker
|
|
66
|
-
var ServiceWorker_1 = require("./ServiceWorker");
|
|
67
|
-
Object.defineProperty(exports, "ServiceWorker", { enumerable: true, get: function () { return ServiceWorker_1.ServiceWorker; } });
|
|
68
65
|
// Other utilities & constants
|
|
69
66
|
var BackgroundProcessManager_1 = require("./BackgroundProcessManager");
|
|
70
67
|
Object.defineProperty(exports, "BackgroundProcessManager", { enumerable: true, get: function () { return BackgroundProcessManager_1.BackgroundProcessManager; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthSession } from '../../../singleton/Auth/types';
|
|
2
2
|
import { UserProfile } from '../../../types';
|
|
3
|
-
export type SupportedCategory = 'Analytics' | 'InAppMessaging' | 'PushNotification';
|
|
3
|
+
export type SupportedCategory = 'Analytics' | 'Core' | 'InAppMessaging' | 'PushNotification';
|
|
4
4
|
export type SupportedChannelType = 'APNS' | 'APNS_SANDBOX' | 'GCM' | 'IN_APP';
|
|
5
5
|
export type PinpointProviderConfig = {
|
|
6
6
|
Pinpoint?: {
|
|
@@ -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;
|