@aws-amplify/core 6.0.1-console-preview.be08038.0 → 6.0.1-console-preview.d745d43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Platform/types.d.ts +1 -1
- package/lib/Platform/types.js +1 -1
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/parseAWSExports.js +19 -10
- package/lib/singleton/Predictions/types.d.ts +49 -0
- package/lib/singleton/Predictions/types.js +4 -0
- package/lib/singleton/types.d.ts +3 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Platform/types.d.ts +1 -1
- package/lib-esm/Platform/types.js +1 -1
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/parseAWSExports.js +19 -10
- package/lib-esm/singleton/Predictions/types.d.ts +49 -0
- package/lib-esm/singleton/Predictions/types.js +3 -0
- package/lib-esm/singleton/types.d.ts +3 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Platform/types.ts +1 -1
- package/src/Platform/version.ts +1 -1
- package/src/index.ts +1 -0
- package/src/parseAWSExports.ts +33 -7
- package/src/singleton/Predictions/types.ts +61 -0
- package/src/singleton/types.ts +3 -1
|
@@ -98,7 +98,7 @@ export var InAppMessagingAction;
|
|
|
98
98
|
(function (InAppMessagingAction) {
|
|
99
99
|
InAppMessagingAction["SyncMessages"] = "1";
|
|
100
100
|
InAppMessagingAction["IdentifyUser"] = "2";
|
|
101
|
-
InAppMessagingAction["
|
|
101
|
+
InAppMessagingAction["NotifyMessageInteraction"] = "3";
|
|
102
102
|
})(InAppMessagingAction || (InAppMessagingAction = {}));
|
|
103
103
|
export var InteractionsAction;
|
|
104
104
|
(function (InteractionsAction) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.d745d43.0+d745d43";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-console-preview.
|
|
2
|
+
export var version = '6.0.1-console-preview.d745d43.0+d745d43';
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Hub } from './Hub';
|
|
2
2
|
export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
|
|
3
3
|
export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, CognitoUserPoolConfig, } from './singleton/Auth/types';
|
|
4
|
-
export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, APIConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, GeoConfig, } from './singleton/types';
|
|
4
|
+
export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, APIConfig, PredictionsConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, GeoConfig, } from './singleton/types';
|
|
5
5
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
6
6
|
export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './awsClients/cognitoIdentity';
|
|
7
7
|
export { UserProfile } from './types';
|
|
@@ -55,9 +55,9 @@ var authTypeMapping = {
|
|
|
55
55
|
* @returns A {@link ResourcesConfig} object.
|
|
56
56
|
*/
|
|
57
57
|
export var parseAWSExports = function (config) {
|
|
58
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
59
59
|
if (config === void 0) { config = {}; }
|
|
60
|
-
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_bots = config.aws_bots, aws_bots_config = config.aws_bots_config, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_social_providers = config.aws_cognito_social_providers, aws_cognito_username_attributes = config.aws_cognito_username_attributes, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
60
|
+
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_bots = config.aws_bots, aws_bots_config = config.aws_bots_config, aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_social_providers = config.aws_cognito_social_providers, aws_cognito_username_attributes = config.aws_cognito_username_attributes, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth, predictions = config.predictions, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
61
61
|
var amplifyConfig = {};
|
|
62
62
|
// Analytics
|
|
63
63
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -69,11 +69,11 @@ export var parseAWSExports = function (config) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
// Notifications
|
|
72
|
-
var
|
|
72
|
+
var _r = Notifications !== null && Notifications !== void 0 ? Notifications : {}, InAppMessaging = _r.InAppMessaging, Push = _r.Push;
|
|
73
73
|
if ((InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) || (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint)) {
|
|
74
74
|
amplifyConfig.Notifications = {};
|
|
75
75
|
if (InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) {
|
|
76
|
-
var
|
|
76
|
+
var _s = InAppMessaging.AWSPinpoint, appId = _s.appId, region = _s.region;
|
|
77
77
|
amplifyConfig.Notifications.InAppMessaging = {
|
|
78
78
|
Pinpoint: {
|
|
79
79
|
appId: appId,
|
|
@@ -82,7 +82,7 @@ export var parseAWSExports = function (config) {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
if (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint) {
|
|
85
|
-
var
|
|
85
|
+
var _t = Push.AWSPinpoint, appId = _t.appId, region = _t.region;
|
|
86
86
|
amplifyConfig.Notifications.PushNotification = {
|
|
87
87
|
Pinpoint: {
|
|
88
88
|
appId: appId,
|
|
@@ -155,16 +155,18 @@ export var parseAWSExports = function (config) {
|
|
|
155
155
|
loginWith: {
|
|
156
156
|
username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true,
|
|
157
157
|
email: loginWithEmailEnabled,
|
|
158
|
-
phone: loginWithPhoneEnabled
|
|
158
|
+
phone: loginWithPhoneEnabled,
|
|
159
159
|
},
|
|
160
160
|
},
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
var hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
|
|
164
|
-
var hasSocialProviderConfig = aws_cognito_social_providers
|
|
164
|
+
var hasSocialProviderConfig = aws_cognito_social_providers
|
|
165
|
+
? aws_cognito_social_providers.length > 0
|
|
166
|
+
: false;
|
|
165
167
|
if (amplifyConfig.Auth && hasOAuthConfig) {
|
|
166
|
-
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({},
|
|
167
|
-
providers: parseSocialProviders(aws_cognito_social_providers)
|
|
168
|
+
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({}, getOAuthConfig(oauth)), (hasSocialProviderConfig && {
|
|
169
|
+
providers: parseSocialProviders(aws_cognito_social_providers),
|
|
168
170
|
})) });
|
|
169
171
|
}
|
|
170
172
|
// Storage
|
|
@@ -194,6 +196,13 @@ export var parseAWSExports = function (config) {
|
|
|
194
196
|
return __assign(__assign({}, acc), (_a = {}, _a[name] = __assign(__assign({ endpoint: endpoint }, (service ? { service: service } : undefined)), (region ? { region: region } : undefined)), _a));
|
|
195
197
|
}, {}) });
|
|
196
198
|
}
|
|
199
|
+
// Predictions
|
|
200
|
+
if (predictions) {
|
|
201
|
+
// map VoiceId from speechGenerator defaults to voiceId
|
|
202
|
+
var voiceId = ((_q = (_p = (_o = predictions === null || predictions === void 0 ? void 0 : predictions.convert) === null || _o === void 0 ? void 0 : _o.speechGenerator) === null || _p === void 0 ? void 0 : _p.defaults) !== null && _q !== void 0 ? _q : {}).VoiceId;
|
|
203
|
+
amplifyConfig.Predictions = voiceId
|
|
204
|
+
? __assign(__assign({}, predictions), { convert: __assign(__assign({}, predictions.convert), { speechGenerator: __assign(__assign({}, predictions.convert.speechGenerator), { defaults: { voiceId: voiceId } }) }) }) : predictions;
|
|
205
|
+
}
|
|
197
206
|
return amplifyConfig;
|
|
198
207
|
};
|
|
199
208
|
var getRedirectUrl = function (redirectStr) {
|
|
@@ -206,7 +215,7 @@ var getOAuthConfig = function (_a) {
|
|
|
206
215
|
scopes: scope,
|
|
207
216
|
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
208
217
|
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
209
|
-
responseType: responseType
|
|
218
|
+
responseType: responseType,
|
|
210
219
|
});
|
|
211
220
|
};
|
|
212
221
|
var parseSocialProviders = function (aws_cognito_social_providers) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type SpeechGeneratorDefaults = {
|
|
2
|
+
voiceId?: string;
|
|
3
|
+
};
|
|
4
|
+
type TranscriptionDefaults = {
|
|
5
|
+
language?: string;
|
|
6
|
+
};
|
|
7
|
+
type TranslateTextDefaults = {
|
|
8
|
+
sourceLanguage?: string;
|
|
9
|
+
targetLanguage?: string;
|
|
10
|
+
};
|
|
11
|
+
type IdentifyEntitiesDefaults = {
|
|
12
|
+
collectionId?: string;
|
|
13
|
+
maxEntities?: number;
|
|
14
|
+
};
|
|
15
|
+
type IdentityLabelsDefaults = {
|
|
16
|
+
type?: string;
|
|
17
|
+
};
|
|
18
|
+
type IdentifyTextDefaults = {
|
|
19
|
+
format?: string;
|
|
20
|
+
};
|
|
21
|
+
type InterpretTextDefaults = {
|
|
22
|
+
type?: string;
|
|
23
|
+
};
|
|
24
|
+
type ConvertConfig = {
|
|
25
|
+
speechGenerator?: PredictionsProviderConfig<SpeechGeneratorDefaults>;
|
|
26
|
+
transcription?: PredictionsProviderConfig<TranscriptionDefaults>;
|
|
27
|
+
translateText?: PredictionsProviderConfig<TranslateTextDefaults>;
|
|
28
|
+
};
|
|
29
|
+
type IdentifyConfig = {
|
|
30
|
+
identifyEntities?: PredictionsProviderConfig<IdentifyEntitiesDefaults> & {
|
|
31
|
+
celebrityDetectionEnabled?: boolean;
|
|
32
|
+
};
|
|
33
|
+
identifyLabels?: PredictionsProviderConfig<IdentityLabelsDefaults>;
|
|
34
|
+
identifyText?: PredictionsProviderConfig<IdentifyTextDefaults>;
|
|
35
|
+
};
|
|
36
|
+
type InterpretConfig = {
|
|
37
|
+
interpretText?: PredictionsProviderConfig<InterpretTextDefaults>;
|
|
38
|
+
};
|
|
39
|
+
export type PredictionsProviderConfig<T> = {
|
|
40
|
+
region?: string;
|
|
41
|
+
proxy?: boolean;
|
|
42
|
+
defaults?: T;
|
|
43
|
+
};
|
|
44
|
+
export type PredictionsConfig = {
|
|
45
|
+
convert?: ConvertConfig;
|
|
46
|
+
identify?: IdentifyConfig;
|
|
47
|
+
interpret?: InterpretConfig;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { APIConfig, LibraryAPIOptions } from './API/types';
|
|
|
2
2
|
import { AnalyticsConfig } from './Analytics/types';
|
|
3
3
|
import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
|
|
4
4
|
import { GeoConfig } from './Geo/types';
|
|
5
|
+
import { PredictionsConfig } from './Predictions/types';
|
|
5
6
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
6
7
|
import { NotificationsConfig } from './Notifications/types';
|
|
7
8
|
import { InteractionsConfig } from './Interactions/types';
|
|
@@ -17,6 +18,7 @@ export type ResourcesConfig = {
|
|
|
17
18
|
Auth?: AuthConfig;
|
|
18
19
|
Interactions?: InteractionsConfig;
|
|
19
20
|
Notifications?: NotificationsConfig;
|
|
21
|
+
Predictions?: PredictionsConfig;
|
|
20
22
|
Storage?: StorageConfig;
|
|
21
23
|
Geo?: GeoConfig;
|
|
22
24
|
};
|
|
@@ -26,4 +28,4 @@ export type LibraryOptions = {
|
|
|
26
28
|
Storage?: LibraryStorageOptions;
|
|
27
29
|
ssr?: boolean;
|
|
28
30
|
};
|
|
29
|
-
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, InteractionsConfig, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
|
|
31
|
+
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, InteractionsConfig, PredictionsConfig, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, GeoConfig, };
|