@aws-amplify/core 6.0.1-console-preview.b5a42af.0 → 6.0.1-console-preview.9607e4a.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"
@@ -42,7 +42,7 @@ var Category;
42
42
  var AnalyticsAction;
43
43
  (function (AnalyticsAction) {
44
44
  AnalyticsAction["Record"] = "1";
45
- AnalyticsAction["UpdateEndpoint"] = "2";
45
+ AnalyticsAction["IdentifyUser"] = "2";
46
46
  })(AnalyticsAction = exports.AnalyticsAction || (exports.AnalyticsAction = {}));
47
47
  var ApiAction;
48
48
  (function (ApiAction) {
@@ -102,7 +102,8 @@ var GeoAction;
102
102
  })(GeoAction = exports.GeoAction || (exports.GeoAction = {}));
103
103
  var InAppMessagingAction;
104
104
  (function (InAppMessagingAction) {
105
- InAppMessagingAction["None"] = "0";
105
+ InAppMessagingAction["SyncMessages"] = "1";
106
+ InAppMessagingAction["IdentifyUser"] = "2";
106
107
  })(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));
107
108
  var InteractionsAction;
108
109
  (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.9607e4a.0+9607e4a";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // generated by genversion
5
- exports.version = '6.0.1-console-preview.b5a42af.0+b5a42af';
5
+ exports.version = '6.0.1-console-preview.9607e4a.0+9607e4a';
@@ -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';
@@ -3,7 +3,7 @@
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.base64Encoder = exports.base64Decoder = exports.AMPLIFY_SYMBOL = exports.fetchAuthSession = exports.USER_AGENT_HEADER = exports.INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER = exports.AmplifyErrorCode = exports.createAssertionFunction = exports.PlatformNotSupportedError = exports.AmplifyError = exports.Reachability = exports.Mutex = exports.BackgroundProcessManager = exports.ServiceWorker = exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InAppMessagingAction = exports.InteractionsAction = exports.GeoAction = exports.Framework = exports.DataStoreAction = exports.Category = exports.AnalyticsAction = exports.AuthAction = exports.ApiAction = exports.getAmplifyUserAgent = exports.getAmplifyUserAgentObject = exports.Platform = exports.ClientDevice = exports.Logger = exports.ConsoleLogger = exports.Signer = exports.isTokenExpired = exports.assertOAuthConfig = exports.assertIdentityPoolIdConfig = exports.assertTokenProviderConfig = exports.decodeJWT = exports.parseAWSExports = exports.urlSafeEncode = exports.urlSafeDecode = exports.retry = exports.NonRetryableError = exports.jitteredExponentialRetry = exports.jitteredBackoff = exports.isWebWorker = exports.isNonRetryableError = exports.isBrowser = exports.generateRandomString = void 0;
6
- exports.getCrypto = void 0;
6
+ exports.HubClass = exports.getCrypto = void 0;
7
7
  /*
8
8
  This file maps top-level exports from `@aws-amplify/core/internals/utils`. These are intended to be internal
9
9
  utils for use throughout the library.
@@ -85,3 +85,6 @@ Object.defineProperty(exports, "base64Decoder", { enumerable: true, get: functio
85
85
  Object.defineProperty(exports, "base64Encoder", { enumerable: true, get: function () { return convert_1.base64Encoder; } });
86
86
  var globalHelpers_1 = require("./utils/globalHelpers");
87
87
  Object.defineProperty(exports, "getCrypto", { enumerable: true, get: function () { return globalHelpers_1.getCrypto; } });
88
+ // Hub
89
+ var Hub_2 = require("./Hub");
90
+ Object.defineProperty(exports, "HubClass", { enumerable: true, get: function () { return Hub_2.HubClass; } });
@@ -0,0 +1 @@
1
+ export * from './kinesis';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./kinesis"), exports);
@@ -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,4 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { KinesisFirehoseProviderConfig } from './kinesis-firehose';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,4 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { PersonalizeProviderConfig } from './personalize';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,4 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,21 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.flushEvents = void 0;
6
+ var getEventBuffer_1 = require("../utils/getEventBuffer");
7
+ var constants_1 = require("../utils/constants");
8
+ var flushEvents = function (appId, region, credentials, identityId, userAgentValue) {
9
+ (0, getEventBuffer_1.getEventBuffer)({
10
+ appId: appId,
11
+ bufferSize: constants_1.BUFFER_SIZE,
12
+ credentials: credentials,
13
+ flushInterval: constants_1.FLUSH_INTERVAL,
14
+ flushSize: constants_1.FLUSH_SIZE,
15
+ identityId: identityId,
16
+ region: region,
17
+ resendLimit: constants_1.RESEND_LIMIT,
18
+ userAgentValue: userAgentValue,
19
+ }).flushAll();
20
+ };
21
+ exports.flushEvents = flushEvents;
@@ -1,2 +1,3 @@
1
1
  export { updateEndpoint } from './updateEndpoint';
2
2
  export { record } from './record';
3
+ export { flushEvents } from './flushEvents';
@@ -2,8 +2,10 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.record = exports.updateEndpoint = void 0;
5
+ exports.flushEvents = exports.record = exports.updateEndpoint = void 0;
6
6
  var updateEndpoint_1 = require("./updateEndpoint");
7
7
  Object.defineProperty(exports, "updateEndpoint", { enumerable: true, get: function () { return updateEndpoint_1.updateEndpoint; } });
8
8
  var record_1 = require("./record");
9
9
  Object.defineProperty(exports, "record", { enumerable: true, get: function () { return record_1.record; } });
10
+ var flushEvents_1 = require("./flushEvents");
11
+ Object.defineProperty(exports, "flushEvents", { enumerable: true, get: function () { return flushEvents_1.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;
@@ -113,6 +113,9 @@ var PinpointEventBuffer = /** @class */ (function () {
113
113
  PinpointEventBuffer.prototype.identityHasChanged = function (identityId) {
114
114
  return this._config.identityId !== identityId;
115
115
  };
116
+ PinpointEventBuffer.prototype.flushAll = function () {
117
+ this._putEvents(this._buffer.splice(0, this._buffer.length));
118
+ };
116
119
  PinpointEventBuffer.prototype._startLoop = function () {
117
120
  if (this._interval) {
118
121
  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;