@quiltt/core 3.5.4 → 3.5.6

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 (50) hide show
  1. package/CHANGELOG.md +30 -10
  2. package/README.md +1 -1
  3. package/dist/SubscriptionLink-client-VkkcO2Yz.js +300 -0
  4. package/dist/index-client-D55-rzVl.js +561 -0
  5. package/dist/index.d.ts +402 -15
  6. package/dist/index.js +284 -11
  7. package/package.json +18 -19
  8. package/src/api/graphql/links/BatchHttpLink.ts +4 -2
  9. package/src/api/graphql/links/HttpLink.ts +4 -2
  10. package/src/api/graphql/links/actioncable/logger.ts +3 -1
  11. package/src/api/graphql/links/actioncable/subscription_guarantor.ts +1 -1
  12. package/src/api/rest/{AuthAPI.ts → auth.ts} +39 -26
  13. package/src/api/rest/fetchWithRetry.ts +73 -0
  14. package/src/api/rest/index.ts +1 -1
  15. package/dist/Storage/index.cjs +0 -10
  16. package/dist/Storage/index.cjs.map +0 -1
  17. package/dist/Storage/index.d.ts +0 -2
  18. package/dist/Storage/index.js +0 -5
  19. package/dist/Storage/index.js.map +0 -1
  20. package/dist/api/graphql/index.cjs +0 -49
  21. package/dist/api/graphql/index.cjs.map +0 -1
  22. package/dist/api/graphql/index.d.ts +0 -16
  23. package/dist/api/graphql/index.js +0 -15
  24. package/dist/api/graphql/index.js.map +0 -1
  25. package/dist/api/graphql/links/actioncable/index.cjs +0 -18
  26. package/dist/api/graphql/links/actioncable/index.cjs.map +0 -1
  27. package/dist/api/graphql/links/actioncable/index.d.ts +0 -62
  28. package/dist/api/graphql/links/actioncable/index.js +0 -5
  29. package/dist/api/graphql/links/actioncable/index.js.map +0 -1
  30. package/dist/api/graphql/links/index.cjs +0 -28
  31. package/dist/api/graphql/links/index.cjs.map +0 -1
  32. package/dist/api/graphql/links/index.d.ts +0 -56
  33. package/dist/api/graphql/links/index.js +0 -14
  34. package/dist/api/graphql/links/index.js.map +0 -1
  35. package/dist/api/index.cjs +0 -54
  36. package/dist/api/index.cjs.map +0 -1
  37. package/dist/api/index.d.ts +0 -78
  38. package/dist/api/index.js +0 -16
  39. package/dist/api/index.js.map +0 -1
  40. package/dist/api/rest/index.cjs +0 -14
  41. package/dist/api/rest/index.cjs.map +0 -1
  42. package/dist/api/rest/index.d.ts +0 -70
  43. package/dist/api/rest/index.js +0 -7
  44. package/dist/api/rest/index.js.map +0 -1
  45. package/dist/consumer-c13efb94.d.ts +0 -78
  46. package/dist/index-f53b61b3.d.ts +0 -129
  47. package/dist/index.cjs +0 -67
  48. package/dist/index.cjs.map +0 -1
  49. package/dist/index.js.map +0 -1
  50. package/src/api/rest/axios.ts +0 -52
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @quiltt/core
2
2
 
