@aws-amplify/core 6.0.1-console-preview.b5a42af.0 → 6.0.1-console-preview.4ae78ed.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 (74) hide show
  1. package/lib/Platform/types.d.ts +3 -2
  2. package/lib/Platform/types.js +3 -2
  3. package/lib/Platform/version.d.ts +1 -1
  4. package/lib/Platform/version.js +1 -1
  5. package/lib/clients/types/http.d.ts +1 -1
  6. package/lib/libraryUtils.d.ts +1 -0
  7. package/lib/libraryUtils.js +4 -1
  8. package/lib/providers/kinesis/types/index.d.ts +1 -0
  9. package/lib/providers/kinesis/types/index.js +19 -0
  10. package/lib/providers/kinesis/types/kinesis.d.ts +9 -0
  11. package/lib/providers/kinesis/types/kinesis.js +4 -0
  12. package/lib/providers/kinesis-firehose/types/index.d.ts +1 -0
  13. package/lib/providers/kinesis-firehose/types/index.js +4 -0
  14. package/lib/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  15. package/lib/providers/kinesis-firehose/types/kinesis-firehose.js +4 -0
  16. package/lib/providers/personalize/types/index.d.ts +1 -0
  17. package/lib/providers/personalize/types/index.js +4 -0
  18. package/lib/providers/personalize/types/personalize.d.ts +8 -0
  19. package/lib/providers/personalize/types/personalize.js +4 -0
  20. package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  21. package/lib/providers/pinpoint/apis/flushEvents.js +21 -0
  22. package/lib/providers/pinpoint/apis/index.d.ts +1 -0
  23. package/lib/providers/pinpoint/apis/index.js +3 -1
  24. package/lib/providers/pinpoint/types/pinpoint.d.ts +1 -1
  25. package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
  26. package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +3 -0
  27. package/lib/singleton/Analytics/types.d.ts +4 -1
  28. package/lib/tsconfig.tsbuildinfo +1 -1
  29. package/lib-esm/Platform/types.d.ts +3 -2
  30. package/lib-esm/Platform/types.js +3 -2
  31. package/lib-esm/Platform/version.d.ts +1 -1
  32. package/lib-esm/Platform/version.js +1 -1
  33. package/lib-esm/clients/types/http.d.ts +1 -1
  34. package/lib-esm/libraryUtils.d.ts +1 -0
  35. package/lib-esm/libraryUtils.js +2 -0
  36. package/lib-esm/providers/kinesis/types/index.d.ts +1 -0
  37. package/lib-esm/providers/kinesis/types/index.js +3 -0
  38. package/lib-esm/providers/kinesis/types/kinesis.d.ts +9 -0
  39. package/lib-esm/providers/kinesis/types/kinesis.js +3 -0
  40. package/lib-esm/providers/kinesis-firehose/types/index.d.ts +1 -0
  41. package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
  42. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
  43. package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.js +3 -0
  44. package/lib-esm/providers/personalize/types/index.d.ts +1 -0
  45. package/lib-esm/providers/personalize/types/index.js +3 -0
  46. package/lib-esm/providers/personalize/types/personalize.d.ts +8 -0
  47. package/lib-esm/providers/personalize/types/personalize.js +3 -0
  48. package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
  49. package/lib-esm/providers/pinpoint/apis/flushEvents.js +17 -0
  50. package/lib-esm/providers/pinpoint/apis/index.d.ts +1 -0
  51. package/lib-esm/providers/pinpoint/apis/index.js +1 -0
  52. package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +1 -1
  53. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
  54. package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +3 -0
  55. package/lib-esm/singleton/Analytics/types.d.ts +4 -1
  56. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  57. package/package.json +4 -4
  58. package/src/Hub/index.ts +1 -0
  59. package/src/Platform/types.ts +3 -2
  60. package/src/Platform/version.ts +1 -1
  61. package/src/Signer/DateUtils.ts +1 -1
  62. package/src/clients/types/http.ts +1 -1
  63. package/src/libraryUtils.ts +3 -0
  64. package/src/providers/kinesis/types/index.ts +4 -0
  65. package/src/providers/kinesis/types/kinesis.ts +12 -0
  66. package/src/providers/kinesis-firehose/types/index.ts +4 -0
  67. package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +12 -0
  68. package/src/providers/personalize/types/index.ts +4 -0
  69. package/src/providers/personalize/types/personalize.ts +11 -0
  70. package/src/providers/pinpoint/apis/flushEvents.ts +31 -0
  71. package/src/providers/pinpoint/apis/index.ts +1 -0
  72. package/src/providers/pinpoint/types/pinpoint.ts +1 -1
  73. package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +4 -0
  74. package/src/singleton/Analytics/types.ts +7 -1
