@aws-amplify/api-graphql 4.0.1-unstable.cfbde4c.0 → 4.0.2-unstable.ff4e8d7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{lib → 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 +146 -122
- 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,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;
|
package/lib/internals/v6.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { V6Client, GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Invokes graphql operations against a graphql service, providing correct input and
|
|
4
|
-
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
5
|
-
* are used *or* correct typing is provided via the type argument.
|
|
6
|
-
*
|
|
7
|
-
* Amplify-generated "branded" graphql queries will look similar to this:
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* //
|
|
11
|
-
* // |-- branding
|
|
12
|
-
* // v
|
|
13
|
-
* export const getModel = `...` as GeneratedQuery<
|
|
14
|
-
* GetModelQueryVariables,
|
|
15
|
-
* GetModelQuery
|
|
16
|
-
* >;
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* If this branding is not in your generated graphql, update to a newer version of
|
|
20
|
-
* CLI/codegen and regenerate your graphql using `amplify codegen`.
|
|
21
|
-
*
|
|
22
|
-
* ## Using Amplify-generated graphql
|
|
23
|
-
*
|
|
24
|
-
* ```ts
|
|
25
|
-
* import * as queries from './graphql/queries';
|
|
26
|
-
*
|
|
27
|
-
* //
|
|
28
|
-
* // |-- correctly typed graphql response containing a Widget
|
|
29
|
-
* // v
|
|
30
|
-
* const queryResult = await graphql({
|
|
31
|
-
* query: queries.getWidget,
|
|
32
|
-
* variables: {
|
|
33
|
-
* id: "abc", // <-- type hinted/enforced
|
|
34
|
-
* },
|
|
35
|
-
* });
|
|
36
|
-
*
|
|
37
|
-
* //
|
|
38
|
-
* // |-- a correctly typed Widget
|
|
39
|
-
* // v
|
|
40
|
-
* const fetchedWidget = queryResult.data?.getWidget!;
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* ## Custom input + result types
|
|
44
|
-
*
|
|
45
|
-
* To provide input types (`variables`) and result types:
|
|
46
|
-
*
|
|
47
|
-
* ```ts
|
|
48
|
-
* type GetById_NameOnly = {
|
|
49
|
-
* variables: {
|
|
50
|
-
* id: string
|
|
51
|
-
* },
|
|
52
|
-
* result: Promise<{
|
|
53
|
-
* data: { getWidget: { name: string } }
|
|
54
|
-
* }>
|
|
55
|
-
* }
|
|
56
|
-
*
|
|
57
|
-
* //
|
|
58
|
-
* // |-- type is GetById_NameOnly["result"]
|
|
59
|
-
* // v
|
|
60
|
-
* const result = graphql<GetById_NameOnly>({
|
|
61
|
-
* query: "...",
|
|
62
|
-
* variables: { id: "abc" } // <-- type of GetById_NameOnly["variables"]
|
|
63
|
-
* });
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* ## Custom result type only
|
|
67
|
-
*
|
|
68
|
-
* To specify result types only, use a type that is *not* in the `{variables, result}` shape:
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* type MyResultType = Promise<{
|
|
72
|
-
* data: {
|
|
73
|
-
* getWidget: { name: string }
|
|
74
|
-
* }
|
|
75
|
-
* }>
|
|
76
|
-
*
|
|
77
|
-
* //
|
|
78
|
-
* // |-- type is MyResultType
|
|
79
|
-
* // v
|
|
80
|
-
* const result = graphql<MyResultType>({query: "..."});
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @param options
|
|
84
|
-
* @param additionalHeaders
|
|
85
|
-
*/
|
|
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
|
-
[key: string]: string;
|
|
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;
|
|
101
|
-
export { GraphQLOptionsV6, GraphQLResponseV6 };
|