react-easy-wall 1.0.22 → 1.0.25

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 (209) hide show
  1. package/dist/cjs/components/panel/Panel.js +0 -1
  2. package/dist/cjs/components/panel/Panel.js.map +1 -1
  3. package/dist/cjs/components/panel/PanelAvatar.js +2 -4
  4. package/dist/cjs/components/panel/PanelAvatar.js.map +1 -1
  5. package/dist/cjs/components/panel/PanelButton.js +0 -1
  6. package/dist/cjs/components/panel/PanelButton.js.map +1 -1
  7. package/dist/cjs/components/panel/PanelDivider.js +0 -1
  8. package/dist/cjs/components/panel/PanelDivider.js.map +1 -1
  9. package/dist/cjs/components/panel/PanelFooter.js +0 -1
  10. package/dist/cjs/components/panel/PanelFooter.js.map +1 -1
  11. package/dist/cjs/components/panel/PanelHeader.js +0 -1
  12. package/dist/cjs/components/panel/PanelHeader.js.map +1 -1
  13. package/dist/cjs/components/panel/PanelItem.js +0 -1
  14. package/dist/cjs/components/panel/PanelItem.js.map +1 -1
  15. package/dist/cjs/components/panel/PanelListItems.js +0 -1
  16. package/dist/cjs/components/panel/PanelListItems.js.map +1 -1
  17. package/dist/cjs/components/session/SessionProvider.js +0 -1
  18. package/dist/cjs/components/session/SessionProvider.js.map +1 -1
  19. package/dist/cjs/components/session/SessionUserContext.js +0 -1
  20. package/dist/cjs/components/session/SessionUserContext.js.map +1 -1
  21. package/dist/cjs/components/session/SessionUserProvider.js +0 -1
  22. package/dist/cjs/components/session/SessionUserProvider.js.map +1 -1
  23. package/dist/cjs/node_modules/@apollo/client/errors/CombinedProtocolErrors.js +85 -0
  24. package/dist/cjs/node_modules/@apollo/client/errors/CombinedProtocolErrors.js.map +1 -0
  25. package/dist/cjs/node_modules/@apollo/client/errors/ServerError.js +80 -0
  26. package/dist/cjs/node_modules/@apollo/client/errors/ServerError.js.map +1 -0
  27. package/dist/cjs/node_modules/@apollo/client/errors/ServerParseError.js +77 -0
  28. package/dist/cjs/node_modules/@apollo/client/errors/ServerParseError.js.map +1 -0
  29. package/dist/cjs/node_modules/@apollo/client/errors/index.js +9 -0
  30. package/dist/cjs/node_modules/@apollo/client/errors/index.js.map +1 -0
  31. package/dist/cjs/node_modules/@apollo/client/errors/utils.js +19 -0
  32. package/dist/cjs/node_modules/@apollo/client/errors/utils.js.map +1 -0
  33. package/dist/cjs/node_modules/@apollo/client/link/client-awareness/ClientAwarenessLink.js +91 -0
  34. package/dist/cjs/node_modules/@apollo/client/link/client-awareness/ClientAwarenessLink.js.map +1 -0
  35. package/dist/cjs/node_modules/@apollo/client/link/core/ApolloLink.js +262 -0
  36. package/dist/cjs/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
  37. package/dist/cjs/node_modules/@apollo/client/link/http/BaseHttpLink.js +155 -0
  38. package/dist/cjs/node_modules/@apollo/client/link/http/BaseHttpLink.js.map +1 -0
  39. package/dist/cjs/node_modules/@apollo/client/link/http/HttpLink.js +41 -0
  40. package/dist/cjs/node_modules/@apollo/client/link/http/HttpLink.js.map +1 -0
  41. package/dist/cjs/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js +168 -0
  42. package/dist/cjs/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js.map +1 -0
  43. package/dist/cjs/node_modules/@apollo/client/link/http/rewriteURIForGET.js +56 -0
  44. package/dist/cjs/node_modules/@apollo/client/link/http/rewriteURIForGET.js.map +1 -0
  45. package/dist/cjs/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js +106 -0
  46. package/dist/cjs/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js.map +1 -0
  47. package/dist/cjs/node_modules/@apollo/client/link/http/selectURI.js +18 -0
  48. package/dist/cjs/node_modules/@apollo/client/link/http/selectURI.js.map +1 -0
  49. package/dist/cjs/node_modules/@apollo/client/link/utils/createOperation.js +40 -0
  50. package/dist/cjs/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
  51. package/dist/cjs/node_modules/@apollo/client/link/utils/filterOperationVariables.js +27 -0
  52. package/dist/cjs/node_modules/@apollo/client/link/utils/filterOperationVariables.js.map +1 -0
  53. package/dist/cjs/node_modules/@apollo/client/utilities/caching/sizes.js +31 -0
  54. package/dist/cjs/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
  55. package/dist/cjs/node_modules/@apollo/client/utilities/environment/index.production.js +6 -0
  56. package/dist/cjs/node_modules/@apollo/client/utilities/environment/index.production.js.map +1 -0
  57. package/dist/cjs/node_modules/@apollo/client/utilities/graphql/operations.js +65 -0
  58. package/dist/cjs/node_modules/@apollo/client/utilities/graphql/operations.js.map +1 -0
  59. package/dist/cjs/node_modules/@apollo/client/utilities/graphql/print.js +31 -0
  60. package/dist/cjs/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
  61. package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.js +49 -0
  62. package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
  63. package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.js +62 -0
  64. package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
  65. package/dist/cjs/node_modules/@apollo/client/utilities/internal/compact.js +27 -0
  66. package/dist/cjs/node_modules/@apollo/client/utilities/internal/compact.js.map +1 -0
  67. package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +16 -0
  68. package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
  69. package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationName.js +13 -0
  70. package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
  71. package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/global.js +21 -0
  72. package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
  73. package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/maybe.js +11 -0
  74. package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
  75. package/dist/cjs/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +13 -0
  76. package/dist/cjs/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
  77. package/dist/cjs/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +19 -0
  78. package/dist/cjs/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
  79. package/dist/cjs/node_modules/@apollo/client/utilities/internal/memoize.js +33 -0
  80. package/dist/cjs/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
  81. package/dist/cjs/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +20 -0
  82. package/dist/cjs/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
  83. package/dist/cjs/node_modules/@apollo/client/utilities/invariant/index.js +94 -0
  84. package/dist/cjs/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
  85. package/dist/cjs/node_modules/@apollo/client/version.js +6 -0
  86. package/dist/cjs/node_modules/@apollo/client/version.js.map +1 -0
  87. package/dist/cjs/node_modules/@wry/caches/lib/weak.js +147 -0
  88. package/dist/cjs/node_modules/@wry/caches/lib/weak.js.map +1 -0
  89. package/dist/cjs/node_modules/@wry/trie/lib/index.js +86 -0
  90. package/dist/cjs/node_modules/@wry/trie/lib/index.js.map +1 -0
  91. package/dist/cjs/node_modules/graphql/error/GraphQLError.js +232 -0
  92. package/dist/cjs/node_modules/graphql/error/GraphQLError.js.map +1 -0
  93. package/dist/cjs/node_modules/graphql/error/syntaxError.js +18 -0
  94. package/dist/cjs/node_modules/graphql/error/syntaxError.js.map +1 -0
  95. package/dist/cjs/node_modules/graphql/jsutils/devAssert.js +12 -0
  96. package/dist/cjs/node_modules/graphql/jsutils/devAssert.js.map +1 -0
  97. package/dist/cjs/node_modules/graphql/jsutils/inspect.js +120 -0
  98. package/dist/cjs/node_modules/graphql/jsutils/inspect.js.map +1 -0
  99. package/dist/cjs/node_modules/graphql/jsutils/instanceOf.js +63 -0
  100. package/dist/cjs/node_modules/graphql/jsutils/instanceOf.js.map +1 -0
  101. package/dist/cjs/node_modules/graphql/jsutils/invariant.js +14 -0
  102. package/dist/cjs/node_modules/graphql/jsutils/invariant.js.map +1 -0
  103. package/dist/cjs/node_modules/graphql/jsutils/isObjectLike.js +12 -0
  104. package/dist/cjs/node_modules/graphql/jsutils/isObjectLike.js.map +1 -0
  105. package/dist/cjs/node_modules/graphql/language/ast.js +227 -0
  106. package/dist/cjs/node_modules/graphql/language/ast.js.map +1 -0
  107. package/dist/cjs/node_modules/graphql/language/blockString.js +114 -0
  108. package/dist/cjs/node_modules/graphql/language/blockString.js.map +1 -0
  109. package/dist/cjs/node_modules/graphql/language/characterClasses.js +73 -0
  110. package/dist/cjs/node_modules/graphql/language/characterClasses.js.map +1 -0
  111. package/dist/cjs/node_modules/graphql/language/directiveLocation.js +34 -0
  112. package/dist/cjs/node_modules/graphql/language/directiveLocation.js.map +1 -0
  113. package/dist/cjs/node_modules/graphql/language/kinds.js +63 -0
  114. package/dist/cjs/node_modules/graphql/language/kinds.js.map +1 -0
  115. package/dist/cjs/node_modules/graphql/language/lexer.js +925 -0
  116. package/dist/cjs/node_modules/graphql/language/lexer.js.map +1 -0
  117. package/dist/cjs/node_modules/graphql/language/location.js +36 -0
  118. package/dist/cjs/node_modules/graphql/language/location.js.map +1 -0
  119. package/dist/cjs/node_modules/graphql/language/parser.js +1582 -0
  120. package/dist/cjs/node_modules/graphql/language/parser.js.map +1 -0
  121. package/dist/cjs/node_modules/graphql/language/printLocation.js +72 -0
  122. package/dist/cjs/node_modules/graphql/language/printLocation.js.map +1 -0
  123. package/dist/cjs/node_modules/graphql/language/printString.js +181 -0
  124. package/dist/cjs/node_modules/graphql/language/printString.js.map +1 -0
  125. package/dist/cjs/node_modules/graphql/language/printer.js +374 -0
  126. package/dist/cjs/node_modules/graphql/language/printer.js.map +1 -0
  127. package/dist/cjs/node_modules/graphql/language/source.js +56 -0
  128. package/dist/cjs/node_modules/graphql/language/source.js.map +1 -0
  129. package/dist/cjs/node_modules/graphql/language/tokenKind.js +39 -0
  130. package/dist/cjs/node_modules/graphql/language/tokenKind.js.map +1 -0
  131. package/dist/cjs/node_modules/graphql/language/visitor.js +274 -0
  132. package/dist/cjs/node_modules/graphql/language/visitor.js.map +1 -0
  133. package/dist/cjs/node_modules/graphql-tag/lib/index.js +129 -0
  134. package/dist/cjs/node_modules/graphql-tag/lib/index.js.map +1 -0
  135. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Observable.js +106 -0
  136. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
  137. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscriber.js +158 -0
  138. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
  139. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.js +148 -0
  140. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
  141. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/config.js +7 -0
  142. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
  143. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/observable/empty.js +8 -0
  144. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
  145. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +20 -0
  146. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
  147. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
  148. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
  149. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +17 -0
  150. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
  151. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
  152. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
  153. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +15 -0
  154. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
  155. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +10 -0
  156. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
  157. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
  158. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
  159. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
  160. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
  161. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
  162. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
  163. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/pipe.js +18 -0
  164. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
  165. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +14 -0
  166. package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
  167. package/dist/cjs/node_modules/tslib/tslib.es6.js +93 -0
  168. package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -0
  169. package/dist/cjs/shared/apollo/apollo.client.js +2 -2
  170. package/dist/cjs/shared/apollo/apollo.client.js.map +1 -1
  171. package/dist/cjs/shared/types/generated.js +2 -2
  172. package/dist/cjs/shared/types/generated.js.map +1 -1
  173. package/dist/esm/_virtual/_commonjsHelpers.js +1 -30
  174. package/dist/esm/_virtual/_commonjsHelpers.js.map +1 -1
  175. package/dist/esm/components/panel/Panel.js +0 -1
  176. package/dist/esm/components/panel/Panel.js.map +1 -1
  177. package/dist/esm/components/panel/PanelAvatar.js +2 -4
  178. package/dist/esm/components/panel/PanelAvatar.js.map +1 -1
  179. package/dist/esm/components/panel/PanelButton.js +0 -1
  180. package/dist/esm/components/panel/PanelButton.js.map +1 -1
  181. package/dist/esm/components/panel/PanelDivider.js +0 -1
  182. package/dist/esm/components/panel/PanelDivider.js.map +1 -1
  183. package/dist/esm/components/panel/PanelFooter.js +0 -1
  184. package/dist/esm/components/panel/PanelFooter.js.map +1 -1
  185. package/dist/esm/components/panel/PanelHeader.js +0 -1
  186. package/dist/esm/components/panel/PanelHeader.js.map +1 -1
  187. package/dist/esm/components/panel/PanelItem.js +0 -1
  188. package/dist/esm/components/panel/PanelItem.js.map +1 -1
  189. package/dist/esm/components/panel/PanelListItems.js +0 -1
  190. package/dist/esm/components/panel/PanelListItems.js.map +1 -1
  191. package/dist/esm/components/session/SessionProvider.js +0 -1
  192. package/dist/esm/components/session/SessionProvider.js.map +1 -1
  193. package/dist/esm/components/session/SessionUserContext.js +0 -1
  194. package/dist/esm/components/session/SessionUserContext.js.map +1 -1
  195. package/dist/esm/components/session/SessionUserProvider.js +0 -1
  196. package/dist/esm/components/session/SessionUserProvider.js.map +1 -1
  197. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/hooks.js +2 -2
  198. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/hooks.js.map +1 -1
  199. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js +2 -2
  200. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js.map +1 -1
  201. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/views.js +2 -2
  202. package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/views.js.map +1 -1
  203. package/dist/esm/node_modules/@mui/material-nextjs/esm/nextCompatRouter.js +1 -1
  204. package/dist/esm/node_modules/@mui/material-nextjs/esm/v13-appRouter/nextNavigation.js +1 -1
  205. package/dist/esm/shared/apollo/apollo.client.js +1 -1
  206. package/dist/esm/shared/types/generated.js +1 -1
  207. package/dist/esm/types/components/panel/PanelAvatar.d.ts +3 -1
  208. package/dist/index.d.ts +2 -0
  209. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ var ApolloLink = require('../core/ApolloLink.js');
