@apollo/federation-internals 2.8.0-connectors.4 → 2.8.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 (88) hide show
  1. package/dist/directiveAndTypeSpecification.d.ts +13 -1
  2. package/dist/directiveAndTypeSpecification.d.ts.map +1 -1
  3. package/dist/directiveAndTypeSpecification.js +2 -2
  4. package/dist/directiveAndTypeSpecification.js.map +1 -1
  5. package/dist/error.d.ts +25 -0
  6. package/dist/error.d.ts.map +1 -1
  7. package/dist/error.js +50 -0
  8. package/dist/error.js.map +1 -1
  9. package/dist/extractSubgraphsFromSupergraph.d.ts +1 -1
  10. package/dist/extractSubgraphsFromSupergraph.d.ts.map +1 -1
  11. package/dist/extractSubgraphsFromSupergraph.js +62 -7
  12. package/dist/extractSubgraphsFromSupergraph.js.map +1 -1
  13. package/dist/federation.d.ts +19 -2
  14. package/dist/federation.d.ts.map +1 -1
  15. package/dist/federation.js +420 -9
  16. package/dist/federation.js.map +1 -1
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/knownCoreFeatures.d.ts +3 -0
  22. package/dist/knownCoreFeatures.d.ts.map +1 -1
  23. package/dist/knownCoreFeatures.js +12 -1
  24. package/dist/knownCoreFeatures.js.map +1 -1
  25. package/dist/operations.d.ts +10 -8
  26. package/dist/operations.d.ts.map +1 -1
  27. package/dist/operations.js +48 -16
  28. package/dist/operations.js.map +1 -1
  29. package/dist/specs/contextSpec.d.ts +20 -0
  30. package/dist/specs/contextSpec.d.ts.map +1 -0
  31. package/dist/specs/contextSpec.js +62 -0
  32. package/dist/specs/contextSpec.js.map +1 -0
  33. package/dist/specs/coreSpec.d.ts +1 -0
  34. package/dist/specs/coreSpec.d.ts.map +1 -1
  35. package/dist/specs/coreSpec.js +3 -0
  36. package/dist/specs/coreSpec.js.map +1 -1
  37. package/dist/specs/federationSpec.d.ts +8 -2
  38. package/dist/specs/federationSpec.d.ts.map +1 -1
  39. package/dist/specs/federationSpec.js +16 -1
  40. package/dist/specs/federationSpec.js.map +1 -1
  41. package/dist/specs/joinSpec.d.ts +6 -0
  42. package/dist/specs/joinSpec.d.ts.map +1 -1
  43. package/dist/specs/joinSpec.js +11 -1
  44. package/dist/specs/joinSpec.js.map +1 -1
  45. package/dist/specs/sourceSpec.d.ts +69 -0
  46. package/dist/specs/sourceSpec.d.ts.map +1 -0
  47. package/dist/specs/sourceSpec.js +345 -0
  48. package/dist/specs/sourceSpec.js.map +1 -0
  49. package/dist/supergraphs.d.ts +4 -0
  50. package/dist/supergraphs.d.ts.map +1 -1
  51. package/dist/supergraphs.js +35 -2
  52. package/dist/supergraphs.js.map +1 -1
  53. package/dist/utils.d.ts +3 -0
  54. package/dist/utils.d.ts.map +1 -1
  55. package/dist/utils.js +39 -1
  56. package/dist/utils.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/directiveAndTypeSpecification.ts +8 -1
  59. package/src/error.ts +175 -0
  60. package/src/extractSubgraphsFromSupergraph.ts +76 -14
  61. package/src/federation.ts +636 -17
  62. package/src/index.ts +2 -1
  63. package/src/knownCoreFeatures.ts +15 -0
  64. package/src/operations.ts +63 -23
  65. package/src/specs/contextSpec.ts +87 -0
  66. package/src/specs/coreSpec.ts +5 -0
  67. package/src/specs/federationSpec.ts +18 -1
  68. package/src/specs/joinSpec.ts +27 -3
  69. package/src/specs/sourceSpec.ts +607 -0
  70. package/src/supergraphs.ts +37 -1
  71. package/src/utils.ts +38 -0
  72. package/dist/specs/connectSpec.d.ts +0 -42
  73. package/dist/specs/connectSpec.d.ts.map +0 -1
  74. package/dist/specs/connectSpec.js +0 -82
  75. package/dist/specs/connectSpec.js.map +0 -1
  76. package/dist/wasm.d.ts +0 -4
  77. package/dist/wasm.d.ts.map +0 -1
  78. package/dist/wasm.js +0 -83
  79. package/dist/wasm.js.map +0 -1
  80. package/src/specs/connectSpec.ts +0 -181
  81. package/src/wasm.ts +0 -111
  82. package/wasm/node/.gitignore +0 -1
  83. package/wasm/node/.npmignore +0 -2
  84. package/wasm/node/federation_internals_wasm.d.ts +0 -49
  85. package/wasm/node/federation_internals_wasm.js +0 -367
  86. package/wasm/node/federation_internals_wasm_bg.wasm +0 -0
  87. package/wasm/node/federation_internals_wasm_bg.wasm.d.ts +0 -19
  88. package/wasm/node/package.json +0 -15