3
+ ## 3.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#223](https://github.com/quiltt/quiltt-js/pull/223) [`8c5041c`](https://github.com/quiltt/quiltt-js/commit/8c5041c1670fd7dbfed06355c06888256ce84b08) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Remove axios and replace with native fetch
8
+
9
+ ## 3.5.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#218](https://github.com/quiltt/quiltt-js/pull/218) [`7dd42db`](https://github.com/quiltt/quiltt-js/commit/7dd42dbc744805d68fbff8fbed73a4bd68022b44) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Fix changeset md to release packages
14
+
15
+ - [#213](https://github.com/quiltt/quiltt-js/pull/213) [`5648e3c`](https://github.com/quiltt/quiltt-js/commit/5648e3c91d572d97ad88115710ab840b98e1d469) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Add exported files to '@quiltt/react-native'"
16
+
17
+ - [#210](https://github.com/quiltt/quiltt-js/pull/210) [`e57fdb8`](https://github.com/quiltt/quiltt-js/commit/e57fdb8c21e90b6a3492bc7a0c858031384caebf) Thanks [@zubairaziz](https://github.com/zubairaziz)! - Migrate bundler to 'bunchee'
18
+
19
+ - [#215](https://github.com/quiltt/quiltt-js/pull/215) [`c36abb4`](https://github.com/quiltt/quiltt-js/commit/c36abb47cffea3d754fd243b321f2ae50518c297) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Remove React Native SDK about:srcdoc warning
20
+
21
+ - [#216](https://github.com/quiltt/quiltt-js/pull/216) [`2895899`](https://github.com/quiltt/quiltt-js/commit/289589913c55f8dad2e818d71c4be39c93e5a52a) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Fix release changeset command
22
+
3
23
  ## 3.5.4
4
24
 
5
25
  ### Patch Changes
@@ -10,57 +30,57 @@
10
30
 
11
31
  ### Patch Changes
12
32
 
13
- - [#204](https://github.com/quiltt/quiltt-public/pull/204) [`ee42bf1`](https://github.com/quiltt/quiltt-public/commit/ee42bf137db1029807df49f66ff7e57117e8ace9) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add missing type to QuilttButton
33
+ - [#204](https://github.com/quiltt/quiltt-js/pull/204) [`ee42bf1`](https://github.com/quiltt/quiltt-js/commit/ee42bf137db1029807df49f66ff7e57117e8ace9) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add missing type to QuilttButton
14
34
 
15
- - [#197](https://github.com/quiltt/quiltt-public/pull/197) [`8d9f24c`](https://github.com/quiltt/quiltt-public/commit/8d9f24c59102db5dc665195a6145cfac2c80e2c0) Thanks [@rubendinho](https://github.com/rubendinho)! - Update docs, and fix typo in types
35
+ - [#197](https://github.com/quiltt/quiltt-js/pull/197) [`8d9f24c`](https://github.com/quiltt/quiltt-js/commit/8d9f24c59102db5dc665195a6145cfac2c80e2c0) Thanks [@rubendinho](https://github.com/rubendinho)! - Update docs, and fix typo in types
16
36
 
17
37
  ## 3.5.2
18
38
 
19
39
  ### Patch Changes
20
40
 
21
- - [#202](https://github.com/quiltt/quiltt-public/pull/202) [`42705f0`](https://github.com/quiltt/quiltt-public/commit/42705f0e01b0adb35ab627697169433e1065a8f0) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Expose Institutions to React API
41
+ - [#202](https://github.com/quiltt/quiltt-js/pull/202) [`42705f0`](https://github.com/quiltt/quiltt-js/commit/42705f0e01b0adb35ab627697169433e1065a8f0) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Expose Institutions to React API
22
42
 
23
43
  ## 3.5.1
24
44
 
25
45
  ### Patch Changes
26
46
 
27
- - [#200](https://github.com/quiltt/quiltt-public/pull/200) [`0a07431`](https://github.com/quiltt/quiltt-public/commit/0a07431ff936e6cd4fd3aeee66bba1fec21f6624) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Fix release
47
+ - [#200](https://github.com/quiltt/quiltt-js/pull/200) [`0a07431`](https://github.com/quiltt/quiltt-js/commit/0a07431ff936e6cd4fd3aeee66bba1fec21f6624) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Fix release
28
48
 
29
49
  ## 3.5.0
30
50
 
31
51
  ### Minor Changes
32
52
 
33
- - [#198](https://github.com/quiltt/quiltt-public/pull/198) [`c65d87a`](https://github.com/quiltt/quiltt-public/commit/c65d87a8316dbec82635a0c4108714de7bbd082b) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add Institutions to the Connect API
53
+ - [#198](https://github.com/quiltt/quiltt-js/pull/198) [`c65d87a`](https://github.com/quiltt/quiltt-js/commit/c65d87a8316dbec82635a0c4108714de7bbd082b) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add Institutions to the Connect API
34
54
 
35
55
  ## 3.4.1
36
56
 
37
57
  ### Patch Changes
38
58
 
39
- - [#195](https://github.com/quiltt/quiltt-public/pull/195) [`6c36908`](https://github.com/quiltt/quiltt-public/commit/6c36908678cb46d5f6a0c7438e0ed48889cabf79) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Report preflight error before sending connectorUrl to webview
59
+ - [#195](https://github.com/quiltt/quiltt-js/pull/195) [`6c36908`](https://github.com/quiltt/quiltt-js/commit/6c36908678cb46d5f6a0c7438e0ed48889cabf79) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Report preflight error before sending connectorUrl to webview
40
60
 
41
61
  ## 3.4.0
42
62
 
43
63
  ### Minor Changes
44
64
 
45
- - [#191](https://github.com/quiltt/quiltt-public/pull/191) [`58c8f0c`](https://github.com/quiltt/quiltt-public/commit/58c8f0c5265dfa379263225baafb4552067514c6) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Add agent QSP for analytic
65
+ - [#191](https://github.com/quiltt/quiltt-js/pull/191) [`58c8f0c`](https://github.com/quiltt/quiltt-js/commit/58c8f0c5265dfa379263225baafb4552067514c6) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Add agent QSP for analytic
46
66
 
47
67
  ## 3.3.10
48
68
 
49
69
  ### Patch Changes
50
70
 
51
- - [#190](https://github.com/quiltt/quiltt-public/pull/190) [`21ead66`](https://github.com/quiltt/quiltt-public/commit/21ead662e7626f906562f952c9d1c0bc2c859985) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Fix Android App with Chase app installed not able to launch Chase app
71
+ - [#190](https://github.com/quiltt/quiltt-js/pull/190) [`21ead66`](https://github.com/quiltt/quiltt-js/commit/21ead662e7626f906562f952c9d1c0bc2c859985) Thanks [@tom-quiltt](https://github.com/tom-quiltt)! - Fix Android App with Chase app installed not able to launch Chase app
52
72
 
53
73
  ## 3.3.9
54
74
 
55
75
  ### Patch Changes
56
76
 
57
- - [#187](https://github.com/quiltt/quiltt-public/pull/187) [`02f37cd`](https://github.com/quiltt/quiltt-public/commit/02f37cda97f501f2d77601d0fd6b7fbbd1c71431) Thanks [@rubendinho](https://github.com/rubendinho)! - Export Quiltt config
77
+ - [#187](https://github.com/quiltt/quiltt-js/pull/187) [`02f37cd`](https://github.com/quiltt/quiltt-js/commit/02f37cda97f501f2d77601d0fd6b7fbbd1c71431) Thanks [@rubendinho](https://github.com/rubendinho)! - Export Quiltt config
58
78
 
59
79
  ## 3.3.8
60
80
 
61
81
  ### Patch Changes
62
82
 
63
- - [#185](https://github.com/quiltt/quiltt-public/pull/185) [`a3452da`](https://github.com/quiltt/quiltt-public/commit/a3452da3c7604902b5917e1f838e2dced42b708c) Thanks [@rubendinho](https://github.com/rubendinho)! - Fix Vite build error
83
+ - [#185](https://github.com/quiltt/quiltt-js/pull/185) [`a3452da`](https://github.com/quiltt/quiltt-js/commit/a3452da3c7604902b5917e1f838e2dced42b708c) Thanks [@rubendinho](https://github.com/rubendinho)! - Fix Vite build error
64
84
 
65
85
  ## 3.3.7
66
86
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @quiltt/core
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/@quiltt%2Fcore.svg)](https://badge.fury.io/js/@quiltt%2Fcore)
4
- [![CI](https://github.com/quiltt/quiltt-public/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/quiltt/quiltt-public/actions/workflows/ci.yml)
4
+ [![CI](https://github.com/quiltt/quiltt-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/quiltt/quiltt-js/actions/workflows/ci.yml)
5
5
 
6
6
  `@quiltt/core` provides essential functionality for building Javascript-based applications with Quiltt. It provides an Auth API client and modules for handling JSON Web Tokens (JWT), observables, storage management, timeouts, API handling, and Typescript types.
7
7
 
@@ -0,0 +1,300 @@
1
+ 'use client';
2
+ import { ApolloLink, Observable as Observable$1 } from '@apollo/client/core/index.js';
3
+ import { print } from 'graphql';
4
+ import { c as createConsumer } from './index-client-D55-rzVl.js';
5
+
6
+ var name = "@quiltt/core";
7
+ var version$1 = "3.5.6";
8
+
9
+ const QUILTT_API_INSECURE = (()=>{
10
+ try {
11
+ return process.env.QUILTT_API_INSECURE;
12
+ } catch {
13
+ return undefined;
14
+ }
15
+ })();
16
+ const QUILTT_API_DOMAIN = (()=>{
17
+ try {
18
+ return process.env.QUILTT_API_DOMAIN;
19
+ } catch {
20
+ return undefined;
21
+ }
22
+ })();
23
+ const QUILTT_DEBUG = (()=>{
24
+ try {
25
+ return !!process.env.QUILTT_DEBUG || process.env.NODE_ENV !== 'production';
26
+ } catch {
27
+ return false;
28
+ }
29
+ })();
30
+ const domain = QUILTT_API_DOMAIN || 'quiltt.io';
31
+ const protocolHttp = `http${QUILTT_API_INSECURE ? '' : 's'}`;
32
+ const protocolWebsockets = `ws${QUILTT_API_DOMAIN ? '' : 's'}`;
33
+ const debugging = QUILTT_DEBUG;
34
+ const version = `${name}: v${version$1}`;
35
+ const cdnBase = `${protocolHttp}://cdn.${domain}`;
36
+ const endpointAuth = `${protocolHttp}://auth.${domain}/v1/users/session`;
37
+ const endpointGraphQL = `${protocolHttp}://api.${domain}/v1/graphql`;
38
+ const endpointWebsockets = `${protocolWebsockets}://api.${domain}/websockets`;
39
+
40
+ /**
41
+ * This is designed to support singletons to share the memory states across all
42
+ * instance of hooks to ensure that updates only process once, by storing a value
43
+ * then notifying all subscribers when it's updated.
44
+ */ class Observable {
45
+ constructor(initalState){
46
+ this.observers = [];
47
+ this.get = ()=>{
48
+ return this.state;
49
+ };
50
+ this.set = (nextState)=>{
51
+ if (this.state === nextState) return;
52
+ this.state = nextState;
53
+ this.observers.forEach((update)=>update(nextState));
54
+ };
55
+ this.subscribe = (observer)=>{
56
+ this.observers.push(observer);
57
+ };
58
+ this.unsubscribe = (observer)=>{
59
+ this.observers = this.observers.filter((update)=>update !== observer);
60
+ };
61
+ this.state = initalState;
62
+ }
63
+ }
64
+
65
+ /**
66
+ * An error and type safe wrapper for localStorage.
67
+ * It allows you to subscribe to changes;
68
+ * but localStorage changes only fire with another
69
+ * window updates the record.
70
+ */ class LocalStorage {
71
+ constructor(){
72
+ this.observers = {};
73
+ this.isEnabled = ()=>{
74
+ try {
75
+ localStorage.setItem(`quiltt.ping`, 'pong');
76
+ localStorage.removeItem(`quiltt.ping`);
77
+ return true;
78
+ } catch (error) {
79
+ return false;
80
+ }
81
+ };
82
+ this.isDisabled = ()=>!this.isEnabled();
83
+ this.get = (key)=>{
84
+ if (typeof window === 'undefined' || !!window.expo) return undefined;
85
+ try {
86
+ const state = window.localStorage.getItem(`quiltt.${key}`);
87
+ return state ? JSON.parse(state) : state;
88
+ } catch (error) {
89
+ console.warn(`localStorage Error: "quiltt.${key}"`, error);
90
+ return undefined;
91
+ }
92
+ };
93
+ this.set = (key, state)=>{
94
+ if (typeof window === 'undefined' || !!window.expo) return;
95
+ try {
96
+ if (state) {
97
+ window.localStorage.setItem(`quiltt.${key}`, JSON.stringify(state));
98
+ } else {
99
+ window.localStorage.removeItem(`quiltt.${key}`);
100
+ }
101
+ } catch (error) {
102
+ console.warn(`localStorage Error: "quiltt.${key}"`, error);
103
+ }
104
+ };
105
+ this.remove = (key)=>{
106
+ try {
107
+ window.localStorage.removeItem(`quiltt.${key}`);
108
+ } catch (error) {
109
+ console.warn(`localStorage Error: "quiltt.${key}">`, error);
110
+ }
111
+ };
112
+ this.subscribe = (key, observer)=>{
113
+ if (!this.observers[key]) this.observers[key] = [];
114
+ this.observers[key].push(observer);
115
+ };
116
+ this.unsubscribe = (key, observer)=>{
117
+ this.observers[key] = this.observers[key]?.filter((update)=>update !== observer);
118
+ };
119
+ // if there is a key, then trigger the related updates. If there is not key
120
+ // it means that a record has been removed and everything needs to be rechecked.
121
+ this.handleStorageEvent = (event)=>{
122
+ if (event.key && event.key.includes('quiltt.')) {
123
+ const newState = event.newValue ? JSON.parse(event.newValue) : null;
124
+ if (this.observers[event.key]) {
125
+ this.observers[event.key].forEach((update)=>update(newState));
126
+ }
127
+ } else {
128
+ Object.entries(this.observers).forEach(([key, observers])=>{
129
+ observers.forEach((update)=>update(this.get(key)));
130
+ });
131
+ }
132
+ };
133
+ if (typeof window !== 'undefined' && !window?.expo) {
134
+ window.addEventListener('storage', this.handleStorageEvent.bind(this));
135
+ }
136
+ }
137
+ }
138
+
139
+ /**
140
+ * This is designed to support effectively an in memory key value store singleton,
141
+ * similar to localstorage, but allows you to subscribe to changes within the current
142
+ * window.
143
+ */ class MemoryStorage {
144
+ constructor(){
145
+ this.observables = {};
146
+ this.get = (key)=>{
147
+ if (this.observables[key]) {
148
+ return this.observables[key].get();
149
+ } else {
150
+ return undefined;
151
+ }
152
+ };
153
+ this.set = (key, state)=>{
154
+ if (!this.observables[key]) {
155
+ this.observables[key] = new Observable(state);
156
+ } else {
157
+ this.observables[key].set(state);
158
+ }
159
+ };
160
+ this.subscribe = (key, observer)=>{
161
+ if (!this.observables[key]) this.observables[key] = new Observable();
162
+ this.observables[key].subscribe(observer);
163
+ };
164
+ this.unsubscribe = (key, observer)=>{
165
+ if (this.observables[key]) {
166
+ this.observables[key].unsubscribe(observer);
167
+ }
168
+ };
169
+ }
170
+ }
171
+
172
+ /**
173
+ * This is wraps both local and memory storage to create a unified interface, that
174
+ * allows you to subscribe to all either changes made within this window, or changes
175
+ * made by other windows.
176
+ */ class Storage {
177
+ constructor(){
178
+ this.memoryStore = new MemoryStorage();
179
+ this.localStore = new LocalStorage();
180
+ this.observers = {};
181
+ this.monitors = new Set();
182
+ /**
183
+ * Checks memoryStorage before falling back to localStorage.
184
+ */ this.get = (key)=>{
185
+ this.monitorLocalStorageChanges(key);
186
+ let state = this.memoryStore.get(key);
187
+ if (state === undefined) {
188
+ state = this.localStore.get(key);
189
+ }
190
+ return state;
191
+ };
192
+ /**
193
+ * We don't trust localStorage to always be present, so we can't rely on it to
194
+ * update memoryStorage based on emitted changes. So we manage our own
195
+ * emitting while using the underlying events to keep memoryStore in sync with
196
+ * localStore.
197
+ */ this.set = (key, newState)=>{
198
+ this.monitorLocalStorageChanges(key);
199
+ this.localStore.set(key, newState);
200
+ this.memoryStore.set(key, newState);
201
+ this.observers[key]?.forEach((update)=>update(newState));
202
+ };
203
+ /**
204
+ * Allows you to subscribe to all changes in memory or local storage as a
205
+ * single event.
206
+ */ this.subscribe = (key, observer)=>{
207
+ if (!this.observers[key]) this.observers[key] = [];
208
+ this.observers[key].push(observer);
209
+ };
210
+ this.unsubscribe = (key, observer)=>{
211
+ this.observers[key] = this.observers[key]?.filter((update)=>update !== observer);
212
+ };
213
+ /**
214
+ * Sets bubble the changes down the stack starting with memoryStore and then
215
+ * localStore. memoryStore will emit changes to everything within the current
216
+ * window context, while localStore will emit changes to every other window
217
+ * context.
218
+ *
219
+ * To ensure that the other windows are updated correctly, changes to localStore
220
+ * need to be subscribed and updated to in memory store, which then may be subscribed
221
+ * to outside of storage.
222
+ */ this.monitorLocalStorageChanges = (key)=>{
223
+ if (this.monitors.has(key)) return;
224
+ this.monitors.add(key);
225
+ this.localStore.subscribe(key, (nextState)=>{
226
+ const prevValue = this.memoryStore.get(key);
227
+ const newState = nextState instanceof Function ? nextState(prevValue) : nextState;
228
+ this.memoryStore.set(key, newState);
229
+ this.observers[key]?.forEach((update)=>update(newState));
230
+ });
231
+ };
232
+ }
233
+ }
234
+ /**
235
+ * This is an singleton to share the memory states across all instances; This
236
+ * basically acts like shared memory when there is no localStorage.
237
+ */ const GlobalStorage = new Storage();
238
+
239
+ class ActionCableLink extends ApolloLink {
240
+ constructor(options){
241
+ super();
242
+ this.cables = {};
243
+ this.channelName = options.channelName || 'GraphqlChannel';
244
+ this.actionName = options.actionName || 'execute';
245
+ this.connectionParams = options.connectionParams || {};
246
+ }
247
+ // Interestingly, this link does _not_ call through to `next` because
248
+ // instead, it sends the request to ActionCable.
249
+ request(operation, _next) {
250
+ const token = GlobalStorage.get('session');
251
+ if (!token) {
252
+ console.warn(`QuilttClient attempted to send an unauthenticated Subscription`);
253
+ return null;
254
+ }
255
+ if (!this.cables[token]) {
256
+ this.cables[token] = createConsumer(endpointWebsockets + (token ? `?token=${token}` : ''));
257
+ }
258
+ return new Observable$1((observer)=>{
259
+ const channelId = Math.round(Date.now() + Math.random() * 100000).toString(16);
260
+ const actionName = this.actionName;
261
+ const connectionParams = typeof this.connectionParams === 'function' ? this.connectionParams(operation) : this.connectionParams;
262
+ const channel = this.cables[token].subscriptions.create(Object.assign({}, {
263
+ channel: this.channelName,
264
+ channelId: channelId
265
+ }, connectionParams), {
266
+ connected: ()=>{
267
+ channel.perform(actionName, {
268
+ query: operation.query ? print(operation.query) : null,
269
+ variables: operation.variables,
270
+ // This is added for persisted operation support:
271
+ operationId: operation.operationId,
272
+ operationName: operation.operationName
273
+ });
274
+ },
275
+ received: (payload)=>{
276
+ if (payload?.result?.data || payload?.result?.errors) {
277
+ observer.next(payload.result);
278
+ }
279
+ if (!payload.more) {
280
+ observer.complete();
281
+ }
282
+ }
283
+ });
284
+ // Make the ActionCable subscription behave like an Apollo subscription
285
+ return Object.assign(channel, {
286
+ closed: false
287
+ });
288
+ });
289
+ }
290
+ }
291
+
292
+ class SubscriptionLink extends ActionCableLink {
293
+ constructor(){
294
+ super({
295
+ channelName: 'GraphQLChannel'
296
+ });
297
+ }
298
+ }
299
+
300
+ export { GlobalStorage as G, LocalStorage as L, MemoryStorage as M, Observable as O, SubscriptionLink as S, endpointAuth as a, endpointWebsockets as b, cdnBase as c, debugging as d, endpointGraphQL as e, Storage as f, version as v };