@aws-amplify/api-graphql 4.0.1-api-v6-models.9351bcf.0 → 4.0.1-api-v6-models.891fe0d.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/internals/server/package.json +8 -0
- package/lib/GraphQLAPI.d.ts +1 -1
- package/lib/GraphQLAPI.js +23 -28
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +467 -582
- package/lib/index.js +1 -1
- package/lib/internals/APIClient.d.ts +16 -1
- package/lib/internals/APIClient.js +232 -206
- package/lib/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib/internals/InternalGraphQLAPI.js +205 -247
- package/lib/internals/generateClient.js +14 -13
- package/lib/internals/generateModelsProperty.js +19 -312
- package/lib/internals/operations/get.d.ts +2 -0
- package/lib/internals/operations/get.js +59 -0
- package/lib/internals/operations/list.d.ts +2 -0
- package/lib/internals/operations/list.js +71 -0
- package/lib/internals/operations/observeQuery.d.ts +2 -0
- package/lib/internals/operations/observeQuery.js +119 -0
- package/lib/internals/operations/subscription.d.ts +1 -0
- package/lib/internals/operations/subscription.js +27 -0
- package/lib/internals/server/generateClient.d.ts +11 -0
- package/lib/internals/server/generateClient.js +30 -0
- package/lib/internals/server/generateModelsProperty.d.ts +3 -0
- package/lib/internals/server/generateModelsProperty.js +45 -0
- package/lib/internals/server/index.d.ts +1 -0
- package/lib/internals/server/index.js +7 -0
- package/lib/internals/v6.js +3 -3
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/index.d.ts +36 -4
- package/lib/utils/ConnectionStateMonitor.js +51 -64
- package/lib/utils/ReachabilityMonitor/index.js +2 -2
- package/lib/utils/ReachabilityMonitor/index.native.js +4 -6
- package/lib/utils/ReconnectionMonitor.js +20 -24
- package/lib/utils/errors/APIError.js +7 -11
- package/lib/utils/errors/assertValidationError.js +4 -4
- package/lib/utils/errors/validation.js +5 -6
- package/lib/utils/findIndexByFields.js +4 -9
- package/lib/utils/resolveConfig.js +9 -10
- package/lib/utils/resolveLibraryOptions.js +4 -5
- package/lib/utils/resolveOwnerFields.js +10 -33
- package/lib/utils/resolvePKFields.js +2 -3
- package/lib-esm/GraphQLAPI.d.ts +1 -1
- package/lib-esm/GraphQLAPI.js +23 -29
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +459 -575
- package/lib-esm/Providers/constants.js +10 -10
- package/lib-esm/internals/APIClient.d.ts +16 -1
- package/lib-esm/internals/APIClient.js +230 -205
- package/lib-esm/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib-esm/internals/InternalGraphQLAPI.js +201 -244
- package/lib-esm/internals/generateClient.js +11 -10
- package/lib-esm/internals/generateModelsProperty.js +19 -312
- package/lib-esm/internals/operations/get.d.ts +2 -0
- package/lib-esm/internals/operations/get.js +55 -0
- package/lib-esm/internals/operations/list.d.ts +2 -0
- package/lib-esm/internals/operations/list.js +67 -0
- package/lib-esm/internals/operations/observeQuery.d.ts +2 -0
- package/lib-esm/internals/operations/observeQuery.js +115 -0
- package/lib-esm/internals/operations/subscription.d.ts +1 -0
- package/lib-esm/internals/operations/subscription.js +23 -0
- package/lib-esm/internals/server/generateClient.d.ts +11 -0
- package/lib-esm/internals/server/generateClient.js +26 -0
- package/lib-esm/internals/server/generateModelsProperty.d.ts +3 -0
- package/lib-esm/internals/server/generateModelsProperty.js +41 -0
- package/lib-esm/internals/server/index.d.ts +1 -0
- package/lib-esm/internals/server/index.js +3 -0
- package/lib-esm/internals/v6.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/index.d.ts +36 -4
- package/lib-esm/types/index.js +3 -3
- package/lib-esm/utils/ConnectionStateMonitor.js +49 -63
- package/lib-esm/utils/ReachabilityMonitor/index.js +1 -1
- package/lib-esm/utils/ReachabilityMonitor/index.native.js +1 -3
- package/lib-esm/utils/ReconnectionMonitor.js +19 -24
- package/lib-esm/utils/errors/APIError.js +6 -11
- package/lib-esm/utils/errors/assertValidationError.js +2 -2
- package/lib-esm/utils/errors/validation.js +5 -6
- package/lib-esm/utils/findIndexByFields.js +4 -9
- package/lib-esm/utils/resolveConfig.js +8 -9
- package/lib-esm/utils/resolveLibraryOptions.js +4 -5
- package/lib-esm/utils/resolveOwnerFields.js +10 -33
- package/lib-esm/utils/resolvePKFields.js +2 -3
- package/package.json +8 -7
- package/src/GraphQLAPI.ts +6 -2
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +6 -5
- package/src/internals/APIClient.ts +122 -35
- package/src/internals/InternalGraphQLAPI.ts +35 -10
- package/src/internals/generateClient.ts +0 -1
- package/src/internals/generateModelsProperty.ts +27 -340
- package/src/internals/operations/get.ts +121 -0
- package/src/internals/operations/list.ts +111 -0
- package/src/internals/operations/observeQuery.ts +140 -0
- package/src/internals/operations/subscription.ts +59 -0
- package/src/internals/server/generateClient.ts +45 -0
- package/src/internals/server/generateModelsProperty.ts +70 -0
- package/src/internals/server/index.ts +4 -0
- package/src/types/index.ts +65 -9
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
export { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export const MAX_DELAY_MS = 5000;
|
|
5
|
+
export const NON_RETRYABLE_CODES = [400, 401, 403];
|
|
6
|
+
export const CONNECTION_STATE_CHANGE = 'ConnectionStateChange';
|
|
7
7
|
export var MESSAGE_TYPES;
|
|
8
8
|
(function (MESSAGE_TYPES) {
|
|
9
9
|
/**
|
|
@@ -69,7 +69,7 @@ export var SOCKET_STATUS;
|
|
|
69
69
|
SOCKET_STATUS[SOCKET_STATUS["READY"] = 1] = "READY";
|
|
70
70
|
SOCKET_STATUS[SOCKET_STATUS["CONNECTING"] = 2] = "CONNECTING";
|
|
71
71
|
})(SOCKET_STATUS || (SOCKET_STATUS = {}));
|
|
72
|
-
export
|
|
72
|
+
export const AWS_APPSYNC_REALTIME_HEADERS = {
|
|
73
73
|
accept: 'application/json, text/javascript',
|
|
74
74
|
'content-encoding': 'amz-1.0',
|
|
75
75
|
'content-type': 'application/json; charset=UTF-8',
|
|
@@ -77,24 +77,24 @@ export var AWS_APPSYNC_REALTIME_HEADERS = {
|
|
|
77
77
|
/**
|
|
78
78
|
* Time in milleseconds to wait for GQL_CONNECTION_INIT message
|
|
79
79
|
*/
|
|
80
|
-
export
|
|
80
|
+
export const CONNECTION_INIT_TIMEOUT = 15000;
|
|
81
81
|
/**
|
|
82
82
|
* Time in milleseconds to wait for GQL_START_ACK message
|
|
83
83
|
*/
|
|
84
|
-
export
|
|
84
|
+
export const START_ACK_TIMEOUT = 15000;
|
|
85
85
|
/**
|
|
86
86
|
* Default Time in milleseconds to wait for GQL_CONNECTION_KEEP_ALIVE message
|
|
87
87
|
*/
|
|
88
|
-
export
|
|
88
|
+
export const DEFAULT_KEEP_ALIVE_TIMEOUT = 5 * 60 * 1000;
|
|
89
89
|
/**
|
|
90
90
|
* Default Time in milleseconds to alert for missed GQL_CONNECTION_KEEP_ALIVE message
|
|
91
91
|
*/
|
|
92
|
-
export
|
|
92
|
+
export const DEFAULT_KEEP_ALIVE_ALERT_TIMEOUT = 65 * 1000;
|
|
93
93
|
/**
|
|
94
94
|
* Default delay time in milleseconds between when reconnect is triggered vs when it is attempted
|
|
95
95
|
*/
|
|
96
|
-
export
|
|
96
|
+
export const RECONNECT_DELAY = 5 * 1000;
|
|
97
97
|
/**
|
|
98
98
|
* Default interval time in milleseconds between when reconnect is re-attempted
|
|
99
99
|
*/
|
|
100
|
-
export
|
|
100
|
+
export const RECONNECT_INTERVAL = 60 * 1000;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
|
|
2
|
+
import { V6Client } from '../types';
|
|
2
3
|
type ListArgs = {
|
|
3
4
|
selectionSet?: string[];
|
|
4
5
|
filter?: {};
|
|
@@ -9,7 +10,7 @@ type ListArgs = {
|
|
|
9
10
|
* @returns response object with `items` properties flattened
|
|
10
11
|
*/
|
|
11
12
|
export declare const flattenItems: (obj: Record<string, any>) => Record<string, any>;
|
|
12
|
-
export declare function initializeModel(client: any, modelName: string, result: any[], modelIntrospection: any, authMode: GraphQLAuthMode | undefined, authToken: string | undefined): any[];
|
|
13
|
+
export declare function initializeModel(client: any, modelName: string, result: any[], modelIntrospection: any, authMode: GraphQLAuthMode | undefined, authToken: string | undefined, context?: boolean): any[];
|
|
13
14
|
export declare const graphQLOperationsInfo: {
|
|
14
15
|
CREATE: {
|
|
15
16
|
operationPrefix: "create";
|
|
@@ -103,4 +104,18 @@ export declare function buildGraphQLVariables(modelDefinition: any, operation: M
|
|
|
103
104
|
*
|
|
104
105
|
*/
|
|
105
106
|
export declare function normalizeMutationInput(mutationInput: any, model: any, modelDefinition: any): Record<string, unknown>;
|
|
107
|
+
type AuthModeParams = {
|
|
108
|
+
authMode?: GraphQLAuthMode;
|
|
109
|
+
authToken?: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Produces a parameter object that can contains auth mode/token overrides
|
|
113
|
+
* only if present in either `options` (first) or configured on the `client`
|
|
114
|
+
* as a fallback.
|
|
115
|
+
*
|
|
116
|
+
* @param client Configured client from `generateClient`
|
|
117
|
+
* @param options Args/Options obect from call site.
|
|
118
|
+
* @returns
|
|
119
|
+
*/
|
|
120
|
+
export declare function authModeParams(client: V6Client, options?: AuthModeParams): AuthModeParams;
|
|
106
121
|
export {};
|