@@ -31,7 +31,7 @@ export declare enum Category {
31
31
  }
32
32
  export declare enum AnalyticsAction {
33
33
  Record = "1",
34
- UpdateEndpoint = "2"
34
+ IdentifyUser = "2"
35
35
  }
36
36
  export declare enum ApiAction {
37
37
  GraphQl = "1",
@@ -53,7 +53,8 @@ export declare enum GeoAction {
53
53
  None = "0"
54
54
  }
55
55
  export declare enum InAppMessagingAction {
56
- None = "0"
56
+ SyncMessages = "1",
57
+ IdentifyUser = "2"
57
58
  }
58
59
  export declare enum InteractionsAction {
59
60
  None = "0"
@@ -39,7 +39,7 @@ export var Category;
39
39
  export var AnalyticsAction;
40
40
  (function (AnalyticsAction) {
41
41
  AnalyticsAction["Record"] = "1";
42
- AnalyticsAction["UpdateEndpoint"] = "2";
42
+ AnalyticsAction["IdentifyUser"] = "2";
43
43
  })(AnalyticsAction || (AnalyticsAction = {}));
44
44
  export var ApiAction;
45
45
  (function (ApiAction) {
@@ -99,7 +99,8 @@ export var GeoAction;
99
99
  })(GeoAction || (GeoAction = {}));
100
100
  export var InAppMessagingAction;
101
101
  (function (InAppMessagingAction) {
102
- InAppMessagingAction["None"] = "0";
102
+ InAppMessagingAction["SyncMessages"] = "1";
103
+ InAppMessagingAction["IdentifyUser"] = "2";
103
104
  })(InAppMessagingAction || (InAppMessagingAction = {}));
104
105
  export var InteractionsAction;
105
106
  (function (InteractionsAction) {
@@ -1 +1 @@
1
- export declare const version = "6.0.1-console-preview.b5a42af.0+b5a42af";
1
+ export declare const version = "6.0.1-console-preview.4ae78ed.0+4ae78ed";
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export var version = '6.0.1-console-preview.b5a42af.0+b5a42af';
2
+ export var version = '6.0.1-console-preview.4ae78ed.0+4ae78ed';
@@ -17,7 +17,7 @@ export interface HttpRequest extends Request {
17
17
  */
18
18
  export type ResponseBodyMixin = Pick<Body, 'blob' | 'json' | 'text'>;
19
19
  export interface HttpResponse extends Response {
20
- body: (ResponseBodyMixin & ReadableStream) | ResponseBodyMixin | null;
20
+ body: (ResponseBodyMixin & ReadableStream) | ResponseBodyMixin;
21
21
  statusCode: number;
22
22
  /**
23
23
  * @see {@link HttpRequest.headers}
@@ -21,3 +21,4 @@ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
21
21
  export { AMPLIFY_SYMBOL } from './Hub';
22
22
  export { base64Decoder, base64Encoder } from './utils/convert';
23
23
  export { getCrypto } from './utils/globalHelpers';
24
+ export { HubClass } from './Hub';
@@ -30,3 +30,5 @@ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
30
30
  export { AMPLIFY_SYMBOL } from './Hub';
31
31
  export { base64Decoder, base64Encoder } from './utils/convert';
32
32
  export { getCrypto } from './utils/globalHelpers';
33
+ // Hub
34
+ export { HubClass } from './Hub';
@@ -0,0 +1 @@
1
+ export * from './kinesis';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export * from './kinesis';
@@ -0,0 +1,9 @@
1
+ export type KinesisProviderConfig = {
2
+ Kinesis?: {
3
+ region: string;
4
+ bufferSize?: number;
5
+ flushSize?: number;
6
+ flushInterval?: number;
7
+ resendLimit?: number;
8
+ };
9
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1 @@
1
+ export { KinesisFirehoseProviderConfig } from './kinesis-firehose';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,9 @@
1
+ export type KinesisFirehoseProviderConfig = {
2
+ KinesisFirehose?: {
3
+ region: string;
4
+ bufferSize?: number;
5
+ flushSize?: number;
6
+ flushInterval?: number;
7
+ resendLimit?: number;
8
+ };
9
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1 @@
1
+ export { PersonalizeProviderConfig } from './personalize';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,8 @@
1
+ export type PersonalizeProviderConfig = {
2
+ Personalize?: {
3
+ trackingId: string;
4
+ region: string;
5
+ flushSize?: number;
6
+ flushInterval?: number;
7
+ };
8
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Credentials } from '@aws-sdk/types';
2
+ export declare const flushEvents: (appId: string, region: string, credentials: Credentials, identityId?: string, userAgentValue?: string) => void;
@@ -0,0 +1,17 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { getEventBuffer } from '../utils/getEventBuffer';
4
+ import { BUFFER_SIZE, FLUSH_INTERVAL, FLUSH_SIZE, RESEND_LIMIT, } from '../utils/constants';
5
+ export var flushEvents = function (appId, region, credentials, identityId, userAgentValue) {
6
+ getEventBuffer({
7
+ appId: appId,
8
+ bufferSize: BUFFER_SIZE,
9
+ credentials: credentials,
10
+ flushInterval: FLUSH_INTERVAL,
11
+ flushSize: FLUSH_SIZE,
12
+ identityId: identityId,
13
+ region: region,
14
+ resendLimit: RESEND_LIMIT,
15
+ userAgentValue: userAgentValue,
16
+ }).flushAll();
17
+ };
@@ -1,2 +1,3 @@
1
1
  export { updateEndpoint } from './updateEndpoint';
2
2
  export { record } from './record';
3
+ export { flushEvents } from './flushEvents';
@@ -2,3 +2,4 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { updateEndpoint } from './updateEndpoint';
4
4
  export { record } from './record';
5
+ export { flushEvents } from './flushEvents';
@@ -3,7 +3,7 @@ import { UserProfile } from '../../../types';
3
3
  export type SupportedCategory = 'Analytics' | 'InAppMessaging' | 'PushNotification';
4
4
  export type SupportedChannelType = 'APNS' | 'APNS_SANDBOX' | 'GCM' | 'IN_APP';
5
5
  export type PinpointProviderConfig = {
6
- Pinpoint: {
6
+ Pinpoint?: {
7
7
  appId: string;
8
8
  region: string;
9
9
  };
@@ -12,6 +12,7 @@ export declare class PinpointEventBuffer {
12
12
  resume(): void;
13
13
  flush(): void;
14
14
  identityHasChanged(identityId: AuthSession['identityId']): boolean;
15
+ flushAll(): void;
15
16
  private _startLoop;
16
17
  private _sendBatch;
17
18
  private _putEvents;
@@ -110,6 +110,9 @@ var PinpointEventBuffer = /** @class */ (function () {
110
110
  PinpointEventBuffer.prototype.identityHasChanged = function (identityId) {
111
111
  return this._config.identityId !== identityId;
112
112
  };
113
+ PinpointEventBuffer.prototype.flushAll = function () {
114
+ this._putEvents(this._buffer.splice(0, this._buffer.length));
115
+ };
113
116
  PinpointEventBuffer.prototype._startLoop = function () {
114
117
  if (this._interval) {
115
118
  clearInterval(this._interval);
@@ -1,2 +1,5 @@
1
1
  import { PinpointProviderConfig } from '../../providers/pinpoint/types';
2
- export type AnalyticsConfig = PinpointProviderConfig;
2
+ import { KinesisProviderConfig } from '../../providers/kinesis/types';
3
+ import { KinesisFirehoseProviderConfig } from '../../providers/kinesis-firehose/types';
4
+ import { PersonalizeProviderConfig } from '../../providers/personalize/types';
5
+ export type AnalyticsConfig = PinpointProviderConfig & KinesisProviderConfig & KinesisFirehoseProviderConfig & PersonalizeProviderConfig;