@aws-amplify/api-graphql 4.0.1-unstable.cfbde4c.0 → 4.0.1
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 → dist/cjs}/GraphQLAPI.js +8 -4
- package/dist/cjs/GraphQLAPI.js.map +1 -0
- package/{lib → dist/cjs}/Providers/AWSAppSyncRealTimeProvider/index.js +11 -8
- package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -0
- package/{lib → dist/cjs}/Providers/constants.js +8 -8
- package/dist/cjs/Providers/constants.js.map +1 -0
- package/dist/cjs/index.js +15 -0
- package/dist/cjs/index.js.map +1 -0
- package/{lib → dist/cjs}/internals/InternalGraphQLAPI.js +18 -18
- package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -0
- package/dist/cjs/internals/index.js +14 -0
- package/dist/cjs/internals/index.js.map +1 -0
- package/{lib → dist/cjs}/internals/v6.js +4 -1
- package/dist/cjs/internals/v6.js.map +1 -0
- package/{lib → dist/cjs}/types/PubSub.js +6 -6
- package/dist/cjs/types/PubSub.js.map +1 -0
- package/{lib → dist/cjs}/types/index.js +7 -5
- package/dist/cjs/types/index.js.map +1 -0
- package/{lib → dist/cjs}/utils/ConnectionStateMonitor.js +8 -5
- package/dist/cjs/utils/ConnectionStateMonitor.js.map +1 -0
- package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.js +6 -2
- package/dist/cjs/utils/ReachabilityMonitor/index.js.map +1 -0
- package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.native.js +6 -2
- package/dist/cjs/utils/ReachabilityMonitor/index.native.js.map +1 -0
- package/{lib → dist/cjs}/utils/ReconnectionMonitor.js +4 -1
- package/dist/cjs/utils/ReconnectionMonitor.js.map +1 -0
- package/{lib → dist/cjs}/utils/errors/APIError.js +4 -1
- package/dist/cjs/utils/errors/APIError.js.map +1 -0
- package/{lib → dist/cjs}/utils/errors/assertValidationError.js +4 -1
- package/dist/cjs/utils/errors/assertValidationError.js.map +1 -0
- package/dist/cjs/utils/errors/index.js +14 -0
- package/dist/cjs/utils/errors/index.js.map +1 -0
- package/{lib → dist/cjs}/utils/errors/validation.js +4 -1
- package/dist/cjs/utils/errors/validation.js.map +1 -0
- package/dist/cjs/utils/index.js +11 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/{lib → dist/cjs}/utils/resolveConfig.js +7 -3
- package/dist/cjs/utils/resolveConfig.js.map +1 -0
- package/{lib-esm → dist/cjs}/utils/resolveLibraryOptions.js +7 -1
- package/dist/cjs/utils/resolveLibraryOptions.js.map +1 -0
- package/{lib-esm → dist/esm}/GraphQLAPI.d.ts +2 -2
- package/{lib-esm/GraphQLAPI.js → dist/esm/GraphQLAPI.mjs} +8 -4
- package/dist/esm/GraphQLAPI.mjs.map +1 -0
- package/{lib → dist/esm}/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
- package/{lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js → dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs} +13 -9
- package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs.map +1 -0
- package/{lib-esm/Providers/constants.js → dist/esm/Providers/constants.mjs} +18 -14
- package/dist/esm/Providers/constants.mjs.map +1 -0
- package/dist/esm/index.mjs +5 -0
- package/dist/esm/index.mjs.map +1 -0
- package/{lib → dist/esm}/internals/InternalGraphQLAPI.d.ts +1 -1
- package/{lib-esm/internals/InternalGraphQLAPI.js → dist/esm/internals/InternalGraphQLAPI.mjs} +19 -18
- package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -0
- package/dist/esm/internals/index.mjs +3 -0
- package/dist/esm/internals/index.mjs.map +1 -0
- package/{lib-esm/internals/v6.js → dist/esm/internals/v6.mjs} +9 -5
- package/dist/esm/internals/v6.mjs.map +1 -0
- package/{lib → dist/esm}/types/PubSub.d.ts +2 -2
- package/{lib-esm/types/PubSub.js → dist/esm/types/PubSub.mjs} +5 -2
- package/dist/esm/types/PubSub.mjs.map +1 -0
- package/{lib-esm → dist/esm}/types/index.d.ts +25 -25
- package/{lib-esm/types/index.js → dist/esm/types/index.mjs} +7 -3
- package/dist/esm/types/index.mjs.map +1 -0
- package/{lib-esm → dist/esm}/utils/ConnectionStateMonitor.d.ts +3 -3
- package/{lib-esm/utils/ConnectionStateMonitor.js → dist/esm/utils/ConnectionStateMonitor.mjs} +9 -5
- package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -0
- package/dist/esm/utils/ReachabilityMonitor/index.d.ts +1 -0
- package/{lib-esm/utils/ReachabilityMonitor/index.js → dist/esm/utils/ReachabilityMonitor/index.mjs} +6 -2
- package/dist/esm/utils/ReachabilityMonitor/index.mjs.map +1 -0
- package/dist/esm/utils/ReachabilityMonitor/index.native.d.ts +1 -0
- package/dist/esm/utils/ReachabilityMonitor/index.native.mjs +9 -0
- package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -0
- package/{lib-esm/utils/ReconnectionMonitor.js → dist/esm/utils/ReconnectionMonitor.mjs} +7 -3
- package/dist/esm/utils/ReconnectionMonitor.mjs.map +1 -0
- package/{lib-esm/utils/errors/APIError.js → dist/esm/utils/errors/APIError.mjs} +6 -2
- package/dist/esm/utils/errors/APIError.mjs.map +1 -0
- package/{lib-esm/utils/errors/assertValidationError.js → dist/esm/utils/errors/assertValidationError.mjs} +7 -3
- package/dist/esm/utils/errors/assertValidationError.mjs.map +1 -0
- package/dist/esm/utils/errors/index.mjs +4 -0
- package/dist/esm/utils/errors/index.mjs.map +1 -0
- package/{lib-esm/utils/errors/validation.js → dist/esm/utils/errors/validation.mjs} +5 -2
- package/dist/esm/utils/errors/validation.mjs.map +1 -0
- package/dist/esm/utils/index.mjs +3 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/{lib → dist/esm}/utils/resolveConfig.d.ts +1 -1
- package/{lib-esm/utils/resolveConfig.js → dist/esm/utils/resolveConfig.mjs} +8 -2
- package/dist/esm/utils/resolveConfig.mjs.map +1 -0
- package/{lib → dist/esm}/utils/resolveLibraryOptions.d.ts +2 -2
- package/{lib/utils/resolveLibraryOptions.js → dist/esm/utils/resolveLibraryOptions.mjs} +4 -3
- package/dist/esm/utils/resolveLibraryOptions.mjs.map +1 -0
- package/internals/package.json +4 -4
- package/package.json +49 -25
- package/src/GraphQLAPI.ts +1 -1
- package/lib/GraphQLAPI.d.ts +0 -38
- package/lib/Providers/constants.d.ts +0 -95
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -12
- package/lib/internals/index.d.ts +0 -2
- package/lib/internals/index.js +0 -11
- package/lib/internals/v6.d.ts +0 -101
- package/lib/tsconfig.tsbuildinfo +0 -6813
- package/lib/types/index.d.ts +0 -309
- package/lib/utils/ConnectionStateMonitor.d.ts +0 -41
- package/lib/utils/ReachabilityMonitor/index.d.ts +0 -1
- package/lib/utils/ReachabilityMonitor/index.native.d.ts +0 -1
- package/lib/utils/ReconnectionMonitor.d.ts +0 -29
- package/lib/utils/errors/APIError.d.ts +0 -7
- package/lib/utils/errors/assertValidationError.d.ts +0 -5
- package/lib/utils/errors/index.d.ts +0 -3
- package/lib/utils/errors/index.js +0 -11
- package/lib/utils/errors/validation.d.ts +0 -7
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -8
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +0 -64
- package/lib-esm/index.js +0 -5
- package/lib-esm/internals/InternalGraphQLAPI.d.ts +0 -58
- package/lib-esm/internals/index.js +0 -4
- package/lib-esm/tsconfig.tsbuildinfo +0 -6813
- package/lib-esm/types/PubSub.d.ts +0 -27
- package/lib-esm/utils/ReachabilityMonitor/index.d.ts +0 -1
- package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +0 -1
- package/lib-esm/utils/ReachabilityMonitor/index.native.js +0 -5
- package/lib-esm/utils/errors/index.js +0 -5
- package/lib-esm/utils/index.js +0 -4
- package/lib-esm/utils/resolveConfig.d.ts +0 -12
- package/lib-esm/utils/resolveLibraryOptions.d.ts +0 -11
- /package/{lib-esm → dist/esm}/Providers/constants.d.ts +0 -0
- /package/{lib-esm → dist/esm}/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/internals/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/internals/v6.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/ReconnectionMonitor.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/errors/APIError.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/errors/assertValidationError.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/errors/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/errors/validation.d.ts +0 -0
- /package/{lib-esm → dist/esm}/utils/index.d.ts +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';
|
|
2
|
+
|
|
1
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export var MESSAGE_TYPES;
|
|
5
|
+
const MAX_DELAY_MS = 5000;
|
|
6
|
+
const NON_RETRYABLE_CODES = [400, 401, 403];
|
|
7
|
+
const CONNECTION_STATE_CHANGE = 'ConnectionStateChange';
|
|
8
|
+
var MESSAGE_TYPES;
|
|
8
9
|
(function (MESSAGE_TYPES) {
|
|
9
10
|
/**
|
|
10
11
|
* Client -> Server message.
|
|
@@ -57,19 +58,19 @@ export var MESSAGE_TYPES;
|
|
|
57
58
|
*/
|
|
58
59
|
MESSAGE_TYPES["GQL_ERROR"] = "error";
|
|
59
60
|
})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));
|
|
60
|
-
|
|
61
|
+
var SUBSCRIPTION_STATUS;
|
|
61
62
|
(function (SUBSCRIPTION_STATUS) {
|
|
62
63
|
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["PENDING"] = 0] = "PENDING";
|
|
63
64
|
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["CONNECTED"] = 1] = "CONNECTED";
|
|
64
65
|
SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS["FAILED"] = 2] = "FAILED";
|
|
65
66
|
})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));
|
|
66
|
-
|
|
67
|
+
var SOCKET_STATUS;
|
|
67
68
|
(function (SOCKET_STATUS) {
|
|
68
69
|
SOCKET_STATUS[SOCKET_STATUS["CLOSED"] = 0] = "CLOSED";
|
|
69
70
|
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
70
71
|
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
71
72
|
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
72
|
-
|
|
73
|
+
const AWS_APPSYNC_REALTIME_HEADERS = {
|
|
73
74
|
accept: 'application/json, text/javascript',
|
|
74
75
|
'content-encoding': 'amz-1.0',
|
|
75
76
|
'content-type': 'application/json; charset=UTF-8',
|
|
@@ -77,24 +78,27 @@ export const AWS_APPSYNC_REALTIME_HEADERS = {
|
|
|
77
78
|
/**
|
|
78
79
|
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
+
const CONNECTION_INIT_TIMEOUT = 15000;
|
|
81
82
|
/**
|
|
82
83
|
* Time in milleseconds to wait for GQL_START_ACK message
|
|
83
84
|
*/
|
|
84
|
-
|
|
85
|
+
const START_ACK_TIMEOUT = 15000;
|
|
85
86
|
/**
|
|
86
87
|
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
87
88
|
*/
|
|
88
|
-
|
|
89
|
+
const DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
89
90
|
/**
|
|
90
91
|
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
91
92
|
*/
|
|
92
|
-
|
|
93
|
+
const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
93
94
|
/**
|
|
94
95
|
* Default delay time in milleseconds between when reconnect is triggered vs when it is attempted
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
const RECONNECT_DELAY = 5 * 1000;
|
|
97
98
|
/**
|
|
98
99
|
* Default interval time in milleseconds between when reconnect is re-attempted
|
|
99
100
|
*/
|
|
100
|
-
|
|
101
|
+
const RECONNECT_INTERVAL = 60 * 1000;
|
|
102
|
+
|
|
103
|
+
export { AWS_APPSYNC_REALTIME_HEADERS, CONNECTION_INIT_TIMEOUT, CONNECTION_STATE_CHANGE, DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT, DEFAULT_KEEP_ALIVE_TIMEOUT, MAX_DELAY_MS, MESSAGE_TYPES, NON_RETRYABLE_CODES, RECONNECT_DELAY, RECONNECT_INTERVAL, SOCKET_STATUS, START_ACK_TIMEOUT, SUBSCRIPTION_STATUS };
|
|
104
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../src/Providers/constants.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nexport const MAX_DELAY_MS = 5000;\nexport const NON_RETRYABLE_CODES = [400, 401, 403];\nexport const CONNECTION_STATE_CHANGE = 'ConnectionStateChange';\nexport var MESSAGE_TYPES;\n(function (MESSAGE_TYPES) {\n /**\n * Client -> Server message.\n * This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication\n */\n MESSAGE_TYPES[\"GQL_CONNECTION_INIT\"] = \"connection_init\";\n /**\n * Server -> Client message\n * This message type is in case there is an issue with AWS AppSync RealTime when establishing connection\n */\n MESSAGE_TYPES[\"GQL_CONNECTION_ERROR\"] = \"connection_error\";\n /**\n * Server -> Client message.\n * This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message\n */\n MESSAGE_TYPES[\"GQL_CONNECTION_ACK\"] = \"connection_ack\";\n /**\n * Client -> Server message.\n * This message type is for register subscriptions with AWS AppSync RealTime\n */\n MESSAGE_TYPES[\"GQL_START\"] = \"start\";\n /**\n * Server -> Client message.\n * This message type is for the ack response from AWS AppSync RealTime for GQL_START message\n */\n MESSAGE_TYPES[\"GQL_START_ACK\"] = \"start_ack\";\n /**\n * Server -> Client message.\n * This message type is for subscription message from AWS AppSync RealTime\n */\n MESSAGE_TYPES[\"GQL_DATA\"] = \"data\";\n /**\n * Server -> Client message.\n * This message type helps the client to know is still receiving messages from AWS AppSync RealTime\n */\n MESSAGE_TYPES[\"GQL_CONNECTION_KEEP_ALIVE\"] = \"ka\";\n /**\n * Client -> Server message.\n * This message type is for unregister subscriptions with AWS AppSync RealTime\n */\n MESSAGE_TYPES[\"GQL_STOP\"] = \"stop\";\n /**\n * Server -> Client message.\n * This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message\n */\n MESSAGE_TYPES[\"GQL_COMPLETE\"] = \"complete\";\n /**\n * Server -> Client message.\n * This message type is for sending error messages from AWS AppSync RealTime to the client\n */\n MESSAGE_TYPES[\"GQL_ERROR\"] = \"error\";\n})(MESSAGE_TYPES || (MESSAGE_TYPES = {}));\nexport var SUBSCRIPTION_STATUS;\n(function (SUBSCRIPTION_STATUS) {\n SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS[\"PENDING\"] = 0] = \"PENDING\";\n SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS[\"CONNECTED\"] = 1] = \"CONNECTED\";\n SUBSCRIPTION_STATUS[SUBSCRIPTION_STATUS[\"FAILED\"] = 2] = \"FAILED\";\n})(SUBSCRIPTION_STATUS || (SUBSCRIPTION_STATUS = {}));\nexport var SOCKET_STATUS;\n(function (SOCKET_STATUS) {\n SOCKET_STATUS[SOCKET_STATUS[\"CLOSED\"] = 0] = \"CLOSED\";\n SOCKET_STATUS[SOCKET_STATUS[\"READY\"] = 1] = \"READY\";\n SOCKET_STATUS[SOCKET_STATUS[\"CONNECTING\"] = 2] = \"CONNECTING\";\n})(SOCKET_STATUS || (SOCKET_STATUS = {}));\nexport const AWS_APPSYNC_REALTIME_HEADERS = {\n accept: 'application/json, text/javascript',\n 'content-encoding': 'amz-1.0',\n 'content-type': 'application/json; charset=UTF-8',\n};\n/**\n * Time in milleseconds to wait for GQL_CONNECTION_INIT message\n */\nexport const CONNECTION_INIT_TIMEOUT = 15000;\n/**\n * Time in milleseconds to wait for GQL_START_ACK message\n */\nexport const START_ACK_TIMEOUT = 15000;\n/**\n * Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message\n */\nexport const DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;\n/**\n * Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message\n */\nexport const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;\n/**\n * Default delay time in milleseconds between when reconnect is triggered vs when it is attempted\n */\nexport const RECONNECT_DELAY = 5 * 1000;\n/**\n * Default interval time in milleseconds between when reconnect is re-attempted\n */\nexport const RECONNECT_INTERVAL = 60 * 1000;\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,YAAY,GAAG,KAAK;AACrB,MAAC,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;AACvC,MAAC,uBAAuB,GAAG,wBAAwB;AACrD,IAAC,cAAc;AACzB,CAAC,UAAU,aAAa,EAAE;AAC1B;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,qBAAqB,CAAC,GAAG,iBAAiB,CAAC;AAC7D;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,sBAAsB,CAAC,GAAG,kBAAkB,CAAC;AAC/D;AACA;AACA;AACA;AACA,IAAI,aAAa,CAAC,oBAAoB,CAA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IAAI,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC;AAClE,CAAC,EAAE,aAAa,KAAK,aAAa,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9B,MAAC,4BAA4B,GAAG;AAC5C,IAAI,MAAM,EAAE,mCAAmC;AAC/C,IAAI,kBAAkB,EAAE,SAAS;AACjC,IAAI,cAAc,EAAE,iCAAiC;AACrD,EAAE;AACF;AACA;AACA;AACY,MAAC,uBAAuB,GAAG,MAAM;AAC7C;AACA;AACA;AACY,MAAC,iBAAiB,GAAG,MAAM;AACvC;AACA;AACA;AACY,MAAC,0BAA0B,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK;AACxD;AACA;AACA;AACY,MAAC,gCAAgC,GAAG,EAAE,GAAG,KAAK;AAC1D;AACA;AACA;AACY,MAAC,eAAe,GAAG,CAAC,GAAG,KAAK;AACxC;AACA;AACA;AACY,MAAC,kBAAkB,GAAG,EAAE,GAAG;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { GraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI.mjs';
|
|
2
|
+
export { GraphQLAuthError, __amplify } from './types/index.mjs';
|
|
3
|
+
export { CONNECTION_STATE_CHANGE } from './Providers/constants.mjs';
|
|
4
|
+
export { CONTROL_MSG, ConnectionState } from './types/PubSub.mjs';
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
4
4
|
import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
|
|
5
5
|
import { GraphQLResult, GraphQLOperation, GraphQLOptions } from '../types';
|
|
6
|
-
export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string
|
|
6
|
+
export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string) => {
|
|
7
7
|
query: any;
|
|
8
8
|
variables: {};
|
|
9
9
|
authToken: string | undefined;
|
package/{lib-esm/internals/InternalGraphQLAPI.js → dist/esm/internals/InternalGraphQLAPI.mjs}
RENAMED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { parse, print, GraphQLError } from 'graphql';
|
|
2
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
3
|
+
import { getAmplifyUserAgent, AmplifyUrl } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
import { GraphQLAuthError } from '../types/index.mjs';
|
|
5
|
+
import { isCancelError } from '@aws-amplify/api-rest';
|
|
6
|
+
import { post, cancel, updateRequestToBeCancellable } from '@aws-amplify/api-rest/internals';
|
|
7
|
+
import { AWSAppSyncRealTimeProvider } from '../Providers/AWSAppSyncRealTimeProvider/index.mjs';
|
|
8
|
+
import { resolveConfig } from '../utils/resolveConfig.mjs';
|
|
9
|
+
import { resolveLibraryOptions } from '../utils/resolveLibraryOptions.mjs';
|
|
10
|
+
|
|
1
11
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
12
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { print, parse, GraphQLError, } from 'graphql';
|
|
4
|
-
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
-
import { getAmplifyUserAgent, AmplifyUrl, } from '@aws-amplify/core/internals/utils';
|
|
6
|
-
import { GraphQLAuthError, } from '../types';
|
|
7
|
-
import { isCancelError as isCancelErrorREST } from '@aws-amplify/api-rest';
|
|
8
|
-
import { post, cancel as cancelREST, updateRequestToBeCancellable, } from '@aws-amplify/api-rest/internals';
|
|
9
|
-
import { AWSAppSyncRealTimeProvider } from '../Providers/AWSAppSyncRealTimeProvider';
|
|
10
|
-
import { resolveConfig, resolveLibraryOptions } from '../utils';
|
|
11
13
|
const USER_AGENT_HEADER = 'x-amz-user-agent';
|
|
12
14
|
const logger = new ConsoleLogger('GraphQLAPI');
|
|
13
|
-
|
|
15
|
+
const graphqlOperation = (query, variables = {}, authToken) => ({
|
|
14
16
|
query,
|
|
15
17
|
variables,
|
|
16
18
|
authToken,
|
|
@@ -21,7 +23,7 @@ const isAmplifyInstance = (amplify) => {
|
|
|
21
23
|
/**
|
|
22
24
|
* Export Cloud Logic APIs
|
|
23
25
|
*/
|
|
24
|
-
|
|
26
|
+
class InternalGraphQLAPIClass {
|
|
25
27
|
/**
|
|
26
28
|
* Initialize GraphQL API with AWS configuration
|
|
27
29
|
* @param {Object} options - Configuration object for API
|
|
@@ -29,8 +31,8 @@ export class InternalGraphQLAPIClass {
|
|
|
29
31
|
constructor(options) {
|
|
30
32
|
this._api = {
|
|
31
33
|
post,
|
|
32
|
-
cancelREST,
|
|
33
|
-
isCancelErrorREST,
|
|
34
|
+
cancelREST: cancel,
|
|
35
|
+
isCancelErrorREST: isCancelError,
|
|
34
36
|
updateRequestToBeCancellable,
|
|
35
37
|
};
|
|
36
38
|
this._options = options;
|
|
@@ -40,7 +42,7 @@ export class InternalGraphQLAPIClass {
|
|
|
40
42
|
return 'InternalGraphQLAPI';
|
|
41
43
|
}
|
|
42
44
|
async _headerBasedAuth(amplify, authMode, additionalHeaders = {}) {
|
|
43
|
-
|
|
45
|
+
amplify.getConfig();
|
|
44
46
|
const { region: region, endpoint: appSyncGraphqlEndpoint, apiKey, defaultAuthMode, } = resolveConfig(amplify);
|
|
45
47
|
const authenticationType = authMode || defaultAuthMode || 'iam';
|
|
46
48
|
let headers = {};
|
|
@@ -83,10 +85,6 @@ export class InternalGraphQLAPIClass {
|
|
|
83
85
|
Authorization: additionalHeaders.Authorization,
|
|
84
86
|
};
|
|
85
87
|
break;
|
|
86
|
-
case 'none':
|
|
87
|
-
break;
|
|
88
|
-
default:
|
|
89
|
-
break;
|
|
90
88
|
}
|
|
91
89
|
return headers;
|
|
92
90
|
}
|
|
@@ -268,4 +266,7 @@ export class InternalGraphQLAPIClass {
|
|
|
268
266
|
}, customUserAgentDetails);
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
|
-
|
|
269
|
+
const InternalGraphQLAPI = new InternalGraphQLAPIClass(null);
|
|
270
|
+
|
|
271
|
+
export { InternalGraphQLAPI, InternalGraphQLAPIClass, graphqlOperation };
|
|
272
|
+
//# sourceMappingURL=InternalGraphQLAPI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalGraphQLAPI.mjs","sources":["../../../src/internals/InternalGraphQLAPI.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { print, parse, GraphQLError, } from 'graphql';\nimport { ConsoleLogger } from '@aws-amplify/core';\nimport { getAmplifyUserAgent, AmplifyUrl, } from '@aws-amplify/core/internals/utils';\nimport { GraphQLAuthError, } from '../types';\nimport { isCancelError as isCancelErrorREST } from '@aws-amplify/api-rest';\nimport { post, cancel as cancelREST, updateRequestToBeCancellable, } from '@aws-amplify/api-rest/internals';\nimport { AWSAppSyncRealTimeProvider } from '../Providers/AWSAppSyncRealTimeProvider';\nimport { resolveConfig, resolveLibraryOptions } from '../utils';\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst logger = new ConsoleLogger('GraphQLAPI');\nexport const graphqlOperation = (query, variables = {}, authToken) => ({\n query,\n variables,\n authToken,\n});\nconst isAmplifyInstance = (amplify) => {\n return typeof amplify !== 'function';\n};\n/**\n * Export Cloud Logic APIs\n */\nexport class InternalGraphQLAPIClass {\n /**\n * Initialize GraphQL API with AWS configuration\n * @param {Object} options - Configuration object for API\n */\n constructor(options) {\n this._api = {\n post,\n cancelREST,\n isCancelErrorREST,\n updateRequestToBeCancellable,\n };\n this._options = options;\n logger.debug('API Options', this._options);\n }\n getModuleName() {\n return 'InternalGraphQLAPI';\n }\n async _headerBasedAuth(amplify, authMode, additionalHeaders = {}) {\n const config = amplify.getConfig();\n const { region: region, endpoint: appSyncGraphqlEndpoint, apiKey, defaultAuthMode, } = resolveConfig(amplify);\n const authenticationType = authMode || defaultAuthMode || 'iam';\n let headers = {};\n switch (authenticationType) {\n case 'apiKey':\n if (!apiKey) {\n throw new Error(GraphQLAuthError.NO_API_KEY);\n }\n headers = {\n 'X-Api-Key': apiKey,\n };\n break;\n case 'iam':\n const session = await amplify.Auth.fetchAuthSession();\n if (session.credentials === undefined) {\n throw new Error(GraphQLAuthError.NO_CREDENTIALS);\n }\n break;\n case 'oidc':\n case 'userPool':\n try {\n let token;\n token = (await amplify.Auth.fetchAuthSession()).tokens?.accessToken.toString();\n if (!token) {\n throw new Error(GraphQLAuthError.NO_FEDERATED_JWT);\n }\n headers = {\n Authorization: token,\n };\n }\n catch (e) {\n throw new Error(GraphQLAuthError.NO_CURRENT_USER);\n }\n break;\n case 'lambda':\n if (!additionalHeaders.Authorization) {\n throw new Error(GraphQLAuthError.NO_AUTH_TOKEN);\n }\n headers = {\n Authorization: additionalHeaders.Authorization,\n };\n break;\n case 'none':\n break;\n default:\n break;\n }\n return headers;\n }\n /**\n * to get the operation type\n * @param operation\n */\n getGraphqlOperationType(operation) {\n const doc = parse(operation);\n const definitions = doc.definitions;\n const [{ operation: operationType }] = definitions;\n return operationType;\n }\n /**\n * Executes a GraphQL operation\n *\n * @param options - GraphQL Options\n * @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config\n * @returns An Observable if the query is a subscription query, else a promise of the graphql result.\n */\n graphql(amplify, { query: paramQuery, variables = {}, authMode, authToken }, additionalHeaders, customUserAgentDetails) {\n const query = typeof paramQuery === 'string'\n ? parse(paramQuery)\n : parse(print(paramQuery));\n const [operationDef = {}] = query.definitions.filter(def => def.kind === 'OperationDefinition');\n const { operation: operationType } = operationDef;\n const headers = additionalHeaders || {};\n // if an authorization header is set, have the explicit authToken take precedence\n if (authToken) {\n headers.Authorization = authToken;\n }\n switch (operationType) {\n case 'query':\n case 'mutation':\n const abortController = new AbortController();\n let responsePromise;\n if (isAmplifyInstance(amplify)) {\n responsePromise = this._graphql(amplify, { query, variables, authMode }, headers, abortController, customUserAgentDetails);\n }\n else {\n const wrapper = amplifyInstance => this._graphql(amplifyInstance, { query, variables, authMode }, headers, abortController, customUserAgentDetails);\n responsePromise = amplify(wrapper);\n }\n this._api.updateRequestToBeCancellable(responsePromise, abortController);\n return responsePromise;\n case 'subscription':\n return this._graphqlSubscribe(amplify, { query, variables, authMode }, headers, customUserAgentDetails);\n default:\n throw new Error(`invalid operation type: ${operationType}`);\n }\n }\n async _graphql(amplify, { query, variables, authMode }, additionalHeaders = {}, abortController, customUserAgentDetails) {\n const { region: region, endpoint: appSyncGraphqlEndpoint, customEndpoint, customEndpointRegion, } = resolveConfig(amplify);\n // Retrieve library options from Amplify configuration\n const { headers: customHeaders, withCredentials } = resolveLibraryOptions(amplify);\n // TODO: Figure what we need to do to remove `!`'s.\n const headers = {\n ...(!customEndpoint &&\n (await this._headerBasedAuth(amplify, authMode, additionalHeaders))),\n /**\n * Custom endpoint headers.\n * If there is both a custom endpoint and custom region present, we get the headers.\n * If there is a custom endpoint but no region, we return an empty object.\n * If neither are present, we return an empty object.\n */\n ...((customEndpoint &&\n (customEndpointRegion\n ? await this._headerBasedAuth(amplify, authMode, additionalHeaders)\n : {})) ||\n {}),\n // Custom headers included in Amplify configuration options:\n ...(customHeaders &&\n (await customHeaders({\n query: print(query),\n variables,\n }))),\n // Headers from individual calls to `graphql`:\n ...additionalHeaders,\n // User agent headers:\n ...(!customEndpoint && {\n [USER_AGENT_HEADER]: getAmplifyUserAgent(customUserAgentDetails),\n }),\n };\n const body = {\n query: print(query),\n variables: variables || null,\n };\n let signingServiceInfo;\n /**\n * We do not send the signing service info to the REST API under the\n * following conditions (i.e. it will not sign the request):\n * - there is a custom endpoint but no region\n * - the auth mode is `none`, or `apiKey`\n * - the auth mode is a type other than the types listed below\n */\n if ((customEndpoint && !customEndpointRegion) ||\n (authMode !== 'oidc' &&\n authMode !== 'userPool' &&\n authMode !== 'iam' &&\n authMode !== 'lambda')) {\n signingServiceInfo = null;\n }\n else {\n signingServiceInfo = {\n service: !customEndpointRegion ? 'appsync' : 'execute-api',\n region: !customEndpointRegion ? region : customEndpointRegion,\n };\n }\n const endpoint = customEndpoint || appSyncGraphqlEndpoint;\n if (!endpoint) {\n const error = new GraphQLError('No graphql endpoint provided.');\n throw {\n data: {},\n errors: [error],\n };\n }\n let response;\n try {\n const { body: responseBody } = await this._api.post({\n url: new AmplifyUrl(endpoint),\n options: {\n headers,\n body,\n signingServiceInfo,\n withCredentials,\n },\n abortController,\n });\n const result = await responseBody.json();\n response = result;\n }\n catch (err) {\n // If the exception is because user intentionally\n // cancelled the request, do not modify the exception\n // so that clients can identify the exception correctly.\n if (this.isCancelError(err)) {\n throw err;\n }\n response = {\n data: {},\n errors: [new GraphQLError(err.message, null, null, null, null, err)],\n };\n }\n const { errors } = response;\n if (errors && errors.length) {\n throw response;\n }\n return response;\n }\n /**\n * Checks to see if an error thrown is from an api request cancellation\n * @param {any} error - Any error\n * @return {boolean} - A boolean indicating if the error was from an api request cancellation\n */\n isCancelError(error) {\n return this._api.isCancelErrorREST(error);\n }\n /**\n * Cancels an inflight request. Only applicable for graphql queries and mutations\n * @param {any} request - request to cancel\n * @returns - A boolean indicating if the request was cancelled\n */\n cancel(request, message) {\n return this._api.cancelREST(request, message);\n }\n _graphqlSubscribe(amplify, { query, variables, authMode }, additionalHeaders = {}, customUserAgentDetails) {\n const config = resolveConfig(amplify);\n if (!this.appSyncRealTime) {\n this.appSyncRealTime = new AWSAppSyncRealTimeProvider();\n }\n return this.appSyncRealTime.subscribe({\n query: print(query),\n variables,\n appSyncGraphqlEndpoint: config?.endpoint,\n region: config?.region,\n authenticationType: authMode ?? config?.defaultAuthMode,\n apiKey: config?.apiKey,\n additionalHeaders,\n }, customUserAgentDetails);\n }\n}\nexport const InternalGraphQLAPI = new InternalGraphQLAPIClass(null);\n"],"names":["cancelREST","isCancelErrorREST"],"mappings":";;;;;;;;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AY,SAAS;AACrB,YAAY,sBAAsB,EAAE,MAAM,EAAE,QAAQ;AACpD,YAAY,MAAM,EAAE,MAAM,EAAE,MAAM;AAClC,YAAY,kBAAkB,EAAE,QAAQ,IAAI,MAAM,EAAE,eAAe;AACnE,YAAY,MAAM,EAAE,MAAM,EAAE,MAAM;AAClC,YAAY,iBAAiB;AAC7B,SAAS,EAAE,sBAAsB,CAAC,CAAC;AACnC,KAAK;AACL,CAAC;AACW,MAAC,kBAAkB,GAAG,IAAI,uBAAuB,CAAC,IAAI;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { GraphQLAPI } from '../GraphQLAPI.mjs';
|
|
2
|
+
import { __amplify } from '../types/index.mjs';
|
|
3
|
+
|
|
1
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { GraphQLAPI } from '../GraphQLAPI';
|
|
4
|
-
import { __amplify, } from '../types';
|
|
5
6
|
/**
|
|
6
7
|
* Invokes graphql operations against a graphql service, providing correct input and
|
|
7
8
|
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
@@ -86,7 +87,7 @@ import { __amplify, } from '../types';
|
|
|
86
87
|
* @param options
|
|
87
88
|
* @param additionalHeaders
|
|
88
89
|
*/
|
|
89
|
-
|
|
90
|
+
function graphql(options, additionalHeaders) {
|
|
90
91
|
/**
|
|
91
92
|
* The correctness of these typings depends on correct string branding or overrides.
|
|
92
93
|
* Neither of these can actually be validated at runtime. Hence, we don't perform
|
|
@@ -100,7 +101,7 @@ export function graphql(options, additionalHeaders) {
|
|
|
100
101
|
* @param {any} request - request to cancel
|
|
101
102
|
* @returns - A boolean indicating if the request was cancelled
|
|
102
103
|
*/
|
|
103
|
-
|
|
104
|
+
function cancel(promise, message) {
|
|
104
105
|
return GraphQLAPI.cancel(promise, message);
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
@@ -108,6 +109,9 @@ export function cancel(promise, message) {
|
|
|
108
109
|
* @param {any} error - Any error
|
|
109
110
|
* @returns - A boolean indicating if the error was from an api request cancellation
|
|
110
111
|
*/
|
|
111
|
-
|
|
112
|
+
function isCancelError(error) {
|
|
112
113
|
return GraphQLAPI.isCancelError(error);
|
|
113
114
|
}
|
|
115
|
+
|
|
116
|
+
export { cancel, graphql, isCancelError };
|
|
117
|
+
//# sourceMappingURL=v6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v6.mjs","sources":["../../../src/internals/v6.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { GraphQLAPI } from '../GraphQLAPI';\nimport { __amplify, } from '../types';\n/**\n * Invokes graphql operations against a graphql service, providing correct input and\n * output types if Amplify-generated graphql from a recent version of the CLI/codegen\n * are used *or* correct typing is provided via the type argument.\n *\n * Amplify-generated \"branded\" graphql queries will look similar to this:\n *\n * ```ts\n * //\n * // |-- branding\n * // v\n * export const getModel = `...` as GeneratedQuery<\n * \tGetModelQueryVariables,\n * \tGetModelQuery\n * >;\n * ```\n *\n * If this branding is not in your generated graphql, update to a newer version of\n * CLI/codegen and regenerate your graphql using `amplify codegen`.\n *\n * ## Using Amplify-generated graphql\n *\n * ```ts\n * import * as queries from './graphql/queries';\n *\n * //\n * // |-- correctly typed graphql response containing a Widget\n * // v\n * const queryResult = await graphql({\n * \tquery: queries.getWidget,\n * \tvariables: {\n * \t\tid: \"abc\", // <-- type hinted/enforced\n * \t},\n * });\n *\n * //\n * // |-- a correctly typed Widget\n * // v\n * const fetchedWidget = queryResult.data?.getWidget!;\n * ```\n *\n * ## Custom input + result types\n *\n * To provide input types (`variables`) and result types:\n *\n * ```ts\n * type GetById_NameOnly = {\n * \tvariables: {\n * \t\tid: string\n * \t},\n * \tresult: Promise<{\n * \t\tdata: { getWidget: { name: string } }\n * \t}>\n * }\n *\n * //\n * // |-- type is GetById_NameOnly[\"result\"]\n * // v\n * const result = graphql<GetById_NameOnly>({\n * \tquery: \"...\",\n * \tvariables: { id: \"abc\" } // <-- type of GetById_NameOnly[\"variables\"]\n * });\n * ```\n *\n * ## Custom result type only\n *\n * To specify result types only, use a type that is *not* in the `{variables, result}` shape:\n *\n * ```ts\n * type MyResultType = Promise<{\n * \tdata: {\n * \t\tgetWidget: { name: string }\n * \t}\n * }>\n *\n * //\n * // |-- type is MyResultType\n * // v\n * const result = graphql<MyResultType>({query: \"...\"});\n * ```\n *\n * @param options\n * @param additionalHeaders\n */\nexport function graphql(options, additionalHeaders) {\n /**\n * The correctness of these typings depends on correct string branding or overrides.\n * Neither of these can actually be validated at runtime. Hence, we don't perform\n * any validation or type-guarding here.\n */\n const result = GraphQLAPI.graphql(this[__amplify], options, additionalHeaders);\n return result;\n}\n/**\n * Cancels an inflight request. Only applicable for graphql queries and mutations\n * @param {any} request - request to cancel\n * @returns - A boolean indicating if the request was cancelled\n */\nexport function cancel(promise, message) {\n return GraphQLAPI.cancel(promise, message);\n}\n/**\n * Checks to see if an error thrown is from an api request cancellation\n * @param {any} error - Any error\n * @returns - A boolean indicating if the error was from an api request cancellation\n */\nexport function isCancelError(error) {\n return GraphQLAPI.isCancelError(error);\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE;AACpD;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACnF,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE;AACzC,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC3C;;;;"}
|
|
@@ -23,5 +23,5 @@ export declare enum ConnectionState {
|
|
|
23
23
|
Disconnected = "Disconnected",
|
|
24
24
|
ConnectedPendingKeepAlive = "ConnectedPendingKeepAlive"
|
|
25
25
|
}
|
|
26
|
-
export
|
|
27
|
-
export
|
|
26
|
+
export type PubSubContent = Record<string, unknown>;
|
|
27
|
+
export type PubSubContentObserver = Observer<PubSubContent>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var CONTROL_MSG;
|
|
2
2
|
(function (CONTROL_MSG) {
|
|
3
3
|
CONTROL_MSG["CONNECTION_CLOSED"] = "Connection closed";
|
|
4
4
|
CONTROL_MSG["CONNECTION_FAILED"] = "Connection failed";
|
|
@@ -7,7 +7,7 @@ export var CONTROL_MSG;
|
|
|
7
7
|
CONTROL_MSG["TIMEOUT_DISCONNECT"] = "Timeout disconnect";
|
|
8
8
|
})(CONTROL_MSG || (CONTROL_MSG = {}));
|
|
9
9
|
/** @enum {string} */
|
|
10
|
-
|
|
10
|
+
var ConnectionState;
|
|
11
11
|
(function (ConnectionState) {
|
|
12
12
|
/*
|
|
13
13
|
* The connection is alive and healthy
|
|
@@ -42,3 +42,6 @@ export var ConnectionState;
|
|
|
42
42
|
*/
|
|
43
43
|
ConnectionState["ConnectedPendingKeepAlive"] = "ConnectedPendingKeepAlive";
|
|
44
44
|
})(ConnectionState || (ConnectionState = {}));
|
|
45
|
+
|
|
46
|
+
export { CONTROL_MSG, ConnectionState };
|
|
47
|
+
//# sourceMappingURL=PubSub.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PubSub.mjs","sources":["../../../src/types/PubSub.ts"],"sourcesContent":["export var CONTROL_MSG;\n(function (CONTROL_MSG) {\n CONTROL_MSG[\"CONNECTION_CLOSED\"] = \"Connection closed\";\n CONTROL_MSG[\"CONNECTION_FAILED\"] = \"Connection failed\";\n CONTROL_MSG[\"REALTIME_SUBSCRIPTION_INIT_ERROR\"] = \"AppSync Realtime subscription init error\";\n CONTROL_MSG[\"SUBSCRIPTION_ACK\"] = \"Subscription ack\";\n CONTROL_MSG[\"TIMEOUT_DISCONNECT\"] = \"Timeout disconnect\";\n})(CONTROL_MSG || (CONTROL_MSG = {}));\n/** @enum {string} */\nexport var ConnectionState;\n(function (ConnectionState) {\n /*\n * The connection is alive and healthy\n */\n ConnectionState[\"Connected\"] = \"Connected\";\n /*\n * The connection is alive, but the connection is offline\n */\n ConnectionState[\"ConnectedPendingNetwork\"] = \"ConnectedPendingNetwork\";\n /*\n * The connection has been disconnected while in use\n */\n ConnectionState[\"ConnectionDisrupted\"] = \"ConnectionDisrupted\";\n /*\n * The connection has been disconnected and the network is offline\n */\n ConnectionState[\"ConnectionDisruptedPendingNetwork\"] = \"ConnectionDisruptedPendingNetwork\";\n /*\n * The connection is in the process of connecting\n */\n ConnectionState[\"Connecting\"] = \"Connecting\";\n /*\n * The connection is not in use and is being disconnected\n */\n ConnectionState[\"ConnectedPendingDisconnect\"] = \"ConnectedPendingDisconnect\";\n /*\n * The connection is not in use and has been disconnected\n */\n ConnectionState[\"Disconnected\"] = \"Disconnected\";\n /*\n * The connection is alive, but a keep alive message has been missed\n */\n ConnectionState[\"ConnectedPendingKeepAlive\"] = \"ConnectedPendingKeepAlive\";\n})(ConnectionState || (ConnectionState = {}));\n"],"names":[],"mappings":"AAAU,IAAC,YAAY;AACvB,CAAC,UAAU,WAAW,EAAE;AACxB,IAAI,WAAW,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;AAC3D,IAAI,WAAW,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;AAC3D,IAAI,WAAW,CAAC,kCAAkC,CAAC,GAAG,0CAA0C,CAAC;AACjG,IAAI,WAAW,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AACzD,IAAI,WAAW,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC;AAC7D,CAAC,EAAE,WAAW,KAAK,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;AACtC;AACU,IAAC,gBAAgB;AAC3B,CAAC,UAAU,eAAe,EAAE;AAC5B;AACA;AACA;AACA,IAAI,eAAe,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;AAC/C;AACA;AACA;AACA,IAAI,eAAe,CAAC,yBAAyB,CAAC,GAAG,yBAAyB,CAAC;AAC3E;AACA;AACA;AACA,IAAI,eAAe,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;AACnE;AACA;AACA;AACA,IAAI,eAAe,CAAC,mCAAmC,CAAC,GAAG,mCAAmC,CAAC;AAC/F;AACA;AACA;AACA,IAAI,eAAe,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AACjD;AACA;AACA;AACA,IAAI,eAAe,CAAC,4BAA4B,CAAC,GAAG,4BAA4B,CAAC;AACjF;AACA;AACA;AACA,IAAI,eAAe,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;AACrD;AACA;AACA;AACA,IAAI,eAAe,CAAC,2BAA2B,CAAC,GAAG,2BAA2B,CAAC;AAC/E,CAAC,EAAE,eAAe,KAAK,eAAe,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
@@ -26,10 +26,10 @@ export interface GraphQLResult<T = object> {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
declare const queryType: unique symbol;
|
|
29
|
-
export
|
|
29
|
+
export type GraphQLQuery<T> = T & {
|
|
30
30
|
readonly [queryType]: 'query';
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type GraphQLSubscription<T> = T & {
|
|
33
33
|
readonly [queryType]: 'subscription';
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
@@ -53,14 +53,14 @@ export declare type GraphQLSubscription<T> = T & {
|
|
|
53
53
|
*
|
|
54
54
|
* This util simply makes related model properties optional recursively.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export type GraphQLReturnType<T> = T extends {} ? {
|
|
57
57
|
[K in keyof T]?: GraphQLReturnType<T[K]>;
|
|
58
58
|
} : T;
|
|
59
59
|
/**
|
|
60
60
|
* Describes a paged list result from AppSync, which can either
|
|
61
61
|
* live at the top query or property (e.g., related model) level.
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
type PagedList<T, TYPENAME> = {
|
|
64
64
|
__typename: TYPENAME;
|
|
65
65
|
nextToken?: string | null | undefined;
|
|
66
66
|
items: Array<T>;
|
|
@@ -73,13 +73,13 @@ declare type PagedList<T, TYPENAME> = {
|
|
|
73
73
|
* array, this will only be the case when we also have errors,
|
|
74
74
|
* which will then be *thrown*.
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
type WithListsFixed<T> = T extends PagedList<infer IT, infer NAME> ? PagedList<Exclude<IT, null | undefined>, NAME> : T extends {} ? {
|
|
77
77
|
[K in keyof T]: WithListsFixed<T[K]>;
|
|
78
78
|
} : T;
|
|
79
79
|
/**
|
|
80
80
|
* Returns an updated response type to always return a value.
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
type NeverEmpty<T> = {
|
|
83
83
|
[K in keyof T]-?: Exclude<WithListsFixed<T[K]>, undefined | null>;
|
|
84
84
|
};
|
|
85
85
|
/**
|
|
@@ -89,7 +89,7 @@ declare type NeverEmpty<T> = {
|
|
|
89
89
|
* If empty members are present, there will also be errors present,
|
|
90
90
|
* and the response will instead be *thrown*.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
type FixedQueryResult<T> = Exclude<T[keyof T], null | undefined> extends PagedList<any, any> ? {
|
|
93
93
|
[K in keyof T]-?: WithListsFixed<Exclude<T[K], null | undefined>>;
|
|
94
94
|
} : T;
|
|
95
95
|
/**
|
|
@@ -112,7 +112,7 @@ declare type FixedQueryResult<T> = Exclude<T[keyof T], null | undefined> extends
|
|
|
112
112
|
* })
|
|
113
113
|
* ```
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type GraphqlSubscriptionResult<T> = Observable<GraphqlSubscriptionMessage<T>>;
|
|
116
116
|
/**
|
|
117
117
|
* The shape of messages passed to `next()` from a graphql subscription. E.g.,
|
|
118
118
|
*
|
|
@@ -129,7 +129,7 @@ export declare type GraphqlSubscriptionResult<T> = Observable<GraphqlSubscriptio
|
|
|
129
129
|
* })
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
132
|
-
export
|
|
132
|
+
export type GraphqlSubscriptionMessage<T> = {
|
|
133
133
|
data: T;
|
|
134
134
|
};
|
|
135
135
|
export interface AWSAppSyncRealTimeProviderOptions {
|
|
@@ -144,7 +144,7 @@ export interface AWSAppSyncRealTimeProviderOptions {
|
|
|
144
144
|
[key: string]: string;
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
export
|
|
147
|
+
export type AWSAppSyncRealTimeProvider = {
|
|
148
148
|
subscribe(options?: AWSAppSyncRealTimeProviderOptions): Observable<Record<string, unknown>>;
|
|
149
149
|
};
|
|
150
150
|
export declare enum GraphQLAuthError {
|
|
@@ -158,7 +158,7 @@ export declare enum GraphQLAuthError {
|
|
|
158
158
|
* GraphQLSource or string, the type of the parameter for calling graphql.parse
|
|
159
159
|
* @see: https://graphql.org/graphql-js/language/#parse
|
|
160
160
|
*/
|
|
161
|
-
export
|
|
161
|
+
export type GraphQLOperation = Source | string;
|
|
162
162
|
/**
|
|
163
163
|
* API V6 `graphql({options})` type that can leverage branded graphql `query`
|
|
164
164
|
* objects and fallback types.
|
|
@@ -180,17 +180,17 @@ export interface GraphQLOptionsV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING ext
|
|
|
180
180
|
* Invoking code should either cast the result or use `?` and `!` operators to
|
|
181
181
|
* navigate the result objects.
|
|
182
182
|
*/
|
|
183
|
-
export
|
|
183
|
+
export type UnknownGraphQLResponse = Promise<GraphQLResult<any>> | GraphqlSubscriptionResult<any>;
|
|
184
184
|
/**
|
|
185
185
|
* The expected type for `variables` in a V6 `graphql()` operation with
|
|
186
186
|
* respect to the given `FALLBACK_TYPES` and `TYPED_GQL_STRING`.
|
|
187
187
|
*/
|
|
188
|
-
export
|
|
188
|
+
export type GraphQLVariablesV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer IN, any> ? IN : TYPED_GQL_STRING extends GeneratedMutation<infer IN, any> ? IN : TYPED_GQL_STRING extends GeneratedSubscription<infer IN, any> ? IN : FALLBACK_TYPES extends GraphQLOperationType<infer IN, any> ? IN : any;
|
|
189
189
|
/**
|
|
190
190
|
* The expected return type with respect to the given `FALLBACK_TYPE`
|
|
191
191
|
* and `TYPED_GQL_STRING`.
|
|
192
192
|
*/
|
|
193
|
-
export
|
|
193
|
+
export type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer IN, infer QUERY_OUT> ? Promise<GraphQLResult<FixedQueryResult<QUERY_OUT>>> : TYPED_GQL_STRING extends GeneratedMutation<infer IN, infer MUTATION_OUT> ? Promise<GraphQLResult<NeverEmpty<MUTATION_OUT>>> : TYPED_GQL_STRING extends GeneratedSubscription<infer IN, infer SUB_OUT> ? GraphqlSubscriptionResult<NeverEmpty<SUB_OUT>> : FALLBACK_TYPE extends GraphQLQuery<infer T> ? Promise<GraphQLResult<FALLBACK_TYPE>> : FALLBACK_TYPE extends GraphQLSubscription<infer T> ? GraphqlSubscriptionResult<FALLBACK_TYPE> : FALLBACK_TYPE extends GraphQLOperationType<infer IN, infer CUSTOM_OUT> ? CUSTOM_OUT : UnknownGraphQLResponse;
|
|
194
194
|
/**
|
|
195
195
|
* The shape customers can use to provide `T` to `graphql<T>()` to specify both
|
|
196
196
|
* `IN` and `OUT` types (the type of `variables` and the return type, respectively).
|
|
@@ -209,7 +209,7 @@ export declare type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING
|
|
|
209
209
|
* })
|
|
210
210
|
* ```
|
|
211
211
|
*/
|
|
212
|
-
export
|
|
212
|
+
export type GraphQLOperationType<IN extends {}, OUT extends {}> = {
|
|
213
213
|
variables: IN;
|
|
214
214
|
result: OUT;
|
|
215
215
|
};
|
|
@@ -229,7 +229,7 @@ export declare type GraphQLOperationType<IN extends {}, OUT extends {}> = {
|
|
|
229
229
|
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
230
230
|
* assign types to the `variables` and result objects.
|
|
231
231
|
*/
|
|
232
|
-
export
|
|
232
|
+
export type GeneratedQuery<InputType, OutputType> = string & {
|
|
233
233
|
__generatedQueryInput: InputType;
|
|
234
234
|
__generatedQueryOutput: OutputType;
|
|
235
235
|
};
|
|
@@ -249,7 +249,7 @@ export declare type GeneratedQuery<InputType, OutputType> = string & {
|
|
|
249
249
|
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
250
250
|
* assign types to the `variables` and result objects.
|
|
251
251
|
*/
|
|
252
|
-
export
|
|
252
|
+
export type GeneratedMutation<InputType, OutputType> = string & {
|
|
253
253
|
__generatedMutationInput: InputType;
|
|
254
254
|
__generatedMutationOutput: OutputType;
|
|
255
255
|
};
|
|
@@ -269,33 +269,33 @@ export declare type GeneratedMutation<InputType, OutputType> = string & {
|
|
|
269
269
|
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
270
270
|
* assign types to the `variables` and result objects.
|
|
271
271
|
*/
|
|
272
|
-
export
|
|
272
|
+
export type GeneratedSubscription<InputType, OutputType> = string & {
|
|
273
273
|
__generatedSubscriptionInput: InputType;
|
|
274
274
|
__generatedSubscriptionOutput: OutputType;
|
|
275
275
|
};
|
|
276
|
-
|
|
276
|
+
type FilteredKeys<T> = {
|
|
277
277
|
[P in keyof T]: T[P] extends never ? never : P;
|
|
278
278
|
}[keyof T];
|
|
279
|
-
|
|
279
|
+
type ExcludeNeverFields<O> = {
|
|
280
280
|
[K in FilteredKeys<O>]: O[K];
|
|
281
281
|
};
|
|
282
282
|
export declare const __amplify: unique symbol;
|
|
283
|
-
export
|
|
283
|
+
export type V6Client<T extends Record<any, any> = never> = ExcludeNeverFields<{
|
|
284
284
|
[__amplify]: AmplifyClassV6;
|
|
285
285
|
graphql: GraphQLMethod;
|
|
286
286
|
cancel: (promise: Promise<any>, message?: string) => boolean;
|
|
287
287
|
isCancelError: (error: any) => boolean;
|
|
288
288
|
}>;
|
|
289
|
-
export
|
|
289
|
+
export type V6ClientSSR<T extends Record<any, any> = never> = ExcludeNeverFields<{
|
|
290
290
|
[__amplify]: AmplifyClassV6;
|
|
291
291
|
graphql: GraphQLMethodSSR;
|
|
292
292
|
cancel: (promise: Promise<any>, message?: string) => boolean;
|
|
293
293
|
isCancelError: (error: any) => boolean;
|
|
294
294
|
}>;
|
|
295
|
-
export
|
|
295
|
+
export type GraphQLMethod = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: {
|
|
296
296
|
[key: string]: string;
|
|
297
297
|
} | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
298
|
-
export
|
|
298
|
+
export type GraphQLMethodSSR = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(contextSpec: AmplifyServer.ContextSpec, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: {
|
|
299
299
|
[key: string]: string;
|
|
300
300
|
} | undefined) => GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
301
301
|
/**
|
|
@@ -303,7 +303,7 @@ export declare type GraphQLMethodSSR = <FALLBACK_TYPES = unknown, TYPED_GQL_STRI
|
|
|
303
303
|
*
|
|
304
304
|
* The knobs available for configuring `server/generateClient` internally.
|
|
305
305
|
*/
|
|
306
|
-
export
|
|
306
|
+
export type ServerClientGenerationParams = {
|
|
307
307
|
amplify: null | ((fn: (amplify: any) => Promise<any>) => Promise<AmplifyClassV6>);
|
|
308
308
|
config: ResourcesConfig;
|
|
309
309
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { CONTROL_MSG, ConnectionState } from './PubSub';
|
|
2
|
-
|
|
1
|
+
export { CONTROL_MSG, ConnectionState } from './PubSub.mjs';
|
|
2
|
+
|
|
3
|
+
var GraphQLAuthError;
|
|
3
4
|
(function (GraphQLAuthError) {
|
|
4
5
|
GraphQLAuthError["NO_API_KEY"] = "No api-key configured";
|
|
5
6
|
GraphQLAuthError["NO_CURRENT_USER"] = "No current user";
|
|
@@ -7,4 +8,7 @@ export var GraphQLAuthError;
|
|
|
7
8
|
GraphQLAuthError["NO_FEDERATED_JWT"] = "No federated jwt";
|
|
8
9
|
GraphQLAuthError["NO_AUTH_TOKEN"] = "No auth token specified";
|
|
9
10
|
})(GraphQLAuthError || (GraphQLAuthError = {}));
|
|
10
|
-
|
|
11
|
+
const __amplify = Symbol('amplify');
|
|
12
|
+
|
|
13
|
+
export { GraphQLAuthError, __amplify };
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/types/index.ts"],"sourcesContent":["export { CONTROL_MSG, ConnectionState } from './PubSub';\nexport var GraphQLAuthError;\n(function (GraphQLAuthError) {\n GraphQLAuthError[\"NO_API_KEY\"] = \"No api-key configured\";\n GraphQLAuthError[\"NO_CURRENT_USER\"] = \"No current user\";\n GraphQLAuthError[\"NO_CREDENTIALS\"] = \"No credentials\";\n GraphQLAuthError[\"NO_FEDERATED_JWT\"] = \"No federated jwt\";\n GraphQLAuthError[\"NO_AUTH_TOKEN\"] = \"No auth token specified\";\n})(GraphQLAuthError || (GraphQLAuthError = {}));\nexport const __amplify = Symbol('amplify');\n"],"names":[],"mappings":";;AACU,IAAC,iBAAiB;AAC5B,CAAC,UAAU,gBAAgB,EAAE;AAC7B,IAAI,gBAAgB,CAAC,YAAY,CAAC,GAAG,uBAAuB,CAAC;AAC7D,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;AAC5D,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AAC1D,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AAC9D,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,yBAAyB,CAAC;AAClE,CAAC,EAAE,gBAAgB,KAAK,gBAAgB,GAAG,EAAE,CAAC,CAAC,CAAC;AACpC,MAAC,SAAS,GAAG,MAAM,CAAC,SAAS;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { ConnectionState } from '../types/PubSub';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type LinkedConnectionState = 'connected' | 'disconnected';
|
|
4
|
+
type LinkedHealthState = 'healthy' | 'unhealthy';
|
|
5
|
+
type LinkedConnectionStates = {
|
|
6
6
|
networkState: LinkedConnectionState;
|
|
7
7
|
connectionState: LinkedConnectionState | 'connecting';
|
|
8
8
|
intendedConnectionState: LinkedConnectionState;
|
package/{lib-esm/utils/ConnectionStateMonitor.js → dist/esm/utils/ConnectionStateMonitor.mjs}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Observable, map, filter } from 'rxjs';
|
|
2
|
+
import { ConnectionState } from '../types/PubSub.mjs';
|
|
3
|
+
import { ReachabilityMonitor } from './ReachabilityMonitor/index.mjs';
|
|
4
|
+
|
|
1
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { ConnectionState } from '../types/PubSub';
|
|
5
|
-
import { ReachabilityMonitor } from './ReachabilityMonitor';
|
|
6
|
-
export const CONNECTION_CHANGE = {
|
|
7
|
+
const CONNECTION_CHANGE = {
|
|
7
8
|
KEEP_ALIVE_MISSED: { keepAliveState: 'unhealthy' },
|
|
8
9
|
KEEP_ALIVE: { keepAliveState: 'healthy' },
|
|
9
10
|
CONNECTION_ESTABLISHED: { connectionState: 'connected' },
|
|
@@ -20,7 +21,7 @@ export const CONNECTION_CHANGE = {
|
|
|
20
21
|
ONLINE: { networkState: 'connected' },
|
|
21
22
|
OFFLINE: { networkState: 'disconnected' },
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
class ConnectionStateMonitor {
|
|
24
25
|
constructor() {
|
|
25
26
|
this._networkMonitoringSubscription = undefined;
|
|
26
27
|
this._linkedConnectionState = {
|
|
@@ -126,3 +127,6 @@ export class ConnectionStateMonitor {
|
|
|
126
127
|
return ConnectionState.Connected;
|
|
127
128
|
}
|
|
128
129
|
}
|
|
130
|
+
|
|
131
|
+
export { CONNECTION_CHANGE, ConnectionStateMonitor };
|
|
132
|
+
//# sourceMappingURL=ConnectionStateMonitor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionStateMonitor.mjs","sources":["../../../src/utils/ConnectionStateMonitor.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Observable, map, filter } from 'rxjs';\nimport { ConnectionState } from '../types/PubSub';\nimport { ReachabilityMonitor } from './ReachabilityMonitor';\nexport const CONNECTION_CHANGE = {\n KEEP_ALIVE_MISSED: { keepAliveState: 'unhealthy' },\n KEEP_ALIVE: { keepAliveState: 'healthy' },\n CONNECTION_ESTABLISHED: { connectionState: 'connected' },\n CONNECTION_FAILED: {\n intendedConnectionState: 'disconnected',\n connectionState: 'disconnected',\n },\n CLOSING_CONNECTION: { intendedConnectionState: 'disconnected' },\n OPENING_CONNECTION: {\n intendedConnectionState: 'connected',\n connectionState: 'connecting',\n },\n CLOSED: { connectionState: 'disconnected' },\n ONLINE: { networkState: 'connected' },\n OFFLINE: { networkState: 'disconnected' },\n};\nexport class ConnectionStateMonitor {\n constructor() {\n this._networkMonitoringSubscription = undefined;\n this._linkedConnectionState = {\n networkState: 'connected',\n connectionState: 'disconnected',\n intendedConnectionState: 'disconnected',\n keepAliveState: 'healthy',\n };\n // Attempt to update the state with the current actual network state\n this._initialNetworkStateSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n this._initialNetworkStateSubscription?.unsubscribe();\n });\n this._linkedConnectionStateObservable =\n new Observable(connectionStateObserver => {\n connectionStateObserver.next(this._linkedConnectionState);\n this._linkedConnectionStateObserver = connectionStateObserver;\n });\n }\n /**\n * Turn network state monitoring on if it isn't on already\n */\n enableNetworkMonitoring() {\n // If no initial network state was discovered, stop trying\n this._initialNetworkStateSubscription?.unsubscribe();\n // Maintain the network state based on the reachability monitor\n if (this._networkMonitoringSubscription === undefined) {\n this._networkMonitoringSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n });\n }\n }\n /**\n * Turn network state monitoring off if it isn't off already\n */\n disableNetworkMonitoring() {\n this._networkMonitoringSubscription?.unsubscribe();\n this._networkMonitoringSubscription = undefined;\n }\n /**\n * Get the observable that allows us to monitor the connection state\n *\n * @returns {Observable<ConnectionState>} - The observable that emits ConnectionState updates\n */\n get connectionStateObservable() {\n let previous;\n // The linked state aggregates state changes to any of the network, connection,\n // intendedConnection and keepAliveHealth. Some states will change these independent\n // states without changing the overall connection state.\n // After translating from linked states to ConnectionState, then remove any duplicates\n return this._linkedConnectionStateObservable\n .pipe(map(value => {\n return this.connectionStatesTranslator(value);\n }))\n .pipe(filter(current => {\n const toInclude = current !== previous;\n previous = current;\n return toInclude;\n }));\n }\n /*\n * Updates local connection state and emits the full state to the observer.\n */\n record(statusUpdates) {\n // Maintain the network monitor\n if (statusUpdates.intendedConnectionState === 'connected') {\n this.enableNetworkMonitoring();\n }\n else if (statusUpdates.intendedConnectionState === 'disconnected') {\n this.disableNetworkMonitoring();\n }\n // Maintain the socket state\n const newSocketStatus = {\n ...this._linkedConnectionState,\n ...statusUpdates,\n };\n this._linkedConnectionState = { ...newSocketStatus };\n this._linkedConnectionStateObserver?.next(this._linkedConnectionState);\n }\n /*\n * Translate the ConnectionState structure into a specific ConnectionState string literal union\n */\n connectionStatesTranslator({ connectionState, networkState, intendedConnectionState, keepAliveState, }) {\n if (connectionState === 'connected' && networkState === 'disconnected')\n return ConnectionState.ConnectedPendingNetwork;\n if (connectionState === 'connected' &&\n intendedConnectionState === 'disconnected')\n return ConnectionState.ConnectedPendingDisconnect;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected' &&\n networkState === 'disconnected')\n return ConnectionState.ConnectionDisruptedPendingNetwork;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected')\n return ConnectionState.ConnectionDisrupted;\n if (connectionState === 'connected' && keepAliveState === 'unhealthy')\n return ConnectionState.ConnectedPendingKeepAlive;\n // All remaining states directly correspond to the connection state\n if (connectionState === 'connecting')\n return ConnectionState.Connecting;\n if (connectionState === 'disconnected')\n return ConnectionState.Disconnected;\n return Conn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