@aws-amplify/core 6.0.1-console-preview.814dea6.0 → 6.0.1-preview-testing.64b45b1.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/AwsClients/CognitoIdentity/base.d.ts +12 -4
- package/lib/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/RNComponents/index.js +2 -2
- package/lib/ServiceWorker/ServiceWorker.js +1 -1
- package/lib/Util/JS.d.ts +1 -4
- package/lib/Util/JS.js +4 -11
- package/lib/Util/Reachability.js +0 -3
- package/lib/clients/handlers/authenticated.d.ts +1 -1
- package/lib/clients/handlers/fetch.d.ts +0 -1
- package/lib/clients/handlers/fetch.js +2 -2
- package/lib/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib/clients/types/aws.d.ts +0 -4
- package/lib/clients/types/http.d.ts +8 -0
- package/lib/clients/types/index.d.ts +1 -1
- package/lib/libraryUtils.d.ts +1 -2
- package/lib/libraryUtils.js +3 -6
- package/lib/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib/providers/pinpoint/apis/record.js +3 -3
- package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib/singleton/Storage/types.d.ts +5 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +12 -4
- package/lib-esm/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/RNComponents/index.js +3 -3
- package/lib-esm/ServiceWorker/ServiceWorker.js +2 -2
- package/lib-esm/Util/JS.d.ts +1 -4
- package/lib-esm/Util/JS.js +2 -9
- package/lib-esm/Util/Reachability.js +1 -4
- package/lib-esm/clients/handlers/authenticated.d.ts +1 -1
- package/lib-esm/clients/handlers/fetch.d.ts +0 -1
- package/lib-esm/clients/handlers/fetch.js +2 -2
- package/lib-esm/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib-esm/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib-esm/clients/types/aws.d.ts +0 -4
- package/lib-esm/clients/types/http.d.ts +8 -0
- package/lib-esm/clients/types/index.d.ts +1 -1
- package/lib-esm/libraryUtils.d.ts +1 -2
- package/lib-esm/libraryUtils.js +1 -2
- package/lib-esm/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib-esm/providers/pinpoint/apis/record.js +3 -3
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib-esm/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib-esm/singleton/Storage/types.d.ts +5 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -4
- package/src/AwsClients/CognitoIdentity/base.ts +2 -2
- package/src/AwsClients/Pinpoint/base.ts +2 -6
- package/src/Platform/version.ts +1 -1
- package/src/RNComponents/index.ts +3 -3
- package/src/ServiceWorker/ServiceWorker.ts +2 -2
- package/src/Util/JS.ts +2 -13
- package/src/Util/Reachability.ts +1 -5
- package/src/clients/handlers/authenticated.ts +2 -1
- package/src/clients/handlers/fetch.ts +2 -2
- package/src/clients/handlers/unauthenticated.ts +2 -1
- package/src/clients/internal/composeServiceApi.ts +10 -3
- package/src/clients/types/aws.ts +0 -10
- package/src/clients/types/http.ts +8 -0
- package/src/clients/types/index.ts +0 -1
- package/src/libraryUtils.ts +1 -2
- package/src/providers/pinpoint/apis/record.ts +8 -8
- package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -2
- package/src/providers/pinpoint/types/buffer.ts +1 -1
- package/src/providers/pinpoint/types/pinpoint.ts +8 -7
- package/src/singleton/Storage/types.ts +6 -2
- package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib/OAuthHelper/FacebookOAuth.js +0 -124
- package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib/OAuthHelper/GoogleOAuth.js +0 -134
- package/lib/OAuthHelper/index.d.ts +0 -4
- package/lib/OAuthHelper/index.js +0 -9
- package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/FacebookOAuth.js +0 -121
- package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/GoogleOAuth.js +0 -131
- package/lib-esm/OAuthHelper/index.d.ts +0 -4
- package/lib-esm/OAuthHelper/index.js +0 -6
- package/src/OAuthHelper/FacebookOAuth.ts +0 -83
- package/src/OAuthHelper/GoogleOAuth.ts +0 -97
- package/src/OAuthHelper/index.ts +0 -7
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
3
|
+
import { isBrowser } from '../Util/JS';
|
|
4
4
|
import { StorageHelper } from '../StorageHelper';
|
|
5
5
|
export var Linking = {};
|
|
6
6
|
export var AppState = {
|
|
7
7
|
addEventListener: function (action, handler) { return undefined; },
|
|
8
|
-
currentState: 'active'
|
|
8
|
+
currentState: 'active',
|
|
9
9
|
};
|
|
10
10
|
// if not in react native, just use local storage
|
|
11
|
-
export var AsyncStorage =
|
|
11
|
+
export var AsyncStorage = isBrowser()
|
|
12
12
|
? new StorageHelper().getStorage()
|
|
13
13
|
: undefined;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
import { ConsoleLogger as Logger } from '../Logger';
|
|
16
|
-
import {
|
|
16
|
+
import { isBrowser } from '../Util/JS';
|
|
17
17
|
import { Amplify } from '../Amplify';
|
|
18
18
|
import { asserts } from '../Util/errors/AssertError';
|
|
19
19
|
import { AmplifyError } from '../Util/Errors';
|
|
@@ -124,7 +124,7 @@ var ServiceWorkerClass = /** @class */ (function () {
|
|
|
124
124
|
});
|
|
125
125
|
this._publicKey = publicKey;
|
|
126
126
|
return new Promise(function (resolve, reject) {
|
|
127
|
-
if (
|
|
127
|
+
if (isBrowser()) {
|
|
128
128
|
asserts(_this._registration !== undefined, {
|
|
129
129
|
name: SERVICE_WORKER_EXCEPTION,
|
|
130
130
|
message: 'Service Worker registration is undefined',
|
package/lib-esm/Util/JS.d.ts
CHANGED
|
@@ -6,10 +6,7 @@ export declare const isTextFile: (contentType: string) => boolean;
|
|
|
6
6
|
export declare const generateRandomString: () => string;
|
|
7
7
|
export declare const makeQuerablePromise: (promise: any) => any;
|
|
8
8
|
export declare const isWebWorker: () => boolean;
|
|
9
|
-
export declare const
|
|
10
|
-
isBrowser: boolean;
|
|
11
|
-
isNode: boolean;
|
|
12
|
-
};
|
|
9
|
+
export declare const isBrowser: () => boolean;
|
|
13
10
|
/**
|
|
14
11
|
* transfer the first letter of the keys to lowercase
|
|
15
12
|
* @param {Object} obj - the object need to be transferred
|
package/lib-esm/Util/JS.js
CHANGED
|
@@ -133,15 +133,8 @@ export var isWebWorker = function () {
|
|
|
133
133
|
return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&
|
|
134
134
|
self instanceof selfContext.WorkerGlobalScope);
|
|
135
135
|
};
|
|
136
|
-
export var
|
|
137
|
-
|
|
138
|
-
var isNode = typeof process !== 'undefined' &&
|
|
139
|
-
process.versions != null &&
|
|
140
|
-
process.versions.node != null;
|
|
141
|
-
return {
|
|
142
|
-
isBrowser: isBrowser,
|
|
143
|
-
isNode: isNode,
|
|
144
|
-
};
|
|
136
|
+
export var isBrowser = function () {
|
|
137
|
+
return typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
145
138
|
};
|
|
146
139
|
/**
|
|
147
140
|
* transfer the first letter of the keys to lowercase
|
|
@@ -12,14 +12,11 @@ var __values = (this && this.__values) || function(o) {
|
|
|
12
12
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
13
13
|
// SPDX-License-Identifier: Apache-2.0
|
|
14
14
|
import Observable from 'zen-observable-ts';
|
|
15
|
-
import {
|
|
15
|
+
import { isWebWorker } from './JS';
|
|
16
16
|
var ReachabilityNavigator = /** @class */ (function () {
|
|
17
17
|
function ReachabilityNavigator() {
|
|
18
18
|
}
|
|
19
19
|
ReachabilityNavigator.prototype.networkMonitor = function (netInfo) {
|
|
20
|
-
if (browserOrNode().isNode) {
|
|
21
|
-
return Observable.from([{ online: true }]);
|
|
22
|
-
}
|
|
23
20
|
var globalObj = isWebWorker() ? self : window;
|
|
24
21
|
return new Observable(function (observer) {
|
|
25
22
|
observer.next({ online: globalObj.navigator.onLine });
|
|
@@ -2,4 +2,4 @@ import { RetryOptions } from '../middleware/retry';
|
|
|
2
2
|
import { SigningOptions } from '../middleware/signing';
|
|
3
3
|
import { UserAgentOptions } from '../middleware/userAgent';
|
|
4
4
|
import { HttpRequest, HttpResponse } from '../types';
|
|
5
|
-
export declare const authenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & SigningOptions) => Promise<HttpResponse>;
|
|
5
|
+
export declare const authenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & SigningOptions & import("../types").HttpTransferOptions) => Promise<HttpResponse>;
|
|
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
import 'isomorphic-unfetch'; // TODO: remove this dependency in v6
|
|
51
50
|
import { withMemoization } from '../utils/memoization';
|
|
52
51
|
var shouldSendBody = function (method) {
|
|
53
52
|
return !['HEAD', 'GET', 'DELETE'].includes(method.toUpperCase());
|
|
@@ -55,7 +54,7 @@ var shouldSendBody = function (method) {
|
|
|
55
54
|
// TODO[AllanZhengYP]: we need to provide isCanceledError utility
|
|
56
55
|
export var fetchTransferHandler = function (_a, _b) {
|
|
57
56
|
var url = _a.url, method = _a.method, headers = _a.headers, body = _a.body;
|
|
58
|
-
var abortSignal = _b.abortSignal;
|
|
57
|
+
var abortSignal = _b.abortSignal, cache = _b.cache;
|
|
59
58
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
60
59
|
var resp, e_1, responseHeaders, httpResponse, bodyWithMixin;
|
|
61
60
|
var _c, _d;
|
|
@@ -68,6 +67,7 @@ export var fetchTransferHandler = function (_a, _b) {
|
|
|
68
67
|
headers: headers,
|
|
69
68
|
body: shouldSendBody(method) ? body : undefined,
|
|
70
69
|
signal: abortSignal,
|
|
70
|
+
cache: cache,
|
|
71
71
|
})];
|
|
72
72
|
case 1:
|
|
73
73
|
resp = _e.sent();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RetryOptions } from '../middleware/retry';
|
|
2
2
|
import { UserAgentOptions } from '../middleware/userAgent';
|
|
3
3
|
import { HttpRequest, HttpResponse } from '../types';
|
|
4
|
-
export declare const unauthenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse>) => Promise<HttpResponse>;
|
|
4
|
+
export declare const unauthenticatedHandler: (request: HttpRequest, options: UserAgentOptions & RetryOptions<HttpResponse> & import("../types").HttpTransferOptions) => Promise<HttpResponse>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ServiceClientOptions } from '../types/aws';
|
|
2
2
|
import { TransferHandler, Endpoint } from '../types/core';
|
|
3
3
|
import { HttpRequest, HttpResponse } from '../types/http';
|
|
4
|
-
export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: Partial<DefaultConfig>) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & Partial<DefaultConfig> & InferEndpointResolverOptionType<DefaultConfig>,
|
|
5
|
-
type OptionalizeKey<
|
|
6
|
-
[
|
|
4
|
+
export declare const composeServiceApi: <TransferHandlerOptions, Input, Output, DefaultConfig>(transferHandler: TransferHandler<HttpRequest, HttpResponse, TransferHandlerOptions>, serializer: (input: Input, endpoint: Endpoint) => Promise<HttpRequest> | HttpRequest, deserializer: (output: HttpResponse) => Promise<Output>, defaultConfig: Partial<DefaultConfig>) => (config: OptionalizeKey<TransferHandlerOptions & ServiceClientOptions & Partial<DefaultConfig> & InferEndpointResolverOptionType<DefaultConfig>, DefaultConfig>, input: Input) => Promise<Output>;
|
|
5
|
+
type OptionalizeKey<InputType, InputDefaultsType> = {
|
|
6
|
+
[KeyWithDefaultValue in keyof InputDefaultsType]?: KeyWithDefaultValue extends keyof InputType ? InputType[KeyWithDefaultValue] : never;
|
|
7
|
+
} & {
|
|
8
|
+
[KeyWithoutDefaultValue in keyof Omit<InputType, keyof InputDefaultsType>]: InputType[KeyWithoutDefaultValue];
|
|
7
9
|
};
|
|
8
10
|
type InferEndpointResolverOptionType<T> = T extends {
|
|
9
11
|
endpointResolver: (options: infer EndpointOptions) => any;
|
|
@@ -18,7 +18,3 @@ export interface ServiceClientOptions {
|
|
|
18
18
|
* This function is protocol-specific (e.g. JSON, XML, etc.)
|
|
19
19
|
*/
|
|
20
20
|
export type ErrorParser = (response?: HttpResponse) => Promise<(Error & MetadataBearer) | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* Default config options for the `composeServiceApi`.
|
|
23
|
-
*/
|
|
24
|
-
export type DefaultConfigOptions<TransferHandlerOptions extends Record<string, unknown> = Record<string, unknown>> = Partial<TransferHandlerOptions & ServiceClientOptions>;
|
|
@@ -26,5 +26,13 @@ export interface HttpResponse extends Response {
|
|
|
26
26
|
}
|
|
27
27
|
export interface HttpTransferOptions {
|
|
28
28
|
abortSignal?: AbortSignal;
|
|
29
|
+
/**
|
|
30
|
+
* Cache mode for the request. Note that this is only effective when the underlying HTTP handler is fetch.
|
|
31
|
+
* For XHR handler, or Node.js `"http(s)"` module or running on React Native, this option is ignored.
|
|
32
|
+
* Instead, you can configure the `Cache-Control` headers to achieve similar effects.
|
|
33
|
+
* @default 'default'
|
|
34
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/cache}
|
|
35
|
+
*/
|
|
36
|
+
cache?: RequestCache;
|
|
29
37
|
}
|
|
30
38
|
export type HttpTransferHandler = TransferHandler<HttpRequest, HttpResponse, HttpTransferOptions>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Middleware, MiddlewareHandler, Request, Response, TransferHandler, Endpoint, } from './core';
|
|
2
2
|
export { Headers, HttpRequest, HttpResponse, HttpTransferHandler, HttpTransferOptions, ResponseBodyMixin, } from './http';
|
|
3
|
-
export { Credentials, EndpointResolverOptions, ErrorParser, ServiceClientOptions,
|
|
3
|
+
export { Credentials, EndpointResolverOptions, ErrorParser, ServiceClientOptions, } from './aws';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { isBrowser, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
|
|
2
2
|
export { JWT, StrictUnion, CognitoIdentityPoolConfig, } from './singleton/Auth/types';
|
|
3
3
|
export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
|
|
4
4
|
export { isTokenExpired } from './singleton/Auth';
|
|
@@ -14,7 +14,6 @@ export { ServiceWorker } from './ServiceWorker';
|
|
|
14
14
|
export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
|
|
15
15
|
export { asserts } from './Util/errors/AssertError';
|
|
16
16
|
export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Util/Errors';
|
|
17
|
-
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
18
17
|
export { AppState, AsyncStorage, Linking } from './RNComponents';
|
|
19
18
|
export { ErrorParams, AmplifyErrorMap, ServiceError } from './types';
|
|
20
19
|
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
|
package/lib-esm/libraryUtils.js
CHANGED
|
@@ -5,7 +5,7 @@ This file maps top-level exports from `@aws-amplify/core/internals/utils`. These
|
|
|
5
5
|
utils for use throughout the library.
|
|
6
6
|
*/
|
|
7
7
|
// JS utilities
|
|
8
|
-
export {
|
|
8
|
+
export { isBrowser, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
|
|
9
9
|
// Auth utilities
|
|
10
10
|
export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
|
|
11
11
|
export { isTokenExpired } from './singleton/Auth';
|
|
@@ -26,7 +26,6 @@ export { ServiceWorker } from './ServiceWorker';
|
|
|
26
26
|
export { AWS_CLOUDWATCH_CATEGORY, BackgroundManagerNotOpenError, BackgroundProcessManager, BackgroundProcessManagerState, DateUtils, Mutex, NO_CREDS_ERROR_STRING, NonRetryableError, RETRY_ERROR_CODES, Reachability, isNonRetryableError, jitteredBackoff, jitteredExponentialRetry, retry, urlSafeDecode, urlSafeEncode, } from './Util';
|
|
27
27
|
export { asserts } from './Util/errors/AssertError';
|
|
28
28
|
export { invalidParameter, missingConfig, AmplifyError, AmplifyErrorString, } from './Util/Errors';
|
|
29
|
-
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
30
29
|
export { AppState, AsyncStorage, Linking } from './RNComponents';
|
|
31
30
|
export { INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, USER_AGENT_HEADER, } from './Util/Constants';
|
|
32
31
|
export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinpointRecordInput } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }:
|
|
5
|
+
export declare const record: ({ appId, category, credentials, event, identityId, region, userAgentValue, }: PinpointRecordInput) => Promise<void>;
|
|
@@ -68,7 +68,7 @@ export var record = function (_a) {
|
|
|
68
68
|
identityId: identityId,
|
|
69
69
|
region: region,
|
|
70
70
|
resendLimit: RESEND_LIMIT,
|
|
71
|
-
userAgentValue: userAgentValue
|
|
71
|
+
userAgentValue: userAgentValue,
|
|
72
72
|
});
|
|
73
73
|
if (!!endpointId) return [3 /*break*/, 4];
|
|
74
74
|
return [4 /*yield*/, updateEndpoint({
|
|
@@ -89,7 +89,7 @@ export var record = function (_a) {
|
|
|
89
89
|
if (!endpointId) {
|
|
90
90
|
throw new AmplifyError({
|
|
91
91
|
name: 'ENDPOINT_NOT_CREATED',
|
|
92
|
-
message: 'Endpoint was not created.'
|
|
92
|
+
message: 'Endpoint was not created.',
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
// Generate session if required
|
|
@@ -107,7 +107,7 @@ export var record = function (_a) {
|
|
|
107
107
|
event: event,
|
|
108
108
|
session: session,
|
|
109
109
|
timestamp: timestampISOString,
|
|
110
|
-
resendLimit: RESEND_LIMIT
|
|
110
|
+
resendLimit: RESEND_LIMIT,
|
|
111
111
|
});
|
|
112
112
|
return [2 /*return*/];
|
|
113
113
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PinpointUpdateEndpointInput } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }:
|
|
5
|
+
export declare const updateEndpoint: ({ address, appId, category, channelType, credentials, identityId, optOut, region, userId, userProfile, userAgentValue, }: PinpointUpdateEndpointInput) => Promise<void>;
|
|
@@ -3,7 +3,7 @@ import { PinpointAnalyticsEvent, PinpointSession } from './pinpoint';
|
|
|
3
3
|
export type EventBufferConfig = {
|
|
4
4
|
appId: string;
|
|
5
5
|
bufferSize: number;
|
|
6
|
-
credentials: AuthSession['credentials'];
|
|
6
|
+
credentials: Required<AuthSession>['credentials'];
|
|
7
7
|
identityId: AuthSession['identityId'];
|
|
8
8
|
flushInterval: number;
|
|
9
9
|
flushSize: number;
|
|
@@ -24,17 +24,17 @@ export type PinpointAnalyticsEvent = {
|
|
|
24
24
|
type PinpointCommonParameters = {
|
|
25
25
|
appId: string;
|
|
26
26
|
category: SupportedCategory;
|
|
27
|
-
credentials: AuthSession['credentials'];
|
|
27
|
+
credentials: Required<AuthSession>['credentials'];
|
|
28
28
|
identityId?: AuthSession['identityId'];
|
|
29
29
|
region: string;
|
|
30
30
|
userAgentValue?: string;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
32
|
+
export type PinpointUpdateEndpointInput = PinpointCommonParameters & PinpointServiceOptions & {
|
|
33
33
|
channelType?: SupportedChannelType;
|
|
34
34
|
userId?: string;
|
|
35
35
|
userProfile?: UserProfile;
|
|
36
36
|
};
|
|
37
|
-
export type
|
|
37
|
+
export type PinpointRecordInput = PinpointCommonParameters & {
|
|
38
38
|
event: PinpointAnalyticsEvent;
|
|
39
39
|
};
|
|
40
40
|
export {};
|