@aws-amplify/core 6.0.1-preview-testing.64b45b1.0 → 6.0.1-preview-testing.034e780.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.
Files changed (43) hide show
  1. package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  2. package/lib/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  3. package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  4. package/lib/Platform/version.d.ts +1 -1
  5. package/lib/Platform/version.js +1 -1
  6. package/lib/clients/types/aws.d.ts +1 -1
  7. package/lib/index.d.ts +0 -1
  8. package/lib/index.js +1 -3
  9. package/lib/libraryUtils.d.ts +2 -0
  10. package/lib/libraryUtils.js +4 -2
  11. package/lib/singleton/Amplify.d.ts +2 -2
  12. package/lib/singleton/Amplify.js +9 -1
  13. package/lib/singleton/Auth/index.d.ts +2 -1
  14. package/lib/singleton/Auth/index.js +22 -12
  15. package/lib/singleton/Auth/utils/index.js +3 -3
  16. package/lib/singleton/types.d.ts +6 -0
  17. package/lib/tsconfig.tsbuildinfo +1 -1
  18. package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
  19. package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
  20. package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
  21. package/lib-esm/Platform/version.d.ts +1 -1
  22. package/lib-esm/Platform/version.js +1 -1
  23. package/lib-esm/clients/types/aws.d.ts +1 -1
  24. package/lib-esm/index.d.ts +0 -1
  25. package/lib-esm/index.js +0 -1
  26. package/lib-esm/libraryUtils.d.ts +2 -0
  27. package/lib-esm/libraryUtils.js +1 -0
  28. package/lib-esm/singleton/Amplify.d.ts +2 -2
  29. package/lib-esm/singleton/Amplify.js +9 -1
  30. package/lib-esm/singleton/Auth/index.d.ts +2 -1
  31. package/lib-esm/singleton/Auth/index.js +22 -12
  32. package/lib-esm/singleton/Auth/utils/index.js +3 -3
  33. package/lib-esm/singleton/types.d.ts +6 -0
  34. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +2 -2
  36. package/src/Platform/version.ts +1 -1
  37. package/src/clients/types/aws.ts +4 -1
  38. package/src/index.ts +0 -2
  39. package/src/libraryUtils.ts +2 -1
  40. package/src/singleton/Amplify.ts +12 -3
  41. package/src/singleton/Auth/index.ts +9 -2
  42. package/src/singleton/Auth/utils/index.ts +3 -3
  43. package/src/singleton/types.ts +7 -0
@@ -52,8 +52,7 @@ export class AuthClass {
52
52
  let userSub: string | undefined;
53
53
 
54
54
  // Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
55
- tokens =
56
- (await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined;
55
+ tokens = await this.getTokens(options);
57
56
 
58
57
  if (tokens) {
59
58
  userSub = tokens.accessToken?.payload?.sub;
@@ -93,4 +92,12 @@ export class AuthClass {
93
92
  return await this.authOptions.credentialsProvider.clearCredentialsAndIdentityId();
94
93
  }
95
94
  }
95
+
96
+ async getTokens(
97
+ options: FetchAuthSessionOptions
98
+ ): Promise<AuthTokens | undefined> {
99
+ return (
100
+ (await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined
101
+ );
102
+ }
96
103
  }
@@ -63,10 +63,10 @@ export function assertIdentityPooIdConfig(
63
63
  ): asserts cognitoConfig is CognitoIdentityPoolConfig {
64
64
  const validConfig = !!cognitoConfig?.identityPoolId;
65
65
  return asserts(validConfig, {
66
- name: 'AuthIdentityPoolIdException',
67
- message: 'Auth IdentityPoolId not configured',
66
+ name: 'InvalidIdentityPoolIdException',
67
+ message: 'Invalid identity pool id provided.',
68
68
  recoverySuggestion:
69
- 'Make sure to call Amplify.configure in your app with a valid IdentityPoolId',
69
+ 'Make sure a valid identityPoolId is given in the config.',
70
70
  });
71
71
  }
72
72
 
@@ -17,6 +17,13 @@ import {
17
17
  StorageConfig,
18
18
  } from './Storage/types';
19
19
 
20
+ export type LegacyConfig = {
21
+ /**
22
+ * @deprecated The field should not be used.
23
+ */
24
+ aws_project_region?: string;
25
+ };
26
+
20
27
  export type ResourcesConfig = {
21
28
  // API?: {};
22
29
  Analytics?: AnalyticsConfig;