@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
package/lib/Platform/types.d.ts
CHANGED
package/lib/Platform/types.js
CHANGED
|
@@ -101,7 +101,7 @@ var InAppMessagingAction;
|
|
|
101
101
|
(function (InAppMessagingAction) {
|
|
102
102
|
InAppMessagingAction["SyncMessages"] = "1";
|
|
103
103
|
InAppMessagingAction["IdentifyUser"] = "2";
|
|
104
|
-
InAppMessagingAction["
|
|
104
|
+
InAppMessagingAction["NotifyMessageInteraction"] = "3";
|
|
105
105
|
})(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));
|
|
106
106
|
var InteractionsAction;
|
|
107
107
|
(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";
|
package/lib/Platform/version.js
CHANGED
package/lib/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';
|
package/lib/parseAWSExports.js
CHANGED
|
@@ -58,9 +58,9 @@ var authTypeMapping = {
|
|
|
58
58
|
* @returns A {@link ResourcesConfig} object.
|
|
59
59
|
*/
|
|
60
60
|
var parseAWSExports = function (config) {
|
|
61
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
62
62
|
if (config === void 0) { config = {}; }
|
|
63
|
-
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;
|
|
63
|
+
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;
|
|
64
64
|
var amplifyConfig = {};
|
|
65
65
|
// Analytics
|
|
66
66
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -72,11 +72,11 @@ var parseAWSExports = function (config) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
// Notifications
|
|
75
|
-
var
|
|
75
|
+
var _r = Notifications !== null && Notifications !== void 0 ? Notifications : {}, InAppMessaging = _r.InAppMessaging, Push = _r.Push;
|
|
76
76
|
if ((InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) || (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint)) {
|
|
77
77
|
amplifyConfig.Notifications = {};
|
|
78
78
|
if (InAppMessaging === null || InAppMessaging === void 0 ? void 0 : InAppMessaging.AWSPinpoint) {
|
|
79
|
-
var
|
|
79
|
+
var _s = InAppMessaging.AWSPinpoint, appId = _s.appId, region = _s.region;
|
|
80
80
|
amplifyConfig.Notifications.InAppMessaging = {
|
|
81
81
|
Pinpoint: {
|
|
82
82
|
appId: appId,
|
|
@@ -85,7 +85,7 @@ var parseAWSExports = function (config) {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
if (Push === null || Push === void 0 ? void 0 : Push.AWSPinpoint) {
|
|
88
|
-
var
|
|
88
|
+
var _t = Push.AWSPinpoint, appId = _t.appId, region = _t.region;
|
|
89
89
|
amplifyConfig.Notifications.PushNotification = {
|
|
90
90
|
Pinpoint: {
|
|
91
91
|
appId: appId,
|
|
@@ -158,16 +158,18 @@ var parseAWSExports = function (config) {
|
|
|
158
158
|
loginWith: {
|
|
159
159
|
username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true,
|
|
160
160
|
email: loginWithEmailEnabled,
|
|
161
|
-
phone: loginWithPhoneEnabled
|
|
161
|
+
phone: loginWithPhoneEnabled,
|
|
162
162
|
},
|
|
163
163
|
},
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
var hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
|
|
167
|
-
var hasSocialProviderConfig = aws_cognito_social_providers
|
|
167
|
+
var hasSocialProviderConfig = aws_cognito_social_providers
|
|
168
|
+
? aws_cognito_social_providers.length > 0
|
|
169
|
+
: false;
|
|
168
170
|
if (amplifyConfig.Auth && hasOAuthConfig) {
|
|
169
|
-
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({},
|
|
170
|
-
providers: parseSocialProviders(aws_cognito_social_providers)
|
|
171
|
+
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({}, getOAuthConfig(oauth)), (hasSocialProviderConfig && {
|
|
172
|
+
providers: parseSocialProviders(aws_cognito_social_providers),
|
|
171
173
|
})) });
|
|
172
174
|
}
|
|
173
175
|
// Storage
|
|
@@ -197,6 +199,13 @@ var parseAWSExports = function (config) {
|
|
|
197
199
|
return __assign(__assign({}, acc), (_a = {}, _a[name] = __assign(__assign({ endpoint: endpoint }, (service ? { service: service } : undefined)), (region ? { region: region } : undefined)), _a));
|
|
198
200
|
}, {}) });
|
|
199
201
|
}
|
|
202
|
+
// Predictions
|
|
203
|
+
if (predictions) {
|
|
204
|
+
// map VoiceId from speechGenerator defaults to voiceId
|
|
205
|
+
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;
|
|
206
|
+
amplifyConfig.Predictions = voiceId
|
|
207
|
+
? __assign(__assign({}, predictions), { convert: __assign(__assign({}, predictions.convert), { speechGenerator: __assign(__assign({}, predictions.convert.speechGenerator), { defaults: { voiceId: voiceId } }) }) }) : predictions;
|
|
208
|
+
}
|
|
200
209
|
return amplifyConfig;
|
|
201
210
|
};
|
|
202
211
|
exports.parseAWSExports = parseAWSExports;
|
|
@@ -210,7 +219,7 @@ var getOAuthConfig = function (_a) {
|
|
|
210
219
|
scopes: scope,
|
|
211
220
|
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
212
221
|
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
213
|
-
responseType: responseType
|
|
222
|
+
responseType: responseType,
|
|
214
223
|
});
|
|
215
224
|
};
|
|
216
225
|
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 {};
|
package/lib/singleton/types.d.ts
CHANGED
|
@@ -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, };
|