@aws-amplify/api-graphql 4.0.1-api-v6-models.6720ee0.0 → 4.0.1-api-v6-models.13c9b49.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 (220) hide show
  1. package/{lib → dist/cjs}/GraphQLAPI.js +5 -3
  2. package/dist/cjs/GraphQLAPI.js.map +1 -0
  3. package/{lib → dist/cjs}/Providers/AWSAppSyncRealTimeProvider/index.js +3 -1
  4. package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -0
  5. package/{lib → dist/cjs}/Providers/constants.js +6 -7
  6. package/dist/cjs/Providers/constants.js.map +1 -0
  7. package/{lib → dist/cjs}/index.js +3 -1
  8. package/dist/cjs/index.js.map +1 -0
  9. package/{lib → dist/cjs}/internals/APIClient.js +3 -4
  10. package/dist/cjs/internals/APIClient.js.map +1 -0
  11. package/{lib → dist/cjs}/internals/InternalGraphQLAPI.js +4 -6
  12. package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -0
  13. package/{lib → dist/cjs}/internals/generateClient.js +3 -1
  14. package/dist/cjs/internals/generateClient.js.map +1 -0
  15. package/{lib → dist/cjs}/internals/generateModelsProperty.js +6 -1
  16. package/dist/cjs/internals/generateModelsProperty.js.map +1 -0
  17. package/{lib → dist/cjs}/internals/index.js +3 -1
  18. package/dist/cjs/internals/index.js.map +1 -0
  19. package/{lib → dist/cjs}/internals/operations/get.js +3 -1
  20. package/dist/cjs/internals/operations/get.js.map +1 -0
  21. package/{lib → dist/cjs}/internals/operations/list.js +3 -1
  22. package/dist/cjs/internals/operations/list.js.map +1 -0
  23. package/{lib → dist/cjs}/internals/operations/observeQuery.js +3 -1
  24. package/dist/cjs/internals/operations/observeQuery.js.map +1 -0
  25. package/{lib → dist/cjs}/internals/operations/subscription.js +3 -1
  26. package/dist/cjs/internals/operations/subscription.js.map +1 -0
  27. package/{lib → dist/cjs}/internals/server/generateClient.js +3 -1
  28. package/dist/cjs/internals/server/generateClient.js.map +1 -0
  29. package/{lib → dist/cjs}/internals/server/generateModelsProperty.js +3 -1
  30. package/dist/cjs/internals/server/generateModelsProperty.js.map +1 -0
  31. package/{lib → dist/cjs}/internals/server/index.js +3 -1
  32. package/dist/cjs/internals/server/index.js.map +1 -0
  33. package/{lib → dist/cjs}/internals/types.js +3 -1
  34. package/dist/cjs/internals/types.js.map +1 -0
  35. package/{lib → dist/cjs}/internals/v6.js +3 -1
  36. package/dist/cjs/internals/v6.js.map +1 -0
  37. package/{lib → dist/cjs}/types/PubSub.js +5 -6
  38. package/dist/cjs/types/PubSub.js.map +1 -0
  39. package/{lib → dist/cjs}/types/index.js +4 -3
  40. package/dist/cjs/types/index.js.map +1 -0
  41. package/{lib → dist/cjs}/utils/ConnectionStateMonitor.js +3 -1
  42. package/dist/cjs/utils/ConnectionStateMonitor.js.map +1 -0
  43. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.js +3 -1
  44. package/dist/cjs/utils/ReachabilityMonitor/index.js.map +1 -0
  45. package/{lib → dist/cjs}/utils/ReachabilityMonitor/index.native.js +3 -1
  46. package/dist/cjs/utils/ReachabilityMonitor/index.native.js.map +1 -0
  47. package/{lib → dist/cjs}/utils/ReconnectionMonitor.js +4 -2
  48. package/dist/cjs/utils/ReconnectionMonitor.js.map +1 -0
  49. package/{lib → dist/cjs}/utils/errors/APIError.js +3 -1
  50. package/dist/cjs/utils/errors/APIError.js.map +1 -0
  51. package/{lib → dist/cjs}/utils/errors/assertValidationError.js +3 -1
  52. package/dist/cjs/utils/errors/assertValidationError.js.map +1 -0
  53. package/{lib → dist/cjs}/utils/errors/index.js +3 -1
  54. package/dist/cjs/utils/errors/index.js.map +1 -0
  55. package/{lib → dist/cjs}/utils/errors/validation.js +4 -2
  56. package/dist/cjs/utils/errors/validation.js.map +1 -0
  57. package/{lib → dist/cjs}/utils/findIndexByFields.js +3 -1
  58. package/dist/cjs/utils/findIndexByFields.js.map +1 -0
  59. package/{lib → dist/cjs}/utils/index.js +3 -1
  60. package/dist/cjs/utils/index.js.map +1 -0
  61. package/{lib → dist/cjs}/utils/resolveConfig.js +3 -1
  62. package/dist/cjs/utils/resolveConfig.js.map +1 -0
  63. package/{lib → dist/cjs}/utils/resolveLibraryOptions.js +3 -1
  64. package/dist/cjs/utils/resolveLibraryOptions.js.map +1 -0
  65. package/{lib → dist/cjs}/utils/resolveOwnerFields.js +3 -1
  66. package/dist/cjs/utils/resolveOwnerFields.js.map +1 -0
  67. package/{lib → dist/cjs}/utils/resolvePKFields.js +3 -1
  68. package/dist/cjs/utils/resolvePKFields.js.map +1 -0
  69. package/{lib-esm → dist/esm}/GraphQLAPI.d.ts +1 -1
  70. package/{lib-esm/GraphQLAPI.js → dist/esm/GraphQLAPI.mjs} +8 -4
  71. package/dist/esm/GraphQLAPI.mjs.map +1 -0
  72. package/{lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js → dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs} +13 -9
  73. package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs.map +1 -0
  74. package/{lib-esm/Providers/constants.js → dist/esm/Providers/constants.mjs} +18 -14
  75. package/dist/esm/Providers/constants.mjs.map +1 -0
  76. package/dist/esm/index.mjs +5 -0
  77. package/dist/esm/index.mjs.map +1 -0
  78. package/{lib-esm/internals/APIClient.js → dist/esm/internals/APIClient.mjs} +16 -15
  79. package/dist/esm/internals/APIClient.mjs.map +1 -0
  80. package/{lib-esm/internals/InternalGraphQLAPI.js → dist/esm/internals/InternalGraphQLAPI.mjs} +19 -18
  81. package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -0
  82. package/{lib-esm/internals/generateClient.js → dist/esm/internals/generateClient.mjs} +8 -4
  83. package/dist/esm/internals/generateClient.mjs.map +1 -0
  84. package/{lib-esm/internals/generateModelsProperty.js → dist/esm/internals/generateModelsProperty.mjs} +13 -6
  85. package/dist/esm/internals/generateModelsProperty.mjs.map +1 -0
  86. package/dist/esm/internals/index.mjs +4 -0
  87. package/dist/esm/internals/index.mjs.map +1 -0
  88. package/{lib-esm/internals/operations/get.js → dist/esm/internals/operations/get.mjs} +6 -2
  89. package/dist/esm/internals/operations/get.mjs.map +1 -0
  90. package/{lib-esm/internals/operations/list.js → dist/esm/internals/operations/list.mjs} +6 -2
  91. package/dist/esm/internals/operations/list.mjs.map +1 -0
  92. package/{lib-esm/internals/operations/observeQuery.js → dist/esm/internals/operations/observeQuery.mjs} +10 -3
  93. package/dist/esm/internals/operations/observeQuery.mjs.map +1 -0
  94. package/{lib-esm/internals/operations/subscription.js → dist/esm/internals/operations/subscription.mjs} +7 -3
  95. package/dist/esm/internals/operations/subscription.mjs.map +1 -0
  96. package/{lib-esm/internals/server/generateClient.js → dist/esm/internals/server/generateClient.mjs} +12 -4
  97. package/dist/esm/internals/server/generateClient.mjs.map +1 -0
  98. package/{lib-esm/internals/server/generateModelsProperty.js → dist/esm/internals/server/generateModelsProperty.mjs} +8 -4
  99. package/dist/esm/internals/server/generateModelsProperty.mjs.map +1 -0
  100. package/dist/esm/internals/server/index.mjs +2 -0
  101. package/dist/esm/internals/server/index.mjs.map +1 -0
  102. package/dist/esm/internals/types.mjs +2 -0
  103. package/dist/esm/internals/types.mjs.map +1 -0
  104. package/{lib-esm/internals/v6.js → dist/esm/internals/v6.mjs} +9 -5
  105. package/dist/esm/internals/v6.mjs.map +1 -0
  106. package/{lib-esm/types/PubSub.js → dist/esm/types/PubSub.mjs} +5 -2
  107. package/dist/esm/types/PubSub.mjs.map +1 -0
  108. package/{lib-esm/types/index.js → dist/esm/types/index.mjs} +9 -5
  109. package/dist/esm/types/index.mjs.map +1 -0
  110. package/{lib-esm/utils/ConnectionStateMonitor.js → dist/esm/utils/ConnectionStateMonitor.mjs} +9 -5
  111. package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -0
  112. package/dist/esm/utils/ReachabilityMonitor/index.d.ts +1 -0
  113. package/{lib-esm/utils/ReachabilityMonitor/index.js → dist/esm/utils/ReachabilityMonitor/index.mjs} +6 -2
  114. package/dist/esm/utils/ReachabilityMonitor/index.mjs.map +1 -0
  115. package/dist/esm/utils/ReachabilityMonitor/index.native.d.ts +1 -0
  116. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs +9 -0
  117. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -0
  118. package/{lib-esm/utils/ReconnectionMonitor.js → dist/esm/utils/ReconnectionMonitor.mjs} +7 -3
  119. package/dist/esm/utils/ReconnectionMonitor.mjs.map +1 -0
  120. package/{lib-esm/utils/errors/APIError.js → dist/esm/utils/errors/APIError.mjs} +6 -2
  121. package/dist/esm/utils/errors/APIError.mjs.map +1 -0
  122. package/{lib-esm/utils/errors/assertValidationError.js → dist/esm/utils/errors/assertValidationError.mjs} +7 -3
  123. package/dist/esm/utils/errors/assertValidationError.mjs.map +1 -0
  124. package/dist/esm/utils/errors/index.mjs +4 -0
  125. package/dist/esm/utils/errors/index.mjs.map +1 -0
  126. package/{lib-esm/utils/errors/validation.js → dist/esm/utils/errors/validation.mjs} +5 -2
  127. package/dist/esm/utils/errors/validation.mjs.map +1 -0
  128. package/{lib-esm/utils/findIndexByFields.js → dist/esm/utils/findIndexByFields.mjs} +4 -1
  129. package/dist/esm/utils/findIndexByFields.mjs.map +1 -0
  130. package/dist/esm/utils/index.mjs +5 -0
  131. package/dist/esm/utils/index.mjs.map +1 -0
  132. package/{lib-esm → dist/esm}/utils/resolveConfig.d.ts +1 -1
  133. package/{lib-esm/utils/resolveConfig.js → dist/esm/utils/resolveConfig.mjs} +8 -2
  134. package/dist/esm/utils/resolveConfig.mjs.map +1 -0
  135. package/{lib → dist/esm}/utils/resolveLibraryOptions.d.ts +2 -2
  136. package/{lib-esm/utils/resolveLibraryOptions.js → dist/esm/utils/resolveLibraryOptions.mjs} +4 -1
  137. package/dist/esm/utils/resolveLibraryOptions.mjs.map +1 -0
  138. package/{lib-esm/utils/resolveOwnerFields.js → dist/esm/utils/resolveOwnerFields.mjs} +4 -1
  139. package/dist/esm/utils/resolveOwnerFields.mjs.map +1 -0
  140. package/{lib-esm/utils/resolvePKFields.js → dist/esm/utils/resolvePKFields.mjs} +4 -1
  141. package/dist/esm/utils/resolvePKFields.mjs.map +1 -0
  142. package/internals/package.json +4 -4
  143. package/internals/server/package.json +4 -4
  144. package/package.json +51 -25
  145. package/src/GraphQLAPI.ts +1 -1
  146. package/src/internals/generateModelsProperty.ts +6 -0
  147. package/lib/GraphQLAPI.d.ts +0 -38
  148. package/lib/Providers/AWSAppSyncRealTimeProvider/index.d.ts +0 -64
  149. package/lib/Providers/constants.d.ts +0 -95
  150. package/lib/index.d.ts +0 -3
  151. package/lib/internals/APIClient.d.ts +0 -121
  152. package/lib/internals/InternalGraphQLAPI.d.ts +0 -58
  153. package/lib/internals/generateClient.d.ts +0 -12
  154. package/lib/internals/generateModelsProperty.d.ts +0 -4
  155. package/lib/internals/index.d.ts +0 -3
  156. package/lib/internals/operations/get.d.ts +0 -2
  157. package/lib/internals/operations/list.d.ts +0 -2
  158. package/lib/internals/operations/observeQuery.d.ts +0 -2
  159. package/lib/internals/operations/subscription.d.ts +0 -1
  160. package/lib/internals/server/generateClient.d.ts +0 -11
  161. package/lib/internals/server/generateModelsProperty.d.ts +0 -3
  162. package/lib/internals/server/index.d.ts +0 -1
  163. package/lib/internals/types.d.ts +0 -17
  164. package/lib/internals/v6.d.ts +0 -101
  165. package/lib/tsconfig.tsbuildinfo +0 -1
  166. package/lib/types/PubSub.d.ts +0 -27
  167. package/lib/types/index.d.ts +0 -329
  168. package/lib/utils/ConnectionStateMonitor.d.ts +0 -41
  169. package/lib/utils/ReachabilityMonitor/index.d.ts +0 -1
  170. package/lib/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  171. package/lib/utils/ReconnectionMonitor.d.ts +0 -29
  172. package/lib/utils/errors/APIError.d.ts +0 -7
  173. package/lib/utils/errors/assertValidationError.d.ts +0 -5
  174. package/lib/utils/errors/index.d.ts +0 -3
  175. package/lib/utils/errors/validation.d.ts +0 -7
  176. package/lib/utils/findIndexByFields.d.ts +0 -9
  177. package/lib/utils/index.d.ts +0 -4
  178. package/lib/utils/resolveConfig.d.ts +0 -12
  179. package/lib/utils/resolveOwnerFields.d.ts +0 -12
  180. package/lib/utils/resolvePKFields.d.ts +0 -13
  181. package/lib-esm/index.js +0 -5
  182. package/lib-esm/internals/index.js +0 -5
  183. package/lib-esm/internals/server/index.js +0 -3
  184. package/lib-esm/internals/types.js +0 -1
  185. package/lib-esm/tsconfig.tsbuildinfo +0 -1
  186. package/lib-esm/utils/ReachabilityMonitor/index.d.ts +0 -1
  187. package/lib-esm/utils/ReachabilityMonitor/index.native.d.ts +0 -1
  188. package/lib-esm/utils/ReachabilityMonitor/index.native.js +0 -5
  189. package/lib-esm/utils/errors/index.js +0 -5
  190. package/lib-esm/utils/index.js +0 -6
  191. package/lib-esm/utils/resolveLibraryOptions.d.ts +0 -11
  192. /package/{lib-esm → dist/esm}/Providers/AWSAppSyncRealTimeProvider/index.d.ts +0 -0
  193. /package/{lib-esm → dist/esm}/Providers/constants.d.ts +0 -0
  194. /package/{lib-esm → dist/esm}/index.d.ts +0 -0
  195. /package/{lib-esm → dist/esm}/internals/APIClient.d.ts +0 -0
  196. /package/{lib-esm → dist/esm}/internals/InternalGraphQLAPI.d.ts +0 -0
  197. /package/{lib-esm → dist/esm}/internals/generateClient.d.ts +0 -0
  198. /package/{lib-esm → dist/esm}/internals/generateModelsProperty.d.ts +0 -0
  199. /package/{lib-esm → dist/esm}/internals/index.d.ts +0 -0
  200. /package/{lib-esm → dist/esm}/internals/operations/get.d.ts +0 -0
  201. /package/{lib-esm → dist/esm}/internals/operations/list.d.ts +0 -0
  202. /package/{lib-esm → dist/esm}/internals/operations/observeQuery.d.ts +0 -0
  203. /package/{lib-esm → dist/esm}/internals/operations/subscription.d.ts +0 -0
  204. /package/{lib-esm → dist/esm}/internals/server/generateClient.d.ts +0 -0
  205. /package/{lib-esm → dist/esm}/internals/server/generateModelsProperty.d.ts +0 -0
  206. /package/{lib-esm → dist/esm}/internals/server/index.d.ts +0 -0
  207. /package/{lib-esm → dist/esm}/internals/types.d.ts +0 -0
  208. /package/{lib-esm → dist/esm}/internals/v6.d.ts +0 -0
  209. /package/{lib-esm → dist/esm}/types/PubSub.d.ts +0 -0
  210. /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
  211. /package/{lib-esm → dist/esm}/utils/ConnectionStateMonitor.d.ts +0 -0
  212. /package/{lib-esm → dist/esm}/utils/ReconnectionMonitor.d.ts +0 -0
  213. /package/{lib-esm → dist/esm}/utils/errors/APIError.d.ts +0 -0
  214. /package/{lib-esm → dist/esm}/utils/errors/assertValidationError.d.ts +0 -0
  215. /package/{lib-esm → dist/esm}/utils/errors/index.d.ts +0 -0
  216. /package/{lib-esm → dist/esm}/utils/errors/validation.d.ts +0 -0
  217. /package/{lib-esm → dist/esm}/utils/findIndexByFields.d.ts +0 -0
  218. /package/{lib-esm → dist/esm}/utils/index.d.ts +0 -0
  219. /package/{lib-esm → dist/esm}/utils/resolveOwnerFields.d.ts +0 -0
  220. /package/{lib-esm → dist/esm}/utils/resolvePKFields.d.ts +0 -0
