@aws-amplify/api-graphql 4.0.19 → 4.0.20-api-graphql-eslint.dd94c10.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 (127) hide show
  1. package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js +40 -31
  2. package/dist/cjs/Providers/AWSAppSyncRealTimeProvider/index.js.map +1 -1
  3. package/dist/cjs/internals/APIClient.js +36 -20
  4. package/dist/cjs/internals/APIClient.js.map +1 -1
  5. package/dist/cjs/internals/InternalGraphQLAPI.js +10 -9
  6. package/dist/cjs/internals/InternalGraphQLAPI.js.map +1 -1
  7. package/dist/cjs/internals/generateClient.js +5 -5
  8. package/dist/cjs/internals/generateClient.js.map +1 -1
  9. package/dist/cjs/internals/operations/custom.js +4 -20
  10. package/dist/cjs/internals/operations/custom.js.map +1 -1
  11. package/dist/cjs/internals/operations/list.js +1 -1
  12. package/dist/cjs/internals/operations/list.js.map +1 -1
  13. package/dist/cjs/internals/server/generateClientWithAmplifyInstance.js +3 -3
  14. package/dist/cjs/internals/server/generateClientWithAmplifyInstance.js.map +1 -1
  15. package/dist/cjs/internals/server/generateModelsProperty.js +1 -1
  16. package/dist/cjs/internals/server/generateModelsProperty.js.map +1 -1
  17. package/dist/cjs/internals/utils/clientProperties/generateEnumsProperty.js.map +1 -0
  18. package/dist/cjs/internals/utils/{generateModelsProperty.js → clientProperties/generateModelsProperty.js} +7 -7
  19. package/dist/cjs/internals/utils/clientProperties/generateModelsProperty.js.map +1 -0
  20. package/dist/cjs/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.js.map +1 -0
  21. package/dist/cjs/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.js.map +1 -0
  22. package/dist/cjs/internals/v6.js +0 -2
  23. package/dist/cjs/internals/v6.js.map +1 -1
  24. package/dist/cjs/utils/errors/repackageAuthError.js +1 -1
  25. package/dist/cjs/utils/errors/repackageAuthError.js.map +1 -1
  26. package/dist/esm/GraphQLAPI.d.ts +2 -2
  27. package/dist/esm/GraphQLAPI.mjs.map +1 -1
  28. package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.d.ts +8 -8
  29. package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs +40 -31
  30. package/dist/esm/Providers/AWSAppSyncRealTimeProvider/index.mjs.map +1 -1
  31. package/dist/esm/internals/APIClient.d.ts +6 -5
  32. package/dist/esm/internals/APIClient.mjs +35 -20
  33. package/dist/esm/internals/APIClient.mjs.map +1 -1
  34. package/dist/esm/internals/InternalGraphQLAPI.d.ts +1 -1
  35. package/dist/esm/internals/InternalGraphQLAPI.mjs +10 -9
  36. package/dist/esm/internals/InternalGraphQLAPI.mjs.map +1 -1
  37. package/dist/esm/internals/generateClient.mjs +5 -5
  38. package/dist/esm/internals/generateClient.mjs.map +1 -1
  39. package/dist/esm/internals/generateCustomOperationsProperty.d.ts +2 -2
  40. package/dist/esm/internals/operations/custom.d.ts +1 -1
  41. package/dist/esm/internals/operations/custom.mjs +5 -21
  42. package/dist/esm/internals/operations/custom.mjs.map +1 -1
  43. package/dist/esm/internals/operations/get.d.ts +1 -1
  44. package/dist/esm/internals/operations/get.mjs.map +1 -1
  45. package/dist/esm/internals/operations/indexQuery.d.ts +3 -3
  46. package/dist/esm/internals/operations/indexQuery.mjs.map +1 -1
  47. package/dist/esm/internals/operations/list.d.ts +1 -1
  48. package/dist/esm/internals/operations/list.mjs +1 -1
  49. package/dist/esm/internals/operations/list.mjs.map +1 -1
  50. package/dist/esm/internals/operations/subscription.d.ts +1 -1
  51. package/dist/esm/internals/operations/subscription.mjs.map +1 -1
  52. package/dist/esm/internals/server/generateClientWithAmplifyInstance.d.ts +1 -1
  53. package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs +3 -3
  54. package/dist/esm/internals/server/generateClientWithAmplifyInstance.mjs.map +1 -1
  55. package/dist/esm/internals/server/generateModelsProperty.d.ts +1 -2
  56. package/dist/esm/internals/server/generateModelsProperty.mjs +1 -1
  57. package/dist/esm/internals/server/generateModelsProperty.mjs.map +1 -1
  58. package/dist/esm/internals/types.d.ts +2 -2
  59. package/dist/esm/internals/utils/clientProperties/generateEnumsProperty.mjs.map +1 -0
  60. package/dist/esm/internals/utils/{generateModelsProperty.d.ts → clientProperties/generateModelsProperty.d.ts} +1 -1
  61. package/dist/esm/internals/utils/{generateModelsProperty.mjs → clientProperties/generateModelsProperty.mjs} +7 -7
  62. package/dist/esm/internals/utils/clientProperties/generateModelsProperty.mjs.map +1 -0
  63. package/dist/esm/internals/utils/runtimeTypeGuards/isApiGraphQLProviderConfig.mjs.map +1 -0
  64. package/dist/esm/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.mjs.map +1 -0
  65. package/dist/esm/internals/v6.d.ts +1 -1
  66. package/dist/esm/internals/v6.mjs +0 -2
  67. package/dist/esm/internals/v6.mjs.map +1 -1
  68. package/dist/esm/types/index.d.ts +33 -35
  69. package/dist/esm/utils/ConnectionStateMonitor.d.ts +2 -2
  70. package/dist/esm/utils/ConnectionStateMonitor.mjs.map +1 -1
  71. package/dist/esm/utils/ReachabilityMonitor/index.native.mjs.map +1 -1
  72. package/dist/esm/utils/errors/repackageAuthError.d.ts +2 -2
  73. package/dist/esm/utils/errors/repackageAuthError.mjs +1 -1
  74. package/dist/esm/utils/errors/repackageAuthError.mjs.map +1 -1
  75. package/dist/esm/utils/findIndexByFields.d.ts +1 -1
  76. package/package.json +8 -7
  77. package/src/GraphQLAPI.ts +4 -3
  78. package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +84 -64
  79. package/src/internals/APIClient.ts +60 -28
  80. package/src/internals/InternalGraphQLAPI.ts +26 -30
  81. package/src/internals/clientUtils.ts +1 -1
  82. package/src/internals/generateClient.ts +13 -11
  83. package/src/internals/generateCustomOperationsProperty.ts +7 -6
  84. package/src/internals/operations/custom.ts +21 -35
  85. package/src/internals/operations/get.ts +9 -8
  86. package/src/internals/operations/indexQuery.ts +12 -11
  87. package/src/internals/operations/list.ts +11 -15
  88. package/src/internals/operations/observeQuery.ts +3 -1
  89. package/src/internals/operations/subscription.ts +12 -10
  90. package/src/internals/server/generateClientWithAmplifyInstance.ts +9 -9
  91. package/src/internals/server/generateModelsProperty.ts +7 -4
  92. package/src/internals/types.ts +2 -2
  93. package/src/internals/utils/{generateEnumsProperty.ts → clientProperties/generateEnumsProperty.ts} +7 -6
  94. package/src/internals/utils/{generateModelsProperty.ts → clientProperties/generateModelsProperty.ts} +10 -9
  95. package/src/internals/v6.ts +6 -4
  96. package/src/server/generateClient.ts +4 -1
  97. package/src/types/PubSub.ts +1 -0
  98. package/src/types/index.ts +51 -47
  99. package/src/utils/ConnectionStateMonitor.ts +8 -3
  100. package/src/utils/ReachabilityMonitor/index.native.ts +1 -1
  101. package/src/utils/ReachabilityMonitor/index.ts +1 -0
  102. package/src/utils/ReconnectionMonitor.ts +1 -0
  103. package/src/utils/errors/repackageAuthError.ts +6 -7
  104. package/src/utils/findIndexByFields.ts +1 -1
  105. package/src/utils/resolveConfig.ts +1 -0
  106. package/src/utils/resolveLibraryOptions.ts +1 -0
  107. package/src/utils/resolveOwnerFields.ts +7 -5
  108. package/src/utils/resolvePKFields.ts +1 -0
  109. package/dist/cjs/internals/utils/generateEnumsProperty.js.map +0 -1
  110. package/dist/cjs/internals/utils/generateModelsProperty.js.map +0 -1
  111. package/dist/cjs/internals/utils/isApiGraphQLProviderConfig.js.map +0 -1
  112. package/dist/cjs/internals/utils/isConfigureEventWithResourceConfig.js.map +0 -1
  113. package/dist/esm/internals/utils/generateEnumsProperty.mjs.map +0 -1
  114. package/dist/esm/internals/utils/generateModelsProperty.mjs.map +0 -1
  115. package/dist/esm/internals/utils/isApiGraphQLProviderConfig.mjs.map +0 -1
  116. package/dist/esm/internals/utils/isConfigureEventWithResourceConfig.mjs.map +0 -1
  117. /package/dist/cjs/internals/utils/{generateEnumsProperty.js → clientProperties/generateEnumsProperty.js} +0 -0
  118. /package/dist/cjs/internals/utils/{isApiGraphQLProviderConfig.js → runtimeTypeGuards/isApiGraphQLProviderConfig.js} +0 -0
  119. /package/dist/cjs/internals/utils/{isConfigureEventWithResourceConfig.js → runtimeTypeGuards/isConfigureEventWithResourceConfig.js} +0 -0
  120. /package/dist/esm/internals/utils/{generateEnumsProperty.d.ts → clientProperties/generateEnumsProperty.d.ts} +0 -0
  121. /package/dist/esm/internals/utils/{generateEnumsProperty.mjs → clientProperties/generateEnumsProperty.mjs} +0 -0
  122. /package/dist/esm/internals/utils/{isApiGraphQLProviderConfig.d.ts → runtimeTypeGuards/isApiGraphQLProviderConfig.d.ts} +0 -0
  123. /package/dist/esm/internals/utils/{isApiGraphQLProviderConfig.mjs → runtimeTypeGuards/isApiGraphQLProviderConfig.mjs} +0 -0
  124. /package/dist/esm/internals/utils/{isConfigureEventWithResourceConfig.d.ts → runtimeTypeGuards/isConfigureEventWithResourceConfig.d.ts} +0 -0
  125. /package/dist/esm/internals/utils/{isConfigureEventWithResourceConfig.mjs → runtimeTypeGuards/isConfigureEventWithResourceConfig.mjs} +0 -0
  126. /package/src/internals/utils/{isApiGraphQLProviderConfig.ts → runtimeTypeGuards/isApiGraphQLProviderConfig.ts} +0 -0
  127. /package/src/internals/utils/{isConfigureEventWithResourceConfig.ts → runtimeTypeGuards/isConfigureEventWithResourceConfig.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isConfigureEventWithResourceConfig.mjs","sources":["../../../../../src/internals/utils/runtimeTypeGuards/isConfigureEventWithResourceConfig.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function isConfigureEventWithResourceConfig(payload) {\n return payload.event === 'configure';\n}\n"],"names":[],"mappings":"AAAA;AACA;AACO,SAAS,kCAAkC,CAAC,OAAO,EAAE;AAC5D,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,CAAC;AACzC;;;;"}
@@ -1,5 +1,5 @@
1
- import { V6Client, GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
2
1
  import { CustomHeaders } from '@aws-amplify/data-schema-types';
2
+ import { GraphQLOptionsV6, GraphQLResponseV6, V6Client } from '../types';
3
3
  /**
4
4
  * Invokes graphql operations against a graphql service, providing correct input and
5
5
  * output types if Amplify-generated graphql from a recent version of the CLI/codegen
@@ -1,8 +1,6 @@
1
1
  import { GraphQLAPI } from '../GraphQLAPI.mjs';
2
2
  import { __authMode, __authToken, __amplify } from '../types/index.mjs';
3
3
 
4
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
- // SPDX-License-Identifier: Apache-2.0
6
4
  /**
7
5
  * Invokes graphql operations against a graphql service, providing correct input and
8
6
  * output types if Amplify-generated graphql from a recent version of the CLI/codegen
@@ -1 +1 @@
1
- {"version":3,"file":"v6.mjs","sources":["../../../src/internals/v6.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { GraphQLAPI } from '../GraphQLAPI';\nimport { __amplify, __authMode, __authToken, } from '../types';\n/**\n * Invokes graphql operations against a graphql service, providing correct input and\n * output types if Amplify-generated graphql from a recent version of the CLI/codegen\n * are used *or* correct typing is provided via the type argument.\n *\n * Amplify-generated \"branded\" graphql queries will look similar to this:\n *\n * ```ts\n * //\n * // |-- branding\n * // v\n * export const getModel = `...` as GeneratedQuery<\n * \tGetModelQueryVariables,\n * \tGetModelQuery\n * >;\n * ```\n *\n * If this branding is not in your generated graphql, update to a newer version of\n * CLI/codegen and regenerate your graphql using `amplify codegen`.\n *\n * ## Using Amplify-generated graphql\n *\n * ```ts\n * import * as queries from './graphql/queries';\n *\n * //\n * // |-- correctly typed graphql response containing a Widget\n * // v\n * const queryResult = await graphql({\n * \tquery: queries.getWidget,\n * \tvariables: {\n * \t\tid: \"abc\", // <-- type hinted/enforced\n * \t},\n * });\n *\n * //\n * // |-- a correctly typed Widget\n * // v\n * const fetchedWidget = queryResult.data?.getWidget!;\n * ```\n *\n * ## Custom input + result types\n *\n * To provide input types (`variables`) and result types:\n *\n * ```ts\n * type GetById_NameOnly = {\n * \tvariables: {\n * \t\tid: string\n * \t},\n * \tresult: Promise<{\n * \t\tdata: { getWidget: { name: string } }\n * \t}>\n * }\n *\n * //\n * // |-- type is GetById_NameOnly[\"result\"]\n * // v\n * const result = graphql<GetById_NameOnly>({\n * \tquery: \"...\",\n * \tvariables: { id: \"abc\" } // <-- type of GetById_NameOnly[\"variables\"]\n * });\n * ```\n *\n * ## Custom result type only\n *\n * To specify result types only, use a type that is *not* in the `{variables, result}` shape:\n *\n * ```ts\n * type MyResultType = Promise<{\n * \tdata: {\n * \t\tgetWidget: { name: string }\n * \t}\n * }>\n *\n * //\n * // |-- type is MyResultType\n * // v\n * const result = graphql<MyResultType>({query: \"...\"});\n * ```\n *\n * @param options\n * @param additionalHeaders\n */\nexport function graphql(options, additionalHeaders) {\n // inject client-level auth\n options.authMode = options.authMode || this[__authMode];\n options.authToken = options.authToken || this[__authToken];\n /**\n * The correctness of these typings depends on correct string branding or overrides.\n * Neither of these can actually be validated at runtime. Hence, we don't perform\n * any validation or type-guarding here.\n */\n const result = GraphQLAPI.graphql(this[__amplify], options, additionalHeaders);\n return result;\n}\n/**\n * Cancels an inflight request. Only applicable for graphql queries and mutations\n * @param {any} request - request to cancel\n * @returns - A boolean indicating if the request was cancelled\n */\nexport function cancel(promise, message) {\n return GraphQLAPI.cancel(promise, message);\n}\n/**\n * Checks to see if an error thrown is from an api request cancellation\n * @param {any} error - Any error\n * @returns - A boolean indicating if the error was from an api request cancellation\n */\nexport function isCancelError(error) {\n return GraphQLAPI.isCancelError(error);\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE;AACpD;AACA,IAAI,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC5D,IAAI,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACnF,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE;AACzC,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"v6.mjs","sources":["../../../src/internals/v6.ts"],"sourcesContent":["import { GraphQLAPI } from '../GraphQLAPI';\nimport { __amplify, __authMode, __authToken, } from '../types';\n/**\n * Invokes graphql operations against a graphql service, providing correct input and\n * output types if Amplify-generated graphql from a recent version of the CLI/codegen\n * are used *or* correct typing is provided via the type argument.\n *\n * Amplify-generated \"branded\" graphql queries will look similar to this:\n *\n * ```ts\n * //\n * // |-- branding\n * // v\n * export const getModel = `...` as GeneratedQuery<\n * \tGetModelQueryVariables,\n * \tGetModelQuery\n * >;\n * ```\n *\n * If this branding is not in your generated graphql, update to a newer version of\n * CLI/codegen and regenerate your graphql using `amplify codegen`.\n *\n * ## Using Amplify-generated graphql\n *\n * ```ts\n * import * as queries from './graphql/queries';\n *\n * //\n * // |-- correctly typed graphql response containing a Widget\n * // v\n * const queryResult = await graphql({\n * \tquery: queries.getWidget,\n * \tvariables: {\n * \t\tid: \"abc\", // <-- type hinted/enforced\n * \t},\n * });\n *\n * //\n * // |-- a correctly typed Widget\n * // v\n * const fetchedWidget = queryResult.data?.getWidget!;\n * ```\n *\n * ## Custom input + result types\n *\n * To provide input types (`variables`) and result types:\n *\n * ```ts\n * type GetById_NameOnly = {\n * \tvariables: {\n * \t\tid: string\n * \t},\n * \tresult: Promise<{\n * \t\tdata: { getWidget: { name: string } }\n * \t}>\n * }\n *\n * //\n * // |-- type is GetById_NameOnly[\"result\"]\n * // v\n * const result = graphql<GetById_NameOnly>({\n * \tquery: \"...\",\n * \tvariables: { id: \"abc\" } // <-- type of GetById_NameOnly[\"variables\"]\n * });\n * ```\n *\n * ## Custom result type only\n *\n * To specify result types only, use a type that is *not* in the `{variables, result}` shape:\n *\n * ```ts\n * type MyResultType = Promise<{\n * \tdata: {\n * \t\tgetWidget: { name: string }\n * \t}\n * }>\n *\n * //\n * // |-- type is MyResultType\n * // v\n * const result = graphql<MyResultType>({query: \"...\"});\n * ```\n *\n * @param options\n * @param additionalHeaders\n */\nexport function graphql(options, additionalHeaders) {\n // inject client-level auth\n options.authMode = options.authMode || this[__authMode];\n options.authToken = options.authToken || this[__authToken];\n /**\n * The correctness of these typings depends on correct string branding or overrides.\n * Neither of these can actually be validated at runtime. Hence, we don't perform\n * any validation or type-guarding here.\n */\n const result = GraphQLAPI.graphql(this[__amplify], options, additionalHeaders);\n return result;\n}\n/**\n * Cancels an inflight request. Only applicable for graphql queries and mutations\n * @param {any} request - request to cancel\n * @returns - A boolean indicating if the request was cancelled\n */\nexport function cancel(promise, message) {\n return GraphQLAPI.cancel(promise, message);\n}\n/**\n * Checks to see if an error thrown is from an api request cancellation\n * @param {any} error - Any error\n * @returns - A boolean indicating if the error was from an api request cancellation\n */\nexport function isCancelError(error) {\n return GraphQLAPI.isCancelError(error);\n}\n"],"names":[],"mappings":";;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE;AACpD;AACA,IAAI,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC5D,IAAI,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;AAC/D;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACnF,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE;AACzC,IAAI,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC;AACD;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC3C;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { AmplifyClassV6, ResourcesConfig } from '@aws-amplify/core';
2
- import { EnumTypes, ModelTypes, CustomHeaders, CustomQueries, CustomMutations } from '@aws-amplify/data-schema-types';
3
- import { Source, DocumentNode, GraphQLError } from 'graphql';
4
- export { OperationTypeNode } from 'graphql';
2
+ import { CustomHeaders, CustomMutations, CustomQueries, EnumTypes, ModelTypes } from '@aws-amplify/data-schema-types';
3
+ import { DocumentNode, GraphQLError, Source } from 'graphql';
5
4
  import { Observable } from 'rxjs';
6
- import { GraphQLAuthMode, DocumentType } from '@aws-amplify/core/internals/utils';
5
+ import { DocumentType, GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
7
6
  import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
7
+ export { OperationTypeNode } from 'graphql';
8
8
  export { CONTROL_MSG, ConnectionState } from './PubSub';
9
9
  export { SelectionSet } from '@aws-amplify/data-schema-types';
10
10
  export { CommonPublicClientOptions } from '../internals/types';
@@ -24,9 +24,7 @@ export interface GraphQLOptions {
24
24
  export interface GraphQLResult<T = object> {
25
25
  data: T;
26
26
  errors?: GraphQLError[];
27
- extensions?: {
28
- [key: string]: any;
29
- };
27
+ extensions?: Record<string, any>;
30
28
  }
31
29
  declare const queryType: unique symbol;
32
30
  export type GraphQLQuery<T> = T & {
@@ -56,18 +54,18 @@ export type GraphQLSubscription<T> = T & {
56
54
  *
57
55
  * This util simply makes related model properties optional recursively.
58
56
  */
59
- export type GraphQLReturnType<T> = T extends {} ? {
57
+ export type GraphQLReturnType<T> = T extends Record<string, unknown> ? {
60
58
  [K in keyof T]?: GraphQLReturnType<T[K]>;
61
59
  } : T;
62
60
  /**
63
61
  * Describes a paged list result from AppSync, which can either
64
62
  * live at the top query or property (e.g., related model) level.
65
63
  */
66
- type PagedList<T, TYPENAME> = {
64
+ interface PagedList<T, TYPENAME> {
67
65
  __typename: TYPENAME;
68
66
  nextToken?: string | null | undefined;
69
- items: Array<T>;
70
- };
67
+ items: T[];
68
+ }
71
69
  /**
72
70
  * Recursively looks through a result type and removes nulls and
73
71
  * and undefined from `PagedList` types.
@@ -76,7 +74,7 @@ type PagedList<T, TYPENAME> = {
76
74
  * array, this will only be the case when we also have errors,
77
75
  * which will then be *thrown*.
78
76
  */
79
- type WithListsFixed<T> = T extends PagedList<infer IT, infer NAME> ? PagedList<Exclude<IT, null | undefined>, NAME> : T extends {} ? {
77
+ type WithListsFixed<T> = T extends PagedList<infer IT, infer NAME> ? PagedList<Exclude<IT, null | undefined>, NAME> : T extends Record<string, unknown> ? {
80
78
  [K in keyof T]: WithListsFixed<T[K]>;
81
79
  } : T;
82
80
  /**
@@ -132,9 +130,9 @@ export type GraphqlSubscriptionResult<T> = Observable<GraphqlSubscriptionMessage
132
130
  * })
133
131
  * ```
134
132
  */
135
- export type GraphqlSubscriptionMessage<T> = {
133
+ export interface GraphqlSubscriptionMessage<T> {
136
134
  data: T;
137
- };
135
+ }
138
136
  export interface AWSAppSyncRealTimeProviderOptions {
139
137
  appSyncGraphqlEndpoint?: string;
140
138
  authenticationType?: GraphQLAuthMode;
@@ -142,12 +140,12 @@ export interface AWSAppSyncRealTimeProviderOptions {
142
140
  variables?: Record<string, unknown>;
143
141
  apiKey?: string;
144
142
  region?: string;
145
- libraryConfigHeaders?: () => {} | (() => Promise<{}>);
143
+ libraryConfigHeaders?(): Record<string, unknown> | (() => Promise<Record<string, unknown> | Headers>);
146
144
  additionalHeaders?: CustomHeaders;
147
145
  }
148
- export type AWSAppSyncRealTimeProvider = {
146
+ export interface AWSAppSyncRealTimeProvider {
149
147
  subscribe(options?: AWSAppSyncRealTimeProviderOptions): Observable<Record<string, unknown>>;
150
- };
148
+ }
151
149
  export declare enum GraphQLAuthError {
152
150
  NO_API_KEY = "No api-key configured",
153
151
  NO_CURRENT_USER = "No current user",
@@ -191,7 +189,7 @@ export type GraphQLVariablesV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extend
191
189
  * The expected return type with respect to the given `FALLBACK_TYPE`
192
190
  * and `TYPED_GQL_STRING`.
193
191
  */
194
- export type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer IN, infer QUERY_OUT> ? Promise<GraphQLResult<FixedQueryResult<QUERY_OUT>>> : TYPED_GQL_STRING extends GeneratedMutation<infer IN, infer MUTATION_OUT> ? Promise<GraphQLResult<NeverEmpty<MUTATION_OUT>>> : TYPED_GQL_STRING extends GeneratedSubscription<infer IN, infer SUB_OUT> ? GraphqlSubscriptionResult<NeverEmpty<SUB_OUT>> : FALLBACK_TYPE extends GraphQLQuery<infer T> ? Promise<GraphQLResult<FALLBACK_TYPE>> : FALLBACK_TYPE extends GraphQLSubscription<infer T> ? GraphqlSubscriptionResult<FALLBACK_TYPE> : FALLBACK_TYPE extends GraphQLOperationType<infer IN, infer CUSTOM_OUT> ? CUSTOM_OUT : UnknownGraphQLResponse;
192
+ export type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer _, infer QUERY_OUT> ? Promise<GraphQLResult<FixedQueryResult<QUERY_OUT>>> : TYPED_GQL_STRING extends GeneratedMutation<infer _, infer MUTATION_OUT> ? Promise<GraphQLResult<NeverEmpty<MUTATION_OUT>>> : TYPED_GQL_STRING extends GeneratedSubscription<infer _, infer SUB_OUT> ? GraphqlSubscriptionResult<NeverEmpty<SUB_OUT>> : FALLBACK_TYPE extends GraphQLQuery<infer _> ? Promise<GraphQLResult<FALLBACK_TYPE>> : FALLBACK_TYPE extends GraphQLSubscription<infer _> ? GraphqlSubscriptionResult<FALLBACK_TYPE> : FALLBACK_TYPE extends GraphQLOperationType<infer _, infer CUSTOM_OUT> ? CUSTOM_OUT : UnknownGraphQLResponse;
195
193
  /**
196
194
  * The shape customers can use to provide `T` to `graphql<T>()` to specify both
197
195
  * `IN` and `OUT` types (the type of `variables` and the return type, respectively).
@@ -210,10 +208,10 @@ export type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING extends
210
208
  * })
211
209
  * ```
212
210
  */
213
- export type GraphQLOperationType<IN extends {}, OUT extends {}> = {
211
+ export interface GraphQLOperationType<IN extends Record<string, DocumentType>, OUT extends Record<string, DocumentType>> {
214
212
  variables: IN;
215
213
  result: OUT;
216
- };
214
+ }
217
215
  /**
218
216
  * Nominal type for branding generated graphql query operation strings with
219
217
  * input and output types.
@@ -291,8 +289,8 @@ export type V6Client<T extends Record<any, any> = never> = ExcludeNeverFields<{
291
289
  [__authToken]?: string;
292
290
  [__headers]?: CustomHeaders;
293
291
  graphql: GraphQLMethod;
294
- cancel: (promise: Promise<any>, message?: string) => boolean;
295
- isCancelError: (error: any) => boolean;
292
+ cancel(promise: Promise<any>, message?: string): boolean;
293
+ isCancelError(error: any): boolean;
296
294
  models: ModelTypes<T>;
297
295
  enums: EnumTypes<T>;
298
296
  queries: CustomQueries<T>;
@@ -304,8 +302,8 @@ export type V6ClientSSRRequest<T extends Record<any, any> = never> = ExcludeNeve
304
302
  [__authToken]?: string;
305
303
  [__headers]?: CustomHeaders;
306
304
  graphql: GraphQLMethodSSR;
307
- cancel: (promise: Promise<any>, message?: string) => boolean;
308
- isCancelError: (error: any) => boolean;
305
+ cancel(promise: Promise<any>, message?: string): boolean;
306
+ isCancelError(error: any): boolean;
309
307
  models: ModelTypes<T, 'REQUEST'>;
310
308
  enums: EnumTypes<T>;
311
309
  queries: CustomQueries<T, 'REQUEST'>;
@@ -317,8 +315,8 @@ export type V6ClientSSRCookies<T extends Record<any, any> = never> = ExcludeNeve
317
315
  [__authToken]?: string;
318
316
  [__headers]?: CustomHeaders;
319
317
  graphql: GraphQLMethod;
320
- cancel: (promise: Promise<any>, message?: string) => boolean;
321
- isCancelError: (error: any) => boolean;
318
+ cancel(promise: Promise<any>, message?: string): boolean;
319
+ isCancelError(error: any): boolean;
322
320
  models: ModelTypes<T, 'COOKIES'>;
323
321
  enums: EnumTypes<T>;
324
322
  queries: CustomQueries<T, 'COOKIES'>;
@@ -331,22 +329,22 @@ export type GraphQLMethodSSR = <FALLBACK_TYPES = unknown, TYPED_GQL_STRING exten
331
329
  *
332
330
  * The knobs available for configuring `server/generateClient` internally.
333
331
  */
334
- export type ServerClientGenerationParams = {
332
+ export interface ServerClientGenerationParams {
335
333
  amplify: null | ((fn: (amplify: AmplifyClassV6) => Promise<any>) => Promise<any>);
336
334
  config: ResourcesConfig;
337
- };
335
+ }
338
336
  export type QueryArgs = Record<string, unknown>;
339
- export type ListArgs = {
337
+ export interface ListArgs extends Record<string, unknown> {
340
338
  selectionSet?: string[];
341
- filter?: {};
339
+ filter?: Record<string, unknown>;
342
340
  headers?: CustomHeaders;
343
- };
344
- export type AuthModeParams = {
341
+ }
342
+ export interface AuthModeParams extends Record<string, unknown> {
345
343
  authMode?: GraphQLAuthMode;
346
344
  authToken?: string;
347
- };
348
- export type GenerateServerClientParams = {
345
+ }
346
+ export interface GenerateServerClientParams {
349
347
  config: ResourcesConfig;
350
348
  authMode?: GraphQLAuthMode;
351
349
  authToken?: string;
352
- };
350
+ }
@@ -2,12 +2,12 @@ import { Observable } from 'rxjs';
2
2
  import { ConnectionState } from '../types/PubSub';
3
3
  type LinkedConnectionState = 'connected' | 'disconnected';
4
4
  type LinkedHealthState = 'healthy' | 'unhealthy';
5
- type LinkedConnectionStates = {
5
+ interface LinkedConnectionStates {
6
6
  networkState: LinkedConnectionState;
7
7
  connectionState: LinkedConnectionState | 'connecting';
8
8
  intendedConnectionState: LinkedConnectionState;
9
9
  keepAliveState: LinkedHealthState;
10
- };
10
+ }
11
11
  export declare const CONNECTION_CHANGE: {
12
12
  [key in 'KEEP_ALIVE_MISSED' | 'KEEP_ALIVE' | 'CONNECTION_ESTABLISHED' | 'CONNECTION_FAILED' | 'CLOSING_CONNECTION' | 'OPENING_CONNECTION' | 'CLOSED' | 'ONLINE' | 'OFFLINE']: Partial<LinkedConnectionStates>;
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionStateMonitor.mjs","sources":["../../../src/utils/ConnectionStateMonitor.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Observable, map, filter } from 'rxjs';\nimport { ConnectionState } from '../types/PubSub';\nimport { ReachabilityMonitor } from './ReachabilityMonitor';\nexport const CONNECTION_CHANGE = {\n KEEP_ALIVE_MISSED: { keepAliveState: 'unhealthy' },\n KEEP_ALIVE: { keepAliveState: 'healthy' },\n CONNECTION_ESTABLISHED: { connectionState: 'connected' },\n CONNECTION_FAILED: {\n intendedConnectionState: 'disconnected',\n connectionState: 'disconnected',\n },\n CLOSING_CONNECTION: { intendedConnectionState: 'disconnected' },\n OPENING_CONNECTION: {\n intendedConnectionState: 'connected',\n connectionState: 'connecting',\n },\n CLOSED: { connectionState: 'disconnected' },\n ONLINE: { networkState: 'connected' },\n OFFLINE: { networkState: 'disconnected' },\n};\nexport class ConnectionStateMonitor {\n constructor() {\n this._networkMonitoringSubscription = undefined;\n this._linkedConnectionState = {\n networkState: 'connected',\n connectionState: 'disconnected',\n intendedConnectionState: 'disconnected',\n keepAliveState: 'healthy',\n };\n // Attempt to update the state with the current actual network state\n this._initialNetworkStateSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n this._initialNetworkStateSubscription?.unsubscribe();\n });\n this._linkedConnectionStateObservable =\n new Observable(connectionStateObserver => {\n connectionStateObserver.next(this._linkedConnectionState);\n this._linkedConnectionStateObserver = connectionStateObserver;\n });\n }\n /**\n * Turn network state monitoring on if it isn't on already\n */\n enableNetworkMonitoring() {\n // If no initial network state was discovered, stop trying\n this._initialNetworkStateSubscription?.unsubscribe();\n // Maintain the network state based on the reachability monitor\n if (this._networkMonitoringSubscription === undefined) {\n this._networkMonitoringSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n });\n }\n }\n /**\n * Turn network state monitoring off if it isn't off already\n */\n disableNetworkMonitoring() {\n this._networkMonitoringSubscription?.unsubscribe();\n this._networkMonitoringSubscription = undefined;\n }\n /**\n * Get the observable that allows us to monitor the connection state\n *\n * @returns {Observable<ConnectionState>} - The observable that emits ConnectionState updates\n */\n get connectionStateObservable() {\n let previous;\n // The linked state aggregates state changes to any of the network, connection,\n // intendedConnection and keepAliveHealth. Some states will change these independent\n // states without changing the overall connection state.\n // After translating from linked states to ConnectionState, then remove any duplicates\n return this._linkedConnectionStateObservable\n .pipe(map(value => {\n return this.connectionStatesTranslator(value);\n }))\n .pipe(filter(current => {\n const toInclude = current !== previous;\n previous = current;\n return toInclude;\n }));\n }\n /*\n * Updates local connection state and emits the full state to the observer.\n */\n record(statusUpdates) {\n // Maintain the network monitor\n if (statusUpdates.intendedConnectionState === 'connected') {\n this.enableNetworkMonitoring();\n }\n else if (statusUpdates.intendedConnectionState === 'disconnected') {\n this.disableNetworkMonitoring();\n }\n // Maintain the socket state\n const newSocketStatus = {\n ...this._linkedConnectionState,\n ...statusUpdates,\n };\n this._linkedConnectionState = { ...newSocketStatus };\n this._linkedConnectionStateObserver?.next(this._linkedConnectionState);\n }\n /*\n * Translate the ConnectionState structure into a specific ConnectionState string literal union\n */\n connectionStatesTranslator({ connectionState, networkState, intendedConnectionState, keepAliveState, }) {\n if (connectionState === 'connected' && networkState === 'disconnected')\n return ConnectionState.ConnectedPendingNetwork;\n if (connectionState === 'connected' &&\n intendedConnectionState === 'disconnected')\n return ConnectionState.ConnectedPendingDisconnect;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected' &&\n networkState === 'disconnected')\n return ConnectionState.ConnectionDisruptedPendingNetwork;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected')\n return ConnectionState.ConnectionDisrupted;\n if (connectionState === 'connected' && keepAliveState === 'unhealthy')\n return ConnectionState.ConnectedPendingKeepAlive;\n // All remaining states directly correspond to the connection state\n if (connectionState === 'connecting')\n return ConnectionState.Connecting;\n if (connectionState === 'disconnected')\n return ConnectionState.Disconnected;\n return ConnectionState.Connected;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,iBAAiB,GAAG;AACjC,IAAI,iBAAiB,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;AACtD,IAAI,UAAU,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;AAC7C,IAAI,sBAAsB,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE;AAC5D,IAAI,iBAAiB,EAAE;AACvB,QAAQ,uBAAuB,EAAE,cAAc;AAC/C,QAAQ,eAAe,EAAE,cAAc;AACvC,KAAK;AACL,IAAI,kBAAkB,EAAE,EAAE,uBAAuB,EAAE,cAAc,EAAE;AACnE,IAAI,kBAAkB,EAAE;AACxB,QAAQ,uBAAuB,EAAE,WAAW;AAC5C,QAAQ,eAAe,EAAE,YAAY;AACrC,KAAK;AACL,IAAI,MAAM,EAAE,EAAE,eAAe,EAAE,cAAc,EAAE;AAC/C,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE;AACzC,IAAI,OAAO,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE;AAC7C,EAAE;AACK,MAAM,sBAAsB,CAAC;AACpC,IAAI,WAAW,GAAG;AAClB,QAAQ,IAAI,CAAC,8BAA8B,GAAG,SAAS,CAAC;AACxD,QAAQ,IAAI,CAAC,sBAAsB,GAAG;AACtC,YAAY,YAAY,EAAE,WAAW;AACrC,YAAY,eAAe,EAAE,cAAc;AAC3C,YAAY,uBAAuB,EAAE,cAAc;AACnD,YAAY,cAAc,EAAE,SAAS;AACrC,SAAS,CAAC;AACV;AACA,QAAQ,IAAI,CAAC,gCAAgC,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,CAAC,0BAA0B,CAAC;AAC9D,QAAQ,IAAI,eAAe,KAAK,cAAc;AAC9C,YAAY,uBAAuB,KAAK,WAAW;AACnD,YAAY,YAAY,KAAK,cAAc;AAC3C,YAAY,OAAO,eAAe,CAAC,iCAAiC,CAAC;AACrE,QAAQ,IAAI,eAAe,KAAK,cAAc;AAC9C,YAAY,uBAAuB,KAAK,WAAW;AACnD,YAAY,OAAO,eAAe,CAAC,mBAAmB,CAAC;AACvD,QAAQ,IAAI,eAAe,KAAK,WAAW,IAAI,cAAc,KAAK,WAAW;AAC7E,YAAY,OAAO,eAAe,CAAC,yBAAyB,CAAC;AAC7D;AACA,QAAQ,IAAI,eAAe,KAAK,YAAY;AAC5C,YAAY,OAAO,eAAe,CAAC,UAAU,CAAC;AAC9C,QAAQ,IAAI,eAAe,KAAK,cAAc;AAC9C,YAAY,OAAO,eAAe,CAAC,YAAY,CAAC;AAChD,QAAQ,OAAO,eAAe,CAAC,SAAS,CAAC;AACzC,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"ConnectionStateMonitor.mjs","sources":["../../../src/utils/ConnectionStateMonitor.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Observable, filter, map } from 'rxjs';\nimport { ConnectionState } from '../types/PubSub';\nimport { ReachabilityMonitor } from './ReachabilityMonitor';\nexport const CONNECTION_CHANGE = {\n KEEP_ALIVE_MISSED: { keepAliveState: 'unhealthy' },\n KEEP_ALIVE: { keepAliveState: 'healthy' },\n CONNECTION_ESTABLISHED: { connectionState: 'connected' },\n CONNECTION_FAILED: {\n intendedConnectionState: 'disconnected',\n connectionState: 'disconnected',\n },\n CLOSING_CONNECTION: { intendedConnectionState: 'disconnected' },\n OPENING_CONNECTION: {\n intendedConnectionState: 'connected',\n connectionState: 'connecting',\n },\n CLOSED: { connectionState: 'disconnected' },\n ONLINE: { networkState: 'connected' },\n OFFLINE: { networkState: 'disconnected' },\n};\nexport class ConnectionStateMonitor {\n constructor() {\n this._networkMonitoringSubscription = undefined;\n this._linkedConnectionState = {\n networkState: 'connected',\n connectionState: 'disconnected',\n intendedConnectionState: 'disconnected',\n keepAliveState: 'healthy',\n };\n // Attempt to update the state with the current actual network state\n this._initialNetworkStateSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n this._initialNetworkStateSubscription?.unsubscribe();\n });\n this._linkedConnectionStateObservable =\n new Observable(connectionStateObserver => {\n connectionStateObserver.next(this._linkedConnectionState);\n this._linkedConnectionStateObserver = connectionStateObserver;\n });\n }\n /**\n * Turn network state monitoring on if it isn't on already\n */\n enableNetworkMonitoring() {\n // If no initial network state was discovered, stop trying\n this._initialNetworkStateSubscription?.unsubscribe();\n // Maintain the network state based on the reachability monitor\n if (this._networkMonitoringSubscription === undefined) {\n this._networkMonitoringSubscription = ReachabilityMonitor().subscribe(({ online }) => {\n this.record(online ? CONNECTION_CHANGE.ONLINE : CONNECTION_CHANGE.OFFLINE);\n });\n }\n }\n /**\n * Turn network state monitoring off if it isn't off already\n */\n disableNetworkMonitoring() {\n this._networkMonitoringSubscription?.unsubscribe();\n this._networkMonitoringSubscription = undefined;\n }\n /**\n * Get the observable that allows us to monitor the connection state\n *\n * @returns {Observable<ConnectionState>} - The observable that emits ConnectionState updates\n */\n get connectionStateObservable() {\n let previous;\n // The linked state aggregates state changes to any of the network, connection,\n // intendedConnection and keepAliveHealth. Some states will change these independent\n // states without changing the overall connection state.\n // After translating from linked states to ConnectionState, then remove any duplicates\n return this._linkedConnectionStateObservable\n .pipe(map(value => {\n return this.connectionStatesTranslator(value);\n }))\n .pipe(filter(current => {\n const toInclude = current !== previous;\n previous = current;\n return toInclude;\n }));\n }\n /*\n * Updates local connection state and emits the full state to the observer.\n */\n record(statusUpdates) {\n // Maintain the network monitor\n if (statusUpdates.intendedConnectionState === 'connected') {\n this.enableNetworkMonitoring();\n }\n else if (statusUpdates.intendedConnectionState === 'disconnected') {\n this.disableNetworkMonitoring();\n }\n // Maintain the socket state\n const newSocketStatus = {\n ...this._linkedConnectionState,\n ...statusUpdates,\n };\n this._linkedConnectionState = { ...newSocketStatus };\n this._linkedConnectionStateObserver?.next(this._linkedConnectionState);\n }\n /*\n * Translate the ConnectionState structure into a specific ConnectionState string literal union\n */\n connectionStatesTranslator({ connectionState, networkState, intendedConnectionState, keepAliveState, }) {\n if (connectionState === 'connected' && networkState === 'disconnected')\n return ConnectionState.ConnectedPendingNetwork;\n if (connectionState === 'connected' &&\n intendedConnectionState === 'disconnected')\n return ConnectionState.ConnectedPendingDisconnect;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected' &&\n networkState === 'disconnected')\n return ConnectionState.ConnectionDisruptedPendingNetwork;\n if (connectionState === 'disconnected' &&\n intendedConnectionState === 'connected')\n return ConnectionState.ConnectionDisrupted;\n if (connectionState === 'connected' && keepAliveState === 'unhealthy')\n return ConnectionState.ConnectedPendingKeepAlive;\n // All remaining states directly correspond to the connection state\n if (connectionState === 'connecting')\n return ConnectionState.Connecting;\n if (connectionState === 'disconnected')\n return ConnectionState.Disconnected;\n return ConnectionState.Connected;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAIY,MAAC,iBAAiB,GAAG;AACjC,IAAI,iBAAiB,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;AACtD,IAAI,UAAU,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;AAC7C,IAAI,sBAAsB,EAAE,EAAE,eAAe,EAAE,WAAW,EAAE;AAC5D,IAAI,iBAAiB,EAAE;AACvB,QAAQ,uBAAuB,EAAE,cAAc;AAC/C,QAAQ,eAAe,EAAE,cAAc;AACvC,KAAK;AACL,IAAI,kBAAkB,EAAE,EAAE,uBAAuB,EAAE,cAAc,EAAE;AACnE,IAAI,kBAAkB,EAAE;AACxB,QAAQ,uBAAuB,EAAE,WAAW;AAC5C,QAAQ,eAAe,E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ent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Reachability } from '@aws-amplify/core/internals/utils';\nimport { default as NetInfo } from '@react-native-community/netinfo';\nexport const ReachabilityMonitor = () => new Reachability().networkMonitor(NetInfo);\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,mBAAmB,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,cAAc,CAAC,OAAO;;;;"}
1
+ {"version":3,"file":"index.native.mjs","sources":["../../../../src/utils/ReachabilityMonitor/index.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Reachability } from '@aws-amplify/core/internals/utils';\nimport NetInfo from '@react-native-community/netinfo';\nexport const ReachabilityMonitor = () => new Reachability().networkMonitor(NetInfo);\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,mBAAmB,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,cAAc,CAAC,OAAO;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { AmplifyErrorParams } from '@aws-amplify/core/internals/utils';
2
- type ErrorObject = {
2
+ interface ErrorObject {
3
3
  errors: AmplifyErrorParams[];
4
- };
4
+ }
5
5
  /**
6
6
  * Checks to see if the given response or subscription message contains an
7
7
  * unauth error. If it does, it changes the error message to include instructions
@@ -21,7 +21,7 @@ function repackageUnauthError(content) {
21
21
  }
22
22
  function isUnauthError(error) {
23
23
  // Error pattern corresponding to appsync calls
24
- if (error?.['originalError']?.['name']?.startsWith('UnauthorizedException')) {
24
+ if (error?.originalError?.name?.startsWith('UnauthorizedException')) {
25
25
  return true;
26
26
  }
27
27
  // Error pattern corresponding to appsync subscriptions
@@ -1 +1 @@
1
- {"version":3,"file":"repackageAuthError.mjs","sources":["../../../../src/utils/errors/repackageAuthError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Checks to see if the given response or subscription message contains an\n * unauth error. If it does, it changes the error message to include instructions\n * for the app developer.\n */\nexport function repackageUnauthError(content) {\n if (content.errors && Array.isArray(content.errors)) {\n content.errors.forEach(e => {\n if (isUnauthError(e)) {\n e.message = 'Unauthorized';\n e.recoverySuggestion =\n `If you're calling an Amplify-generated API, make sure ` +\n `to set the \"authMode\" in generateClient({ authMode: '...' }) to the backend authorization ` +\n `rule's auth provider ('apiKey', 'userPool', 'iam', 'oidc', 'lambda')`;\n }\n });\n }\n return content;\n}\nfunction isUnauthError(error) {\n // Error pattern corresponding to appsync calls\n if (error?.['originalError']?.['name']?.startsWith('UnauthorizedException')) {\n return true;\n }\n // Error pattern corresponding to appsync subscriptions\n if (error.message?.startsWith('Connection failed:') &&\n error.message?.includes('Permission denied')) {\n return true;\n }\n return false;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,OAAO,EAAE;AAC9C,IAAI,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACzD,QAAQ,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI;AACpC,YAAY,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;AAClC,gBAAgB,CAAC,CAAC,OAAO,GAAG,cAAc,CAAC;AAC3C,gBAAgB,CAAC,CAAC,kBAAkB;AACpC,oBAAoB,CAAC,sDAAsD,CAAC;AAC5E,wBAAwB,CAAC,0FAA0F,CAAC;AACpH,wBAAwB,CAAC,oEAAoE,CAAC,CAAC;AAC/F,aAAa;AACb,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,OAAO,CAAC;AACnB,CAAC;AACD,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B;AACA,IAAI,IAAI,KAAK,GAAG,eAAe,CAAC,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,uBAAuB,CAAC,EAAE;AACjF,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,oBAAoB,CAAC;AACvD,QAAQ,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EAAE;AACtD,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB;;;;"}
1
+ {"version":3,"file":"repackageAuthError.mjs","sources":["../../../../src/utils/errors/repackageAuthError.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Checks to see if the given response or subscription message contains an\n * unauth error. If it does, it changes the error message to include instructions\n * for the app developer.\n */\nexport function repackageUnauthError(content) {\n if (content.errors && Array.isArray(content.errors)) {\n content.errors.forEach(e => {\n if (isUnauthError(e)) {\n e.message = 'Unauthorized';\n e.recoverySuggestion =\n `If you're calling an Amplify-generated API, make sure ` +\n `to set the \"authMode\" in generateClient({ authMode: '...' }) to the backend authorization ` +\n `rule's auth provider ('apiKey', 'userPool', 'iam', 'oidc', 'lambda')`;\n }\n });\n }\n return content;\n}\nfunction isUnauthError(error) {\n // Error pattern corresponding to appsync calls\n if (error?.originalError?.name?.startsWith('UnauthorizedException')) {\n return true;\n }\n // Error pattern corresponding to appsync subscriptions\n if (error.message?.startsWith('Connection failed:') &&\n error.message?.includes('Permission denied')) {\n return true;\n }\n return false;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,OAAO,EAAE;AAC9C,IAAI,IAAI,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACzD,QAAQ,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI;AACpC,YAAY,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE;AAClC,gBAAgB,CAAC,CAAC,OAAO,GAAG,cAAc,CAAC;AAC3C,gBAAgB,CAAC,CAAC,kBAAkB;AACpC,oBAAoB,CAAC,sDAAsD,CAAC;AAC5E,wBAAwB,CAAC,0FAA0F,CAAC;AACpH,wBAAwB,CAAC,oEAAoE,CAAC,CAAC;AAC/F,aAAa;AACb,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,OAAO,CAAC;AACnB,CAAC;AACD,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B;AACA,IAAI,IAAI,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,CAAC,uBAAuB,CAAC,EAAE;AACzE,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL;AACA,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,oBAAoB,CAAC;AACvD,QAAQ,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EAAE;AACtD,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB;;;;"}
@@ -6,4 +6,4 @@
6
6
  * @param keyFields The fields used to indicate a match
7
7
  * @returns Index of `needle` in `haystack`, otherwise -1 if not found.
8
8
  */
9
- export declare function findIndexByFields<T>(needle: T, haystack: T[], keyFields: Array<keyof T>): number;
9
+ export declare function findIndexByFields<T>(needle: T, haystack: T[], keyFields: (keyof T)[]): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/api-graphql",
3
- "version": "4.0.19",
3
+ "version": "4.0.20-api-graphql-eslint.dd94c10.0+dd94c10",
4
4
  "description": "Api-graphql category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -24,7 +24,8 @@
24
24
  "clean": "npm run clean:size && rimraf dist lib lib-esm",
25
25
  "clean:size": "rimraf dual-publish-tmp tmp*",
26
26
  "format": "echo \"Not implemented\"",
27
- "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
27
+ "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
28
+ "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
28
29
  "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0"
29
30
  },
30
31
  "exports": {
@@ -71,7 +72,7 @@
71
72
  },
72
73
  "homepage": "https://aws-amplify.github.io/",
73
74
  "devDependencies": {
74
- "@aws-amplify/data-schema": "^0.13.6",
75
+ "@aws-amplify/data-schema": "^0.13.9",
75
76
  "@rollup/plugin-typescript": "11.1.5",
76
77
  "rollup": "^4.9.6",
77
78
  "typescript": "5.0.2"
@@ -84,9 +85,9 @@
84
85
  "server"
85
86
  ],
86
87
  "dependencies": {
87
- "@aws-amplify/api-rest": "4.0.19",
88
- "@aws-amplify/core": "6.0.19",
89
- "@aws-amplify/data-schema-types": "^0.7.5",
88
+ "@aws-amplify/api-rest": "4.0.20-api-graphql-eslint.dd94c10.0+dd94c10",
89
+ "@aws-amplify/core": "6.0.20-api-graphql-eslint.dd94c10.0+dd94c10",
90
+ "@aws-amplify/data-schema-types": "^0.7.6",
90
91
  "@aws-sdk/types": "3.387.0",
91
92
  "graphql": "15.8.0",
92
93
  "rxjs": "^7.8.1",
@@ -101,5 +102,5 @@
101
102
  "limit": "91.7 kB"
102
103
  }
103
104
  ],
104
- "gitHead": "848f05340c9c9a253b9cb52ca11b05d2ec53f8e6"
105
+ "gitHead": "dd94c10857a23881f88431454458ab36ce83dd7f"
105
106
  }
package/src/GraphQLAPI.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { AmplifyClassV6 } from '@aws-amplify/core';
4
- import { Category, ApiAction } from '@aws-amplify/core/internals/utils';
5
- import { GraphQLOptions, GraphQLResult } from './types';
6
- import { InternalGraphQLAPIClass } from './internals/InternalGraphQLAPI';
4
+ import { ApiAction, Category } from '@aws-amplify/core/internals/utils';
7
5
  import { CustomHeaders } from '@aws-amplify/data-schema-types';
8
6
  import { Observable } from 'rxjs';
9
7
 
8
+ import { GraphQLOptions, GraphQLResult } from './types';
9
+ import { InternalGraphQLAPIClass } from './internals/InternalGraphQLAPI';
10
+
10
11
  export const graphqlOperation = (
11
12
  query: any,
12
13
  variables = {},