@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
package/{lib-esm/utils/ReachabilityMonitor/index.js → dist/esm/utils/ReachabilityMonitor/index.mjs}
RENAMED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { Reachability } 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
|
+
const ReachabilityMonitor = () => new Reachability().networkMonitor();
|
|
6
|
+
|
|
7
|
+
export { ReachabilityMonitor };
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../src/utils/ReachabilityMonitor/index.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Reachability } from '@aws-amplify/core/internals/utils';\nexport const ReachabilityMonitor = () => new Reachability().networkMonitor();\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,mBAAmB,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,cAAc;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReachabilityMonitor: () => import("rxjs").Observable<import("@aws-amplify/core/dist/esm/Reachability/types").NetworkStatus>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Reachability } from '@aws-amplify/core/internals/utils';
|
|
2
|
+
import NetInfo from '@react-native-community/netinfo';
|
|
3
|
+
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
const ReachabilityMonitor = () => new Reachability().networkMonitor(NetInfo);
|
|
7
|
+
|
|
8
|
+
export { ReachabilityMonitor };
|
|
9
|
+
//# sourceMappingURL=index.native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.mjs","sources":["../../../../src/utils/ReachabilityMonitor/index.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Reachability } from '@aws-amplify/core/internals/utils';\nimport { default as NetInfo } from '@react-native-community/netinfo';\nexport const ReachabilityMonitor = () => new Reachability().networkMonitor(NetInfo);\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,mBAAmB,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,cAAc,CAAC,OAAO;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { RECONNECT_INTERVAL, RECONNECT_DELAY } from '../Providers/constants.mjs';
|
|
2
|
+
|
|
3
|
+
var ReconnectEvent;
|
|
3
4
|
(function (ReconnectEvent) {
|
|
4
5
|
ReconnectEvent["START_RECONNECT"] = "START_RECONNECT";
|
|
5
6
|
ReconnectEvent["HALT_RECONNECT"] = "HALT_RECONNECT";
|
|
@@ -10,7 +11,7 @@ export var ReconnectEvent;
|
|
|
10
11
|
* Attempting to reconnect only once creates unrecoverable states when the network state isn't
|
|
11
12
|
* supported by the browser, so this keeps retrying every minute until halted.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
class ReconnectionMonitor {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.reconnectObservers = [];
|
|
16
17
|
}
|
|
@@ -63,3 +64,6 @@ export class ReconnectionMonitor {
|
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
}
|
|
67
|
+
|
|
68
|
+
export { ReconnectEvent, ReconnectionMonitor };
|
|
69
|
+
//# sourceMappingURL=ReconnectionMonitor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReconnectionMonitor.mjs","sources":["../../../src/utils/ReconnectionMonitor.ts"],"sourcesContent":["import { RECONNECT_DELAY, RECONNECT_INTERVAL } from '../Providers/constants';\nexport var ReconnectEvent;\n(function (ReconnectEvent) {\n ReconnectEvent[\"START_RECONNECT\"] = \"START_RECONNECT\";\n ReconnectEvent[\"HALT_RECONNECT\"] = \"HALT_RECONNECT\";\n})(ReconnectEvent || (ReconnectEvent = {}));\n/**\n * Captures the reconnect event logic used to determine when to reconnect to PubSub providers.\n * Reconnnect attempts are delayed by 5 seconds to let the interface settle.\n * Attempting to reconnect only once creates unrecoverable states when the network state isn't\n * supported by the browser, so this keeps retrying every minute until halted.\n */\nexport class ReconnectionMonitor {\n constructor() {\n this.reconnectObservers = [];\n }\n /**\n * Add reconnect observer to the list of observers to alert on reconnect\n */\n addObserver(reconnectObserver) {\n this.reconnectObservers.push(reconnectObserver);\n }\n /**\n * Given a reconnect event, start the appropriate behavior\n */\n record(event) {\n if (event === ReconnectEvent.START_RECONNECT) {\n // If the reconnection hasn't been started\n if (this.reconnectSetTimeoutId === undefined &&\n this.reconnectIntervalId === undefined) {\n this.reconnectSetTimeoutId = setTimeout(() => {\n // Reconnect now\n this._triggerReconnect();\n // Retry reconnect every periodically until it works\n this.reconnectIntervalId = setInterval(() => {\n this._triggerReconnect();\n }, RECONNECT_INTERVAL);\n }, RECONNECT_DELAY);\n }\n }\n if (event === ReconnectEvent.HALT_RECONNECT) {\n if (this.reconnectIntervalId) {\n clearInterval(this.reconnectIntervalId);\n this.reconnectIntervalId = undefined;\n }\n if (this.reconnectSetTimeoutId) {\n clearTimeout(this.reconnectSetTimeoutId);\n this.reconnectSetTimeoutId = undefined;\n }\n }\n }\n /**\n * Complete all reconnect observers\n */\n close() {\n this.reconnectObservers.forEach(reconnectObserver => {\n reconnectObserver.complete?.();\n });\n }\n _triggerReconnect() {\n this.reconnectObservers.forEach(reconnectObserver => {\n reconnectObserver.next?.();\n });\n }\n}\n"],"names":[],"mappings":";;AACU,IAAC,eAAe;AAC1B,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;AAC1D,IAAI,cAAc,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AACxD,CAAC,EAAE,cAAc,KAAK,cAAc,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,mBAAmB,CAAC;AACjC,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;AACrC,KAAK;AACL;AACA;AACA;AACA,IAAI,WAAW,CAAC,iBAAiB,EAAE;AACnC,QAAQ,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACxD,KAAK;AACL;AACA;AACA;AACA,IAAI,MAAM,CAAC,KAAK,EAAE;AAClB,QAAQ,IAAI,KAAK,KAAK,cAAc,CAAC,eAAe,EAAE;AACtD;AACA,YAAY,IAAI,IAAI,CAAC,qBAAqB,KAAK,SAAS;AACxD,gBAAgB,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE;AACxD,gBAAgB,IAAI,CAAC,qBAAqB,GAAG,UAAU,CAAC,MAAM;AAC9D;AACA,oBAAoB,IAAI,CAAC,iBAAiB,EAAE,CAAC;AAC7C;AACA,oBAAoB,IAAI,CAAC,mBAAmB,GAAG,WAAW,CAAC,MAAM;AACjE,wBAAwB,IAAI,CAAC,iBAAiB,EAAE,CAAC;AACjD,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;AAC3C,iBAAiB,EAAE,eAAe,CAAC,CAAC;AACpC,aAAa;AACb,SAAS;AACT,QAAQ,IAAI,KAAK,KAAK,cAAc,CAAC,cAAc,EAAE;AACrD,YAAY,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC1C,gBAAgB,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AACxD,gBAAgB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;AACrD,aAAa;AACb,YAAY,IAAI,IAAI,CAAC,qBAAqB,EAAE;AAC5C,gBAAgB,YAAY,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACzD,gBAAgB,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;AACvD,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,iBAAiB,IAAI;AAC7D,YAAY,iBAAiB,CAAC,QAAQ,IAAI,CAAC;AAC3C,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,iBAAiB,IAAI;AAC7D,YAAY,iBAAiB,CAAC,IAAI,IAAI,CAAC;AACvC,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { AmplifyError } 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
|
-
import { AmplifyError, } from '@aws-amplify/core/internals/utils';
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
class APIError extends AmplifyError {
|
|
8
9
|
constructor(params) {
|
|
9
10
|
super(params);
|
|
10
11
|
// Hack for making the custom error class work when transpiled to es5
|
|
@@ -13,3 +14,6 @@ export class APIError extends AmplifyError {
|
|
|
13
14
|
Object.setPrototypeOf(this, APIError.prototype);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
17
|
+
|
|
18
|
+
export { APIError };
|
|
19
|
+
//# sourceMappingURL=APIError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIError.mjs","sources":["../../../../src/utils/errors/APIError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AmplifyError, } from '@aws-amplify/core/internals/utils';\n/**\n * @internal\n */\nexport class APIError extends AmplifyError {\n constructor(params) {\n super(params);\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = APIError;\n Object.setPrototypeOf(this, APIError.prototype);\n }\n}\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACO,MAAM,QAAQ,SAAS,YAAY,CAAC;AAC3C,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC,CAAC;AACtB;AACA;AACA,QAAQ,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;AACpC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxD,KAAK;AACL;;;;"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { APIError } from './APIError.mjs';
|
|
2
|
+
import { validationErrorMap } from './validation.mjs';
|
|
3
|
+
|
|
1
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { APIError } from './APIError';
|
|
4
|
-
import { validationErrorMap } from './validation';
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
function assertValidationError(assertion, name) {
|
|
9
10
|
const { message, recoverySuggestion } = validationErrorMap[name];
|
|
10
11
|
if (!assertion) {
|
|
11
12
|
throw new APIError({ name, message, recoverySuggestion });
|
|
12
13
|
}
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
export { assertValidationError };
|
|
17
|
+
//# sourceMappingURL=assertValidationError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertValidationError.mjs","sources":["../../../../src/utils/errors/assertValidationError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { APIError } from './APIError';\nimport { validationErrorMap } from './validation';\n/**\n * @internal\n */\nexport function assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = validationErrorMap[name];\n if (!assertion) {\n throw new APIError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACO,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AACvD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACrE,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAClE,KAAK;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
3
|
+
var APIValidationErrorCode;
|
|
4
4
|
(function (APIValidationErrorCode) {
|
|
5
5
|
APIValidationErrorCode["NoAuthSession"] = "NoAuthSession";
|
|
6
6
|
APIValidationErrorCode["NoRegion"] = "NoRegion";
|
|
7
7
|
APIValidationErrorCode["NoCustomEndpoint"] = "NoCustomEndpoint";
|
|
8
8
|
})(APIValidationErrorCode || (APIValidationErrorCode = {}));
|
|
9
|
-
|
|
9
|
+
const validationErrorMap = {
|
|
10
10
|
[APIValidationErrorCode.NoAuthSession]: {
|
|
11
11
|
message: 'Auth session should not be empty.',
|
|
12
12
|
},
|
|
@@ -21,3 +21,6 @@ export const validationErrorMap = {
|
|
|
21
21
|
message: 'Custom endpoint region is present without custom endpoint.',
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
export { APIValidationErrorCode, validationErrorMap };
|
|
26
|
+
//# sourceMappingURL=validation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.mjs","sources":["../../../../src/utils/errors/validation.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var APIValidationErrorCode;\n(function (APIValidationErrorCode) {\n APIValidationErrorCode[\"NoAuthSession\"] = \"NoAuthSession\";\n APIValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n APIValidationErrorCode[\"NoCustomEndpoint\"] = \"NoCustomEndpoint\";\n})(APIValidationErrorCode || (APIValidationErrorCode = {}));\nexport const validationErrorMap = {\n [APIValidationErrorCode.NoAuthSession]: {\n message: 'Auth session should not be empty.',\n },\n // TODO: re-enable when working in all test environments:\n // [APIValidationErrorCode.NoEndpoint]: {\n // \tmessage: 'Missing endpoint',\n // },\n [APIValidationErrorCode.NoRegion]: {\n message: 'Missing region.',\n },\n [APIValidationErrorCode.NoCustomEndpoint]: {\n message: 'Custom endpoint region is present without custom endpoint.',\n },\n};\n"],"names":[],"mappings":"AAAA;AACA;AACU,IAAC,uBAAuB;AAClC,CAAC,UAAU,sBAAsB,EAAE;AACnC,IAAI,sBAAsB,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;AAC9D,IAAI,sBAAsB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACpD,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AACpE,CAAC,EAAE,sBAAsB,KAAK,sBAAsB,GAAG,EAAE,CAAC,CAAC,CAAC;AAChD,MAAC,kBAAkB,GAAG;AAClC,IAAI,CAAC,sBAAsB,CAAC,aAAa,GAAG;AAC5C,QAAQ,OAAO,EAAE,mCAAmC;AACpD,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,CAAC,sBAAsB,CAAC,QAAQ,GAAG;AACvC,QAAQ,OAAO,EAAE,iBAAiB;AAClC,KAAK;AACL,IAAI,CAAC,sBAAsB,CAAC,gBAAgB,GAAG;AAC/C,QAAQ,OAAO,EAAE,4DAA4D;AAC7E,KAAK;AACL;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -6,7 +6,7 @@ export declare const resolveConfig: (amplify: AmplifyClassV6) => {
|
|
|
6
6
|
apiKey: string | undefined;
|
|
7
7
|
customEndpoint: string | undefined;
|
|
8
8
|
customEndpointRegion: string | undefined;
|
|
9
|
-
defaultAuthMode: "
|
|
9
|
+
defaultAuthMode: import("@aws-amplify/core/internals/utils").GraphQLAuthMode | undefined;
|
|
10
10
|
endpoint: string | undefined;
|
|
11
11
|
region: string | undefined;
|
|
12
12
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import '@aws-amplify/core/internals/utils';
|
|
2
|
+
import { assertValidationError } from './errors/assertValidationError.mjs';
|
|
3
|
+
import { APIValidationErrorCode } from './errors/validation.mjs';
|
|
4
|
+
|
|
1
5
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
6
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { APIValidationErrorCode, assertValidationError } from './errors';
|
|
4
7
|
/**
|
|
5
8
|
* @internal
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
const resolveConfig = (amplify) => {
|
|
8
11
|
const { apiKey, customEndpoint, customEndpointRegion, defaultAuthMode, endpoint, region, } = amplify.getConfig().API?.GraphQL ?? {};
|
|
9
12
|
// TODO: re-enable when working in all test environments:
|
|
10
13
|
// assertValidationError(!!endpoint, APIValidationErrorCode.NoEndpoint);
|
|
@@ -18,3 +21,6 @@ export const resolveConfig = (amplify) => {
|
|
|
18
21
|
region,
|
|
19
22
|
};
|
|
20
23
|
};
|
|
24
|
+
|
|
25
|
+
export { resolveConfig };
|
|
26
|
+
//# sourceMappingURL=resolveConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveConfig.mjs","sources":["../../../src/utils/resolveConfig.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { APIValidationErrorCode, assertValidationError } from './errors';\n/**\n * @internal\n */\nexport const resolveConfig = (amplify) => {\n const { apiKey, customEndpoint, customEndpointRegion, defaultAuthMode, endpoint, region, } = amplify.getConfig().API?.GraphQL ?? {};\n // TODO: re-enable when working in all test environments:\n // assertValidationError(!!endpoint, APIValidationErrorCode.NoEndpoint);\n assertValidationError(!(!customEndpoint && customEndpointRegion), APIValidationErrorCode.NoCustomEndpoint);\n return {\n apiKey,\n customEndpoint,\n customEndpointRegion,\n defaultAuthMode,\n endpoint,\n region,\n };\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AAEA;AACA;AACA;AACY,MAAC,aAAa,GAAG,CAAC,OAAO,KAAK;AAC1C,IAAI,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,IAAI,EAAE,CAAC;AACxI;AACA;AACA,IAAI,qBAAqB,CAAC,EAAE,CAAC,cAAc,IAAI,oBAAoB,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;AAC/G,IAAI,OAAO;AACX,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,QAAQ,oBAAoB;AAC5B,QAAQ,eAAe;AACvB,QAAQ,QAAQ;AAChB,QAAQ,MAAM;AACd,KAAK,CAAC;AACN;;;;"}
|
|
@@ -5,7 +5,7 @@ import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
|
5
5
|
export declare const resolveLibraryOptions: (amplify: AmplifyClassV6) => {
|
|
6
6
|
headers: ((options: {
|
|
7
7
|
query: string;
|
|
8
|
-
variables?: Record<string, import("@aws-amplify/core/
|
|
9
|
-
}) => Promise<
|
|
8
|
+
variables?: Record<string, import("@aws-amplify/core/internals/utils").DocumentType> | undefined;
|
|
9
|
+
}) => Promise<import("@aws-amplify/core/internals/aws-client-utils").Headers>) | undefined;
|
|
10
10
|
withCredentials: boolean | undefined;
|
|
11
11
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
3
|
/**
|
|
6
4
|
* @internal
|
|
7
5
|
*/
|
|
8
|
-
|
|
6
|
+
const resolveLibraryOptions = (amplify) => {
|
|
9
7
|
const headers = amplify.libraryOptions?.API?.GraphQL?.headers;
|
|
10
8
|
const withCredentials = amplify.libraryOptions?.API?.GraphQL?.withCredentials;
|
|
11
9
|
return { headers, withCredentials };
|
|
12
10
|
};
|
|
11
|
+
|
|
12
|
+
export { resolveLibraryOptions };
|
|
13
|
+
//# sourceMappingURL=resolveLibraryOptions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveLibraryOptions.mjs","sources":["../../../src/utils/resolveLibraryOptions.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nexport const resolveLibraryOptions = (amplify) => {\n const headers = amplify.libraryOptions?.API?.GraphQL?.headers;\n const withCredentials = amplify.libraryOptions?.API?.GraphQL?.withCredentials;\n return { headers, withCredentials };\n};\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,qBAAqB,GAAG,CAAC,OAAO,KAAK;AAClD,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;AAClE,IAAI,MAAM,eAAe,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC;AAClF,IAAI,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AACxC;;;;"}
|
package/internals/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql/internals",
|
|
3
|
-
"types": "../
|
|
4
|
-
"main": "../
|
|
5
|
-
"module": "../
|
|
6
|
-
"react-native": "../
|
|
3
|
+
"types": "../dist/esm/internals/index.d.ts",
|
|
4
|
+
"main": "../dist/cjs/internals/index.js",
|
|
5
|
+
"module": "../dist/esm/internals/index.mjs",
|
|
6
|
+
"react-native": "../src/internals/index.ts",
|
|
7
7
|
"sideEffects": false
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql",
|
|
3
|
-
"version": "4.0.1
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Api-graphql category of aws-amplify",
|
|
5
|
-
"main": "./
|
|
6
|
-
"module": "./
|
|
7
|
-
"typings": "./
|
|
8
|
-
"react-native":
|
|
9
|
-
"./lib/index": "./lib-esm/index.js"
|
|
10
|
-
},
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"typings": "./dist/esm/index.d.ts",
|
|
8
|
+
"react-native": "./src/index.ts",
|
|
11
9
|
"sideEffects": [
|
|
12
|
-
"./
|
|
13
|
-
"./
|
|
10
|
+
"./dist/cjs/GraphQLAPI.js",
|
|
11
|
+
"./dist/esm/GraphQLAPI.mjs"
|
|
14
12
|
],
|
|
15
13
|
"publishConfig": {
|
|
16
14
|
"access": "public"
|
|
@@ -18,18 +16,40 @@
|
|
|
18
16
|
"scripts": {
|
|
19
17
|
"test": "npm run lint && jest -w 1 --coverage",
|
|
20
18
|
"test:watch": "tslint 'src/**/*.ts' && jest -w 1 --watch",
|
|
21
|
-
"build-with-test": "npm
|
|
22
|
-
"build:
|
|
23
|
-
"build:esm": "
|
|
24
|
-
"build:cjs:watch": "rimraf
|
|
25
|
-
"build:esm:watch": "rimraf
|
|
26
|
-
"build": "npm run clean && npm run build:esm && npm run build:
|
|
27
|
-
"clean": "npm run clean:size && rimraf lib-esm
|
|
19
|
+
"build-with-test": "npm test && npm build",
|
|
20
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
21
|
+
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
22
|
+
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
|
|
23
|
+
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
|
|
24
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
25
|
+
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
28
26
|
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
29
27
|
"format": "echo \"Not implemented\"",
|
|
30
28
|
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
|
|
31
29
|
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 70.0"
|
|
32
30
|
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/esm/index.d.ts",
|
|
34
|
+
"import": "./dist/esm/index.mjs",
|
|
35
|
+
"require": "./dist/cjs/index.js",
|
|
36
|
+
"react-native": "./src/index.ts"
|
|
37
|
+
},
|
|
38
|
+
"./internals": {
|
|
39
|
+
"types": "./dist/esm/internals/index.d.ts",
|
|
40
|
+
"import": "./dist/esm/internals/index.mjs",
|
|
41
|
+
"require": "./dist/cjs/internals/index.js",
|
|
42
|
+
"react-native": "./src/internals/index.ts"
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"typesVersions": {
|
|
47
|
+
">=4.2": {
|
|
48
|
+
"internals": [
|
|
49
|
+
"./dist/esm/internals/index.d.ts"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
33
53
|
"repository": {
|
|
34
54
|
"type": "git",
|
|
35
55
|
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
@@ -40,16 +60,22 @@
|
|
|
40
60
|
"url": "https://github.com/aws/aws-amplify/issues"
|
|
41
61
|
},
|
|
42
62
|
"homepage": "https://aws-amplify.github.io/",
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@aws-amplify/core": "^6.0.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@aws-amplify/core": "6.0.1",
|
|
68
|
+
"@rollup/plugin-typescript": "11.1.5",
|
|
69
|
+
"rollup": "3.29.4"
|
|
70
|
+
},
|
|
43
71
|
"files": [
|
|
44
|
-
"
|
|
45
|
-
"
|
|
72
|
+
"dist/cjs",
|
|
73
|
+
"dist/esm",
|
|
46
74
|
"src",
|
|
47
75
|
"internals"
|
|
48
76
|
],
|
|
49
77
|
"dependencies": {
|
|
50
|
-
"@aws-amplify/api-rest": "4.0.1
|
|
51
|
-
"@aws-amplify/auth": "6.0.1-unstable.cfbde4c.0+cfbde4c",
|
|
52
|
-
"@aws-amplify/core": "6.0.1-unstable.cfbde4c.0+cfbde4c",
|
|
78
|
+
"@aws-amplify/api-rest": "4.0.1",
|
|
53
79
|
"@aws-sdk/types": "3.387.0",
|
|
54
80
|
"graphql": "15.8.0",
|
|
55
81
|
"rxjs": "^7.8.1",
|
|
@@ -58,7 +84,7 @@
|
|
|
58
84
|
"size-limit": [
|
|
59
85
|
{
|
|
60
86
|
"name": "API (GraphQL client)",
|
|
61
|
-
"path": "./
|
|
87
|
+
"path": "./dist/esm/index.mjs",
|
|
62
88
|
"import": "{ Amplify, GraphQLAPI }",
|
|
63
89
|
"limit": "91.7 kB"
|
|
64
90
|
}
|
|
@@ -115,10 +141,8 @@
|
|
|
115
141
|
"coveragePathIgnorePatterns": [
|
|
116
142
|
"<rootDir>/node_modules/",
|
|
117
143
|
"<rootDir>/dist",
|
|
118
|
-
"<rootDir>/lib",
|
|
119
|
-
"<rootDir>/lib-esm",
|
|
120
144
|
"<rootDir>/__tests__"
|
|
121
145
|
]
|
|
122
146
|
},
|
|
123
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "f1408db3f570c4a18ada40cecbe7e68a0b31f1fe"
|
|
124
148
|
}
|
package/src/GraphQLAPI.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
4
4
|
import { Category, ApiAction } from '@aws-amplify/core/internals/utils';
|
|
5
5
|
import { GraphQLOptions, GraphQLResult } from './types';
|
|
6
|
-
import { InternalGraphQLAPIClass } from './internals';
|
|
6
|
+
import { InternalGraphQLAPIClass } from './internals/InternalGraphQLAPI';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
8
|
|
|
9
9
|
export const graphqlOperation = (
|
package/lib/GraphQLAPI.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
2
|
-
import { GraphQLOptions, GraphQLResult } from './types';
|
|
3
|
-
import { InternalGraphQLAPIClass } from './internals';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string | undefined) => {
|
|
6
|
-
query: any;
|
|
7
|
-
variables: {};
|
|
8
|
-
authToken: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Export Cloud Logic APIs
|
|
12
|
-
*/
|
|
13
|
-
export declare class GraphQLAPIClass extends InternalGraphQLAPIClass {
|
|
14
|
-
getModuleName(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Executes a GraphQL operation
|
|
17
|
-
*
|
|
18
|
-
* @param options - GraphQL Options
|
|
19
|
-
* @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config
|
|
20
|
-
* @returns An Observable if the query is a subscription query, else a promise of the graphql result.
|
|
21
|
-
*/
|
|
22
|
-
graphql<T = any>(amplify: AmplifyClassV6 | (() => Promise<AmplifyClassV6>), options: GraphQLOptions, additionalHeaders?: {
|
|
23
|
-
[key: string]: string;
|
|
24
|
-
}): Observable<GraphQLResult<T>> | Promise<GraphQLResult<T>>;
|
|
25
|
-
/**
|
|
26
|
-
* Checks to see if an error thrown is from an api request cancellation
|
|
27
|
-
* @param error - Any error
|
|
28
|
-
* @returns A boolean indicating if the error was from an api request cancellation
|
|
29
|
-
*/
|
|
30
|
-
isCancelError(error: any): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Cancels an inflight request. Only applicable for graphql queries and mutations
|
|
33
|
-
* @param {any} request - request to cancel
|
|
34
|
-
* @returns A boolean indicating if the request was cancelled
|
|
35
|
-
*/
|
|
36
|
-
cancel(request: Promise<any>, message?: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare const GraphQLAPI: GraphQLAPIClass;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';
|
|
2
|
-
export declare const MAX_DELAY_MS = 5000;
|
|
3
|
-
export declare const NON_RETRYABLE_CODES: number[];
|
|
4
|
-
export declare const CONNECTION_STATE_CHANGE = "ConnectionStateChange";
|
|
5
|
-
export declare enum MESSAGE_TYPES {
|
|
6
|
-
/**
|
|
7
|
-
* Client -> Server message.
|
|
8
|
-
* This message type is the first message after handshake and this will initialize AWS AppSync RealTime communication
|
|
9
|
-
*/
|
|
10
|
-
GQL_CONNECTION_INIT = "connection_init",
|
|
11
|
-
/**
|
|
12
|
-
* Server -> Client message
|
|
13
|
-
* This message type is in case there is an issue with AWS AppSync RealTime when establishing connection
|
|
14
|
-
*/
|
|
15
|
-
GQL_CONNECTION_ERROR = "connection_error",
|
|
16
|
-
/**
|
|
17
|
-
* Server -> Client message.
|
|
18
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_CONNECTION_INIT message
|
|
19
|
-
*/
|
|
20
|
-
GQL_CONNECTION_ACK = "connection_ack",
|
|
21
|
-
/**
|
|
22
|
-
* Client -> Server message.
|
|
23
|
-
* This message type is for register subscriptions with AWS AppSync RealTime
|
|
24
|
-
*/
|
|
25
|
-
GQL_START = "start",
|
|
26
|
-
/**
|
|
27
|
-
* Server -> Client message.
|
|
28
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_START message
|
|
29
|
-
*/
|
|
30
|
-
GQL_START_ACK = "start_ack",
|
|
31
|
-
/**
|
|
32
|
-
* Server -> Client message.
|
|
33
|
-
* This message type is for subscription message from AWS AppSync RealTime
|
|
34
|
-
*/
|
|
35
|
-
GQL_DATA = "data",
|
|
36
|
-
/**
|
|
37
|
-
* Server -> Client message.
|
|
38
|
-
* This message type helps the client to know is still receiving messages from AWS AppSync RealTime
|
|
39
|
-
*/
|
|
40
|
-
GQL_CONNECTION_KEEP_ALIVE = "ka",
|
|
41
|
-
/**
|
|
42
|
-
* Client -> Server message.
|
|
43
|
-
* This message type is for unregister subscriptions with AWS AppSync RealTime
|
|
44
|
-
*/
|
|
45
|
-
GQL_STOP = "stop",
|
|
46
|
-
/**
|
|
47
|
-
* Server -> Client message.
|
|
48
|
-
* This message type is for the ack response from AWS AppSync RealTime for GQL_STOP message
|
|
49
|
-
*/
|
|
50
|
-
GQL_COMPLETE = "complete",
|
|
51
|
-
/**
|
|
52
|
-
* Server -> Client message.
|
|
53
|
-
* This message type is for sending error messages from AWS AppSync RealTime to the client
|
|
54
|
-
*/
|
|
55
|
-
GQL_ERROR = "error"
|
|
56
|
-
}
|
|
57
|
-
export declare enum SUBSCRIPTION_STATUS {
|
|
58
|
-
PENDING = 0,
|
|
59
|
-
CONNECTED = 1,
|
|
60
|
-
FAILED = 2
|
|
61
|
-
}
|
|
62
|
-
export declare enum SOCKET_STATUS {
|
|
63
|
-
CLOSED = 0,
|
|
64
|
-
READY = 1,
|
|
65
|
-
CONNECTING = 2
|
|
66
|
-
}
|
|
67
|
-
export declare const AWS_APPSYNC_REALTIME_HEADERS: {
|
|
68
|
-
accept: string;
|
|
69
|
-
'content-encoding': string;
|
|
70
|
-
'content-type': string;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
74
|
-
*/
|
|
75
|
-
export declare const CONNECTION_INIT_TIMEOUT = 15000;
|
|
76
|
-
/**
|
|
77
|
-
* Time in milleseconds to wait for GQL_START_ACK message
|
|
78
|
-
*/
|
|
79
|
-
export declare const START_ACK_TIMEOUT = 15000;
|
|
80
|
-
/**
|
|
81
|
-
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
82
|
-
*/
|
|
83
|
-
export declare const DEFAULT_KEEP_ALIVE_TIMEOUT: number;
|
|
84
|
-
/**
|
|
85
|
-
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
86
|
-
*/
|
|
87
|
-
export declare const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT: number;
|
|
88
|
-
/**
|
|
89
|
-
* Default delay time in milleseconds between when reconnect is triggered vs when it is attempted
|
|
90
|
-
*/
|
|
91
|
-
export declare const RECONNECT_DELAY: number;
|
|
92
|
-
/**
|
|
93
|
-
* Default interval time in milleseconds between when reconnect is re-attempted
|
|
94
|
-
*/
|
|
95
|
-
export declare const RECONNECT_INTERVAL: number;
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
var GraphQLAPI_1 = require("./GraphQLAPI");
|
|
7
|
-
exports.GraphQLAPI = GraphQLAPI_1.GraphQLAPI;
|
|
8
|
-
exports.GraphQLAPIClass = GraphQLAPI_1.GraphQLAPIClass;
|
|
9
|
-
exports.graphqlOperation = GraphQLAPI_1.graphqlOperation;
|
|
10
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
11
|
-
var constants_1 = require("./Providers/constants");
|
|
12
|
-
exports.CONNECTION_STATE_CHANGE = constants_1.CONNECTION_STATE_CHANGE;
|
package/lib/internals/index.d.ts
DELETED
package/lib/internals/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
var InternalGraphQLAPI_1 = require("./InternalGraphQLAPI");
|
|
6
|
-
exports.InternalGraphQLAPI = InternalGraphQLAPI_1.InternalGraphQLAPI;
|
|
7
|
-
exports.InternalGraphQLAPIClass = InternalGraphQLAPI_1.InternalGraphQLAPIClass;
|
|
8
|
-
var v6_1 = require("./v6");
|
|
9
|
-
exports.graphql = v6_1.graphql;
|
|
10
|
-
exports.cancel = v6_1.cancel;
|
|
11
|
-
exports.isCancelError = v6_1.isCancelError;
|