@@ -1,121 +0,0 @@
1
- import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
2
- import { V6Client } from '../types';
3
- type ListArgs = {
4
- selectionSet?: string[];
5
- filter?: {};
6
- };
7
- /**
8
- *
9
- * @param GraphQL response object
10
- * @returns response object with `items` properties flattened
11
- */
12
- export declare const flattenItems: (obj: Record<string, any>) => Record<string, any>;
13
- export declare function initializeModel(client: any, modelName: string, result: any[], modelIntrospection: any, authMode: GraphQLAuthMode | undefined, authToken: string | undefined, context?: boolean): any[];
14
- export declare const graphQLOperationsInfo: {
15
- CREATE: {
16
- operationPrefix: "create";
17
- usePlural: boolean;
18
- };
19
- READ: {
20
- operationPrefix: "get";
21
- usePlural: boolean;
22
- };
23
- UPDATE: {
24
- operationPrefix: "update";
25
- usePlural: boolean;
26
- };
27
- DELETE: {
28
- operationPrefix: "delete";
29
- usePlural: boolean;
30
- };
31
- LIST: {
32
- operationPrefix: "list";
33
- usePlural: boolean;
34
- };
35
- ONCREATE: {
36
- operationPrefix: "onCreate";
37
- usePlural: boolean;
38
- };
39
- ONUPDATE: {
40
- operationPrefix: "onUpdate";
41
- usePlural: boolean;
42
- };
43
- ONDELETE: {
44
- operationPrefix: "onDelete";
45
- usePlural: boolean;
46
- };
47
- OBSERVE_QUERY: {
48
- operationPrefix: "observeQuery";
49
- usePlural: boolean;
50
- };
51
- };
52
- export type ModelOperation = keyof typeof graphQLOperationsInfo;
53
- /**
54
- * Generates nested Custom Selection Set IR from path
55
- *
56
- * @param modelIntrospection
57
- * @param modelName
58
- * @param selectionSet - array of object paths
59
- * @example
60
- * ### Given
61
- * `selectionSet = ['id', 'comments.post.id']`
62
- * ### Returns
63
- * ```ts
64
- * {
65
- * id: '',
66
- * comments: {
67
- * items: { post: { id: '' } }
68
- * }
69
- * }
70
- * ```
71
- */
72
- export declare function customSelectionSetToIR(modelIntrospection: any, modelName: string, selectionSet: string[]): Record<string, string | object>;
73
- /**
74
- * Stringifies selection set IR
75
- * * @example
76
- * ### Given
77
- * ```ts
78
- * {
79
- * id: '',
80
- * comments: {
81
- * items: { post: { id: '' } }
82
- * }
83
- * }
84
- * ```
85
- * ### Returns
86
- * `'id comments { items { post { id } } }'`
87
- */
88
- export declare function selectionSetIRToString(obj: Record<string, string | any>): string;
89
- export declare function generateSelectionSet(modelIntrospection: any, modelName: string, selectionSet?: string[]): string;
90
- export declare function generateGraphQLDocument(modelIntrospection: any, modelName: string, modelOperation: ModelOperation, listArgs?: ListArgs): string;
91
- export declare function buildGraphQLVariables(modelDefinition: any, operation: ModelOperation, arg: any, modelIntrospection: any): object;
92
- /**
93
- * Iterates over mutation input values and resolves any model inputs to their corresponding join fields/values
94
- *
95
- * @example
96
- * ### Usage
97
- * ```ts
98
- * const result = normalizeMutationInput({ post: post }, model, modelDefinition);
99
- * ```
100
- * ### Result
101
- * ```ts
102
- * { postId: "abc123" }
103
- * ```
104
- *
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;
121
- export {};
@@ -1,58 +0,0 @@
1
- import { OperationTypeNode } from 'graphql';
2
- import { Observable } from 'rxjs';
3
- import { AmplifyClassV6 } from '@aws-amplify/core';
4
- import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
5
- import { GraphQLResult, GraphQLOperation, GraphQLOptions } from '../types';
6
- export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string) => {
7
- query: any;
8
- variables: {};
9
- authToken: string | undefined;
10
- };
11
- /**
12
- * Export Cloud Logic APIs
13
- */
14
- export declare class InternalGraphQLAPIClass {
15
- /**
16
- * @private
17
- */
18
- private _options;
19
- private appSyncRealTime;
20
- private _api;
21
- /**
22
- * Initialize GraphQL API with AWS configuration
23
- * @param {Object} options - Configuration object for API
24
- */
25
- constructor(options: any);
26
- getModuleName(): string;
27
- private _headerBasedAuth;
28
- /**
29
- * to get the operation type
30
- * @param operation
31
- */
32
- getGraphqlOperationType(operation: GraphQLOperation): OperationTypeNode;
33
- /**
34
- * Executes a GraphQL operation
35
- *
36
- * @param options - GraphQL Options
37
- * @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config
38
- * @returns An Observable if the query is a subscription query, else a promise of the graphql result.
39
- */
40
- graphql<T = any>(amplify: AmplifyClassV6 | ((fn: (amplify: any) => Promise<any>) => Promise<AmplifyClassV6>), { query: paramQuery, variables, authMode, authToken }: GraphQLOptions, additionalHeaders?: {
41
- [key: string]: string;
42
- }, customUserAgentDetails?: CustomUserAgentDetails): Observable<GraphQLResult<T>> | Promise<GraphQLResult<T>>;
43
- private _graphql;
44
- /**
45
- * Checks to see if an error thrown is from an api request cancellation
46
- * @param {any} error - Any error
47
- * @return {boolean} - A boolean indicating if the error was from an api request cancellation
48
- */
49
- isCancelError(error: any): boolean;
50
- /**
51
- * Cancels an inflight request. Only applicable for graphql queries and mutations
52
- * @param {any} request - request to cancel
53
- * @returns - A boolean indicating if the request was cancelled
54
- */
55
- cancel(request: Promise<any>, message?: string): boolean;
56
- private _graphqlSubscribe;
57
- }
58
- export declare const InternalGraphQLAPI: InternalGraphQLAPIClass;
@@ -1,12 +0,0 @@
1
- import { V6Client } from '../types';
2
- import { ClientGenerationParams } from './types';
3
- /**
4
- * @private
5
- *
6
- * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
7
- * compatible context object for config and auth fetching.
8
- *
9
- * @param params
10
- * @returns
11
- */
12
- export declare function generateClient<T extends Record<any, any> = never>(params: ClientGenerationParams): V6Client<T>;
@@ -1,4 +0,0 @@
1
- import { ModelTypes } from '@aws-amplify/amplify-api-next-types-alpha';
2
- import { ClientGenerationParams } from './types';
3
- import { V6Client } from '../types';
4
- export declare function generateModelsProperty<T extends Record<any, any> = never>(client: V6Client, params: ClientGenerationParams): ModelTypes<T>;
@@ -1,3 +0,0 @@
1
- export { InternalGraphQLAPI, InternalGraphQLAPIClass, } from './InternalGraphQLAPI';
2
- export { graphql, cancel, isCancelError } from './v6';
3
- export { generateClient } from './generateClient';
@@ -1,2 +0,0 @@
1
- import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
2
- export declare function getFactory(client: any, modelIntrospection: any, model: any, operation: any, context?: boolean): (contextSpec: AmplifyServer.ContextSpec, arg?: any, options?: any) => Promise<any>;
@@ -1,2 +0,0 @@
1
- import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
2
- export declare function listFactory(client: any, modelIntrospection: any, model: any, context?: boolean): (contextSpec: AmplifyServer.ContextSpec, args?: any) => Promise<any>;
@@ -1,2 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export declare function observeQueryFactory(models: any, model: any): (arg?: any) => Observable<unknown>;
@@ -1 +0,0 @@
1
- export declare function subscriptionFactory(client: any, modelIntrospection: any, model: any, operation: any): (args?: any) => import("rxjs").Observable<any>;
@@ -1,11 +0,0 @@
1
- import { V6ClientSSRRequest, V6ClientSSRCookies, ServerClientGenerationParams, CommonPublicClientOptions } from '../../types';
2
- /**
3
- * @private
4
- *
5
- * Creates a client that can be used to make GraphQL requests, using a provided `AmplifyClassV6`
6
- * compatible context object for config and auth fetching.
7
- *
8
- * @param params
9
- * @returns
10
- */
11
- export declare function generateClient<T extends Record<any, any> = never, ClientType extends V6ClientSSRRequest<T> | V6ClientSSRCookies<T> = V6ClientSSRCookies<T>>(params: ServerClientGenerationParams & CommonPublicClientOptions): ClientType;
@@ -1,3 +0,0 @@
1
- import { ServerClientGenerationParams } from '../../types/';
2
- import { V6ClientSSRRequest, V6ClientSSRCookies } from '../../types';
3
- export declare function generateModelsProperty<T extends Record<any, any> = never, ClientType extends V6ClientSSRRequest<T> | V6ClientSSRCookies<T> = V6ClientSSRCookies<T>>(client: ClientType, params: ServerClientGenerationParams): ClientType;
@@ -1 +0,0 @@
1
- export { generateClient } from './generateClient';
@@ -1,17 +0,0 @@
1
- import { AmplifyClassV6 } from '@aws-amplify/core';
2
- import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
3
- /**
4
- * @private
5
- *
6
- * The knobs available for configuring `generateClient` internally.
7
- */
8
- export type ClientGenerationParams = {
9
- amplify: AmplifyClassV6;
10
- } & CommonPublicClientOptions;
11
- /**
12
- * Common options that can be used on public `generateClient()` interfaces.
13
- */
14
- export type CommonPublicClientOptions = {
15
- authMode?: GraphQLAuthMode;
16
- authToken?: string;
17
- };
@@ -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 };