@aws-amplify/core 6.4.4-unstable.ffa8a24.0 → 6.4.5-events.619318.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/index.js +8 -3
- package/dist/cjs/Platform/index.js.map +1 -1
- package/dist/cjs/Platform/types.js +1 -0
- package/dist/cjs/Platform/types.js.map +1 -1
- package/dist/cjs/Platform/version.js +1 -1
- package/dist/cjs/Platform/version.js.map +1 -1
- package/dist/cjs/parseAmplifyOutputs.js +21 -0
- package/dist/cjs/parseAmplifyOutputs.js.map +1 -1
- package/dist/esm/Platform/index.d.ts +2 -0
- package/dist/esm/Platform/index.mjs +7 -3
- package/dist/esm/Platform/index.mjs.map +1 -1
- package/dist/esm/Platform/types.d.ts +2 -1
- package/dist/esm/Platform/types.mjs +1 -0
- package/dist/esm/Platform/types.mjs.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/parseAmplifyOutputs.mjs +21 -0
- package/dist/esm/parseAmplifyOutputs.mjs.map +1 -1
- package/dist/esm/singleton/API/types.d.ts +34 -1
- package/dist/esm/singleton/Amplify.mjs +1 -1
- package/dist/esm/singleton/AmplifyOutputs/types.d.ts +10 -0
- package/package.json +3 -3
- package/src/Platform/index.ts +9 -2
- package/src/Platform/types.ts +1 -0
- package/src/Platform/version.ts +1 -1
- package/src/parseAmplifyOutputs.ts +32 -1
- package/src/singleton/API/types.ts +38 -1
- package/src/singleton/AmplifyOutputs/types.ts +12 -0
|
@@ -3,15 +3,18 @@
|
|
|
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.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = void 0;
|
|
6
|
+
exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.sanitizeAmplifyVersion = void 0;
|
|
7
7
|
const types_1 = require("./types");
|
|
8
8
|
const version_1 = require("./version");
|
|
9
9
|
const detectFramework_1 = require("./detectFramework");
|
|
10
10
|
const customUserAgent_1 = require("./customUserAgent");
|
|
11
11
|
const BASE_USER_AGENT = `aws-amplify`;
|
|
12
|
+
/** Sanitize Amplify version string be removing special character + and character post the special character */
|
|
13
|
+
const sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\+.*/, '');
|
|
14
|
+
exports.sanitizeAmplifyVersion = sanitizeAmplifyVersion;
|
|
12
15
|
class PlatformBuilder {
|
|
13
16
|
constructor() {
|
|
14
|
-
this.userAgent = `${BASE_USER_AGENT}/${version_1.version}`;
|
|
17
|
+
this.userAgent = `${BASE_USER_AGENT}/${(0, exports.sanitizeAmplifyVersion)(version_1.version)}`;
|
|
15
18
|
}
|
|
16
19
|
get framework() {
|
|
17
20
|
return (0, detectFramework_1.detectFramework)();
|
|
@@ -26,7 +29,9 @@ class PlatformBuilder {
|
|
|
26
29
|
}
|
|
27
30
|
exports.Platform = new PlatformBuilder();
|
|
28
31
|
const getAmplifyUserAgentObject = ({ category, action, } = {}) => {
|
|
29
|
-
const userAgent = [
|
|
32
|
+
const userAgent = [
|
|
33
|
+
[BASE_USER_AGENT, (0, exports.sanitizeAmplifyVersion)(version_1.version)],
|
|
34
|
+
];
|
|
30
35
|
if (category) {
|
|
31
36
|
userAgent.push([category, action]);
|
|
32
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/Platform/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.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = void 0;\nconst types_1 = require(\"./types\");\nconst version_1 = require(\"./version\");\nconst detectFramework_1 = require(\"./detectFramework\");\nconst customUserAgent_1 = require(\"./customUserAgent\");\nconst BASE_USER_AGENT = `aws-amplify`;\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${version_1.version}`;\n }\n get framework() {\n return (0, detectFramework_1.detectFramework)();\n }\n get isReactNative() {\n return (this.framework === types_1.Framework.ReactNative ||\n this.framework === types_1.Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n (0, detectFramework_1.observeFrameworkChanges)(fcn);\n }\n}\nexports.Platform = new PlatformBuilder();\nconst getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [[BASE_USER_AGENT, version_1.version]];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);\n if (category && action) {\n const customState = (0, customUserAgent_1.getCustomUserAgent)(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;\nconst getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = (0, exports.getAmplifyUserAgentObject)(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\nexports.getAmplifyUserAgent = getAmplifyUserAgent;\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,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Platform/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.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.sanitizeAmplifyVersion = void 0;\nconst types_1 = require(\"./types\");\nconst version_1 = require(\"./version\");\nconst detectFramework_1 = require(\"./detectFramework\");\nconst customUserAgent_1 = require(\"./customUserAgent\");\nconst BASE_USER_AGENT = `aws-amplify`;\n/** Sanitize Amplify version string be removing special character + and character post the special character */\nconst sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\\+.*/, '');\nexports.sanitizeAmplifyVersion = sanitizeAmplifyVersion;\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${(0, exports.sanitizeAmplifyVersion)(version_1.version)}`;\n }\n get framework() {\n return (0, detectFramework_1.detectFramework)();\n }\n get isReactNative() {\n return (this.framework === types_1.Framework.ReactNative ||\n this.framework === types_1.Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n (0, detectFramework_1.observeFrameworkChanges)(fcn);\n }\n}\nexports.Platform = new PlatformBuilder();\nconst getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [\n [BASE_USER_AGENT, (0, exports.sanitizeAmplifyVersion)(version_1.version)],\n ];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);\n if (category && action) {\n const customState = (0, customUserAgent_1.getCustomUserAgent)(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;\nconst getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = (0, exports.getAmplifyUserAgentObject)(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\nexports.getAmplifyUserAgent = getAmplifyUserAgent;\n"],"names":[],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AU,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC;AACzG,SAAS,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,IAAI,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC;AACF,OAAO,CAAC,mBAAmB,GAAG,mBAAmB;;"}
|
|
@@ -48,6 +48,7 @@ exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction =
|
|
|
48
48
|
AiAction["ListMessages"] = "6";
|
|
49
49
|
AiAction["OnMessage"] = "7";
|
|
50
50
|
AiAction["Generation"] = "8";
|
|
51
|
+
AiAction["UpdateConversation"] = "9";
|
|
51
52
|
})(exports.AiAction || (exports.AiAction = {}));
|
|
52
53
|
(function (AnalyticsAction) {
|
|
53
54
|
AnalyticsAction["Record"] = "1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/Platform/types.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.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InteractionsAction = exports.InAppMessagingAction = exports.GeoAction = exports.DataStoreAction = exports.AuthAction = exports.ApiAction = exports.AnalyticsAction = exports.AiAction = exports.Category = exports.Framework = void 0;\nvar Framework;\n(function (Framework) {\n // < 100 - Web frameworks\n Framework[\"WebUnknown\"] = \"0\";\n Framework[\"React\"] = \"1\";\n Framework[\"NextJs\"] = \"2\";\n Framework[\"Angular\"] = \"3\";\n Framework[\"VueJs\"] = \"4\";\n Framework[\"Nuxt\"] = \"5\";\n Framework[\"Svelte\"] = \"6\";\n // 100s - Server side frameworks\n Framework[\"ServerSideUnknown\"] = \"100\";\n Framework[\"ReactSSR\"] = \"101\";\n Framework[\"NextJsSSR\"] = \"102\";\n Framework[\"AngularSSR\"] = \"103\";\n Framework[\"VueJsSSR\"] = \"104\";\n Framework[\"NuxtSSR\"] = \"105\";\n Framework[\"SvelteSSR\"] = \"106\";\n // 200s - Mobile framework\n Framework[\"ReactNative\"] = \"201\";\n Framework[\"Expo\"] = \"202\";\n})(Framework = exports.Framework || (exports.Framework = {}));\nvar Category;\n(function (Category) {\n Category[\"AI\"] = \"ai\";\n Category[\"API\"] = \"api\";\n Category[\"Auth\"] = \"auth\";\n Category[\"Analytics\"] = \"analytics\";\n Category[\"DataStore\"] = \"datastore\";\n Category[\"Geo\"] = \"geo\";\n Category[\"InAppMessaging\"] = \"inappmessaging\";\n Category[\"Interactions\"] = \"interactions\";\n Category[\"Predictions\"] = \"predictions\";\n Category[\"PubSub\"] = \"pubsub\";\n Category[\"PushNotification\"] = \"pushnotification\";\n Category[\"Storage\"] = \"storage\";\n})(Category = exports.Category || (exports.Category = {}));\nvar AiAction;\n(function (AiAction) {\n AiAction[\"CreateConversation\"] = \"1\";\n AiAction[\"GetConversation\"] = \"2\";\n AiAction[\"ListConversations\"] = \"3\";\n AiAction[\"DeleteConversation\"] = \"4\";\n AiAction[\"SendMessage\"] = \"5\";\n AiAction[\"ListMessages\"] = \"6\";\n AiAction[\"OnMessage\"] = \"7\";\n AiAction[\"Generation\"] = \"8\";\n})(AiAction = exports.AiAction || (exports.AiAction = {}));\nvar AnalyticsAction;\n(function (AnalyticsAction) {\n AnalyticsAction[\"Record\"] = \"1\";\n AnalyticsAction[\"IdentifyUser\"] = \"2\";\n})(AnalyticsAction = exports.AnalyticsAction || (exports.AnalyticsAction = {}));\nvar ApiAction;\n(function (ApiAction) {\n ApiAction[\"GraphQl\"] = \"1\";\n ApiAction[\"Get\"] = \"2\";\n ApiAction[\"Post\"] = \"3\";\n ApiAction[\"Put\"] = \"4\";\n ApiAction[\"Patch\"] = \"5\";\n ApiAction[\"Del\"] = \"6\";\n ApiAction[\"Head\"] = \"7\";\n})(ApiAction = exports.ApiAction || (exports.ApiAction = {}));\nvar AuthAction;\n(function (AuthAction) {\n AuthAction[\"SignUp\"] = \"1\";\n AuthAction[\"ConfirmSignUp\"] = \"2\";\n AuthAction[\"ResendSignUpCode\"] = \"3\";\n AuthAction[\"SignIn\"] = \"4\";\n AuthAction[\"FetchMFAPreference\"] = \"6\";\n AuthAction[\"UpdateMFAPreference\"] = \"7\";\n AuthAction[\"SetUpTOTP\"] = \"10\";\n AuthAction[\"VerifyTOTPSetup\"] = \"11\";\n AuthAction[\"ConfirmSignIn\"] = \"12\";\n AuthAction[\"DeleteUserAttributes\"] = \"15\";\n AuthAction[\"DeleteUser\"] = \"16\";\n AuthAction[\"UpdateUserAttributes\"] = \"17\";\n AuthAction[\"FetchUserAttributes\"] = \"18\";\n AuthAction[\"ConfirmUserAttribute\"] = \"22\";\n AuthAction[\"SignOut\"] = \"26\";\n AuthAction[\"UpdatePassword\"] = \"27\";\n AuthAction[\"ResetPassword\"] = \"28\";\n AuthAction[\"ConfirmResetPassword\"] = \"29\";\n AuthAction[\"FederatedSignIn\"] = \"30\";\n AuthAction[\"RememberDevice\"] = \"32\";\n AuthAction[\"ForgetDevice\"] = \"33\";\n AuthAction[\"FetchDevices\"] = \"34\";\n AuthAction[\"SendUserAttributeVerificationCode\"] = \"35\";\n AuthAction[\"SignInWithRedirect\"] = \"36\";\n})(AuthAction = exports.AuthAction || (exports.AuthAction = {}));\nvar DataStoreAction;\n(function (DataStoreAction) {\n DataStoreAction[\"Subscribe\"] = \"1\";\n DataStoreAction[\"GraphQl\"] = \"2\";\n})(DataStoreAction = exports.DataStoreAction || (exports.DataStoreAction = {}));\nvar GeoAction;\n(function (GeoAction) {\n GeoAction[\"SearchByText\"] = \"0\";\n GeoAction[\"SearchByCoordinates\"] = \"1\";\n GeoAction[\"SearchForSuggestions\"] = \"2\";\n GeoAction[\"SearchByPlaceId\"] = \"3\";\n GeoAction[\"SaveGeofences\"] = \"4\";\n GeoAction[\"GetGeofence\"] = \"5\";\n GeoAction[\"ListGeofences\"] = \"6\";\n GeoAction[\"DeleteGeofences\"] = \"7\";\n})(GeoAction = exports.GeoAction || (exports.GeoAction = {}));\nvar InAppMessagingAction;\n(function (InAppMessagingAction) {\n InAppMessagingAction[\"SyncMessages\"] = \"1\";\n InAppMessagingAction[\"IdentifyUser\"] = \"2\";\n InAppMessagingAction[\"NotifyMessageInteraction\"] = \"3\";\n})(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));\nvar InteractionsAction;\n(function (InteractionsAction) {\n InteractionsAction[\"None\"] = \"0\";\n})(InteractionsAction = exports.InteractionsAction || (exports.InteractionsAction = {}));\nvar PredictionsAction;\n(function (PredictionsAction) {\n PredictionsAction[\"Convert\"] = \"1\";\n PredictionsAction[\"Identify\"] = \"2\";\n PredictionsAction[\"Interpret\"] = \"3\";\n})(PredictionsAction = exports.PredictionsAction || (exports.PredictionsAction = {}));\nvar PubSubAction;\n(function (PubSubAction) {\n PubSubAction[\"Subscribe\"] = \"1\";\n})(PubSubAction = exports.PubSubAction || (exports.PubSubAction = {}));\nvar PushNotificationAction;\n(function (PushNotificationAction) {\n PushNotificationAction[\"InitializePushNotifications\"] = \"1\";\n PushNotificationAction[\"IdentifyUser\"] = \"2\";\n})(PushNotificationAction = exports.PushNotificationAction || (exports.PushNotificationAction = {}));\nvar StorageAction;\n(function (StorageAction) {\n StorageAction[\"UploadData\"] = \"1\";\n StorageAction[\"DownloadData\"] = \"2\";\n StorageAction[\"List\"] = \"3\";\n StorageAction[\"Copy\"] = \"4\";\n StorageAction[\"Remove\"] = \"5\";\n StorageAction[\"GetProperties\"] = \"6\";\n StorageAction[\"GetUrl\"] = \"7\";\n})(StorageAction = exports.StorageAction || (exports.StorageAction = {}));\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,sBAAsB,GAAG,OAAO,CAA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K,OAAO,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/Platform/types.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.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InteractionsAction = exports.InAppMessagingAction = exports.GeoAction = exports.DataStoreAction = exports.AuthAction = exports.ApiAction = exports.AnalyticsAction = exports.AiAction = exports.Category = exports.Framework = void 0;\nvar Framework;\n(function (Framework) {\n // < 100 - Web frameworks\n Framework[\"WebUnknown\"] = \"0\";\n Framework[\"React\"] = \"1\";\n Framework[\"NextJs\"] = \"2\";\n Framework[\"Angular\"] = \"3\";\n Framework[\"VueJs\"] = \"4\";\n Framework[\"Nuxt\"] = \"5\";\n Framework[\"Svelte\"] = \"6\";\n // 100s - Server side frameworks\n Framework[\"ServerSideUnknown\"] = \"100\";\n Framework[\"ReactSSR\"] = \"101\";\n Framework[\"NextJsSSR\"] = \"102\";\n Framework[\"AngularSSR\"] = \"103\";\n Framework[\"VueJsSSR\"] = \"104\";\n Framework[\"NuxtSSR\"] = \"105\";\n Framework[\"SvelteSSR\"] = \"106\";\n // 200s - Mobile framework\n Framework[\"ReactNative\"] = \"201\";\n Framework[\"Expo\"] = \"202\";\n})(Framework = exports.Framework || (exports.Framework = {}));\nvar Category;\n(function (Category) {\n Category[\"AI\"] = \"ai\";\n Category[\"API\"] = \"api\";\n Category[\"Auth\"] = \"auth\";\n Category[\"Analytics\"] = \"analytics\";\n Category[\"DataStore\"] = \"datastore\";\n Category[\"Geo\"] = \"geo\";\n Category[\"InAppMessaging\"] = \"inappmessaging\";\n Category[\"Interactions\"] = \"interactions\";\n Category[\"Predictions\"] = \"predictions\";\n Category[\"PubSub\"] = \"pubsub\";\n Category[\"PushNotification\"] = \"pushnotification\";\n Category[\"Storage\"] = \"storage\";\n})(Category = exports.Category || (exports.Category = {}));\nvar AiAction;\n(function (AiAction) {\n AiAction[\"CreateConversation\"] = \"1\";\n AiAction[\"GetConversation\"] = \"2\";\n AiAction[\"ListConversations\"] = \"3\";\n AiAction[\"DeleteConversation\"] = \"4\";\n AiAction[\"SendMessage\"] = \"5\";\n AiAction[\"ListMessages\"] = \"6\";\n AiAction[\"OnMessage\"] = \"7\";\n AiAction[\"Generation\"] = \"8\";\n AiAction[\"UpdateConversation\"] = \"9\";\n})(AiAction = exports.AiAction || (exports.AiAction = {}));\nvar AnalyticsAction;\n(function (AnalyticsAction) {\n AnalyticsAction[\"Record\"] = \"1\";\n AnalyticsAction[\"IdentifyUser\"] = \"2\";\n})(AnalyticsAction = exports.AnalyticsAction || (exports.AnalyticsAction = {}));\nvar ApiAction;\n(function (ApiAction) {\n ApiAction[\"GraphQl\"] = \"1\";\n ApiAction[\"Get\"] = \"2\";\n ApiAction[\"Post\"] = \"3\";\n ApiAction[\"Put\"] = \"4\";\n ApiAction[\"Patch\"] = \"5\";\n ApiAction[\"Del\"] = \"6\";\n ApiAction[\"Head\"] = \"7\";\n})(ApiAction = exports.ApiAction || (exports.ApiAction = {}));\nvar AuthAction;\n(function (AuthAction) {\n AuthAction[\"SignUp\"] = \"1\";\n AuthAction[\"ConfirmSignUp\"] = \"2\";\n AuthAction[\"ResendSignUpCode\"] = \"3\";\n AuthAction[\"SignIn\"] = \"4\";\n AuthAction[\"FetchMFAPreference\"] = \"6\";\n AuthAction[\"UpdateMFAPreference\"] = \"7\";\n AuthAction[\"SetUpTOTP\"] = \"10\";\n AuthAction[\"VerifyTOTPSetup\"] = \"11\";\n AuthAction[\"ConfirmSignIn\"] = \"12\";\n AuthAction[\"DeleteUserAttributes\"] = \"15\";\n AuthAction[\"DeleteUser\"] = \"16\";\n AuthAction[\"UpdateUserAttributes\"] = \"17\";\n AuthAction[\"FetchUserAttributes\"] = \"18\";\n AuthAction[\"ConfirmUserAttribute\"] = \"22\";\n AuthAction[\"SignOut\"] = \"26\";\n AuthAction[\"UpdatePassword\"] = \"27\";\n AuthAction[\"ResetPassword\"] = \"28\";\n AuthAction[\"ConfirmResetPassword\"] = \"29\";\n AuthAction[\"FederatedSignIn\"] = \"30\";\n AuthAction[\"RememberDevice\"] = \"32\";\n AuthAction[\"ForgetDevice\"] = \"33\";\n AuthAction[\"FetchDevices\"] = \"34\";\n AuthAction[\"SendUserAttributeVerificationCode\"] = \"35\";\n AuthAction[\"SignInWithRedirect\"] = \"36\";\n})(AuthAction = exports.AuthAction || (exports.AuthAction = {}));\nvar DataStoreAction;\n(function (DataStoreAction) {\n DataStoreAction[\"Subscribe\"] = \"1\";\n DataStoreAction[\"GraphQl\"] = \"2\";\n})(DataStoreAction = exports.DataStoreAction || (exports.DataStoreAction = {}));\nvar GeoAction;\n(function (GeoAction) {\n GeoAction[\"SearchByText\"] = \"0\";\n GeoAction[\"SearchByCoordinates\"] = \"1\";\n GeoAction[\"SearchForSuggestions\"] = \"2\";\n GeoAction[\"SearchByPlaceId\"] = \"3\";\n GeoAction[\"SaveGeofences\"] = \"4\";\n GeoAction[\"GetGeofence\"] = \"5\";\n GeoAction[\"ListGeofences\"] = \"6\";\n GeoAction[\"DeleteGeofences\"] = \"7\";\n})(GeoAction = exports.GeoAction || (exports.GeoAction = {}));\nvar InAppMessagingAction;\n(function (InAppMessagingAction) {\n InAppMessagingAction[\"SyncMessages\"] = \"1\";\n InAppMessagingAction[\"IdentifyUser\"] = \"2\";\n InAppMessagingAction[\"NotifyMessageInteraction\"] = \"3\";\n})(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));\nvar InteractionsAction;\n(function (InteractionsAction) {\n InteractionsAction[\"None\"] = \"0\";\n})(InteractionsAction = exports.InteractionsAction || (exports.InteractionsAction = {}));\nvar PredictionsAction;\n(function (PredictionsAction) {\n PredictionsAction[\"Convert\"] = \"1\";\n PredictionsAction[\"Identify\"] = \"2\";\n PredictionsAction[\"Interpret\"] = \"3\";\n})(PredictionsAction = exports.PredictionsAction || (exports.PredictionsAction = {}));\nvar PubSubAction;\n(function (PubSubAction) {\n PubSubAction[\"Subscribe\"] = \"1\";\n})(PubSubAction = exports.PubSubAction || (exports.PubSubAction = {}));\nvar PushNotificationAction;\n(function (PushNotificationAction) {\n PushNotificationAction[\"InitializePushNotifications\"] = \"1\";\n PushNotificationAction[\"IdentifyUser\"] = \"2\";\n})(PushNotificationAction = exports.PushNotificationAction || (exports.PushNotificationAction = {}));\nvar StorageAction;\n(function (StorageAction) {\n StorageAction[\"UploadData\"] = \"1\";\n StorageAction[\"DownloadData\"] = \"2\";\n StorageAction[\"List\"] = \"3\";\n StorageAction[\"Copy\"] = \"4\";\n StorageAction[\"Remove\"] = \"5\";\n StorageAction[\"GetProperties\"] = \"6\";\n StorageAction[\"GetUrl\"] = \"7\";\n})(StorageAction = exports.StorageAction || (exports.StorageAction = {}));\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,sBAAsB,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAE1V,CAAC,UAAU,SAAS,EAAE;AACtB;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAC7B,I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AY,CAAC,WAAW,CAAC,GAAG,GAAG,CAAC;AACpC,CAAC,EAAiB,OAAO,CAAC,YAAY,KAAK,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;AAEvE,CAAC,UAAU,sBAAsB,EAAE;AACnC,IAAI,sBAAsB,CAAC,6BAA6B,CAAC,GAAG,GAAG,CAAC;AAChE,IAAI,sBAAsB,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC;AACjD,CAAC,EAA2B,OAAO,CAAC,sBAAsB,KAAK,OAAO,CAAC,sBAAsB,GAAG,EAAE,CAAC,CAAC,CAAC;AAErG,CAAC,UAAU,aAAa,EAAE;AAC1B,IAAI,aAAa,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;AACtC,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC;AACxC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAChC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAChC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,aAAa,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;AACzC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,CAAC,EAAkB,OAAO,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,GAAG,EAAE,CAAC,CAAC;;"}
|
|
@@ -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.6.
|
|
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.6.5-events.0619318.0+0619318';\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,gCAAgC;;"}
|
|
@@ -131,6 +131,21 @@ function parseData(amplifyOutputsDataProperties) {
|
|
|
131
131
|
GraphQL,
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
+
function parseCustom(amplifyOutputsCustomProperties) {
|
|
135
|
+
if (!amplifyOutputsCustomProperties?.events) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;
|
|
139
|
+
const Events = {
|
|
140
|
+
endpoint: url,
|
|
141
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
142
|
+
region: aws_region,
|
|
143
|
+
apiKey: api_key,
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
Events,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
134
149
|
function parseNotifications(amplifyOutputsNotificationsProperties) {
|
|
135
150
|
if (!amplifyOutputsNotificationsProperties) {
|
|
136
151
|
return undefined;
|
|
@@ -178,6 +193,12 @@ function parseAmplifyOutputs(amplifyOutputs) {
|
|
|
178
193
|
if (amplifyOutputs.data) {
|
|
179
194
|
resourcesConfig.API = parseData(amplifyOutputs.data);
|
|
180
195
|
}
|
|
196
|
+
if (amplifyOutputs.custom) {
|
|
197
|
+
const customConfig = parseCustom(amplifyOutputs.custom);
|
|
198
|
+
if (customConfig && 'Events' in customConfig) {
|
|
199
|
+
resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
|
|
200
|
+
}
|
|
201
|
+
}
|
|
181
202
|
if (amplifyOutputs.notifications) {
|
|
182
203
|
resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);
|
|
183
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.parseAmplifyOutputs = exports.parseAnalytics = exports.isAmplifyOutputs = void 0;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nexports.isAmplifyOutputs = isAmplifyOutputs;\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nexports.parseAnalytics = parseAnalytics;\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\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,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AACzF,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAC/B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAC5C,SAAS,YAAY,CAAC,+BAA+B,EAAE;AACvD,IAAI,IAAI,CAAC,+BAA+B,EAAE;AAC1C,QAAQ,OAAO,SAAS,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,+BAA+B,CAAC;AACjF,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE;AACZ,YAAY,MAAM,EAA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,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,SAAS,CAAC;AACV,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,aAAa,CAAC;AACzB;;"}
|
|
1
|
+
{"version":3,"file":"parseAmplifyOutputs.js","sources":["../../src/parseAmplifyOutputs.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.parseAmplifyOutputs = exports.parseAnalytics = exports.isAmplifyOutputs = void 0;\nfunction isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nexports.isAmplifyOutputs = isAmplifyOutputs;\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nfunction parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nexports.parseAnalytics = parseAnalytics;\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nfunction parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nexports.parseAmplifyOutputs = parseAmplifyOutputs;\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\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,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AACzF,SAAS,gBAAgB,CAAC,MAAM,EAAE;AAClC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,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SAAS;AACT,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,SAAS,CAAC;AACV,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,aAAa,CAAC;AACzB;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { UserAgent as AWSUserAgent } from '@aws-sdk/types';
|
|
2
2
|
import { CustomUserAgentDetails, Framework } from './types';
|
|
3
|
+
/** Sanitize Amplify version string be removing special character + and character post the special character */
|
|
4
|
+
export declare const sanitizeAmplifyVersion: (amplifyVersion: string) => string;
|
|
3
5
|
declare class PlatformBuilder {
|
|
4
6
|
userAgent: string;
|
|
5
7
|
get framework(): Framework;
|
|
@@ -6,9 +6,11 @@ import { getCustomUserAgent } from './customUserAgent.mjs';
|
|
|
6
6
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
8
8
|
const BASE_USER_AGENT = `aws-amplify`;
|
|
9
|
+
/** Sanitize Amplify version string be removing special character + and character post the special character */
|
|
10
|
+
const sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\+.*/, '');
|
|
9
11
|
class PlatformBuilder {
|
|
10
12
|
constructor() {
|
|
11
|
-
this.userAgent = `${BASE_USER_AGENT}/${version}`;
|
|
13
|
+
this.userAgent = `${BASE_USER_AGENT}/${sanitizeAmplifyVersion(version)}`;
|
|
12
14
|
}
|
|
13
15
|
get framework() {
|
|
14
16
|
return detectFramework();
|
|
@@ -23,7 +25,9 @@ class PlatformBuilder {
|
|
|
23
25
|
}
|
|
24
26
|
const Platform = new PlatformBuilder();
|
|
25
27
|
const getAmplifyUserAgentObject = ({ category, action, } = {}) => {
|
|
26
|
-
const userAgent = [
|
|
28
|
+
const userAgent = [
|
|
29
|
+
[BASE_USER_AGENT, sanitizeAmplifyVersion(version)],
|
|
30
|
+
];
|
|
27
31
|
if (category) {
|
|
28
32
|
userAgent.push([category, action]);
|
|
29
33
|
}
|
|
@@ -46,5 +50,5 @@ const getAmplifyUserAgent = (customUserAgentDetails) => {
|
|
|
46
50
|
return userAgentString;
|
|
47
51
|
};
|
|
48
52
|
|
|
49
|
-
export { Platform, getAmplifyUserAgent, getAmplifyUserAgentObject };
|
|
53
|
+
export { Platform, getAmplifyUserAgent, getAmplifyUserAgentObject, sanitizeAmplifyVersion };
|
|
50
54
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/Platform/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Framework } from './types';\nimport { version } from './version';\nimport { detectFramework, observeFrameworkChanges } from './detectFramework';\nimport { getCustomUserAgent } from './customUserAgent';\nconst BASE_USER_AGENT = `aws-amplify`;\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${version}`;\n }\n get framework() {\n return detectFramework();\n }\n get isReactNative() {\n return (this.framework === Framework.ReactNative ||\n this.framework === Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n observeFrameworkChanges(fcn);\n }\n}\nexport const Platform = new PlatformBuilder();\nexport const getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [[BASE_USER_AGENT, version]];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', detectFramework()]);\n if (category && action) {\n const customState = getCustomUserAgent(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexport const getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = getAmplifyUserAgentObject(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA,MAAM,eAAe,GAAG,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,eAAe,CAAC;AACtB,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/Platform/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Framework } from './types';\nimport { version } from './version';\nimport { detectFramework, observeFrameworkChanges } from './detectFramework';\nimport { getCustomUserAgent } from './customUserAgent';\nconst BASE_USER_AGENT = `aws-amplify`;\n/** Sanitize Amplify version string be removing special character + and character post the special character */\nexport const sanitizeAmplifyVersion = (amplifyVersion) => amplifyVersion.replace(/\\+.*/, '');\nclass PlatformBuilder {\n constructor() {\n this.userAgent = `${BASE_USER_AGENT}/${sanitizeAmplifyVersion(version)}`;\n }\n get framework() {\n return detectFramework();\n }\n get isReactNative() {\n return (this.framework === Framework.ReactNative ||\n this.framework === Framework.Expo);\n }\n observeFrameworkChanges(fcn) {\n observeFrameworkChanges(fcn);\n }\n}\nexport const Platform = new PlatformBuilder();\nexport const getAmplifyUserAgentObject = ({ category, action, } = {}) => {\n const userAgent = [\n [BASE_USER_AGENT, sanitizeAmplifyVersion(version)],\n ];\n if (category) {\n userAgent.push([category, action]);\n }\n userAgent.push(['framework', detectFramework()]);\n if (category && action) {\n const customState = getCustomUserAgent(category, action);\n if (customState) {\n customState.forEach(state => {\n userAgent.push(state);\n });\n }\n }\n return userAgent;\n};\nexport const getAmplifyUserAgent = (customUserAgentDetails) => {\n const userAgent = getAmplifyUserAgentObject(customUserAgentDetails);\n const userAgentString = userAgent\n .map(([agentKey, agentValue]) => agentKey && agentValue ? `${agentKey}/${agentValue}` : agentKey)\n .join(' ');\n return userAgentString;\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AAKA,MAAM,eAAe,GAAG,CA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WAAW,EAAE;AACzB,YAAY,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI;AACzC,gBAAgB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,KAAK;AACL,IAAI,OAAO,SAAS,CAAC;AACrB,EAAE;AACU,MAAC,mBAAmB,GAAG,CAAC,sBAAsB,KAAK;AAC/D,IAAI,MAAM,SAAS,GAAG,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;AACxE,IAAI,MAAM,eAAe,GAAG,SAAS;AACrC,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,QAAQ,IAAI,UAAU,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC;AACzG,SAAS,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,IAAI,OAAO,eAAe,CAAC;AAC3B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../src/Platform/types.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var Framework;\n(function (Framework) {\n // < 100 - Web frameworks\n Framework[\"WebUnknown\"] = \"0\";\n Framework[\"React\"] = \"1\";\n Framework[\"NextJs\"] = \"2\";\n Framework[\"Angular\"] = \"3\";\n Framework[\"VueJs\"] = \"4\";\n Framework[\"Nuxt\"] = \"5\";\n Framework[\"Svelte\"] = \"6\";\n // 100s - Server side frameworks\n Framework[\"ServerSideUnknown\"] = \"100\";\n Framework[\"ReactSSR\"] = \"101\";\n Framework[\"NextJsSSR\"] = \"102\";\n Framework[\"AngularSSR\"] = \"103\";\n Framework[\"VueJsSSR\"] = \"104\";\n Framework[\"NuxtSSR\"] = \"105\";\n Framework[\"SvelteSSR\"] = \"106\";\n // 200s - Mobile framework\n Framework[\"ReactNative\"] = \"201\";\n Framework[\"Expo\"] = \"202\";\n})(Framework || (Framework = {}));\nexport var Category;\n(function (Category) {\n Category[\"AI\"] = \"ai\";\n Category[\"API\"] = \"api\";\n Category[\"Auth\"] = \"auth\";\n Category[\"Analytics\"] = \"analytics\";\n Category[\"DataStore\"] = \"datastore\";\n Category[\"Geo\"] = \"geo\";\n Category[\"InAppMessaging\"] = \"inappmessaging\";\n Category[\"Interactions\"] = \"interactions\";\n Category[\"Predictions\"] = \"predictions\";\n Category[\"PubSub\"] = \"pubsub\";\n Category[\"PushNotification\"] = \"pushnotification\";\n Category[\"Storage\"] = \"storage\";\n})(Category || (Category = {}));\nexport var AiAction;\n(function (AiAction) {\n AiAction[\"CreateConversation\"] = \"1\";\n AiAction[\"GetConversation\"] = \"2\";\n AiAction[\"ListConversations\"] = \"3\";\n AiAction[\"DeleteConversation\"] = \"4\";\n AiAction[\"SendMessage\"] = \"5\";\n AiAction[\"ListMessages\"] = \"6\";\n AiAction[\"OnMessage\"] = \"7\";\n AiAction[\"Generation\"] = \"8\";\n})(AiAction || (AiAction = {}));\nexport var AnalyticsAction;\n(function (AnalyticsAction) {\n AnalyticsAction[\"Record\"] = \"1\";\n AnalyticsAction[\"IdentifyUser\"] = \"2\";\n})(AnalyticsAction || (AnalyticsAction = {}));\nexport var ApiAction;\n(function (ApiAction) {\n ApiAction[\"GraphQl\"] = \"1\";\n ApiAction[\"Get\"] = \"2\";\n ApiAction[\"Post\"] = \"3\";\n ApiAction[\"Put\"] = \"4\";\n ApiAction[\"Patch\"] = \"5\";\n ApiAction[\"Del\"] = \"6\";\n ApiAction[\"Head\"] = \"7\";\n})(ApiAction || (ApiAction = {}));\nexport var AuthAction;\n(function (AuthAction) {\n AuthAction[\"SignUp\"] = \"1\";\n AuthAction[\"ConfirmSignUp\"] = \"2\";\n AuthAction[\"ResendSignUpCode\"] = \"3\";\n AuthAction[\"SignIn\"] = \"4\";\n AuthAction[\"FetchMFAPreference\"] = \"6\";\n AuthAction[\"UpdateMFAPreference\"] = \"7\";\n AuthAction[\"SetUpTOTP\"] = \"10\";\n AuthAction[\"VerifyTOTPSetup\"] = \"11\";\n AuthAction[\"ConfirmSignIn\"] = \"12\";\n AuthAction[\"DeleteUserAttributes\"] = \"15\";\n AuthAction[\"DeleteUser\"] = \"16\";\n AuthAction[\"UpdateUserAttributes\"] = \"17\";\n AuthAction[\"FetchUserAttributes\"] = \"18\";\n AuthAction[\"ConfirmUserAttribute\"] = \"22\";\n AuthAction[\"SignOut\"] = \"26\";\n AuthAction[\"UpdatePassword\"] = \"27\";\n AuthAction[\"ResetPassword\"] = \"28\";\n AuthAction[\"ConfirmResetPassword\"] = \"29\";\n AuthAction[\"FederatedSignIn\"] = \"30\";\n AuthAction[\"RememberDevice\"] = \"32\";\n AuthAction[\"ForgetDevice\"] = \"33\";\n AuthAction[\"FetchDevices\"] = \"34\";\n AuthAction[\"SendUserAttributeVerificationCode\"] = \"35\";\n AuthAction[\"SignInWithRedirect\"] = \"36\";\n})(AuthAction || (AuthAction = {}));\nexport var DataStoreAction;\n(function (DataStoreAction) {\n DataStoreAction[\"Subscribe\"] = \"1\";\n DataStoreAction[\"GraphQl\"] = \"2\";\n})(DataStoreAction || (DataStoreAction = {}));\nexport var GeoAction;\n(function (GeoAction) {\n GeoAction[\"SearchByText\"] = \"0\";\n GeoAction[\"SearchByCoordinates\"] = \"1\";\n GeoAction[\"SearchForSuggestions\"] = \"2\";\n GeoAction[\"SearchByPlaceId\"] = \"3\";\n GeoAction[\"SaveGeofences\"] = \"4\";\n GeoAction[\"GetGeofence\"] = \"5\";\n GeoAction[\"ListGeofences\"] = \"6\";\n GeoAction[\"DeleteGeofences\"] = \"7\";\n})(GeoAction || (GeoAction = {}));\nexport var InAppMessagingAction;\n(function (InAppMessagingAction) {\n InAppMessagingAction[\"SyncMessages\"] = \"1\";\n InAppMessagingAction[\"IdentifyUser\"] = \"2\";\n InAppMessagingAction[\"NotifyMessageInteraction\"] = \"3\";\n})(InAppMessagingAction || (InAppMessagingAction = {}));\nexport var InteractionsAction;\n(function (InteractionsAction) {\n InteractionsAction[\"None\"] = \"0\";\n})(InteractionsAction || (InteractionsAction = {}));\nexport var PredictionsAction;\n(function (PredictionsAction) {\n PredictionsAction[\"Convert\"] = \"1\";\n PredictionsAction[\"Identify\"] = \"2\";\n PredictionsAction[\"Interpret\"] = \"3\";\n})(PredictionsAction || (PredictionsAction = {}));\nexport var PubSubAction;\n(function (PubSubAction) {\n PubSubAction[\"Subscribe\"] = \"1\";\n})(PubSubAction || (PubSubAction = {}));\nexport var PushNotificationAction;\n(function (PushNotificationAction) {\n PushNotificationAction[\"InitializePushNotifications\"] = \"1\";\n PushNotificationAction[\"IdentifyUser\"] = \"2\";\n})(PushNotificationAction || (PushNotificationAction = {}));\nexport var StorageAction;\n(function (StorageAction) {\n StorageAction[\"UploadData\"] = \"1\";\n StorageAction[\"DownloadData\"] = \"2\";\n StorageAction[\"List\"] = \"3\";\n StorageAction[\"Copy\"] = \"4\";\n StorageAction[\"Remove\"] = \"5\";\n StorageAction[\"GetProperties\"] = \"6\";\n StorageAction[\"GetUrl\"] = \"7\";\n})(StorageAction || (StorageAction = {}));\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC,UAAU;AACrB,CAAC,UAAU,SAAS,EAAE;AACtB;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAC7B,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAC9B,IAAI,SAAS,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;AAC/B,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAC7B,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAC5B,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAC9B;AACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GA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AG,CAAC;AACtC,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC;AACxC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAChC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAChC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,aAAa,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;AACzC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../src/Platform/types.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var Framework;\n(function (Framework) {\n // < 100 - Web frameworks\n Framework[\"WebUnknown\"] = \"0\";\n Framework[\"React\"] = \"1\";\n Framework[\"NextJs\"] = \"2\";\n Framework[\"Angular\"] = \"3\";\n Framework[\"VueJs\"] = \"4\";\n Framework[\"Nuxt\"] = \"5\";\n Framework[\"Svelte\"] = \"6\";\n // 100s - Server side frameworks\n Framework[\"ServerSideUnknown\"] = \"100\";\n Framework[\"ReactSSR\"] = \"101\";\n Framework[\"NextJsSSR\"] = \"102\";\n Framework[\"AngularSSR\"] = \"103\";\n Framework[\"VueJsSSR\"] = \"104\";\n Framework[\"NuxtSSR\"] = \"105\";\n Framework[\"SvelteSSR\"] = \"106\";\n // 200s - Mobile framework\n Framework[\"ReactNative\"] = \"201\";\n Framework[\"Expo\"] = \"202\";\n})(Framework || (Framework = {}));\nexport var Category;\n(function (Category) {\n Category[\"AI\"] = \"ai\";\n Category[\"API\"] = \"api\";\n Category[\"Auth\"] = \"auth\";\n Category[\"Analytics\"] = \"analytics\";\n Category[\"DataStore\"] = \"datastore\";\n Category[\"Geo\"] = \"geo\";\n Category[\"InAppMessaging\"] = \"inappmessaging\";\n Category[\"Interactions\"] = \"interactions\";\n Category[\"Predictions\"] = \"predictions\";\n Category[\"PubSub\"] = \"pubsub\";\n Category[\"PushNotification\"] = \"pushnotification\";\n Category[\"Storage\"] = \"storage\";\n})(Category || (Category = {}));\nexport var AiAction;\n(function (AiAction) {\n AiAction[\"CreateConversation\"] = \"1\";\n AiAction[\"GetConversation\"] = \"2\";\n AiAction[\"ListConversations\"] = \"3\";\n AiAction[\"DeleteConversation\"] = \"4\";\n AiAction[\"SendMessage\"] = \"5\";\n AiAction[\"ListMessages\"] = \"6\";\n AiAction[\"OnMessage\"] = \"7\";\n AiAction[\"Generation\"] = \"8\";\n AiAction[\"UpdateConversation\"] = \"9\";\n})(AiAction || (AiAction = {}));\nexport var AnalyticsAction;\n(function (AnalyticsAction) {\n AnalyticsAction[\"Record\"] = \"1\";\n AnalyticsAction[\"IdentifyUser\"] = \"2\";\n})(AnalyticsAction || (AnalyticsAction = {}));\nexport var ApiAction;\n(function (ApiAction) {\n ApiAction[\"GraphQl\"] = \"1\";\n ApiAction[\"Get\"] = \"2\";\n ApiAction[\"Post\"] = \"3\";\n ApiAction[\"Put\"] = \"4\";\n ApiAction[\"Patch\"] = \"5\";\n ApiAction[\"Del\"] = \"6\";\n ApiAction[\"Head\"] = \"7\";\n})(ApiAction || (ApiAction = {}));\nexport var AuthAction;\n(function (AuthAction) {\n AuthAction[\"SignUp\"] = \"1\";\n AuthAction[\"ConfirmSignUp\"] = \"2\";\n AuthAction[\"ResendSignUpCode\"] = \"3\";\n AuthAction[\"SignIn\"] = \"4\";\n AuthAction[\"FetchMFAPreference\"] = \"6\";\n AuthAction[\"UpdateMFAPreference\"] = \"7\";\n AuthAction[\"SetUpTOTP\"] = \"10\";\n AuthAction[\"VerifyTOTPSetup\"] = \"11\";\n AuthAction[\"ConfirmSignIn\"] = \"12\";\n AuthAction[\"DeleteUserAttributes\"] = \"15\";\n AuthAction[\"DeleteUser\"] = \"16\";\n AuthAction[\"UpdateUserAttributes\"] = \"17\";\n AuthAction[\"FetchUserAttributes\"] = \"18\";\n AuthAction[\"ConfirmUserAttribute\"] = \"22\";\n AuthAction[\"SignOut\"] = \"26\";\n AuthAction[\"UpdatePassword\"] = \"27\";\n AuthAction[\"ResetPassword\"] = \"28\";\n AuthAction[\"ConfirmResetPassword\"] = \"29\";\n AuthAction[\"FederatedSignIn\"] = \"30\";\n AuthAction[\"RememberDevice\"] = \"32\";\n AuthAction[\"ForgetDevice\"] = \"33\";\n AuthAction[\"FetchDevices\"] = \"34\";\n AuthAction[\"SendUserAttributeVerificationCode\"] = \"35\";\n AuthAction[\"SignInWithRedirect\"] = \"36\";\n})(AuthAction || (AuthAction = {}));\nexport var DataStoreAction;\n(function (DataStoreAction) {\n DataStoreAction[\"Subscribe\"] = \"1\";\n DataStoreAction[\"GraphQl\"] = \"2\";\n})(DataStoreAction || (DataStoreAction = {}));\nexport var GeoAction;\n(function (GeoAction) {\n GeoAction[\"SearchByText\"] = \"0\";\n GeoAction[\"SearchByCoordinates\"] = \"1\";\n GeoAction[\"SearchForSuggestions\"] = \"2\";\n GeoAction[\"SearchByPlaceId\"] = \"3\";\n GeoAction[\"SaveGeofences\"] = \"4\";\n GeoAction[\"GetGeofence\"] = \"5\";\n GeoAction[\"ListGeofences\"] = \"6\";\n GeoAction[\"DeleteGeofences\"] = \"7\";\n})(GeoAction || (GeoAction = {}));\nexport var InAppMessagingAction;\n(function (InAppMessagingAction) {\n InAppMessagingAction[\"SyncMessages\"] = \"1\";\n InAppMessagingAction[\"IdentifyUser\"] = \"2\";\n InAppMessagingAction[\"NotifyMessageInteraction\"] = \"3\";\n})(InAppMessagingAction || (InAppMessagingAction = {}));\nexport var InteractionsAction;\n(function (InteractionsAction) {\n InteractionsAction[\"None\"] = \"0\";\n})(InteractionsAction || (InteractionsAction = {}));\nexport var PredictionsAction;\n(function (PredictionsAction) {\n PredictionsAction[\"Convert\"] = \"1\";\n PredictionsAction[\"Identify\"] = \"2\";\n PredictionsAction[\"Interpret\"] = \"3\";\n})(PredictionsAction || (PredictionsAction = {}));\nexport var PubSubAction;\n(function (PubSubAction) {\n PubSubAction[\"Subscribe\"] = \"1\";\n})(PubSubAction || (PubSubAction = {}));\nexport var PushNotificationAction;\n(function (PushNotificationAction) {\n PushNotificationAction[\"InitializePushNotifications\"] = \"1\";\n PushNotificationAction[\"IdentifyUser\"] = \"2\";\n})(PushNotificationAction || (PushNotificationAction = {}));\nexport var StorageAction;\n(function (StorageAction) {\n StorageAction[\"UploadData\"] = \"1\";\n StorageAction[\"DownloadData\"] = \"2\";\n StorageAction[\"List\"] = \"3\";\n StorageAction[\"Copy\"] = \"4\";\n StorageAction[\"Remove\"] = \"5\";\n StorageAction[\"GetProperties\"] = \"6\";\n StorageAction[\"GetUrl\"] = \"7\";\n})(StorageAction || (StorageAction = {}));\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC,UAAU;AACrB,CAAC,UAAU,SAAS,EAAE;AACtB;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAC7B,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAC9B,IAAI,SAAS,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;AAC/B,IAAI,SAAS,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;AAC7B,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAC5B,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAC9B;AACA,IAAI,SAAS,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC;AAC3C,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;AAClC,IAAI,SAAS,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;AACnC,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;AACpC,IAAI,S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,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAChC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI,aAAa,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;AACzC,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;AAClC,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.6.
|
|
1
|
+
export declare const version = "6.6.5-events.0619318.0+0619318";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.6.5-events.0619318.0+0619318';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -125,6 +125,21 @@ function parseData(amplifyOutputsDataProperties) {
|
|
|
125
125
|
GraphQL,
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
+
function parseCustom(amplifyOutputsCustomProperties) {
|
|
129
|
+
if (!amplifyOutputsCustomProperties?.events) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;
|
|
133
|
+
const Events = {
|
|
134
|
+
endpoint: url,
|
|
135
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
136
|
+
region: aws_region,
|
|
137
|
+
apiKey: api_key,
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
Events,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
128
143
|
function parseNotifications(amplifyOutputsNotificationsProperties) {
|
|
129
144
|
if (!amplifyOutputsNotificationsProperties) {
|
|
130
145
|
return undefined;
|
|
@@ -172,6 +187,12 @@ function parseAmplifyOutputs(amplifyOutputs) {
|
|
|
172
187
|
if (amplifyOutputs.data) {
|
|
173
188
|
resourcesConfig.API = parseData(amplifyOutputs.data);
|
|
174
189
|
}
|
|
190
|
+
if (amplifyOutputs.custom) {
|
|
191
|
+
const customConfig = parseCustom(amplifyOutputs.custom);
|
|
192
|
+
if (customConfig && 'Events' in customConfig) {
|
|
193
|
+
resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
175
196
|
if (amplifyOutputs.notifications) {
|
|
176
197
|
resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);
|
|
177
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAmplifyOutputs.mjs","sources":["../../src/parseAmplifyOutputs.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nexport function parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nexport function parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAE;AACzC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAC/B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,YAAY,CAAC,+BAA+B,EAAE;AACvD,IAAI,IAAI,CAAC,+BAA+B,EAAE;AAC1C,QAAQ,OAAO,SAAS,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,+BAA+B,CAAC;AACjF,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE;AACZ,YAA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CAAC;AACP,IAAI,OAAO,aAAa,CAAC;AACzB;;;;"}
|
|
1
|
+
{"version":3,"file":"parseAmplifyOutputs.mjs","sources":["../../src/parseAmplifyOutputs.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function isAmplifyOutputs(config) {\n // version format initially will be '1' but is expected to be something like x.y where x is major and y minor version\n const { version } = config;\n if (!version) {\n return false;\n }\n return version.startsWith('1');\n}\nfunction parseStorage(amplifyOutputsStorageProperties) {\n if (!amplifyOutputsStorageProperties) {\n return undefined;\n }\n const { bucket_name, aws_region, buckets } = amplifyOutputsStorageProperties;\n return {\n S3: {\n bucket: bucket_name,\n region: aws_region,\n buckets: buckets && createBucketInfoMap(buckets),\n },\n };\n}\nfunction parseAuth(amplifyOutputsAuthProperties) {\n if (!amplifyOutputsAuthProperties) {\n return undefined;\n }\n const { user_pool_id, user_pool_client_id, identity_pool_id, password_policy, mfa_configuration, mfa_methods, unauthenticated_identities_enabled, oauth, username_attributes, standard_required_attributes, } = amplifyOutputsAuthProperties;\n const authConfig = {\n Cognito: {\n userPoolId: user_pool_id,\n userPoolClientId: user_pool_client_id,\n },\n };\n if (identity_pool_id) {\n authConfig.Cognito = {\n ...authConfig.Cognito,\n identityPoolId: identity_pool_id,\n };\n }\n if (password_policy) {\n authConfig.Cognito.passwordFormat = {\n requireLowercase: password_policy.require_lowercase,\n requireNumbers: password_policy.require_numbers,\n requireUppercase: password_policy.require_uppercase,\n requireSpecialCharacters: password_policy.require_symbols,\n minLength: password_policy.min_length ?? 6,\n };\n }\n if (mfa_configuration) {\n authConfig.Cognito.mfa = {\n status: getMfaStatus(mfa_configuration),\n smsEnabled: mfa_methods?.includes('SMS'),\n totpEnabled: mfa_methods?.includes('TOTP'),\n };\n }\n if (unauthenticated_identities_enabled) {\n authConfig.Cognito.allowGuestAccess = unauthenticated_identities_enabled;\n }\n if (oauth) {\n authConfig.Cognito.loginWith = {\n oauth: {\n domain: oauth.domain,\n redirectSignIn: oauth.redirect_sign_in_uri,\n redirectSignOut: oauth.redirect_sign_out_uri,\n responseType: oauth.response_type === 'token' ? 'token' : 'code',\n scopes: oauth.scopes,\n providers: getOAuthProviders(oauth.identity_providers),\n },\n };\n }\n if (username_attributes) {\n authConfig.Cognito.loginWith = {\n ...authConfig.Cognito.loginWith,\n email: username_attributes.includes('email'),\n phone: username_attributes.includes('phone_number'),\n // Signing in with a username is not currently supported in Gen2, this should always evaluate to false\n username: username_attributes.includes('username'),\n };\n }\n if (standard_required_attributes) {\n authConfig.Cognito.userAttributes = standard_required_attributes.reduce((acc, curr) => ({ ...acc, [curr]: { required: true } }), {});\n }\n return authConfig;\n}\nexport function parseAnalytics(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties?.amazon_pinpoint) {\n return undefined;\n }\n const { amazon_pinpoint } = amplifyOutputsAnalyticsProperties;\n return {\n Pinpoint: {\n appId: amazon_pinpoint.app_id,\n region: amazon_pinpoint.aws_region,\n },\n };\n}\nfunction parseGeo(amplifyOutputsAnalyticsProperties) {\n if (!amplifyOutputsAnalyticsProperties) {\n return undefined;\n }\n const { aws_region, geofence_collections, maps, search_indices } = amplifyOutputsAnalyticsProperties;\n return {\n LocationService: {\n region: aws_region,\n searchIndices: search_indices,\n geofenceCollections: geofence_collections,\n maps,\n },\n };\n}\nfunction parseData(amplifyOutputsDataProperties) {\n if (!amplifyOutputsDataProperties) {\n return undefined;\n }\n const { aws_region, default_authorization_type, url, api_key, model_introspection, } = amplifyOutputsDataProperties;\n const GraphQL = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n modelIntrospection: model_introspection,\n };\n return {\n GraphQL,\n };\n}\nfunction parseCustom(amplifyOutputsCustomProperties) {\n if (!amplifyOutputsCustomProperties?.events) {\n return undefined;\n }\n const { url, aws_region, api_key, default_authorization_type } = amplifyOutputsCustomProperties.events;\n const Events = {\n endpoint: url,\n defaultAuthMode: getGraphQLAuthMode(default_authorization_type),\n region: aws_region,\n apiKey: api_key,\n };\n return {\n Events,\n };\n}\nfunction parseNotifications(amplifyOutputsNotificationsProperties) {\n if (!amplifyOutputsNotificationsProperties) {\n return undefined;\n }\n const { aws_region, channels, amazon_pinpoint_app_id } = amplifyOutputsNotificationsProperties;\n const hasInAppMessaging = channels.includes('IN_APP_MESSAGING');\n const hasPushNotification = channels.includes('APNS') || channels.includes('FCM');\n if (!(hasInAppMessaging || hasPushNotification)) {\n return undefined;\n }\n // At this point, we know the Amplify outputs contains at least one supported channel\n const notificationsConfig = {};\n if (hasInAppMessaging) {\n notificationsConfig.InAppMessaging = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n if (hasPushNotification) {\n notificationsConfig.PushNotification = {\n Pinpoint: {\n appId: amazon_pinpoint_app_id,\n region: aws_region,\n },\n };\n }\n return notificationsConfig;\n}\nexport function parseAmplifyOutputs(amplifyOutputs) {\n const resourcesConfig = {};\n if (amplifyOutputs.storage) {\n resourcesConfig.Storage = parseStorage(amplifyOutputs.storage);\n }\n if (amplifyOutputs.auth) {\n resourcesConfig.Auth = parseAuth(amplifyOutputs.auth);\n }\n if (amplifyOutputs.analytics) {\n resourcesConfig.Analytics = parseAnalytics(amplifyOutputs.analytics);\n }\n if (amplifyOutputs.geo) {\n resourcesConfig.Geo = parseGeo(amplifyOutputs.geo);\n }\n if (amplifyOutputs.data) {\n resourcesConfig.API = parseData(amplifyOutputs.data);\n }\n if (amplifyOutputs.custom) {\n const customConfig = parseCustom(amplifyOutputs.custom);\n if (customConfig && 'Events' in customConfig) {\n resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };\n }\n }\n if (amplifyOutputs.notifications) {\n resourcesConfig.Notifications = parseNotifications(amplifyOutputs.notifications);\n }\n return resourcesConfig;\n}\nconst authModeNames = {\n AMAZON_COGNITO_USER_POOLS: 'userPool',\n API_KEY: 'apiKey',\n AWS_IAM: 'iam',\n AWS_LAMBDA: 'lambda',\n OPENID_CONNECT: 'oidc',\n};\nfunction getGraphQLAuthMode(authType) {\n return authModeNames[authType];\n}\nconst providerNames = {\n GOOGLE: 'Google',\n LOGIN_WITH_AMAZON: 'Amazon',\n FACEBOOK: 'Facebook',\n SIGN_IN_WITH_APPLE: 'Apple',\n};\nfunction getOAuthProviders(providers = []) {\n return providers.reduce((oAuthProviders, provider) => {\n if (providerNames[provider] !== undefined) {\n oAuthProviders.push(providerNames[provider]);\n }\n return oAuthProviders;\n }, []);\n}\nfunction getMfaStatus(mfaConfiguration) {\n if (mfaConfiguration === 'OPTIONAL')\n return 'optional';\n if (mfaConfiguration === 'REQUIRED')\n return 'on';\n return 'off';\n}\nfunction createBucketInfoMap(buckets) {\n const mappedBuckets = {};\n buckets.forEach(({ name, bucket_name: bucketName, aws_region: region }) => {\n if (name in mappedBuckets) {\n throw new Error(`Duplicate friendly name found: ${name}. Name must be unique.`);\n }\n mappedBuckets[name] = {\n bucketName,\n region,\n };\n });\n return mappedBuckets;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAE;AACzC;AACA,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAC/B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,YAAY,CAAC,+BAA+B,EAAE;AACvD,IAAI,IAAI,CAAC,+BAA+B,EAAE;AAC1C,QAAQ,OAAO,SAAS,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,+BAA+B,CAAC;AACjF,IAAI,OAAO;AACX,QAAQ,EAAE,EAAE;AACZ,YAAY,MAAM,EAAE,WAAW;AAC/B,YAAY,MAAM,EAA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OAAO,cAAc,CAAC;AAC9B,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AACD,SAAS,YAAY,CAAC,gBAAgB,EAAE;AACxC,IAAI,IAAI,gBAAgB,KAAK,UAAU;AACvC,QAAQ,OAAO,UAAU,CAAC;AAC1B,IAAI,IAAI,gBAAgB,KAAK,UAAU;AACvC,QAAQ,OAAO,IAAI,CAAC;AACpB,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD,SAAS,mBAAmB,CAAC,OAAO,EAAE;AACtC,IAAI,MAAM,aAAa,GAAG,EAAE,CAAC;AAC7B,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK;AAC/E,QAAQ,IAAI,IAAI,IAAI,aAAa,EAAE;AACnC,YAAY,MAAM,IAAI,KAAK,CAAC,CAAC,+BAA+B,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAC5F,SAAS;AACT,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG;AAC9B,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,SAAS,CAAC;AACV,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,aAAa,CAAC;AACzB;;;;"}
|
|
@@ -42,6 +42,36 @@ export interface APIGraphQLConfig {
|
|
|
42
42
|
defaultAuthMode: GraphQLAuthMode;
|
|
43
43
|
modelIntrospection?: ModelIntrospectionSchema;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* @experimental
|
|
47
|
+
*/
|
|
48
|
+
export interface APIEventsConfig {
|
|
49
|
+
/**
|
|
50
|
+
* Required GraphQL endpoint, must be a valid URL string.
|
|
51
|
+
*/
|
|
52
|
+
endpoint: string;
|
|
53
|
+
/**
|
|
54
|
+
* Optional region string used to sign the request. Required only if the auth mode is 'iam'.
|
|
55
|
+
*/
|
|
56
|
+
region?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Optional API key string. Required only if the auth mode is 'apiKey'.
|
|
59
|
+
*/
|
|
60
|
+
apiKey?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Custom domain endpoint for GraphQL API.
|
|
63
|
+
*/
|
|
64
|
+
customEndpoint?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Optional region string used to sign the request to `customEndpoint`. Effective only if `customEndpoint` is
|
|
67
|
+
* specified, and the auth mode is 'iam'.
|
|
68
|
+
*/
|
|
69
|
+
customEndpointRegion?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Default auth mode for all the API calls to given service.
|
|
72
|
+
*/
|
|
73
|
+
defaultAuthMode: GraphQLAuthMode;
|
|
74
|
+
}
|
|
45
75
|
export interface APIRestConfig {
|
|
46
76
|
/**
|
|
47
77
|
* Required REST endpoint, must be a valid URL string.
|
|
@@ -67,7 +97,10 @@ export interface RESTProviderConfig {
|
|
|
67
97
|
export interface GraphQLProviderConfig {
|
|
68
98
|
GraphQL: APIGraphQLConfig;
|
|
69
99
|
}
|
|
70
|
-
export
|
|
100
|
+
export interface EventsProviderConfig {
|
|
101
|
+
Events: APIEventsConfig;
|
|
102
|
+
}
|
|
103
|
+
export type APIConfig = AtLeastOne<RESTProviderConfig & GraphQLProviderConfig & EventsProviderConfig>;
|
|
71
104
|
export type GraphQLAuthMode = 'apiKey' | 'oidc' | 'userPool' | 'iam' | 'identityPool' | 'lambda' | 'none';
|
|
72
105
|
/**
|
|
73
106
|
* Type representing a plain JavaScript object that can be serialized to JSON.
|
|
@@ -12,8 +12,8 @@ import './Auth/utils/errorHelpers.mjs';
|
|
|
12
12
|
import { AuthClass } from './Auth/index.mjs';
|
|
13
13
|
import '@aws-crypto/sha256-js';
|
|
14
14
|
import '@smithy/util-hex-encoding';
|
|
15
|
+
import '../Platform/index.mjs';
|
|
15
16
|
import '../Platform/types.mjs';
|
|
16
|
-
import '../Platform/detection/index.mjs';
|
|
17
17
|
import '../BackgroundProcessManager/types.mjs';
|
|
18
18
|
import '../Reachability/Reachability.mjs';
|
|
19
19
|
import '../utils/sessionListener/index.mjs';
|
|
@@ -76,6 +76,15 @@ export interface AmplifyOutputsDataProperties {
|
|
|
76
76
|
api_key?: string;
|
|
77
77
|
conflict_resolution_mode?: string;
|
|
78
78
|
}
|
|
79
|
+
export interface AmplifyOutputsCustomProperties {
|
|
80
|
+
events?: {
|
|
81
|
+
url: string;
|
|
82
|
+
aws_region: string;
|
|
83
|
+
default_authorization_type: string;
|
|
84
|
+
api_key?: string;
|
|
85
|
+
};
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
79
88
|
export interface AmplifyOutputsNotificationsProperties {
|
|
80
89
|
aws_region: string;
|
|
81
90
|
amazon_pinpoint_app_id: string;
|
|
@@ -88,5 +97,6 @@ export interface AmplifyOutputs {
|
|
|
88
97
|
analytics?: AmplifyOutputsAnalyticsProperties;
|
|
89
98
|
geo?: AmplifyOutputsGeoProperties;
|
|
90
99
|
data?: AmplifyOutputsDataProperties;
|
|
100
|
+
custom?: AmplifyOutputsCustomProperties;
|
|
91
101
|
notifications?: AmplifyOutputsNotificationsProperties;
|
|
92
102
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/core",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.5-events.0619318.0+0619318",
|
|
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-events.0619318.0+0619318",
|
|
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": "06193189d7eb5d64880eb70d94c0a82748cc2097"
|
|
196
196
|
}
|
package/src/Platform/index.ts
CHANGED
|
@@ -10,8 +10,12 @@ import { getCustomUserAgent } from './customUserAgent';
|
|
|
10
10
|
|
|
11
11
|
const BASE_USER_AGENT = `aws-amplify`;
|
|
12
12
|
|
|
13
|
+
/** Sanitize Amplify version string be removing special character + and character post the special character */
|
|
14
|
+
export const sanitizeAmplifyVersion = (amplifyVersion: string) =>
|
|
15
|
+
amplifyVersion.replace(/\+.*/, '');
|
|
16
|
+
|
|
13
17
|
class PlatformBuilder {
|
|
14
|
-
userAgent = `${BASE_USER_AGENT}/${version}`;
|
|
18
|
+
userAgent = `${BASE_USER_AGENT}/${sanitizeAmplifyVersion(version)}`;
|
|
15
19
|
get framework() {
|
|
16
20
|
return detectFramework();
|
|
17
21
|
}
|
|
@@ -34,7 +38,10 @@ export const getAmplifyUserAgentObject = ({
|
|
|
34
38
|
category,
|
|
35
39
|
action,
|
|
36
40
|
}: CustomUserAgentDetails = {}): AWSUserAgent => {
|
|
37
|
-
const userAgent: AWSUserAgent = [
|
|
41
|
+
const userAgent: AWSUserAgent = [
|
|
42
|
+
[BASE_USER_AGENT, sanitizeAmplifyVersion(version)],
|
|
43
|
+
];
|
|
44
|
+
|
|
38
45
|
if (category) {
|
|
39
46
|
userAgent.push([category, action]);
|
|
40
47
|
}
|
package/src/Platform/types.ts
CHANGED
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '6.6.
|
|
2
|
+
export const version = '6.6.5-events.0619318.0+0619318';
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/* eslint-disable camelcase */
|
|
6
6
|
|
|
7
7
|
/* Does not like exhaustive checks */
|
|
8
|
-
/* eslint-disable no-case-declarations */
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
APIConfig,
|
|
11
|
+
APIEventsConfig,
|
|
12
12
|
APIGraphQLConfig,
|
|
13
13
|
GraphQLAuthMode,
|
|
14
14
|
ModelIntrospectionSchema,
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
AmplifyOutputs,
|
|
23
23
|
AmplifyOutputsAnalyticsProperties,
|
|
24
24
|
AmplifyOutputsAuthProperties,
|
|
25
|
+
AmplifyOutputsCustomProperties,
|
|
25
26
|
AmplifyOutputsDataProperties,
|
|
26
27
|
AmplifyOutputsGeoProperties,
|
|
27
28
|
AmplifyOutputsNotificationsProperties,
|
|
@@ -223,6 +224,28 @@ function parseData(
|
|
|
223
224
|
};
|
|
224
225
|
}
|
|
225
226
|
|
|
227
|
+
function parseCustom(
|
|
228
|
+
amplifyOutputsCustomProperties?: AmplifyOutputsCustomProperties,
|
|
229
|
+
) {
|
|
230
|
+
if (!amplifyOutputsCustomProperties?.events) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const { url, aws_region, api_key, default_authorization_type } =
|
|
235
|
+
amplifyOutputsCustomProperties.events;
|
|
236
|
+
|
|
237
|
+
const Events: APIEventsConfig = {
|
|
238
|
+
endpoint: url,
|
|
239
|
+
defaultAuthMode: getGraphQLAuthMode(default_authorization_type),
|
|
240
|
+
region: aws_region,
|
|
241
|
+
apiKey: api_key,
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
Events,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
226
249
|
function parseNotifications(
|
|
227
250
|
amplifyOutputsNotificationsProperties?: AmplifyOutputsNotificationsProperties,
|
|
228
251
|
): NotificationsConfig | undefined {
|
|
@@ -290,6 +313,14 @@ export function parseAmplifyOutputs(
|
|
|
290
313
|
resourcesConfig.API = parseData(amplifyOutputs.data);
|
|
291
314
|
}
|
|
292
315
|
|
|
316
|
+
if (amplifyOutputs.custom) {
|
|
317
|
+
const customConfig = parseCustom(amplifyOutputs.custom);
|
|
318
|
+
|
|
319
|
+
if (customConfig && 'Events' in customConfig) {
|
|
320
|
+
resourcesConfig.API = { ...resourcesConfig.API, ...customConfig };
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
293
324
|
if (amplifyOutputs.notifications) {
|
|
294
325
|
resourcesConfig.Notifications = parseNotifications(
|
|
295
326
|
amplifyOutputs.notifications,
|
|
@@ -47,6 +47,37 @@ export interface APIGraphQLConfig {
|
|
|
47
47
|
modelIntrospection?: ModelIntrospectionSchema;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @experimental
|
|
52
|
+
*/
|
|
53
|
+
export interface APIEventsConfig {
|
|
54
|
+
/**
|
|
55
|
+
* Required GraphQL endpoint, must be a valid URL string.
|
|
56
|
+
*/
|
|
57
|
+
endpoint: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional region string used to sign the request. Required only if the auth mode is 'iam'.
|
|
60
|
+
*/
|
|
61
|
+
region?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional API key string. Required only if the auth mode is 'apiKey'.
|
|
64
|
+
*/
|
|
65
|
+
apiKey?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Custom domain endpoint for GraphQL API.
|
|
68
|
+
*/
|
|
69
|
+
customEndpoint?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional region string used to sign the request to `customEndpoint`. Effective only if `customEndpoint` is
|
|
72
|
+
* specified, and the auth mode is 'iam'.
|
|
73
|
+
*/
|
|
74
|
+
customEndpointRegion?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Default auth mode for all the API calls to given service.
|
|
77
|
+
*/
|
|
78
|
+
defaultAuthMode: GraphQLAuthMode;
|
|
79
|
+
}
|
|
80
|
+
|
|
50
81
|
export interface APIRestConfig {
|
|
51
82
|
/**
|
|
52
83
|
* Required REST endpoint, must be a valid URL string.
|
|
@@ -75,7 +106,13 @@ export interface GraphQLProviderConfig {
|
|
|
75
106
|
GraphQL: APIGraphQLConfig;
|
|
76
107
|
}
|
|
77
108
|
|
|
78
|
-
export
|
|
109
|
+
export interface EventsProviderConfig {
|
|
110
|
+
Events: APIEventsConfig;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type APIConfig = AtLeastOne<
|
|
114
|
+
RESTProviderConfig & GraphQLProviderConfig & EventsProviderConfig
|
|
115
|
+
>;
|
|
79
116
|
|
|
80
117
|
export type GraphQLAuthMode =
|
|
81
118
|
| 'apiKey'
|
|
@@ -94,6 +94,17 @@ export interface AmplifyOutputsDataProperties {
|
|
|
94
94
|
conflict_resolution_mode?: string;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
export interface AmplifyOutputsCustomProperties {
|
|
98
|
+
// @experimental
|
|
99
|
+
events?: {
|
|
100
|
+
url: string;
|
|
101
|
+
aws_region: string;
|
|
102
|
+
default_authorization_type: string;
|
|
103
|
+
api_key?: string;
|
|
104
|
+
};
|
|
105
|
+
[key: string]: any;
|
|
106
|
+
}
|
|
107
|
+
|
|
97
108
|
export interface AmplifyOutputsNotificationsProperties {
|
|
98
109
|
aws_region: string;
|
|
99
110
|
amazon_pinpoint_app_id: string;
|
|
@@ -107,5 +118,6 @@ export interface AmplifyOutputs {
|
|
|
107
118
|
analytics?: AmplifyOutputsAnalyticsProperties;
|
|
108
119
|
geo?: AmplifyOutputsGeoProperties;
|
|
109
120
|
data?: AmplifyOutputsDataProperties;
|
|
121
|
+
custom?: AmplifyOutputsCustomProperties;
|
|
110
122
|
notifications?: AmplifyOutputsNotificationsProperties;
|
|
111
123
|
}
|