4
+ var compact = require('../../utilities/internal/compact.js');
5
+
6
+ /**
7
+ * `ClientAwarenessLink` provides support for providing client awareness
8
+ * features.
9
+ *
10
+ * @remarks
11
+ *
12
+ * Client awareness adds identifying information about the client to HTTP
13
+ * requests for use with metrics reporting tools, such as [Apollo GraphOS](https://apollographql.com/docs/graphos/platform).
14
+ * It is included in the functionality of [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) by default.
15
+ *
16
+ * Client awareness distinguishes between user-provided client awareness
17
+ * (provided by the `clientAwareness` option) and enhanced client awareness
18
+ * (provided by the `enhancedClientAwareness` option). User-provided client
19
+ * awareness enables you to set a customized client name and version for
20
+ * identification in metrics reporting tools. Enhanced client awareness enables
21
+ * the identification of the Apollo Client package name and version.
22
+ *
23
+ * @example
24
+ *
25
+ * ```ts
26
+ * import { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
27
+ *
28
+ * const link = new ClientAwarenessLink({
29
+ * clientAwareness: {
30
+ * name: "My Client",
31
+ * version: "1",
32
+ * },
33
+ * enhancedClientAwareness: {
34
+ * transport: "extensions",
35
+ * },
36
+ * });
37
+ * ```
38
+ */
39
+ class ClientAwarenessLink extends ApolloLink.ApolloLink {
40
+ constructor(options = {}) {
41
+ super((operation, forward) => {
42
+ const client = operation.client;
43
+ const clientOptions = client["queryManager"].clientOptions;
44
+ const context = operation.getContext();
45
+ {
46
+ const { name, version, transport = "headers", } = compact.compact({}, clientOptions.clientAwareness, options.clientAwareness, context.clientAwareness);
47
+ if (transport === "headers") {
48
+ operation.setContext(({ headers }) => {
49
+ return {
50
+ headers: compact.compact(
51
+ // setting these first so that they can be overridden by user-provided headers
52
+ {
53
+ "apollographql-client-name": name,
54
+ "apollographql-client-version": version,
55
+ }, headers),
56
+ };
57
+ });
58
+ }
59
+ }
60
+ {
61
+ const { transport = "extensions" } = compact.compact({}, clientOptions.enhancedClientAwareness, options.enhancedClientAwareness);
62
+ if (transport === "extensions") {
63
+ operation.extensions = compact.compact(
64
+ // setting these first so that it can be overridden by user-provided extensions
65
+ {
66
+ clientLibrary: {
67
+ name: "@apollo/client",
68
+ version: client.version,
69
+ },
70
+ }, operation.extensions);
71
+ }
72
+ if (transport === "headers") {
73
+ operation.setContext(({ headers }) => {
74
+ return {
75
+ headers: compact.compact(
76
+ // setting these first so that they can be overridden by user-provided headers
77
+ {
78
+ "apollographql-library-name": "@apollo/client",
79
+ "apollographql-library-version": client.version,
80
+ }, headers),
81
+ };
82
+ });
83
+ }
84
+ }
85
+ return forward(operation);
86
+ });
87
+ }
88
+ }
89
+
90
+ exports.ClientAwarenessLink = ClientAwarenessLink;
91
+ //# sourceMappingURL=ClientAwarenessLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientAwarenessLink.js","sources":["../../../../../../../node_modules/@apollo/client/link/client-awareness/ClientAwarenessLink.js"],"sourcesContent":["import { ApolloLink } from \"@apollo/client/link\";\nimport { compact } from \"@apollo/client/utilities/internal\";\n/**\n * `ClientAwarenessLink` provides support for providing client awareness\n * features.\n *\n * @remarks\n *\n * Client awareness adds identifying information about the client to HTTP\n * requests for use with metrics reporting tools, such as [Apollo GraphOS](https://apollographql.com/docs/graphos/platform).\n * It is included in the functionality of [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) by default.\n *\n * Client awareness distinguishes between user-provided client awareness\n * (provided by the `clientAwareness` option) and enhanced client awareness\n * (provided by the `enhancedClientAwareness` option). User-provided client\n * awareness enables you to set a customized client name and version for\n * identification in metrics reporting tools. Enhanced client awareness enables\n * the identification of the Apollo Client package name and version.\n *\n * @example\n *\n * ```ts\n * import { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\n *\n * const link = new ClientAwarenessLink({\n * clientAwareness: {\n * name: \"My Client\",\n * version: \"1\",\n * },\n * enhancedClientAwareness: {\n * transport: \"extensions\",\n * },\n * });\n * ```\n */\nexport class ClientAwarenessLink extends ApolloLink {\n constructor(options = {}) {\n super((operation, forward) => {\n const client = operation.client;\n const clientOptions = client[\"queryManager\"].clientOptions;\n const context = operation.getContext();\n {\n const { name, version, transport = \"headers\", } = compact({}, clientOptions.clientAwareness, options.clientAwareness, context.clientAwareness);\n if (transport === \"headers\") {\n operation.setContext(({ headers }) => {\n return {\n headers: compact(\n // setting these first so that they can be overridden by user-provided headers\n {\n \"apollographql-client-name\": name,\n \"apollographql-client-version\": version,\n }, headers),\n };\n });\n }\n }\n {\n const { transport = \"extensions\" } = compact({}, clientOptions.enhancedClientAwareness, options.enhancedClientAwareness);\n if (transport === \"extensions\") {\n operation.extensions = compact(\n // setting these first so that it can be overridden by user-provided extensions\n {\n clientLibrary: {\n name: \"@apollo/client\",\n version: client.version,\n },\n }, operation.extensions);\n }\n if (transport === \"headers\") {\n operation.setContext(({ headers }) => {\n return {\n headers: compact(\n // setting these first so that they can be overridden by user-provided headers\n {\n \"apollographql-library-name\": \"@apollo/client\",\n \"apollographql-library-version\": client.version,\n }, headers),\n };\n });\n }\n }\n return forward(operation);\n });\n }\n}\n//# sourceMappingURL=ClientAwarenessLink.js.map"],"names":["ApolloLink","compact"],"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;AACO,MAAM,mBAAmB,SAASA,qBAAU,CAAC;AACpD,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK;AACtC,YAAY,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM;AAC3C,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B,OAAO;AAC/B,4BAA4B,OAAO,EAAEA,eAAO;AAC5C;AACA,4BAA4B;AAC5B,gCAAgC,4BAA4B,EAAE,gBAAgB;AAC9E,gCAAgC,+BAA+B,EAAE,MAAM,CAAC,OAAO;AAC/E,6BAA6B,EAAE,OAAO,CAAC;AACvC,yBAAyB;AACzB,oBAAoB,CAAC,CAAC;AACtB,gBAAgB;AAChB,YAAY;AACZ,YAAY,OAAO,OAAO,CAAC,SAAS,CAAC;AACrC,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,262 @@
1
+ 'use strict';
2
+
3
+ var createOperation = require('../utils/createOperation.js');
4
+ var index = require('../../utilities/invariant/index.js');
5
+ var empty = require('../../../../rxjs/dist/esm5/internal/observable/empty.js');
6
+
7
+ /**
8
+ * The base class for all links in Apollo Client. A link represents either a
9
+ * self-contained modification to a GraphQL operation or a side effect (such as
10
+ * logging).
11
+ *
12
+ * @remarks
13
+ *
14
+ * Links enable you to customize Apollo Client's request flow by composing
15
+ * together different pieces of functionality into a chain of links. Each
16
+ * link represents a specific capability, such as adding authentication headers,
17
+ * retrying failed requests, batching operations, or sending requests to a
18
+ * GraphQL server.
19
+ *
20
+ * Every link must define a request handler via its constructor or by extending
21
+ * this class and implementing the `request` method.
22
+ *
23
+ * @example
24
+ *
25
+ * ```ts
26
+ * import { ApolloLink } from "@apollo/client";
27
+ *
28
+ * const link = new ApolloLink((operation, forward) => {
29
+ * console.log("Operation:", operation.operationName);
30
+ * return forward(operation);
31
+ * });
32
+ * ```
33
+ */
34
+ class ApolloLink {
35
+ /**
36
+ * Creates a link that completes immediately and does not emit a result.
37
+ *
38
+ * @example
39
+ *
40
+ * ```ts
41
+ * const link = ApolloLink.empty();
42
+ * ```
43
+ */
44
+ static empty() {
45
+ return new ApolloLink(() => empty.EMPTY);
46
+ }
47
+ /**
48
+ * Composes multiple links into a single composed link that executes each
49
+ * provided link in serial order.
50
+ *
51
+ * @example
52
+ *
53
+ * ```ts
54
+ * import { from, HttpLink, ApolloLink } from "@apollo/client";
55
+ * import { RetryLink } from "@apollo/client/link/retry";
56
+ * import MyAuthLink from "../auth";
57
+ *
58
+ * const link = ApolloLink.from([
59
+ * new RetryLink(),
60
+ * new MyAuthLink(),
61
+ * new HttpLink({ uri: "http://localhost:4000/graphql" }),
62
+ * ]);
63
+ * ```
64
+ *
65
+ * @param links - An array of `ApolloLink` instances or request handlers that
66
+ * are executed in serial order.
67
+ */
68
+ static from(links) {
69
+ if (links.length === 0)
70
+ return ApolloLink.empty();
71
+ const [first, ...rest] = links;
72
+ return first.concat(...rest);
73
+ }
74
+ /**
75
+ * Creates a link that conditionally routes a request to different links.
76
+ *
77
+ * @example
78
+ *
79
+ * ```ts
80
+ * import { ApolloLink, HttpLink } from "@apollo/client";
81
+ *
82
+ * const link = ApolloLink.split(
83
+ * (operation) => operation.getContext().version === 1,
84
+ * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
85
+ * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
86
+ * );
87
+ * ```
88
+ *
89
+ * @param test - A predicate function that receives the current `operation`
90
+ * and returns a boolean indicating which link to execute. Returning `true`
91
+ * executes the `left` link. Returning `false` executes the `right` link.
92
+ *
93
+ * @param left - The link that executes when the `test` function returns
94
+ * `true`.
95
+ *
96
+ * @param right - The link that executes when the `test` function returns
97
+ * `false`. If the `right` link is not provided, the request is forwarded to
98
+ * the next link in the chain.
99
+ */
100
+ static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {
101
+ const link = new ApolloLink((operation, forward) => {
102
+ const result = test(operation);
103
+ return result ?
104
+ left.request(operation, forward)
105
+ : right.request(operation, forward);
106
+ });
107
+ return Object.assign(link, { left, right });
108
+ }
109
+ /**
110
+ * Executes a GraphQL request against a link. The `execute` function begins
111
+ * the request by calling the request handler of the link.
112
+ *
113
+ * @example
114
+ *
115
+ * ```ts
116
+ * const observable = ApolloLink.execute(link, { query, variables }, { client });
117
+ *
118
+ * observable.subscribe({
119
+ * next(value) {
120
+ * console.log("Received", value);
121
+ * },
122
+ * error(error) {
123
+ * console.error("Oops got error", error);
124
+ * },
125
+ * complete() {
126
+ * console.log("Request complete");
127
+ * },
128
+ * });
129
+ * ```
130
+ *
131
+ * @param link - The `ApolloLink` instance to execute the request.
132
+ *
133
+ * @param request - The GraphQL request details, such as the `query` and
134
+ * `variables`.
135
+ *
136
+ * @param context - The execution context for the request, such as the
137
+ * `client` making the request.
138
+ */
139
+ static execute(link, request, context) {
140
+ return link.request(createOperation.createOperation(request, context), () => {
141
+ return empty.EMPTY;
142
+ });
143
+ }
144
+ /**
145
+ * Combines multiple links into a single composed link.
146
+ *
147
+ * @example
148
+ *
149
+ * ```ts
150
+ * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);
151
+ * ```
152
+ *
153
+ * @param links - The links to concatenate into a single link. Each link will
154
+ * execute in serial order.
155
+ *
156
+ * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be
157
+ * removed in a future major version.
158
+ */
159
+ static concat(...links) {
160
+ return ApolloLink.from(links);
161
+ }
162
+ constructor(request) {
163
+ if (request)
164
+ this.request = request;
165
+ }
166
+ /**
167
+ * Concatenates a link that conditionally routes a request to different links.
168
+ *
169
+ * @example
170
+ *
171
+ * ```ts
172
+ * import { ApolloLink, HttpLink } from "@apollo/client";
173
+ *
174
+ * const previousLink = new ApolloLink((operation, forward) => {
175
+ * // Handle the request
176
+ *
177
+ * return forward(operation);
178
+ * });
179
+ *
180
+ * const link = previousLink.split(
181
+ * (operation) => operation.getContext().version === 1,
182
+ * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
183
+ * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
184
+ * );
185
+ * ```
186
+ *
187
+ * @param test - A predicate function that receives the current `operation`
188
+ * and returns a boolean indicating which link to execute. Returning `true`
189
+ * executes the `left` link. Returning `false` executes the `right` link.
190
+ *
191
+ * @param left - The link that executes when the `test` function returns
192
+ * `true`.
193
+ *
194
+ * @param right - The link that executes when the `test` function returns
195
+ * `false`. If the `right` link is not provided, the request is forwarded to
196
+ * the next link in the chain.
197
+ */
198
+ split(test, left, right) {
199
+ return this.concat(ApolloLink.split(test, left, right));
200
+ }
201
+ /**
202
+ * Combines the link with other links into a single composed link.
203
+ *
204
+ * @example
205
+ *
206
+ * ```ts
207
+ * import { ApolloLink, HttpLink } from "@apollo/client";
208
+ *
209
+ * const previousLink = new ApolloLink((operation, forward) => {
210
+ * // Handle the request
211
+ *
212
+ * return forward(operation);
213
+ * });
214
+ *
215
+ * const link = previousLink.concat(
216
+ * link1,
217
+ * link2,
218
+ * new HttpLink({ uri: "http://localhost:4000/graphql" })
219
+ * );
220
+ * ```
221
+ */
222
+ concat(...links) {
223
+ if (links.length === 0) {
224
+ return this;
225
+ }
226
+ return links.reduce(this.combine.bind(this), this);
227
+ }
228
+ combine(left, right) {
229
+ const link = new ApolloLink((operation, forward) => {
230
+ return left.request(operation, (op) => right.request(op, forward));
231
+ });
232
+ return Object.assign(link, { left, right });
233
+ }
234
+ /**
235
+ * Runs the request handler for the provided operation.
236
+ *
237
+ * > [!NOTE]
238
+ * > This is called by the `ApolloLink.execute` function for you and should
239
+ * > not be called directly. Prefer using `ApolloLink.execute` to make the
240
+ * > request instead.
241
+ */
242
+ request(operation, forward) {
243
+ throw index.newInvariantError(65);
244
+ }
245
+ /**
246
+ * @internal
247
+ * Used to iterate through all links that are concatenations or `split` links.
248
+ *
249
+ * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
250
+ */
251
+ left;
252
+ /**
253
+ * @internal
254
+ * Used to iterate through all links that are concatenations or `split` links.
255
+ *
256
+ * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
257
+ */
258
+ right;
259
+ }
260
+
261
+ exports.ApolloLink = ApolloLink;
262
+ //# sourceMappingURL=ApolloLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApolloLink.js","sources":["../../../../../../../node_modules/@apollo/client/link/core/ApolloLink.js"],"sourcesContent":["import { EMPTY } from \"rxjs\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n static empty() {\n return new ApolloLink(() => EMPTY);\n }\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n static from(links) {\n if (links.length === 0)\n return ApolloLink.empty();\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n __DEV__ && invariant.warn(63, result);\n }\n }\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n static execute(link, request, context) {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n __DEV__ && invariant.warn(64);\n }\n return EMPTY;\n });\n }\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n static concat(...links) {\n return ApolloLink.from(links);\n }\n constructor(request) {\n if (request)\n this.request = request;\n }\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n split(test, left, right) {\n return this.concat(ApolloLink.split(test, left, right));\n }\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n concat(...links) {\n if (links.length === 0) {\n return this;\n }\n return links.reduce(this.combine.bind(this), this);\n }\n combine(left, right) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n request(operation, forward) {\n throw newInvariantError(65);\n }\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n left;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n right;\n}\n//# sourceMappingURL=ApolloLink.js.map\n"],"names":["EMPTY","createOperation","newInvariantError"],"mappings":";;;;;;AAIA;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,MAAM,UAAU,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,KAAK,GAAG;AACnB,QAAQ,OAAO,IAAI,UAAU,CAAC,MAAMA,WAAK,CAAC;AAC1C,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE;AACvB,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC9B,YAAY,OAAO,UAAU,CAAC,KAAK,EAAE;AACrC,QAAQ,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK;AACtC,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpC,IAAI;AACJ;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,IAAI,OAAO,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE;AACnF,QAAQ,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK;AAC5D,YAAY,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;AAM1C,YAAY,OAAO,MAAM;AACzB,gBAAgB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO;AAC/C,kBAAkB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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,CAAC,GAAG,KAAK,EAAE;AACrB,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAChC,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;AAC1D,IAAI;AACJ,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;AACzB,QAAQ,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK;AAC5D,YAAY,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9E,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACnD,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE;AAChC,QAAQ,MAAME,uBAAiB,CAAC,EAAE,CAAC;AACnC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK;AACT;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,155 @@
1
+ 'use strict';
2
+
3
+ var ApolloLink = require('../core/ApolloLink.js');
4
+ var filterOperationVariables = require('../utils/filterOperationVariables.js');
5
+ var operations = require('../../utilities/graphql/operations.js');
6
+ var maybe = require('../../utilities/internal/globals/maybe.js');
7
+ var parseAndCheckHttpResponse = require('./parseAndCheckHttpResponse.js');
8
+ var rewriteURIForGET = require('./rewriteURIForGET.js');
9
+ var selectHttpOptionsAndBody = require('./selectHttpOptionsAndBody.js');
10
+ var selectURI = require('./selectURI.js');
11
+ var Observable = require('../../../../rxjs/dist/esm5/internal/Observable.js');
12
+ var compact = require('../../utilities/internal/compact.js');
13
+
14
+ const backupFetch = maybe.maybe(() => fetch);
15
+ function noop() { }
16
+ /**
17
+ * `BaseHttpLink` is a terminating link that sends a GraphQL operation to a
18
+ * remote endpoint over HTTP. It serves as a base link to `HttpLink`.
19
+ *
20
+ * @remarks
21
+ *
22
+ * `BaseHttpLink` supports both POST and GET requests, and you can configure
23
+ * HTTP options on a per-operation basis. You can use these options for
24
+ * authentication, persisted queries, dynamic URIs, and other granular updates.
25
+ *
26
+ * > [!NOTE]
27
+ * > Prefer using `HttpLink` over `BaseHttpLink`. Use `BaseHttpLink` when you
28
+ * > need to disable client awareness features and would like to tree-shake
29
+ * > the implementation of `ClientAwarenessLink` out of your app bundle.
30
+ *
31
+ * @example
32
+ *
33
+ * ```ts
34
+ * import { BaseHttpLink } from "@apollo/client/link/http";
35
+ *
36
+ * const link = new BaseHttpLink({
37
+ * uri: "http://localhost:4000/graphql",
38
+ * headers: {
39
+ * authorization: `Bearer ${token}`,
40
+ * },
41
+ * });
42
+ * ```
43
+ */
44
+ class BaseHttpLink extends ApolloLink.ApolloLink {
45
+ constructor(options = {}) {
46
+ let { uri = "/graphql",
47
+ // use default global fetch if nothing passed in
48
+ fetch: preferredFetch, print = selectHttpOptionsAndBody.defaultPrinter, includeExtensions, preserveHeaderCase, useGETForQueries, includeUnusedVariables = false, ...requestOptions } = options;
49
+ const linkConfig = {
50
+ http: compact.compact({ includeExtensions, preserveHeaderCase }),
51
+ options: requestOptions.fetchOptions,
52
+ credentials: requestOptions.credentials,
53
+ headers: requestOptions.headers,
54
+ };
55
+ super((operation) => {
56
+ let chosenURI = selectURI.selectURI(operation, uri);
57
+ const context = operation.getContext();
58
+ const http = { ...context.http };
59
+ if (operations.isSubscriptionOperation(operation.query)) {
60
+ http.accept = [
61
+ "multipart/mixed;boundary=graphql;subscriptionSpec=1.0",
62
+ ...(http.accept || []),
63
+ ];
64
+ }
65
+ const contextConfig = {
66
+ http,
67
+ options: context.fetchOptions,
68
+ credentials: context.credentials,
69
+ headers: context.headers,
70
+ };
71
+ //uses fallback, link, and then context to build options
72
+ const { options, body } = selectHttpOptionsAndBody.selectHttpOptionsAndBodyInternal(operation, print, selectHttpOptionsAndBody.fallbackHttpConfig, linkConfig, contextConfig);
73
+ if (body.variables && !includeUnusedVariables) {
74
+ body.variables = filterOperationVariables.filterOperationVariables(body.variables, operation.query);
75
+ }
76
+ let controller = new AbortController();
77
+ let cleanupController = () => {
78
+ controller = undefined;
79
+ };
80
+ if (options.signal) {
81
+ const externalSignal = options.signal;
82
+ // in an ideal world we could use `AbortSignal.any` here, but
83
+ // React Native uses https://github.com/mysticatea/abort-controller as
84
+ // a polyfill for `AbortController`, and it does not support `AbortSignal.any`.
85
+ const listener = () => {
86
+ controller?.abort(externalSignal.reason);
87
+ };
88
+ externalSignal.addEventListener("abort", listener, { once: true });
89
+ cleanupController = () => {
90
+ controller?.signal.removeEventListener("abort", cleanupController);
91
+ controller = undefined;
92
+ // on cleanup, we need to stop listening to `options.signal` to avoid memory leaks
93
+ externalSignal.removeEventListener("abort", listener);
94
+ cleanupController = noop;
95
+ };
96
+ // react native also does not support the addEventListener `signal` option
97
+ // so we have to simulate that ourself
98
+ controller.signal.addEventListener("abort", cleanupController, {
99
+ once: true,
100
+ });
101
+ }
102
+ options.signal = controller.signal;
103
+ if (useGETForQueries && !operations.isMutationOperation(operation.query)) {
104
+ options.method = "GET";
105
+ }
106
+ return new Observable.Observable((observer) => {
107
+ if (options.method === "GET") {
108
+ const { newURI, parseError } = rewriteURIForGET.rewriteURIForGET(chosenURI, body);
109
+ if (parseError) {
110
+ throw parseError;
111
+ }
112
+ chosenURI = newURI;
113
+ }
114
+ else {
115
+ options.body = JSON.stringify(body);
116
+ }
117
+ // Prefer linkOptions.fetch (preferredFetch) if provided, and otherwise
118
+ // fall back to the *current* global window.fetch function (see issue
119
+ // #7832), or (if all else fails) the backupFetch function we saved when
120
+ // this module was first evaluated. This last option protects against the
121
+ // removal of window.fetch, which is unlikely but not impossible.
122
+ const currentFetch = preferredFetch || maybe.maybe(() => fetch) || backupFetch;
123
+ const observerNext = observer.next.bind(observer);
124
+ currentFetch(chosenURI, options)
125
+ .then((response) => {
126
+ operation.setContext({ response });
127
+ const ctype = response.headers?.get("content-type");
128
+ if (ctype !== null && /^multipart\/mixed/i.test(ctype)) {
129
+ return parseAndCheckHttpResponse.readMultipartBody(response, observerNext);
130
+ }
131
+ else {
132
+ return parseAndCheckHttpResponse.parseAndCheckHttpResponse(operation)(response).then(observerNext);
133
+ }
134
+ })
135
+ .then(() => {
136
+ cleanupController();
137
+ observer.complete();
138
+ })
139
+ .catch((err) => {
140
+ cleanupController();
141
+ observer.error(err);
142
+ });
143
+ return () => {
144
+ // XXX support canceling this request
145
+ // https://developers.google.com/web/updates/2017/09/abortable-fetch
146
+ if (controller)
147
+ controller.abort();
148
+ };
149
+ });
150
+ });
151
+ }
152
+ }
153
+
154
+ exports.BaseHttpLink = BaseHttpLink;
155
+ //# sourceMappingURL=BaseHttpLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseHttpLink.js","sources":["../../../../../../../node_modules/@apollo/client/link/http/BaseHttpLink.js"],"sourcesContent":["import { Observable } from \"rxjs\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { filterOperationVariables } from \"@apollo/client/link/utils\";\nimport { isMutationOperation, isSubscriptionOperation, } from \"@apollo/client/utilities\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { compact } from \"@apollo/client/utilities/internal\";\nimport { maybe } from \"@apollo/client/utilities/internal/globals\";\nimport { checkFetcher } from \"./checkFetcher.js\";\nimport { parseAndCheckHttpResponse, readMultipartBody, } from \"./parseAndCheckHttpResponse.js\";\nimport { rewriteURIForGET } from \"./rewriteURIForGET.js\";\nimport { defaultPrinter, fallbackHttpConfig, selectHttpOptionsAndBodyInternal, } from \"./selectHttpOptionsAndBody.js\";\nimport { selectURI } from \"./selectURI.js\";\nconst backupFetch = maybe(() => fetch);\nfunction noop() { }\n/**\n * `BaseHttpLink` is a terminating link that sends a GraphQL operation to a\n * remote endpoint over HTTP. It serves as a base link to `HttpLink`.\n *\n * @remarks\n *\n * `BaseHttpLink` supports both POST and GET requests, and you can configure\n * HTTP options on a per-operation basis. You can use these options for\n * authentication, persisted queries, dynamic URIs, and other granular updates.\n *\n * > [!NOTE]\n * > Prefer using `HttpLink` over `BaseHttpLink`. Use `BaseHttpLink` when you\n * > need to disable client awareness features and would like to tree-shake\n * > the implementation of `ClientAwarenessLink` out of your app bundle.\n *\n * @example\n *\n * ```ts\n * import { BaseHttpLink } from \"@apollo/client/link/http\";\n *\n * const link = new BaseHttpLink({\n * uri: \"http://localhost:4000/graphql\",\n * headers: {\n * authorization: `Bearer ${token}`,\n * },\n * });\n * ```\n */\nexport class BaseHttpLink extends ApolloLink {\n constructor(options = {}) {\n let { uri = \"/graphql\", \n // use default global fetch if nothing passed in\n fetch: preferredFetch, print = defaultPrinter, includeExtensions, preserveHeaderCase, useGETForQueries, includeUnusedVariables = false, ...requestOptions } = options;\n if (__DEV__) {\n // Make sure at least one of preferredFetch, window.fetch, or backupFetch is\n // defined, so requests won't fail at runtime.\n checkFetcher(preferredFetch || backupFetch);\n }\n const linkConfig = {\n http: compact({ includeExtensions, preserveHeaderCase }),\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n super((operation) => {\n let chosenURI = selectURI(operation, uri);\n const context = operation.getContext();\n const http = { ...context.http };\n if (isSubscriptionOperation(operation.query)) {\n http.accept = [\n \"multipart/mixed;boundary=graphql;subscriptionSpec=1.0\",\n ...(http.accept || []),\n ];\n }\n const contextConfig = {\n http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig);\n if (body.variables && !includeUnusedVariables) {\n body.variables = filterOperationVariables(body.variables, operation.query);\n }\n let controller = new AbortController();\n let cleanupController = () => {\n controller = undefined;\n };\n if (options.signal) {\n const externalSignal = options.signal;\n // in an ideal world we could use `AbortSignal.any` here, but\n // React Native uses https://github.com/mysticatea/abort-controller as\n // a polyfill for `AbortController`, and it does not support `AbortSignal.any`.\n const listener = () => {\n controller?.abort(externalSignal.reason);\n };\n externalSignal.addEventListener(\"abort\", listener, { once: true });\n cleanupController = () => {\n controller?.signal.removeEventListener(\"abort\", cleanupController);\n controller = undefined;\n // on cleanup, we need to stop listening to `options.signal` to avoid memory leaks\n externalSignal.removeEventListener(\"abort\", listener);\n cleanupController = noop;\n };\n // react native also does not support the addEventListener `signal` option\n // so we have to simulate that ourself\n controller.signal.addEventListener(\"abort\", cleanupController, {\n once: true,\n });\n }\n options.signal = controller.signal;\n if (useGETForQueries && !isMutationOperation(operation.query)) {\n options.method = \"GET\";\n }\n return new Observable((observer) => {\n if (options.method === \"GET\") {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n throw parseError;\n }\n chosenURI = newURI;\n }\n else {\n options.body = JSON.stringify(body);\n }\n // Prefer linkOptions.fetch (preferredFetch) if provided, and otherwise\n // fall back to the *current* global window.fetch function (see issue\n // #7832), or (if all else fails) the backupFetch function we saved when\n // this module was first evaluated. This last option protects against the\n // removal of window.fetch, which is unlikely but not impossible.\n const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;\n const observerNext = observer.next.bind(observer);\n currentFetch(chosenURI, options)\n .then((response) => {\n operation.setContext({ response });\n const ctype = response.headers?.get(\"content-type\");\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observerNext);\n }\n else {\n return parseAndCheckHttpResponse(operation)(response).then(observerNext);\n }\n })\n .then(() => {\n cleanupController();\n observer.complete();\n })\n .catch((err) => {\n cleanupController();\n observer.error(err);\n });\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller)\n controller.abort();\n };\n });\n });\n }\n}\n//# sourceMappingURL=BaseHttpLink.js.map"],"names":["maybe","ApolloLink","defaultPrinter","compact","selectURI","isSubscriptionOperation","selectHttpOptionsAndBodyInternal","fallbackHttpConfig","filterOperationVariables","isMutationOperation","Observable","rewriteURIForGET","readMultipartBody","parseAndCheckHttpResponse"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,WAAW,GAAGA,WAAK,CAAC,MAAM,KAAK,CAAC;AACtC,SAAS,IAAI,GAAG,EAAE;AAClB;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,MAAM,YAAY,SAASC,qBAAU,CAAC;AAC7C,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,IAAI,EAAE,GAAG,GAAG,UAAU;AAC9B;AACA,QAAQ,KAAK,EAAE,cAAc,EAAE,KAAK,GAAGC,uCAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,sBAAsB,GAAG,KAAK,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO;AAM7K,QAAQ,MAAM,UAAU,GAAG;AAC3B,YAAY,IAAI,EAAEC,eAAO,CAAC,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AACpE,YAAY,OAAO,EAAE,cAAc,CAAC,YAAY;AAChD,YAAY,WAAW,EAAE,cAAc,CAAC,WAAW;AACnD,YAAY,OAAO,EAAE,cAAc,CAAC,OAAO;AAC3C,SAAS;AACT,QAAQ,KAAK,CAAC,CAAC,SAAS,KAAK;AAC7B,YAAY,IAAI,SAAS,GAAGC,mBAAS,CAAC,SAAS,EAAE,GAAG,CAAC;AACrD,YAAY,MAAM,OAAO,GAAG,S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AACxF,gBAAgB,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACjE,gBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO;AAC/C,qBAAqB,IAAI,CAAC,CAAC,QAAQ,KAAK;AACxC,oBAAoB,SAAS,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;AACtD,oBAAoB,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC;AACvE,oBAAoB,IAAI,KAAK,KAAK,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AAC5E,wBAAwB,OAAOY,2CAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC;AACxE,oBAAoB;AACpB,yBAAyB;AACzB,wBAAwB,OAAOC,mDAAyB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;AAChG,oBAAoB;AACpB,gBAAgB,CAAC;AACjB,qBAAqB,IAAI,CAAC,MAAM;AAChC,oBAAoB,iBAAiB,EAAE;AACvC,oBAAoB,QAAQ,CAAC,QAAQ,EAAE;AACvC,gBAAgB,CAAC;AACjB,qBAAqB,KAAK,CAAC,CAAC,GAAG,KAAK;AACpC,oBAAoB,iBAAiB,EAAE;AACvC,oBAAoB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;AACvC,gBAAgB,CAAC,CAAC;AAClB,gBAAgB,OAAO,MAAM;AAC7B;AACA;AACA,oBAAoB,IAAI,UAAU;AAClC,wBAAwB,UAAU,CAAC,KAAK,EAAE;AAC1C,gBAAgB,CAAC;AACjB,YAAY,CAAC,CAAC;AACd,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var ApolloLink = require('../core/ApolloLink.js');
4
+ var ClientAwarenessLink = require('../client-awareness/ClientAwarenessLink.js');
5
+ var BaseHttpLink = require('./BaseHttpLink.js');
6
+
7
+ /**
8
+ * `HttpLink` is a terminating link that sends a GraphQL operation to a remote
9
+ * endpoint over HTTP. It combines the functionality of `BaseHttpLink` and
10
+ * `ClientAwarenessLink` into a single link.
11
+ *
12
+ * @remarks
13
+ *
14
+ * `HttpLink` supports both POST and GET requests, and you can configure HTTP
15
+ * options on a per-operation basis. You can use these options for
16
+ * authentication, persisted queries, dynamic URIs, and other granular updates.
17
+ *
18
+ * @example
19
+ *
20
+ * ```ts
21
+ * import { HttpLink } from "@apollo/client";
22
+ *
23
+ * const link = new HttpLink({
24
+ * uri: "http://localhost:4000/graphql",
25
+ * // Additional options
26
+ * });
27
+ * ```
28
+ */
29
+ class HttpLink extends ApolloLink.ApolloLink {
30
+ constructor(options = {}) {
31
+ const { left, right, request } = ApolloLink.ApolloLink.from([
32
+ new ClientAwarenessLink.ClientAwarenessLink(options),
33
+ new BaseHttpLink.BaseHttpLink(options),
34
+ ]);
35
+ super(request);
36
+ Object.assign(this, { left, right });
37
+ }
38
+ }
39
+
40
+ exports.HttpLink = HttpLink;
41
+ //# sourceMappingURL=HttpLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpLink.js","sources":["../../../../../../../node_modules/@apollo/client/link/http/HttpLink.js"],"sourcesContent":["import { ApolloLink } from \"@apollo/client/link\";\nimport { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\nimport { BaseHttpLink } from \"./BaseHttpLink.js\";\n/**\n * `HttpLink` is a terminating link that sends a GraphQL operation to a remote\n * endpoint over HTTP. It combines the functionality of `BaseHttpLink` and\n * `ClientAwarenessLink` into a single link.\n *\n * @remarks\n *\n * `HttpLink` supports both POST and GET requests, and you can configure HTTP\n * options on a per-operation basis. You can use these options for\n * authentication, persisted queries, dynamic URIs, and other granular updates.\n *\n * @example\n *\n * ```ts\n * import { HttpLink } from \"@apollo/client\";\n *\n * const link = new HttpLink({\n * uri: \"http://localhost:4000/graphql\",\n * // Additional options\n * });\n * ```\n */\nexport class HttpLink extends ApolloLink {\n constructor(options = {}) {\n const { left, right, request } = ApolloLink.from([\n new ClientAwarenessLink(options),\n new BaseHttpLink(options),\n ]);\n super(request);\n Object.assign(this, { left, right });\n }\n}\n/**\n * @deprecated\n * Use `HttpLink` from `@apollo/client/link/http` instead.\n */\nexport const createHttpLink = (options = {}) => new HttpLink(options);\n//# sourceMappingURL=HttpLink.js.map"],"names":["ApolloLink","ClientAwarenessLink","BaseHttpLink"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,SAASA,qBAAU,CAAC;AACzC,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAGA,qBAAU,CAAC,IAAI,CAAC;AACzD,YAAY,IAAIC,uCAAmB,CAAC,OAAO,CAAC;AAC5C,YAAY,IAAIC,yBAAY,CAAC,OAAO,CAAC;AACrC,SAAS,CAAC;AACV,QAAQ,KAAK,CAAC,OAAO,CAAC;AACtB,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC5C,IAAI;AACJ;;;;","x_google_ignoreList":[0]}