@@ -1,367 +0,0 @@
1
- let imports = {};
2
- imports['__wbindgen_placeholder__'] = module.exports;
3
- let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
5
-
6
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
9
-
10
- let cachedUint8Memory0 = null;
11
-
12
- function getUint8Memory0() {
13
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
14
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
15
- }
16
- return cachedUint8Memory0;
17
- }
18
-
19
- function getStringFromWasm0(ptr, len) {
20
- ptr = ptr >>> 0;
21
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22
- }
23
-
24
- const heap = new Array(128).fill(undefined);
25
-
26
- heap.push(undefined, null, true, false);
27
-
28
- let heap_next = heap.length;
29
-
30
- function addHeapObject(obj) {
31
- if (heap_next === heap.length) heap.push(heap.length + 1);
32
- const idx = heap_next;
33
- heap_next = heap[idx];
34
-
35
- heap[idx] = obj;
36
- return idx;
37
- }
38
-
39
- function getObject(idx) { return heap[idx]; }
40
-
41
- let WASM_VECTOR_LEN = 0;
42
-
43
- let cachedTextEncoder = new TextEncoder('utf-8');
44
-
45
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
46
- ? function (arg, view) {
47
- return cachedTextEncoder.encodeInto(arg, view);
48
- }
49
- : function (arg, view) {
50
- const buf = cachedTextEncoder.encode(arg);
51
- view.set(buf);
52
- return {
53
- read: arg.length,
54
- written: buf.length
55
- };
56
- });
57
-
58
- function passStringToWasm0(arg, malloc, realloc) {
59
-
60
- if (realloc === undefined) {
61
- const buf = cachedTextEncoder.encode(arg);
62
- const ptr = malloc(buf.length, 1) >>> 0;
63
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
64
- WASM_VECTOR_LEN = buf.length;
65
- return ptr;
66
- }
67
-
68
- let len = arg.length;
69
- let ptr = malloc(len, 1) >>> 0;
70
-
71
- const mem = getUint8Memory0();
72
-
73
- let offset = 0;
74
-
75
- for (; offset < len; offset++) {
76
- const code = arg.charCodeAt(offset);
77
- if (code > 0x7F) break;
78
- mem[ptr + offset] = code;
79
- }
80
-
81
- if (offset !== len) {
82
- if (offset !== 0) {
83
- arg = arg.slice(offset);
84
- }
85
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
86
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
87
- const ret = encodeString(arg, view);
88
-
89
- offset += ret.written;
90
- ptr = realloc(ptr, len, offset, 1) >>> 0;
91
- }
92
-
93
- WASM_VECTOR_LEN = offset;
94
- return ptr;
95
- }
96
-
97
- function isLikeNone(x) {
98
- return x === undefined || x === null;
99
- }
100
-
101
- let cachedInt32Memory0 = null;
102
-
103
- function getInt32Memory0() {
104
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
105
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
106
- }
107
- return cachedInt32Memory0;
108
- }
109
-
110
- function dropObject(idx) {
111
- if (idx < 132) return;
112
- heap[idx] = heap_next;
113
- heap_next = idx;
114
- }
115
-
116
- function takeObject(idx) {
117
- const ret = getObject(idx);
118
- dropObject(idx);
119
- return ret;
120
- }
121
-
122
- let cachedUint32Memory0 = null;
123
-
124
- function getUint32Memory0() {
125
- if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
126
- cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
127
- }
128
- return cachedUint32Memory0;
129
- }
130
-
131
- function getArrayJsValueFromWasm0(ptr, len) {
132
- ptr = ptr >>> 0;
133
- const mem = getUint32Memory0();
134
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
135
- const result = [];
136
- for (let i = 0; i < slice.length; i++) {
137
- result.push(takeObject(slice[i]));
138
- }
139
- return result;
140
- }
141
- /**
142
- * @param {string} schema
143
- * @returns {(GraphQLError)[]}
144
- */
145
- module.exports.validate_connect_directives = function(schema) {
146
- try {
147
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
148
- const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149
- const len0 = WASM_VECTOR_LEN;
150
- wasm.validate_connect_directives(retptr, ptr0, len0);
151
- var r0 = getInt32Memory0()[retptr / 4 + 0];
152
- var r1 = getInt32Memory0()[retptr / 4 + 1];
153
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
154
- wasm.__wbindgen_free(r0, r1 * 4, 4);
155
- return v2;
156
- } finally {
157
- wasm.__wbindgen_add_to_stack_pointer(16);
158
- }
159
- };
160
-
161
- /**
162
- */
163
- module.exports.SourceArgument = Object.freeze({ Name:0,"0":"Name",Url:1,"1":"Url", });
164
-
165
- const ErrorLocationFinalization = (typeof FinalizationRegistry === 'undefined')
166
- ? { register: () => {}, unregister: () => {} }
167
- : new FinalizationRegistry(ptr => wasm.__wbg_errorlocation_free(ptr >>> 0));
168
- /**
169
- */
170
- class ErrorLocation {
171
-
172
- static __wrap(ptr) {
173
- ptr = ptr >>> 0;
174
- const obj = Object.create(ErrorLocation.prototype);
175
- obj.__wbg_ptr = ptr;
176
- ErrorLocationFinalization.register(obj, obj.__wbg_ptr, obj);
177
- return obj;
178
- }
179
-
180
- __destroy_into_raw() {
181
- const ptr = this.__wbg_ptr;
182
- this.__wbg_ptr = 0;
183
- ErrorLocationFinalization.unregister(this);
184
- return ptr;
185
- }
186
-
187
- free() {
188
- const ptr = this.__destroy_into_raw();
189
- wasm.__wbg_errorlocation_free(ptr);
190
- }
191
- /**
192
- * @returns {SourceDirective | undefined}
193
- */
194
- get source() {
195
- const ret = wasm.errorlocation_source(this.__wbg_ptr);
196
- return ret === 0 ? undefined : SourceDirective.__wrap(ret);
197
- }
198
- }
199
- module.exports.ErrorLocation = ErrorLocation;
200
-
201
- const GraphQLErrorFinalization = (typeof FinalizationRegistry === 'undefined')
202
- ? { register: () => {}, unregister: () => {} }
203
- : new FinalizationRegistry(ptr => wasm.__wbg_graphqlerror_free(ptr >>> 0));
204
- /**
205
- * Rust representation of `GraphQLError` from TypeScript
206
- *
207
- * TODO: Import the JavaScript version directly to avoid extra copying?
208
- */
209
- class GraphQLError {
210
-
211
- static __wrap(ptr) {
212
- ptr = ptr >>> 0;
213
- const obj = Object.create(GraphQLError.prototype);
214
- obj.__wbg_ptr = ptr;
215
- GraphQLErrorFinalization.register(obj, obj.__wbg_ptr, obj);
216
- return obj;
217
- }
218
-
219
- __destroy_into_raw() {
220
- const ptr = this.__wbg_ptr;
221
- this.__wbg_ptr = 0;
222
- GraphQLErrorFinalization.unregister(this);
223
- return ptr;
224
- }
225
-
226
- free() {
227
- const ptr = this.__destroy_into_raw();
228
- wasm.__wbg_graphqlerror_free(ptr);
229
- }
230
- /**
231
- * @returns {any}
232
- */
233
- get code() {
234
- const ret = wasm.__wbg_get_graphqlerror_code(this.__wbg_ptr);
235
- return takeObject(ret);
236
- }
237
- /**
238
- * @param {any} arg0
239
- */
240
- set code(arg0) {
241
- wasm.__wbg_set_graphqlerror_code(this.__wbg_ptr, addHeapObject(arg0));
242
- }
243
- /**
244
- * @returns {string}
245
- */
246
- get message() {
247
- let deferred1_0;
248
- let deferred1_1;
249
- try {
250
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
251
- wasm.graphqlerror_message(retptr, this.__wbg_ptr);
252
- var r0 = getInt32Memory0()[retptr / 4 + 0];
253
- var r1 = getInt32Memory0()[retptr / 4 + 1];
254
- deferred1_0 = r0;
255
- deferred1_1 = r1;
256
- return getStringFromWasm0(r0, r1);
257
- } finally {
258
- wasm.__wbindgen_add_to_stack_pointer(16);
259
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
260
- }
261
- }
262
- /**
263
- * @returns {ErrorLocation | undefined}
264
- */
265
- get location() {
266
- const ret = wasm.graphqlerror_location(this.__wbg_ptr);
267
- return ret === 0 ? undefined : ErrorLocation.__wrap(ret);
268
- }
269
- }
270
- module.exports.GraphQLError = GraphQLError;
271
-
272
- const SourceDirectiveFinalization = (typeof FinalizationRegistry === 'undefined')
273
- ? { register: () => {}, unregister: () => {} }
274
- : new FinalizationRegistry(ptr => wasm.__wbg_sourcedirective_free(ptr >>> 0));
275
- /**
276
- */
277
- class SourceDirective {
278
-
279
- static __wrap(ptr) {
280
- ptr = ptr >>> 0;
281
- const obj = Object.create(SourceDirective.prototype);
282
- obj.__wbg_ptr = ptr;
283
- SourceDirectiveFinalization.register(obj, obj.__wbg_ptr, obj);
284
- return obj;
285
- }
286
-
287
- __destroy_into_raw() {
288
- const ptr = this.__wbg_ptr;
289
- this.__wbg_ptr = 0;
290
- SourceDirectiveFinalization.unregister(this);
291
- return ptr;
292
- }
293
-
294
- free() {
295
- const ptr = this.__destroy_into_raw();
296
- wasm.__wbg_sourcedirective_free(ptr);
297
- }
298
- /**
299
- * @returns {SourceArgument}
300
- */
301
- get arg() {
302
- const ret = wasm.__wbg_get_sourcedirective_arg(this.__wbg_ptr);
303
- return ret;
304
- }
305
- /**
306
- * @param {SourceArgument} arg0
307
- */
308
- set arg(arg0) {
309
- wasm.__wbg_set_sourcedirective_arg(this.__wbg_ptr, arg0);
310
- }
311
- /**
312
- * @returns {string}
313
- */
314
- get name() {
315
- let deferred1_0;
316
- let deferred1_1;
317
- try {
318
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
319
- wasm.graphqlerror_message(retptr, this.__wbg_ptr);
320
- var r0 = getInt32Memory0()[retptr / 4 + 0];
321
- var r1 = getInt32Memory0()[retptr / 4 + 1];
322
- deferred1_0 = r0;
323
- deferred1_1 = r1;
324
- return getStringFromWasm0(r0, r1);
325
- } finally {
326
- wasm.__wbindgen_add_to_stack_pointer(16);
327
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
328
- }
329
- }
330
- }
331
- module.exports.SourceDirective = SourceDirective;
332
-
333
- module.exports.__wbg_graphqlerror_new = function(arg0) {
334
- const ret = GraphQLError.__wrap(arg0);
335
- return addHeapObject(ret);
336
- };
337
-
338
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
339
- const ret = getStringFromWasm0(arg0, arg1);
340
- return addHeapObject(ret);
341
- };
342
-
343
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
344
- const obj = getObject(arg1);
345
- const ret = typeof(obj) === 'string' ? obj : undefined;
346
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
347
- var len1 = WASM_VECTOR_LEN;
348
- getInt32Memory0()[arg0 / 4 + 1] = len1;
349
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
350
- };
351
-
352
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
353
- takeObject(arg0);
354
- };
355
-
356
- module.exports.__wbindgen_throw = function(arg0, arg1) {
357
- throw new Error(getStringFromWasm0(arg0, arg1));
358
- };
359
-
360
- const path = require('path').join(__dirname, 'federation_internals_wasm_bg.wasm');
361
- const bytes = require('fs').readFileSync(path);
362
-
363
- const wasmModule = new WebAssembly.Module(bytes);
364
- const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
365
- wasm = wasmInstance.exports;
366
- module.exports.__wasm = wasm;
367
-
@@ -1,19 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export const memory: WebAssembly.Memory;
4
- export function validate_connect_directives(a: number, b: number, c: number): void;
5
- export function __wbg_graphqlerror_free(a: number): void;
6
- export function __wbg_get_graphqlerror_code(a: number): number;
7
- export function __wbg_set_graphqlerror_code(a: number, b: number): void;
8
- export function graphqlerror_message(a: number, b: number): void;
9
- export function graphqlerror_location(a: number): number;
10
- export function __wbg_errorlocation_free(a: number): void;
11
- export function errorlocation_source(a: number): number;
12
- export function __wbg_sourcedirective_free(a: number): void;
13
- export function __wbg_get_sourcedirective_arg(a: number): number;
14
- export function __wbg_set_sourcedirective_arg(a: number, b: number): void;
15
- export function sourcedirective_name(a: number, b: number): void;
16
- export function __wbindgen_malloc(a: number, b: number): number;
17
- export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
18
- export function __wbindgen_add_to_stack_pointer(a: number): number;
19
- export function __wbindgen_free(a: number, b: number, c: number): void;
@@ -1,15 +0,0 @@
1
- {
2
- "name": "federation-internals-wasm",
3
- "collaborators": [
4
- "The Apollo GraphQL Contributors"
5
- ],
6
- "version": "0.1.0",
7
- "license": "Elastic-2.0",
8
- "files": [
9
- "federation_internals_wasm_bg.wasm",
10
- "federation_internals_wasm.js",
11
- "federation_internals_wasm.d.ts"
12
- ],
13
- "main": "federation_internals_wasm.js",
14
- "types": "federation_internals_wasm.d.ts"
15
- }