@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.
Files changed (136) hide show
  1. package/{lib → dist/cjs}/GraphQLAPI.js +8 -4
  2. package/dist/cjs/GraphQLAPI.js.map +1 -0
  3. package/{lib → dist/cjs}/Providers/AWSAppSyncRealTimeProvider/index.js +11 -8
  4. package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -0
  5. package/{lib → dist/cjs}/Providers/constants.js +8 -8
  6. package/dist/cjs/Providers/constants.js.map +1 -0
  7. package/dist/cjs/index.js +15 -0
  8. package/dist/cjs/index.js.map +1 -0
  9. package/{lib → dist/cjs}/internals/InternalGraphQLAPI.js +18 -18
  10. package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -0
  11. package/dist/cjs/internals/index.js +14 -0
  12. package/dist/cjs/internals/index.js.map +1 -0
  13. package/{lib → dist/cjs}/internals/v6.js +4 -1
  14. package/dist/cjs/internals/v6.js.map +1 -0
  15. package/{lib → dist/cjs}/types/PubSub.js +6 -6
  16. package/dist/cjs/types/PubSub.js.map +1 -0
  17. package/{lib → dist/cjs}/types/index.js +7 -5
  18. package/dist/cjs/types/index.js.map +1 -0
  19. package/{lib → dist/cjs}/utils/ConnectionStateMonitor.js +8 -5
  20. package/dist/cjs/utils/ConnectionStateMonitor.js.map +1 -0
  21. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.js +6 -2
  22. package/dist/cjs/utils/ReachabilityMonitor/index.js.map +1 -0
  23. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.native.js +6 -2
  24. package/dist/cjs/utils/ReachabilityMonitor/index.native.js.map +1 -0
  25. package/{lib → dist/cjs}/utils/ReconnectionMonitor.js +4 -1
  26. package/dist/cjs/utils/ReconnectionMonitor.js.map +1 -0
  27. package/{lib → dist/cjs}/utils/errors/APIError.js +4 -1
  28. package/dist/cjs/utils/errors/APIError.js.map +1 -0
  29. package/{lib → dist/cjs}/utils/errors/assertValidationError.js +4 -1
  30. package/dist/cjs/utils/errors/assertValidationError.js.map +1 -0
  31. package/dist/cjs/utils/errors/index.js +14 -0
  32. package/dist/cjs/utils/errors/index.js.map +1 -0
  33. package/{lib → dist/cjs}/utils/errors/validation.js +4 -1
  34. package/dist/cjs/utils/errors/validation.js.map +1 -0
  35. package/dist/cjs/utils/index.js +11 -0
  36. package/dist/cjs/utils/index.js.map +1 -0
  37. package/{lib → dist/cjs}/utils/resolveConfig.js +7 -3
  38. package/dist/cjs/utils/resolveConfig.js.map +1 -0
  39. package/{lib-esm → dist/cjs}/utils/resolveLibraryOptions.js +7 -1
  40. package/dist/cjs/utils/resolveLibraryOptions.js.map +1 -0
  41. package/{lib-esm → dist/esm}/GraphQLAPI.d.ts +2 -2
  42. package/{lib-esm/GraphQLAPI.js → dist/esm/GraphQLAPI.mjs} +8 -4
  43. package/dist/esm/GraphQLAPI.mjs.map +1 -0
  44. package/{lib → dist/esm}/Providers/AWSAppSyncRealTimeProvider/index.d.ts +1 -1
  45. package/{lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js → dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs} +13 -9
  46. package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs.map +1 -0
  47. package/{lib-esm/Providers/constants.js → dist/esm/Providers/constants.mjs} +18 -14
  48. package/dist/esm/Providers/constants.mjs.map +1 -0
  49. package/dist/esm/index.mjs +5 -0
  50. package/dist/esm/index.mjs.map +1 -0
  51. package/{lib → dist/esm}/internals/InternalGraphQLAPI.d.ts +1 -1
  52. package/{lib-esm/internals/InternalGraphQLAPI.js → dist/esm/internals/InternalGraphQLAPI.mjs} +19 -18
  53. package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -0
  54. package/dist/esm/internals/index.mjs +3 -0
  55. package/dist/esm/internals/index.mjs.map +1 -0
  56. package/{lib-esm/internals/v6.js → dist/esm/internals/v6.mjs} +9 -5
  57. package/dist/esm/internals/v6.mjs.map +1 -0
  58. package/{lib → dist/esm}/types/PubSub.d.ts +2 -2
  59. package/{lib-esm/types/PubSub.js → dist/esm/types/PubSub.mjs} +5 -2
  60. package/dist/esm/types/PubSub.mjs.map +1 -0
  61. package/{lib-esm → dist/esm}/types/index.d.ts +25 -25
  62. package/{lib-esm/types/index.js → dist/esm/types/index.mjs} +7 -3
  63. package/dist/esm/types/index.mjs.map +1 -0
  64. package/{lib-esm → dist/esm}/utils/ConnectionStateMonitor.d.ts +3 -3
  65. package/{lib-esm/utils/ConnectionStateMonitor.js → dist/esm/utils/ConnectionStateMonitor.mjs} +9 -5
  66. package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -0
  67. package/dist/esm/utils/ReachabilityMonitor/index.d.ts +1 -0
  68. package/{lib-esm/utils/ReachabilityMonitor/index.js → dist/esm/utils/ReachabilityMonitor/index.mjs} +6 -2
  69. package/dist/esm/utils/ReachabilityMonitor/index.mjs.map +1 -0
  70. package/dist/esm/utils/ReachabilityMonitor/index.native.d.ts +1 -0
  71. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs +9 -0
  72. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -0
  73. package/{lib-esm/utils/ReconnectionMonitor.js → dist/esm/utils/ReconnectionMonitor.mjs} +7 -3
  74. package/dist/esm/utils/ReconnectionMonitor.mjs.map +1 -0
  75. package/{lib-esm/utils/errors/APIError.js → dist/esm/utils/errors/APIError.mjs} +6 -2
  76. package/dist/esm/utils/errors/APIError.mjs.map +1 -0
  77. package/{lib-esm/utils/errors/assertValidationError.js → dist/esm/utils/errors/assertValidationError.mjs} +7 -3
  78. package/dist/esm/utils/errors/assertValidationError.mjs.map +1 -0
  79. package/dist/esm/utils/errors/index.mjs +4 -0
  80. package/dist/esm/utils/errors/index.mjs.map +1 -0
  81. package/{lib-esm/utils/errors/validation.js → dist/esm/utils/errors/validation.mjs} +5 -2
  82. package/dist/esm/utils/errors/validation.mjs.map +1 -0
  83. package/dist/esm/utils/index.mjs +3 -0
  84. package/dist/esm/utils/index.mjs.map +1 -0
  85. package/{lib → dist/esm}/utils/resolveConfig.d.ts +1 -1
  86. package/{lib-esm/utils/resolveConfig.js → dist/esm/utils/resolveConfig.mjs} +8 -2
  87. package/dist/esm/utils/resolveConfig.mjs.map +1 -0
  88. package/{lib → dist/esm}/utils/resolveLibraryOptions.d.ts +2 -2
  89. package/{lib/utils/resolveLibraryOptions.js → dist/esm/utils/resolveLibraryOptions.mjs} +4 -3
  90. package/dist/esm/utils/resolveLibraryOptions.mjs.map +1 -0
  91. package/internals/package.json +4 -4
  92. package/package.json +146 -122
  93. package/src/GraphQLAPI.ts +1 -1
  94. package/lib/GraphQLAPI.d.ts +0 -38
  95. package/lib/Providers/constants.d.ts +0 -95
  96. package/lib/index.d.ts +0 -3
  97. package/lib/index.js +0 -12
  98. package/lib/internals/index.d.ts +0 -2
  99. package/lib/internals/index.js +0 -11
  100. package/lib/internals/v6.d.ts +0 -101
  101. package/lib/tsconfig.tsbuildinfo +0 -6813
  102. package/lib/types/index.d.ts +0 -309
  103. package/lib/utils/ConnectionStateMonitor.d.ts +0 -41
  104. package/lib/utils/ReachabilityMonitor/index.d.ts +0 -1
  105. package/lib/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  106. package/lib/utils/ReconnectionMonitor.d.ts +0 -29
  107. package/lib/utils/errors/APIError.d.ts +0 -7
  108. package/lib/utils/errors/assertValidationError.d.ts +0 -5
  109. package/lib/utils/errors/index.d.ts +0 -3
  110. package/lib/utils/errors/index.js +0 -11
  111. package/lib/utils/errors/validation.d.ts +0 -7
  112. package/lib/utils/index.d.ts +0 -2
  113. package/lib/utils/index.js +0 -8
  114. package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +0 -64
  115. package/lib-esm/index.js +0 -5
  116. package/lib-esm/internals/InternalGraphQLAPI.d.ts +0 -58
  117. package/lib-esm/internals/index.js +0 -4
  118. package/lib-esm/tsconfig.tsbuildinfo +0 -6813
  119. package/lib-esm/types/PubSub.d.ts +0 -27
  120. package/lib-esm/utils/ReachabilityMonitor/index.d.ts +0 -1
  121. package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  122. package/lib-esm/utils/ReachabilityMonitor/index.native.js +0 -5
  123. package/lib-esm/utils/errors/index.js +0 -5
  124. package/lib-esm/utils/index.js +0 -4
  125. package/lib-esm/utils/resolveConfig.d.ts +0 -12
  126. package/lib-esm/utils/resolveLibraryOptions.d.ts +0 -11
  127. /package/{lib-esm → dist/esm}/Providers/constants.d.ts +0 -0
  128. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  129. /package/{lib-esm → dist/esm}/internals/index.d.ts +0 -0
  130. /package/{lib-esm → dist/esm}/internals/v6.d.ts +0 -0
  131. /package/{lib-esm → dist/esm}/utils/ReconnectionMonitor.d.ts +0 -0
  132. /package/{lib-esm → dist/esm}/utils/errors/APIError.d.ts +0 -0
  133. /package/{lib-esm → dist/esm}/utils/errors/assertValidationError.d.ts +0 -0
  134. /package/{lib-esm → dist/esm}/utils/errors/index.d.ts +0 -0
  135. /package/{lib-esm → dist/esm}/utils/errors/validation.d.ts +0 -0
  136. /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
@@ -1,3 +0,0 @@
1
- export { GraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI';
2
- export * from './types';
3
- export { CONNECTION_STATE_CHANGE } from './Providers/constants';
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;
@@ -1,2 +0,0 @@
1
- export { InternalGraphQLAPI, InternalGraphQLAPIClass, } from './InternalGraphQLAPI';
2
- export { graphql, cancel, isCancelError } from './v6';
@@ -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;
@@ -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 };