@aws-amplify/api-graphql 3.4.12-api-v6-models.b3abc9b.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/lib/GraphQLAPI.d.ts +17 -4
- package/lib/GraphQLAPI.js +33 -27
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.d.ts +64 -0
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +690 -0
- package/lib/Providers/constants.d.ts +95 -0
- package/lib/Providers/constants.js +103 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +6 -10
- package/lib/internals/InternalGraphQLAPI.d.ts +11 -34
- package/lib/internals/InternalGraphQLAPI.js +219 -345
- package/lib/internals/index.d.ts +1 -1
- package/lib/internals/index.js +2 -1
- package/lib/internals/v6.d.ts +14 -2
- package/lib/internals/v6.js +21 -3
- package/lib/tsconfig.tsbuildinfo +6813 -0
- package/lib/types/PubSub.d.ts +27 -0
- package/lib/types/PubSub.js +46 -0
- package/lib/types/index.d.ts +119 -12
- package/lib/types/index.js +4 -3
- package/lib/utils/ConnectionStateMonitor.d.ts +41 -0
- package/lib/utils/ConnectionStateMonitor.js +131 -0
- package/lib/utils/ReachabilityMonitor/index.d.ts +1 -0
- package/lib/utils/ReachabilityMonitor/index.js +6 -0
- package/lib/utils/ReachabilityMonitor/index.native.d.ts +1 -0
- package/lib/utils/ReachabilityMonitor/index.native.js +8 -0
- package/lib/utils/ReconnectionMonitor.d.ts +29 -0
- package/lib/utils/ReconnectionMonitor.js +68 -0
- package/lib/utils/errors/APIError.d.ts +7 -0
- package/lib/utils/errors/APIError.js +18 -0
- package/lib/utils/errors/assertValidationError.d.ts +5 -0
- package/lib/utils/errors/assertValidationError.js +16 -0
- package/lib/utils/errors/index.d.ts +3 -0
- package/lib/utils/errors/index.js +11 -0
- package/lib/utils/errors/validation.d.ts +7 -0
- package/lib/utils/errors/validation.js +25 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +8 -0
- package/lib/utils/resolveConfig.d.ts +12 -0
- package/lib/utils/resolveConfig.js +22 -0
- package/lib/utils/resolveLibraryOptions.d.ts +11 -0
- package/lib/utils/resolveLibraryOptions.js +12 -0
- package/lib-esm/GraphQLAPI.d.ts +17 -4
- package/lib-esm/GraphQLAPI.js +33 -28
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +64 -0
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +687 -0
- package/lib-esm/Providers/constants.d.ts +95 -0
- package/lib-esm/Providers/constants.js +100 -0
- package/lib-esm/index.d.ts +1 -3
- package/lib-esm/index.js +1 -4
- package/lib-esm/internals/InternalGraphQLAPI.d.ts +11 -34
- package/lib-esm/internals/InternalGraphQLAPI.js +218 -345
- package/lib-esm/internals/index.d.ts +1 -1
- package/lib-esm/internals/index.js +1 -2
- package/lib-esm/internals/v6.d.ts +14 -2
- package/lib-esm/internals/v6.js +18 -2
- package/lib-esm/tsconfig.tsbuildinfo +6813 -0
- package/lib-esm/types/PubSub.d.ts +27 -0
- package/lib-esm/types/PubSub.js +44 -0
- package/lib-esm/types/index.d.ts +119 -12
- package/lib-esm/types/index.js +2 -3
- package/lib-esm/utils/ConnectionStateMonitor.d.ts +41 -0
- package/lib-esm/utils/ConnectionStateMonitor.js +128 -0
- package/lib-esm/utils/ReachabilityMonitor/index.d.ts +1 -0
- package/lib-esm/utils/ReachabilityMonitor/index.js +4 -0
- package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +1 -0
- package/lib-esm/utils/ReachabilityMonitor/index.native.js +5 -0
- package/lib-esm/utils/ReconnectionMonitor.d.ts +29 -0
- package/lib-esm/utils/ReconnectionMonitor.js +65 -0
- package/lib-esm/utils/errors/APIError.d.ts +7 -0
- package/lib-esm/utils/errors/APIError.js +15 -0
- package/lib-esm/utils/errors/assertValidationError.d.ts +5 -0
- package/lib-esm/utils/errors/assertValidationError.js +13 -0
- package/lib-esm/utils/errors/index.d.ts +3 -0
- package/lib-esm/utils/errors/index.js +5 -0
- package/lib-esm/utils/errors/validation.d.ts +7 -0
- package/lib-esm/utils/errors/validation.js +23 -0
- package/lib-esm/utils/index.d.ts +2 -0
- package/lib-esm/utils/index.js +4 -0
- package/lib-esm/utils/resolveConfig.d.ts +12 -0
- package/lib-esm/utils/resolveConfig.js +20 -0
- package/lib-esm/utils/resolveLibraryOptions.d.ts +11 -0
- package/lib-esm/utils/resolveLibraryOptions.js +10 -0
- package/package.json +122 -118
- package/src/GraphQLAPI.ts +26 -4
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +998 -0
- package/src/Providers/constants.ts +110 -0
- package/src/index.ts +2 -3
- package/src/internals/InternalGraphQLAPI.ts +181 -218
- package/src/internals/index.ts +1 -1
- package/src/internals/v6.ts +34 -2
- package/src/types/PubSub.ts +56 -0
- package/src/types/index.ts +175 -15
- package/src/utils/ConnectionStateMonitor.ts +199 -0
- package/src/utils/ReachabilityMonitor/index.native.ts +7 -0
- package/src/utils/ReachabilityMonitor/index.ts +4 -0
- package/src/utils/ReconnectionMonitor.ts +76 -0
- package/src/utils/errors/APIError.ts +21 -0
- package/src/utils/errors/assertValidationError.ts +19 -0
- package/src/utils/errors/index.ts +6 -0
- package/src/utils/errors/validation.ts +26 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/resolveConfig.ts +35 -0
- package/src/utils/resolveLibraryOptions.ts +13 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/GraphQLAPI.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/internals/InternalGraphQLAPI.js.map +0 -1
- package/lib/internals/index.js.map +0 -1
- package/lib/internals/v6.js.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/GraphQLAPI.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/internals/InternalGraphQLAPI.js.map +0 -1
- package/lib-esm/internals/index.js.map +0 -1
- package/lib-esm/internals/v6.js.map +0 -1
- package/lib-esm/types/index.js.map +0 -1
package/lib/internals/v6.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
|
|
1
|
+
import { V6Client, GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Invokes graphql operations against a graphql service, providing correct input and
|
|
4
4
|
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
@@ -83,7 +83,19 @@ import { GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
|
|
|
83
83
|
* @param options
|
|
84
84
|
* @param additionalHeaders
|
|
85
85
|
*/
|
|
86
|
-
export declare function graphql<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: {
|
|
86
|
+
export declare function graphql<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(this: V6Client, options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: {
|
|
87
87
|
[key: string]: string;
|
|
88
88
|
}): GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
89
|
+
/**
|
|
90
|
+
* Cancels an inflight request. Only applicable for graphql queries and mutations
|
|
91
|
+
* @param {any} request - request to cancel
|
|
92
|
+
* @returns - A boolean indicating if the request was cancelled
|
|
93
|
+
*/
|
|
94
|
+
export declare function cancel(this: V6Client, promise: Promise<any>, message?: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Checks to see if an error thrown is from an api request cancellation
|
|
97
|
+
* @param {any} error - Any error
|
|
98
|
+
* @returns - A boolean indicating if the error was from an api request cancellation
|
|
99
|
+
*/
|
|
100
|
+
export declare function isCancelError(this: V6Client, error: any): boolean;
|
|
89
101
|
export { GraphQLOptionsV6, GraphQLResponseV6 };
|
package/lib/internals/v6.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
|
|
5
|
+
const GraphQLAPI_1 = require("../GraphQLAPI");
|
|
6
|
+
const types_1 = require("../types");
|
|
6
7
|
/**
|
|
7
8
|
* Invokes graphql operations against a graphql service, providing correct input and
|
|
8
9
|
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
@@ -93,8 +94,25 @@ function graphql(options, additionalHeaders) {
|
|
|
93
94
|
* Neither of these can actually be validated at runtime. Hence, we don't perform
|
|
94
95
|
* any validation or type-guarding here.
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
const result = GraphQLAPI_1.GraphQLAPI.graphql(this[types_1.__amplify], options, additionalHeaders);
|
|
97
98
|
return result;
|
|
98
99
|
}
|
|
99
100
|
exports.graphql = graphql;
|
|
100
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Cancels an inflight request. Only applicable for graphql queries and mutations
|
|
103
|
+
* @param {any} request - request to cancel
|
|
104
|
+
* @returns - A boolean indicating if the request was cancelled
|
|
105
|
+
*/
|
|
106
|
+
function cancel(promise, message) {
|
|
107
|
+
return GraphQLAPI_1.GraphQLAPI.cancel(promise, message);
|
|
108
|
+
}
|
|
109
|
+
exports.cancel = cancel;
|
|
110
|
+
/**
|
|
111
|
+
* Checks to see if an error thrown is from an api request cancellation
|
|
112
|
+
* @param {any} error - Any error
|
|
113
|
+
* @returns - A boolean indicating if the error was from an api request cancellation
|
|
114
|
+
*/
|
|
115
|
+
function isCancelError(error) {
|
|
116
|
+
return GraphQLAPI_1.GraphQLAPI.isCancelError(error);
|
|
117
|
+
}
|
|
118
|
+
exports.isCancelError = isCancelError;
|