@clawconquest/client 1.1.1

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.
package/dist/index.cjs ADDED
@@ -0,0 +1,1873 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // generated/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ GenqlError: () => GenqlError,
24
+ createClient: () => createClient2,
25
+ enumApplicationStatus: () => enumApplicationStatus,
26
+ enumClanPactType: () => enumClanPactType,
27
+ enumClanStatus: () => enumClanStatus,
28
+ enumGovernanceType: () => enumGovernanceType,
29
+ enumMembershipPolicy: () => enumMembershipPolicy,
30
+ enumPactStatus: () => enumPactStatus,
31
+ enumPoolType: () => enumPoolType,
32
+ enumPrimaryGoal: () => enumPrimaryGoal,
33
+ enumSiegeStatus: () => enumSiegeStatus,
34
+ enumSpecies: () => enumSpecies,
35
+ enumUnitType: () => enumUnitType,
36
+ everything: () => everything,
37
+ generateMutationOp: () => generateMutationOp,
38
+ generateQueryOp: () => generateQueryOp,
39
+ generateSubscriptionOp: () => generateSubscriptionOp,
40
+ isClan: () => isClan,
41
+ isClanApplication: () => isClanApplication,
42
+ isClanPact: () => isClanPact,
43
+ isClaw: () => isClaw,
44
+ isClawSummary: () => isClawSummary,
45
+ isCreateClawPayload: () => isCreateClawPayload,
46
+ isGameEvent: () => isGameEvent,
47
+ isMutation: () => isMutation,
48
+ isPlayer: () => isPlayer,
49
+ isPlayerProfile: () => isPlayerProfile,
50
+ isPool: () => isPool,
51
+ isPublicClaw: () => isPublicClaw,
52
+ isQuery: () => isQuery,
53
+ isRegenerateKeyPayload: () => isRegenerateKeyPayload,
54
+ isRelationship: () => isRelationship,
55
+ isSiege: () => isSiege,
56
+ isSpyDeployment: () => isSpyDeployment,
57
+ isStandingOrder: () => isStandingOrder,
58
+ isSubscription: () => isSubscription,
59
+ isUnit: () => isUnit,
60
+ isWhisper: () => isWhisper
61
+ });
62
+ module.exports = __toCommonJS(index_exports);
63
+
64
+ // generated/runtime/error.ts
65
+ var GenqlError = class extends Error {
66
+ errors = [];
67
+ /**
68
+ * Partial data returned by the server
69
+ */
70
+ data;
71
+ constructor(errors, data) {
72
+ let message = Array.isArray(errors) ? errors.map((x) => x?.message || "").join("\n") : "";
73
+ if (!message) {
74
+ message = "GraphQL error";
75
+ }
76
+ super(message);
77
+ this.errors = errors;
78
+ this.data = data;
79
+ }
80
+ };
81
+
82
+ // generated/runtime/batcher.ts
83
+ function dispatchQueueBatch(client, queue) {
84
+ let batchedQuery = queue.map((item) => item.request);
85
+ if (batchedQuery.length === 1) {
86
+ batchedQuery = batchedQuery[0];
87
+ }
88
+ (() => {
89
+ try {
90
+ return client.fetcher(batchedQuery);
91
+ } catch (e) {
92
+ return Promise.reject(e);
93
+ }
94
+ })().then((responses) => {
95
+ if (queue.length === 1 && !Array.isArray(responses)) {
96
+ if (responses.errors && responses.errors.length) {
97
+ queue[0].reject(
98
+ new GenqlError(responses.errors, responses.data)
99
+ );
100
+ return;
101
+ }
102
+ queue[0].resolve(responses);
103
+ return;
104
+ } else if (responses.length !== queue.length) {
105
+ throw new Error("response length did not match query length");
106
+ }
107
+ for (let i = 0; i < queue.length; i++) {
108
+ if (responses[i].errors && responses[i].errors.length) {
109
+ queue[i].reject(
110
+ new GenqlError(responses[i].errors, responses[i].data)
111
+ );
112
+ } else {
113
+ queue[i].resolve(responses[i]);
114
+ }
115
+ }
116
+ }).catch((e) => {
117
+ for (let i = 0; i < queue.length; i++) {
118
+ queue[i].reject(e);
119
+ }
120
+ });
121
+ }
122
+ function dispatchQueue(client, options) {
123
+ const queue = client._queue;
124
+ const maxBatchSize = options.maxBatchSize || 0;
125
+ client._queue = [];
126
+ if (maxBatchSize > 0 && maxBatchSize < queue.length) {
127
+ for (let i = 0; i < queue.length / maxBatchSize; i++) {
128
+ dispatchQueueBatch(
129
+ client,
130
+ queue.slice(i * maxBatchSize, (i + 1) * maxBatchSize)
131
+ );
132
+ }
133
+ } else {
134
+ dispatchQueueBatch(client, queue);
135
+ }
136
+ }
137
+ var QueryBatcher = class _QueryBatcher {
138
+ fetcher;
139
+ _options;
140
+ _queue;
141
+ constructor(fetcher, {
142
+ batchInterval = 6,
143
+ shouldBatch = true,
144
+ maxBatchSize = 0
145
+ } = {}) {
146
+ this.fetcher = fetcher;
147
+ this._options = {
148
+ batchInterval,
149
+ shouldBatch,
150
+ maxBatchSize
151
+ };
152
+ this._queue = [];
153
+ }
154
+ /**
155
+ * Fetch will send a graphql request and return the parsed json.
156
+ * @param {string} query - the graphql query.
157
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
158
+ * @param {[string]} operationName - the graphql operationName.
159
+ * @param {Options} overrides - the client options overrides.
160
+ *
161
+ * @return {promise} resolves to parsed json of server response
162
+ *
163
+ * @example
164
+ * client.fetch(`
165
+ * query getHuman($id: ID!) {
166
+ * human(id: $id) {
167
+ * name
168
+ * height
169
+ * }
170
+ * }
171
+ * `, { id: "1001" }, 'getHuman')
172
+ * .then(human => {
173
+ * // do something with human
174
+ * console.log(human);
175
+ * });
176
+ */
177
+ fetch(query, variables, operationName, overrides = {}) {
178
+ const request = {
179
+ query
180
+ };
181
+ const options = Object.assign({}, this._options, overrides);
182
+ if (variables) {
183
+ request.variables = variables;
184
+ }
185
+ if (operationName) {
186
+ request.operationName = operationName;
187
+ }
188
+ const promise = new Promise((resolve, reject) => {
189
+ this._queue.push({
190
+ request,
191
+ resolve,
192
+ reject
193
+ });
194
+ if (this._queue.length === 1) {
195
+ if (options.shouldBatch) {
196
+ setTimeout(
197
+ () => dispatchQueue(this, options),
198
+ options.batchInterval
199
+ );
200
+ } else {
201
+ dispatchQueue(this, options);
202
+ }
203
+ }
204
+ });
205
+ return promise;
206
+ }
207
+ /**
208
+ * Fetch will send a graphql request and return the parsed json.
209
+ * @param {string} query - the graphql query.
210
+ * @param {Variables} variables - any variables you wish to inject as key/value pairs.
211
+ * @param {[string]} operationName - the graphql operationName.
212
+ * @param {Options} overrides - the client options overrides.
213
+ *
214
+ * @return {Promise<Array<Result>>} resolves to parsed json of server response
215
+ *
216
+ * @example
217
+ * client.forceFetch(`
218
+ * query getHuman($id: ID!) {
219
+ * human(id: $id) {
220
+ * name
221
+ * height
222
+ * }
223
+ * }
224
+ * `, { id: "1001" }, 'getHuman')
225
+ * .then(human => {
226
+ * // do something with human
227
+ * console.log(human);
228
+ * });
229
+ */
230
+ forceFetch(query, variables, operationName, overrides = {}) {
231
+ const request = {
232
+ query
233
+ };
234
+ const options = Object.assign({}, this._options, overrides, {
235
+ shouldBatch: false
236
+ });
237
+ if (variables) {
238
+ request.variables = variables;
239
+ }
240
+ if (operationName) {
241
+ request.operationName = operationName;
242
+ }
243
+ const promise = new Promise((resolve, reject) => {
244
+ const client = new _QueryBatcher(this.fetcher, this._options);
245
+ client._queue = [
246
+ {
247
+ request,
248
+ resolve,
249
+ reject
250
+ }
251
+ ];
252
+ dispatchQueue(client, options);
253
+ });
254
+ return promise;
255
+ }
256
+ };
257
+
258
+ // generated/runtime/fetcher.ts
259
+ var DEFAULT_BATCH_OPTIONS = {
260
+ maxBatchSize: 10,
261
+ batchInterval: 40
262
+ };
263
+ var createFetcher = ({
264
+ url,
265
+ headers = {},
266
+ fetcher,
267
+ fetch: _fetch,
268
+ batch = false,
269
+ ...rest
270
+ }) => {
271
+ if (!url && !fetcher) {
272
+ throw new Error("url or fetcher is required");
273
+ }
274
+ fetcher = fetcher || (async (body) => {
275
+ let headersObject = typeof headers == "function" ? await headers() : headers;
276
+ headersObject = headersObject || {};
277
+ if (typeof fetch === "undefined" && !_fetch) {
278
+ throw new Error(
279
+ "Global `fetch` function is not available, pass a fetch polyfill to Genql `createClient`"
280
+ );
281
+ }
282
+ let fetchImpl = _fetch || fetch;
283
+ const res = await fetchImpl(url, {
284
+ headers: {
285
+ "Content-Type": "application/json",
286
+ ...headersObject
287
+ },
288
+ method: "POST",
289
+ body: JSON.stringify(body),
290
+ ...rest
291
+ });
292
+ if (!res.ok) {
293
+ throw new Error(`${res.statusText}: ${await res.text()}`);
294
+ }
295
+ const json = await res.json();
296
+ return json;
297
+ });
298
+ if (!batch) {
299
+ return async (body) => {
300
+ const json = await fetcher(body);
301
+ if (Array.isArray(json)) {
302
+ return json.map((json2) => {
303
+ if (json2?.errors?.length) {
304
+ throw new GenqlError(json2.errors || [], json2.data);
305
+ }
306
+ return json2.data;
307
+ });
308
+ } else {
309
+ if (json?.errors?.length) {
310
+ throw new GenqlError(json.errors || [], json.data);
311
+ }
312
+ return json.data;
313
+ }
314
+ };
315
+ }
316
+ const batcher = new QueryBatcher(
317
+ async (batchedQuery) => {
318
+ const json = await fetcher(batchedQuery);
319
+ return json;
320
+ },
321
+ batch === true ? DEFAULT_BATCH_OPTIONS : batch
322
+ );
323
+ return async ({ query, variables }) => {
324
+ const json = await batcher.fetch(query, variables);
325
+ if (json?.data) {
326
+ return json.data;
327
+ }
328
+ throw new Error(
329
+ "Genql batch fetcher returned unexpected result " + JSON.stringify(json)
330
+ );
331
+ };
332
+ };
333
+
334
+ // generated/runtime/generateGraphqlOperation.ts
335
+ var parseRequest = (request, ctx, path) => {
336
+ if (typeof request === "object" && "__args" in request) {
337
+ const args = request.__args;
338
+ let fields = { ...request };
339
+ delete fields.__args;
340
+ const argNames = Object.keys(args);
341
+ if (argNames.length === 0) {
342
+ return parseRequest(fields, ctx, path);
343
+ }
344
+ const field = getFieldFromPath(ctx.root, path);
345
+ const argStrings = argNames.map((argName) => {
346
+ ctx.varCounter++;
347
+ const varName = `v${ctx.varCounter}`;
348
+ const typing = field.args && field.args[argName];
349
+ if (!typing) {
350
+ throw new Error(
351
+ `no typing defined for argument \`${argName}\` in path \`${path.join(
352
+ "."
353
+ )}\``
354
+ );
355
+ }
356
+ ctx.variables[varName] = {
357
+ value: args[argName],
358
+ typing
359
+ };
360
+ return `${argName}:$${varName}`;
361
+ });
362
+ return `(${argStrings})${parseRequest(fields, ctx, path)}`;
363
+ } else if (typeof request === "object" && Object.keys(request).length > 0) {
364
+ const fields = request;
365
+ const fieldNames = Object.keys(fields).filter((k) => Boolean(fields[k]));
366
+ if (fieldNames.length === 0) {
367
+ throw new Error(
368
+ `field selection should not be empty: ${path.join(".")}`
369
+ );
370
+ }
371
+ const type = path.length > 0 ? getFieldFromPath(ctx.root, path).type : ctx.root;
372
+ const scalarFields = type.scalar;
373
+ let scalarFieldsFragment;
374
+ if (fieldNames.includes("__scalar")) {
375
+ const falsyFieldNames = new Set(
376
+ Object.keys(fields).filter((k) => !Boolean(fields[k]))
377
+ );
378
+ if (scalarFields?.length) {
379
+ ctx.fragmentCounter++;
380
+ scalarFieldsFragment = `f${ctx.fragmentCounter}`;
381
+ ctx.fragments.push(
382
+ `fragment ${scalarFieldsFragment} on ${type.name}{${scalarFields.filter((f) => !falsyFieldNames.has(f)).join(",")}}`
383
+ );
384
+ }
385
+ }
386
+ const fieldsSelection = fieldNames.filter((f) => !["__scalar", "__name"].includes(f)).map((f) => {
387
+ const parsed = parseRequest(fields[f], ctx, [...path, f]);
388
+ if (f.startsWith("on_")) {
389
+ ctx.fragmentCounter++;
390
+ const implementationFragment = `f${ctx.fragmentCounter}`;
391
+ const typeMatch = f.match(/^on_(.+)/);
392
+ if (!typeMatch || !typeMatch[1])
393
+ throw new Error("match failed");
394
+ ctx.fragments.push(
395
+ `fragment ${implementationFragment} on ${typeMatch[1]}${parsed}`
396
+ );
397
+ return `...${implementationFragment}`;
398
+ } else {
399
+ return `${f}${parsed}`;
400
+ }
401
+ }).concat(scalarFieldsFragment ? [`...${scalarFieldsFragment}`] : []).join(",");
402
+ return `{${fieldsSelection}}`;
403
+ } else {
404
+ return "";
405
+ }
406
+ };
407
+ var generateGraphqlOperation = (operation, root, fields) => {
408
+ const ctx = {
409
+ root,
410
+ varCounter: 0,
411
+ variables: {},
412
+ fragmentCounter: 0,
413
+ fragments: []
414
+ };
415
+ const result = parseRequest(fields, ctx, []);
416
+ const varNames = Object.keys(ctx.variables);
417
+ const varsString = varNames.length > 0 ? `(${varNames.map((v) => {
418
+ const variableType = ctx.variables[v].typing[1];
419
+ return `$${v}:${variableType}`;
420
+ })})` : "";
421
+ const operationName = fields?.__name || "";
422
+ return {
423
+ query: [
424
+ `${operation} ${operationName}${varsString}${result}`,
425
+ ...ctx.fragments
426
+ ].join(","),
427
+ variables: Object.keys(ctx.variables).reduce(
428
+ (r, v) => {
429
+ r[v] = ctx.variables[v].value;
430
+ return r;
431
+ },
432
+ {}
433
+ ),
434
+ ...operationName ? { operationName: operationName.toString() } : {}
435
+ };
436
+ };
437
+ var getFieldFromPath = (root, path) => {
438
+ let current;
439
+ if (!root) throw new Error("root type is not provided");
440
+ if (path.length === 0) throw new Error(`path is empty`);
441
+ path.forEach((f) => {
442
+ const type = current ? current.type : root;
443
+ if (!type.fields)
444
+ throw new Error(`type \`${type.name}\` does not have fields`);
445
+ const possibleTypes = Object.keys(type.fields).filter((i) => i.startsWith("on_")).reduce(
446
+ (types, fieldName) => {
447
+ const field2 = type.fields && type.fields[fieldName];
448
+ if (field2) types.push(field2.type);
449
+ return types;
450
+ },
451
+ [type]
452
+ );
453
+ let field = null;
454
+ possibleTypes.forEach((type2) => {
455
+ const found = type2.fields && type2.fields[f];
456
+ if (found) field = found;
457
+ });
458
+ if (!field)
459
+ throw new Error(
460
+ `type \`${type.name}\` does not have a field \`${f}\``
461
+ );
462
+ current = field;
463
+ });
464
+ return current;
465
+ };
466
+
467
+ // generated/runtime/createClient.ts
468
+ var createClient = ({
469
+ queryRoot,
470
+ mutationRoot,
471
+ subscriptionRoot,
472
+ ...options
473
+ }) => {
474
+ const fetcher = createFetcher(options);
475
+ const client = {};
476
+ if (queryRoot) {
477
+ client.query = (request) => {
478
+ if (!queryRoot) throw new Error("queryRoot argument is missing");
479
+ const resultPromise = fetcher(
480
+ generateGraphqlOperation("query", queryRoot, request)
481
+ );
482
+ return resultPromise;
483
+ };
484
+ }
485
+ if (mutationRoot) {
486
+ client.mutation = (request) => {
487
+ if (!mutationRoot)
488
+ throw new Error("mutationRoot argument is missing");
489
+ const resultPromise = fetcher(
490
+ generateGraphqlOperation("mutation", mutationRoot, request)
491
+ );
492
+ return resultPromise;
493
+ };
494
+ }
495
+ return client;
496
+ };
497
+
498
+ // generated/runtime/linkTypeMap.ts
499
+ var linkTypeMap = (typeMap2) => {
500
+ const indexToName = Object.assign(
501
+ {},
502
+ ...Object.keys(typeMap2.types).map((k, i) => ({ [i]: k }))
503
+ );
504
+ let intermediaryTypeMap = Object.assign(
505
+ {},
506
+ ...Object.keys(typeMap2.types || {}).map(
507
+ (k) => {
508
+ const type = typeMap2.types[k];
509
+ const fields = type || {};
510
+ return {
511
+ [k]: {
512
+ name: k,
513
+ // type scalar properties
514
+ scalar: Object.keys(fields).filter((f) => {
515
+ const [type2] = fields[f] || [];
516
+ const isScalar = type2 && typeMap2.scalars.includes(type2);
517
+ if (!isScalar) {
518
+ return false;
519
+ }
520
+ const args = fields[f]?.[1];
521
+ const argTypes = Object.values(args || {}).map((x) => x?.[1]).filter(Boolean);
522
+ const hasRequiredArgs = argTypes.some(
523
+ (str) => str && str.endsWith("!")
524
+ );
525
+ if (hasRequiredArgs) {
526
+ return false;
527
+ }
528
+ return true;
529
+ }),
530
+ // fields with corresponding `type` and `args`
531
+ fields: Object.assign(
532
+ {},
533
+ ...Object.keys(fields).map(
534
+ (f) => {
535
+ const [typeIndex, args] = fields[f] || [];
536
+ if (typeIndex == null) {
537
+ return {};
538
+ }
539
+ return {
540
+ [f]: {
541
+ // replace index with type name
542
+ type: indexToName[typeIndex],
543
+ args: Object.assign(
544
+ {},
545
+ ...Object.keys(args || {}).map(
546
+ (k2) => {
547
+ if (!args || !args[k2]) {
548
+ return;
549
+ }
550
+ const [
551
+ argTypeName,
552
+ argTypeString
553
+ ] = args[k2];
554
+ return {
555
+ [k2]: [
556
+ indexToName[argTypeName],
557
+ argTypeString || indexToName[argTypeName]
558
+ ]
559
+ };
560
+ }
561
+ )
562
+ )
563
+ }
564
+ };
565
+ }
566
+ )
567
+ )
568
+ }
569
+ };
570
+ }
571
+ )
572
+ );
573
+ const res = resolveConcreteTypes(intermediaryTypeMap);
574
+ return res;
575
+ };
576
+ var resolveConcreteTypes = (linkedTypeMap) => {
577
+ Object.keys(linkedTypeMap).forEach((typeNameFromKey) => {
578
+ const type = linkedTypeMap[typeNameFromKey];
579
+ if (!type.fields) {
580
+ return;
581
+ }
582
+ const fields = type.fields;
583
+ Object.keys(fields).forEach((f) => {
584
+ const field = fields[f];
585
+ if (field.args) {
586
+ const args = field.args;
587
+ Object.keys(args).forEach((key) => {
588
+ const arg = args[key];
589
+ if (arg) {
590
+ const [typeName2] = arg;
591
+ if (typeof typeName2 === "string") {
592
+ if (!linkedTypeMap[typeName2]) {
593
+ linkedTypeMap[typeName2] = { name: typeName2 };
594
+ }
595
+ arg[0] = linkedTypeMap[typeName2];
596
+ }
597
+ }
598
+ });
599
+ }
600
+ const typeName = field.type;
601
+ if (typeof typeName === "string") {
602
+ if (!linkedTypeMap[typeName]) {
603
+ linkedTypeMap[typeName] = { name: typeName };
604
+ }
605
+ field.type = linkedTypeMap[typeName];
606
+ }
607
+ });
608
+ });
609
+ return linkedTypeMap;
610
+ };
611
+
612
+ // generated/types.ts
613
+ var types_default = {
614
+ "scalars": [
615
+ 0,
616
+ 3,
617
+ 7,
618
+ 8,
619
+ 14,
620
+ 17,
621
+ 19,
622
+ 20,
623
+ 21,
624
+ 22,
625
+ 24,
626
+ 28,
627
+ 29,
628
+ 38,
629
+ 39,
630
+ 42,
631
+ 45
632
+ ],
633
+ "types": {
634
+ "ApplicationStatus": {},
635
+ "ApplyToClanInput": {
636
+ "clan_id": [
637
+ 42
638
+ ],
639
+ "motivation_text": [
640
+ 42
641
+ ],
642
+ "__typename": [
643
+ 42
644
+ ]
645
+ },
646
+ "AssignUnitInput": {
647
+ "pool_id": [
648
+ 42
649
+ ],
650
+ "unit_ids": [
651
+ 42
652
+ ],
653
+ "__typename": [
654
+ 42
655
+ ]
656
+ },
657
+ "Boolean": {},
658
+ "Clan": {
659
+ "created_at": [
660
+ 14
661
+ ],
662
+ "created_at_tick": [
663
+ 21
664
+ ],
665
+ "description": [
666
+ 42
667
+ ],
668
+ "governance_type": [
669
+ 19
670
+ ],
671
+ "id": [
672
+ 20
673
+ ],
674
+ "leader_claw_id": [
675
+ 42
676
+ ],
677
+ "membership_policy": [
678
+ 22
679
+ ],
680
+ "name": [
681
+ 42
682
+ ],
683
+ "status": [
684
+ 8
685
+ ],
686
+ "tax_rate": [
687
+ 17
688
+ ],
689
+ "treasury_food": [
690
+ 17
691
+ ],
692
+ "treasury_minerals": [
693
+ 17
694
+ ],
695
+ "__typename": [
696
+ 42
697
+ ]
698
+ },
699
+ "ClanApplication": {
700
+ "clan_id": [
701
+ 42
702
+ ],
703
+ "claw_id": [
704
+ 42
705
+ ],
706
+ "created_at": [
707
+ 14
708
+ ],
709
+ "id": [
710
+ 20
711
+ ],
712
+ "motivation_text": [
713
+ 42
714
+ ],
715
+ "status": [
716
+ 0
717
+ ],
718
+ "__typename": [
719
+ 42
720
+ ]
721
+ },
722
+ "ClanPact": {
723
+ "created_at": [
724
+ 14
725
+ ],
726
+ "duration_ticks": [
727
+ 21
728
+ ],
729
+ "id": [
730
+ 20
731
+ ],
732
+ "proposer_clan_id": [
733
+ 42
734
+ ],
735
+ "status": [
736
+ 24
737
+ ],
738
+ "target_clan_id": [
739
+ 42
740
+ ],
741
+ "ticks_remaining": [
742
+ 21
743
+ ],
744
+ "type": [
745
+ 7
746
+ ],
747
+ "__typename": [
748
+ 42
749
+ ]
750
+ },
751
+ "ClanPactType": {},
752
+ "ClanStatus": {},
753
+ "Claw": {
754
+ "aggression": [
755
+ 17
756
+ ],
757
+ "bio": [
758
+ 42
759
+ ],
760
+ "created_at": [
761
+ 14
762
+ ],
763
+ "deception": [
764
+ 17
765
+ ],
766
+ "food": [
767
+ 17
768
+ ],
769
+ "id": [
770
+ 20
771
+ ],
772
+ "is_alive": [
773
+ 3
774
+ ],
775
+ "is_molting": [
776
+ 3
777
+ ],
778
+ "level": [
779
+ 21
780
+ ],
781
+ "loyalty": [
782
+ 17
783
+ ],
784
+ "minerals": [
785
+ 17
786
+ ],
787
+ "molt_ticks_remaining": [
788
+ 21
789
+ ],
790
+ "name": [
791
+ 42
792
+ ],
793
+ "profile_emoji": [
794
+ 42
795
+ ],
796
+ "scent": [
797
+ 21
798
+ ],
799
+ "shell_tier": [
800
+ 21
801
+ ],
802
+ "soft_shell_curse_ticks_remaining": [
803
+ 21
804
+ ],
805
+ "species": [
806
+ 39
807
+ ],
808
+ "territoriality": [
809
+ 17
810
+ ],
811
+ "webhook_url": [
812
+ 42
813
+ ],
814
+ "xp": [
815
+ 21
816
+ ],
817
+ "__typename": [
818
+ 42
819
+ ]
820
+ },
821
+ "ClawSummary": {
822
+ "id": [
823
+ 20
824
+ ],
825
+ "is_alive": [
826
+ 3
827
+ ],
828
+ "name": [
829
+ 42
830
+ ],
831
+ "species": [
832
+ 42
833
+ ],
834
+ "__typename": [
835
+ 42
836
+ ]
837
+ },
838
+ "CreateClanInput": {
839
+ "description": [
840
+ 42
841
+ ],
842
+ "governance_type": [
843
+ 19
844
+ ],
845
+ "membership_policy": [
846
+ 22
847
+ ],
848
+ "name": [
849
+ 42
850
+ ],
851
+ "tax_rate": [
852
+ 17
853
+ ],
854
+ "__typename": [
855
+ 42
856
+ ]
857
+ },
858
+ "CreateClawInput": {
859
+ "aggression": [
860
+ 17
861
+ ],
862
+ "bio": [
863
+ 42
864
+ ],
865
+ "deception": [
866
+ 17
867
+ ],
868
+ "loyalty": [
869
+ 17
870
+ ],
871
+ "name": [
872
+ 42
873
+ ],
874
+ "profile_emoji": [
875
+ 42
876
+ ],
877
+ "species": [
878
+ 39
879
+ ],
880
+ "territoriality": [
881
+ 17
882
+ ],
883
+ "__typename": [
884
+ 42
885
+ ]
886
+ },
887
+ "CreateClawPayload": {
888
+ "api_key": [
889
+ 42
890
+ ],
891
+ "claw": [
892
+ 9
893
+ ],
894
+ "__typename": [
895
+ 42
896
+ ]
897
+ },
898
+ "DateTime": {},
899
+ "DeploySpyInput": {
900
+ "target_claw_id": [
901
+ 42
902
+ ],
903
+ "__typename": [
904
+ 42
905
+ ]
906
+ },
907
+ "DismissUnitInput": {
908
+ "count": [
909
+ 21
910
+ ],
911
+ "unit_id": [
912
+ 42
913
+ ],
914
+ "__typename": [
915
+ 42
916
+ ]
917
+ },
918
+ "Float": {},
919
+ "GameEvent": {
920
+ "claw_id": [
921
+ 42
922
+ ],
923
+ "data": [
924
+ 42
925
+ ],
926
+ "event_type": [
927
+ 42
928
+ ],
929
+ "id": [
930
+ 20
931
+ ],
932
+ "pool_id": [
933
+ 42
934
+ ],
935
+ "region_id": [
936
+ 21
937
+ ],
938
+ "target_claw_id": [
939
+ 42
940
+ ],
941
+ "tick": [
942
+ 21
943
+ ],
944
+ "__typename": [
945
+ 42
946
+ ]
947
+ },
948
+ "GovernanceType": {},
949
+ "ID": {},
950
+ "Int": {},
951
+ "MembershipPolicy": {},
952
+ "Mutation": {
953
+ "acceptClanPact": [
954
+ 6,
955
+ {
956
+ "pactId": [
957
+ 42,
958
+ "String!"
959
+ ]
960
+ }
961
+ ],
962
+ "applyToClan": [
963
+ 5,
964
+ {
965
+ "input": [
966
+ 1,
967
+ "ApplyToClanInput!"
968
+ ]
969
+ }
970
+ ],
971
+ "assign_units": [
972
+ 44,
973
+ {
974
+ "input": [
975
+ 2,
976
+ "AssignUnitInput!"
977
+ ]
978
+ }
979
+ ],
980
+ "breakClanPact": [
981
+ 6,
982
+ {
983
+ "pactId": [
984
+ 42,
985
+ "String!"
986
+ ]
987
+ }
988
+ ],
989
+ "cancelApplication": [
990
+ 5,
991
+ {
992
+ "applicationId": [
993
+ 42,
994
+ "String!"
995
+ ]
996
+ }
997
+ ],
998
+ "createClan": [
999
+ 4,
1000
+ {
1001
+ "input": [
1002
+ 11,
1003
+ "CreateClanInput!"
1004
+ ]
1005
+ }
1006
+ ],
1007
+ "createClaw": [
1008
+ 13,
1009
+ {
1010
+ "input": [
1011
+ 12,
1012
+ "CreateClawInput!"
1013
+ ]
1014
+ }
1015
+ ],
1016
+ "deploy_spy": [
1017
+ 40,
1018
+ {
1019
+ "input": [
1020
+ 15,
1021
+ "DeploySpyInput!"
1022
+ ]
1023
+ }
1024
+ ],
1025
+ "dismiss_units": [
1026
+ 44,
1027
+ {
1028
+ "input": [
1029
+ 16,
1030
+ "DismissUnitInput!"
1031
+ ]
1032
+ }
1033
+ ],
1034
+ "dissolveClan": [
1035
+ 4
1036
+ ],
1037
+ "initiate_siege": [
1038
+ 37,
1039
+ {
1040
+ "attacker_pool_id": [
1041
+ 42,
1042
+ "String!"
1043
+ ],
1044
+ "defender_pool_id": [
1045
+ 42,
1046
+ "String!"
1047
+ ]
1048
+ }
1049
+ ],
1050
+ "kickMember": [
1051
+ 9,
1052
+ {
1053
+ "clawId": [
1054
+ 42,
1055
+ "String!"
1056
+ ]
1057
+ }
1058
+ ],
1059
+ "leaveClan": [
1060
+ 9
1061
+ ],
1062
+ "proposeClanPact": [
1063
+ 6,
1064
+ {
1065
+ "input": [
1066
+ 30,
1067
+ "ProposeClanPactInput!"
1068
+ ]
1069
+ }
1070
+ ],
1071
+ "recruit_units": [
1072
+ 44,
1073
+ {
1074
+ "input": [
1075
+ 33,
1076
+ "RecruitUnitInput!"
1077
+ ]
1078
+ }
1079
+ ],
1080
+ "regenerateClawKey": [
1081
+ 34,
1082
+ {
1083
+ "clawId": [
1084
+ 42,
1085
+ "String!"
1086
+ ]
1087
+ }
1088
+ ],
1089
+ "reviewApplication": [
1090
+ 5,
1091
+ {
1092
+ "accept": [
1093
+ 3,
1094
+ "Boolean!"
1095
+ ],
1096
+ "applicationId": [
1097
+ 42,
1098
+ "String!"
1099
+ ]
1100
+ }
1101
+ ],
1102
+ "send_whisper": [
1103
+ 47,
1104
+ {
1105
+ "input": [
1106
+ 36,
1107
+ "SendWhisperInput!"
1108
+ ]
1109
+ }
1110
+ ],
1111
+ "signIn": [
1112
+ 25
1113
+ ],
1114
+ "updateDirectives": [
1115
+ 41,
1116
+ {
1117
+ "input": [
1118
+ 46,
1119
+ "UpdateDirectivesInput!"
1120
+ ]
1121
+ }
1122
+ ],
1123
+ "withdraw_siege": [
1124
+ 37,
1125
+ {
1126
+ "siege_id": [
1127
+ 42,
1128
+ "String!"
1129
+ ]
1130
+ }
1131
+ ],
1132
+ "__typename": [
1133
+ 42
1134
+ ]
1135
+ },
1136
+ "PactStatus": {},
1137
+ "Player": {
1138
+ "avatar_url": [
1139
+ 42
1140
+ ],
1141
+ "created_at": [
1142
+ 14
1143
+ ],
1144
+ "display_name": [
1145
+ 42
1146
+ ],
1147
+ "email": [
1148
+ 42
1149
+ ],
1150
+ "id": [
1151
+ 20
1152
+ ],
1153
+ "onboarding_finalized_at": [
1154
+ 14
1155
+ ],
1156
+ "__typename": [
1157
+ 42
1158
+ ]
1159
+ },
1160
+ "PlayerProfile": {
1161
+ "claws": [
1162
+ 10
1163
+ ],
1164
+ "player": [
1165
+ 25
1166
+ ],
1167
+ "__typename": [
1168
+ 42
1169
+ ]
1170
+ },
1171
+ "Pool": {
1172
+ "fortification": [
1173
+ 21
1174
+ ],
1175
+ "id": [
1176
+ 20
1177
+ ],
1178
+ "is_spawn_zone": [
1179
+ 3
1180
+ ],
1181
+ "owner_claw_id": [
1182
+ 42
1183
+ ],
1184
+ "q": [
1185
+ 21
1186
+ ],
1187
+ "r": [
1188
+ 21
1189
+ ],
1190
+ "region_id": [
1191
+ 21
1192
+ ],
1193
+ "type": [
1194
+ 28
1195
+ ],
1196
+ "__typename": [
1197
+ 42
1198
+ ]
1199
+ },
1200
+ "PoolType": {},
1201
+ "PrimaryGoal": {},
1202
+ "ProposeClanPactInput": {
1203
+ "duration_ticks": [
1204
+ 21
1205
+ ],
1206
+ "target_clan_id": [
1207
+ 42
1208
+ ],
1209
+ "type": [
1210
+ 7
1211
+ ],
1212
+ "__typename": [
1213
+ 42
1214
+ ]
1215
+ },
1216
+ "PublicClaw": {
1217
+ "bio": [
1218
+ 42
1219
+ ],
1220
+ "id": [
1221
+ 20
1222
+ ],
1223
+ "is_alive": [
1224
+ 3
1225
+ ],
1226
+ "level": [
1227
+ 21
1228
+ ],
1229
+ "name": [
1230
+ 42
1231
+ ],
1232
+ "profile_emoji": [
1233
+ 42
1234
+ ],
1235
+ "scent": [
1236
+ 21
1237
+ ],
1238
+ "shell_tier": [
1239
+ 21
1240
+ ],
1241
+ "species": [
1242
+ 39
1243
+ ],
1244
+ "xp": [
1245
+ 21
1246
+ ],
1247
+ "__typename": [
1248
+ 42
1249
+ ]
1250
+ },
1251
+ "Query": {
1252
+ "clan": [
1253
+ 4,
1254
+ {
1255
+ "id": [
1256
+ 42,
1257
+ "String!"
1258
+ ]
1259
+ }
1260
+ ],
1261
+ "clanApplications": [
1262
+ 5
1263
+ ],
1264
+ "clanPacts": [
1265
+ 6
1266
+ ],
1267
+ "clans": [
1268
+ 4
1269
+ ],
1270
+ "claw": [
1271
+ 31,
1272
+ {
1273
+ "id": [
1274
+ 42,
1275
+ "String!"
1276
+ ]
1277
+ }
1278
+ ],
1279
+ "claws": [
1280
+ 31,
1281
+ {
1282
+ "limit": [
1283
+ 21,
1284
+ "Int!"
1285
+ ],
1286
+ "offset": [
1287
+ 21,
1288
+ "Int!"
1289
+ ]
1290
+ }
1291
+ ],
1292
+ "events": [
1293
+ 18,
1294
+ {
1295
+ "clawId": [
1296
+ 42
1297
+ ],
1298
+ "eventType": [
1299
+ 42
1300
+ ],
1301
+ "limit": [
1302
+ 21,
1303
+ "Int!"
1304
+ ],
1305
+ "offset": [
1306
+ 21,
1307
+ "Int!"
1308
+ ],
1309
+ "regionId": [
1310
+ 21
1311
+ ],
1312
+ "tick": [
1313
+ 21
1314
+ ]
1315
+ }
1316
+ ],
1317
+ "inbox": [
1318
+ 47,
1319
+ {
1320
+ "limit": [
1321
+ 21,
1322
+ "Int!"
1323
+ ],
1324
+ "offset": [
1325
+ 21,
1326
+ "Int!"
1327
+ ]
1328
+ }
1329
+ ],
1330
+ "intercepted_whispers": [
1331
+ 47
1332
+ ],
1333
+ "me": [
1334
+ 26
1335
+ ],
1336
+ "myApplications": [
1337
+ 5
1338
+ ],
1339
+ "myClan": [
1340
+ 4
1341
+ ],
1342
+ "myDirectives": [
1343
+ 41
1344
+ ],
1345
+ "myProfile": [
1346
+ 9
1347
+ ],
1348
+ "myRelationships": [
1349
+ 35
1350
+ ],
1351
+ "my_sieges": [
1352
+ 37
1353
+ ],
1354
+ "my_spy_deployments": [
1355
+ 40
1356
+ ],
1357
+ "my_units": [
1358
+ 44
1359
+ ],
1360
+ "outbox": [
1361
+ 47,
1362
+ {
1363
+ "limit": [
1364
+ 21,
1365
+ "Int!"
1366
+ ],
1367
+ "offset": [
1368
+ 21,
1369
+ "Int!"
1370
+ ]
1371
+ }
1372
+ ],
1373
+ "pool": [
1374
+ 27,
1375
+ {
1376
+ "id": [
1377
+ 42,
1378
+ "String!"
1379
+ ]
1380
+ }
1381
+ ],
1382
+ "pool_units": [
1383
+ 44,
1384
+ {
1385
+ "pool_id": [
1386
+ 42,
1387
+ "String!"
1388
+ ]
1389
+ }
1390
+ ],
1391
+ "pools": [
1392
+ 27,
1393
+ {
1394
+ "clawId": [
1395
+ 42
1396
+ ]
1397
+ }
1398
+ ],
1399
+ "siege": [
1400
+ 37,
1401
+ {
1402
+ "id": [
1403
+ 42,
1404
+ "String!"
1405
+ ]
1406
+ }
1407
+ ],
1408
+ "__typename": [
1409
+ 42
1410
+ ]
1411
+ },
1412
+ "RecruitUnitInput": {
1413
+ "count": [
1414
+ 21
1415
+ ],
1416
+ "type": [
1417
+ 45
1418
+ ],
1419
+ "__typename": [
1420
+ 42
1421
+ ]
1422
+ },
1423
+ "RegenerateKeyPayload": {
1424
+ "api_key": [
1425
+ 42
1426
+ ],
1427
+ "__typename": [
1428
+ 42
1429
+ ]
1430
+ },
1431
+ "Relationship": {
1432
+ "battles": [
1433
+ 21
1434
+ ],
1435
+ "betrayals": [
1436
+ 21
1437
+ ],
1438
+ "claw_id": [
1439
+ 42
1440
+ ],
1441
+ "encounters": [
1442
+ 21
1443
+ ],
1444
+ "id": [
1445
+ 20
1446
+ ],
1447
+ "other_claw_id": [
1448
+ 42
1449
+ ],
1450
+ "trust_score": [
1451
+ 17
1452
+ ],
1453
+ "__typename": [
1454
+ 42
1455
+ ]
1456
+ },
1457
+ "SendWhisperInput": {
1458
+ "content": [
1459
+ 42
1460
+ ],
1461
+ "receiver_id": [
1462
+ 42
1463
+ ],
1464
+ "__typename": [
1465
+ 42
1466
+ ]
1467
+ },
1468
+ "Siege": {
1469
+ "attacker_claw_id": [
1470
+ 42
1471
+ ],
1472
+ "attacker_pool_id": [
1473
+ 42
1474
+ ],
1475
+ "created_at": [
1476
+ 14
1477
+ ],
1478
+ "defender_claw_id": [
1479
+ 42
1480
+ ],
1481
+ "defender_pool_id": [
1482
+ 42
1483
+ ],
1484
+ "ended_at_tick": [
1485
+ 21
1486
+ ],
1487
+ "id": [
1488
+ 20
1489
+ ],
1490
+ "started_at_tick": [
1491
+ 21
1492
+ ],
1493
+ "status": [
1494
+ 38
1495
+ ],
1496
+ "__typename": [
1497
+ 42
1498
+ ]
1499
+ },
1500
+ "SiegeStatus": {},
1501
+ "Species": {},
1502
+ "SpyDeployment": {
1503
+ "created_at": [
1504
+ 14
1505
+ ],
1506
+ "id": [
1507
+ 20
1508
+ ],
1509
+ "is_detected": [
1510
+ 3
1511
+ ],
1512
+ "owner_claw_id": [
1513
+ 42
1514
+ ],
1515
+ "started_at_tick": [
1516
+ 21
1517
+ ],
1518
+ "target_claw_id": [
1519
+ 42
1520
+ ],
1521
+ "ticks_remaining": [
1522
+ 21
1523
+ ],
1524
+ "__typename": [
1525
+ 42
1526
+ ]
1527
+ },
1528
+ "StandingOrder": {
1529
+ "aggression_stance": [
1530
+ 17
1531
+ ],
1532
+ "claw_id": [
1533
+ 42
1534
+ ],
1535
+ "diplomacy_stance": [
1536
+ 17
1537
+ ],
1538
+ "id": [
1539
+ 20
1540
+ ],
1541
+ "primary_goal": [
1542
+ 29
1543
+ ],
1544
+ "target_claw_id": [
1545
+ 42
1546
+ ],
1547
+ "target_region_id": [
1548
+ 21
1549
+ ],
1550
+ "__typename": [
1551
+ 42
1552
+ ]
1553
+ },
1554
+ "String": {},
1555
+ "Subscription": {
1556
+ "tickEvents": [
1557
+ 18
1558
+ ],
1559
+ "__typename": [
1560
+ 42
1561
+ ]
1562
+ },
1563
+ "Unit": {
1564
+ "claw_id": [
1565
+ 42
1566
+ ],
1567
+ "count": [
1568
+ 21
1569
+ ],
1570
+ "id": [
1571
+ 20
1572
+ ],
1573
+ "pool_id": [
1574
+ 42
1575
+ ],
1576
+ "type": [
1577
+ 45
1578
+ ],
1579
+ "__typename": [
1580
+ 42
1581
+ ]
1582
+ },
1583
+ "UnitType": {},
1584
+ "UpdateDirectivesInput": {
1585
+ "aggression_stance": [
1586
+ 17
1587
+ ],
1588
+ "diplomacy_stance": [
1589
+ 17
1590
+ ],
1591
+ "exclusions": [
1592
+ 42
1593
+ ],
1594
+ "primary_goal": [
1595
+ 29
1596
+ ],
1597
+ "target_claw_id": [
1598
+ 42
1599
+ ],
1600
+ "target_region_id": [
1601
+ 21
1602
+ ],
1603
+ "__typename": [
1604
+ 42
1605
+ ]
1606
+ },
1607
+ "Whisper": {
1608
+ "content": [
1609
+ 42
1610
+ ],
1611
+ "created_at": [
1612
+ 14
1613
+ ],
1614
+ "id": [
1615
+ 20
1616
+ ],
1617
+ "receiver_id": [
1618
+ 42
1619
+ ],
1620
+ "sender_id": [
1621
+ 42
1622
+ ],
1623
+ "tick": [
1624
+ 21
1625
+ ],
1626
+ "__typename": [
1627
+ 42
1628
+ ]
1629
+ }
1630
+ }
1631
+ };
1632
+
1633
+ // generated/schema.ts
1634
+ var Clan_possibleTypes = ["Clan"];
1635
+ var isClan = (obj) => {
1636
+ if (!obj?.__typename) throw new Error('__typename is missing in "isClan"');
1637
+ return Clan_possibleTypes.includes(obj.__typename);
1638
+ };
1639
+ var ClanApplication_possibleTypes = ["ClanApplication"];
1640
+ var isClanApplication = (obj) => {
1641
+ if (!obj?.__typename) throw new Error('__typename is missing in "isClanApplication"');
1642
+ return ClanApplication_possibleTypes.includes(obj.__typename);
1643
+ };
1644
+ var ClanPact_possibleTypes = ["ClanPact"];
1645
+ var isClanPact = (obj) => {
1646
+ if (!obj?.__typename) throw new Error('__typename is missing in "isClanPact"');
1647
+ return ClanPact_possibleTypes.includes(obj.__typename);
1648
+ };
1649
+ var Claw_possibleTypes = ["Claw"];
1650
+ var isClaw = (obj) => {
1651
+ if (!obj?.__typename) throw new Error('__typename is missing in "isClaw"');
1652
+ return Claw_possibleTypes.includes(obj.__typename);
1653
+ };
1654
+ var ClawSummary_possibleTypes = ["ClawSummary"];
1655
+ var isClawSummary = (obj) => {
1656
+ if (!obj?.__typename) throw new Error('__typename is missing in "isClawSummary"');
1657
+ return ClawSummary_possibleTypes.includes(obj.__typename);
1658
+ };
1659
+ var CreateClawPayload_possibleTypes = ["CreateClawPayload"];
1660
+ var isCreateClawPayload = (obj) => {
1661
+ if (!obj?.__typename) throw new Error('__typename is missing in "isCreateClawPayload"');
1662
+ return CreateClawPayload_possibleTypes.includes(obj.__typename);
1663
+ };
1664
+ var GameEvent_possibleTypes = ["GameEvent"];
1665
+ var isGameEvent = (obj) => {
1666
+ if (!obj?.__typename) throw new Error('__typename is missing in "isGameEvent"');
1667
+ return GameEvent_possibleTypes.includes(obj.__typename);
1668
+ };
1669
+ var Mutation_possibleTypes = ["Mutation"];
1670
+ var isMutation = (obj) => {
1671
+ if (!obj?.__typename) throw new Error('__typename is missing in "isMutation"');
1672
+ return Mutation_possibleTypes.includes(obj.__typename);
1673
+ };
1674
+ var Player_possibleTypes = ["Player"];
1675
+ var isPlayer = (obj) => {
1676
+ if (!obj?.__typename) throw new Error('__typename is missing in "isPlayer"');
1677
+ return Player_possibleTypes.includes(obj.__typename);
1678
+ };
1679
+ var PlayerProfile_possibleTypes = ["PlayerProfile"];
1680
+ var isPlayerProfile = (obj) => {
1681
+ if (!obj?.__typename) throw new Error('__typename is missing in "isPlayerProfile"');
1682
+ return PlayerProfile_possibleTypes.includes(obj.__typename);
1683
+ };
1684
+ var Pool_possibleTypes = ["Pool"];
1685
+ var isPool = (obj) => {
1686
+ if (!obj?.__typename) throw new Error('__typename is missing in "isPool"');
1687
+ return Pool_possibleTypes.includes(obj.__typename);
1688
+ };
1689
+ var PublicClaw_possibleTypes = ["PublicClaw"];
1690
+ var isPublicClaw = (obj) => {
1691
+ if (!obj?.__typename) throw new Error('__typename is missing in "isPublicClaw"');
1692
+ return PublicClaw_possibleTypes.includes(obj.__typename);
1693
+ };
1694
+ var Query_possibleTypes = ["Query"];
1695
+ var isQuery = (obj) => {
1696
+ if (!obj?.__typename) throw new Error('__typename is missing in "isQuery"');
1697
+ return Query_possibleTypes.includes(obj.__typename);
1698
+ };
1699
+ var RegenerateKeyPayload_possibleTypes = ["RegenerateKeyPayload"];
1700
+ var isRegenerateKeyPayload = (obj) => {
1701
+ if (!obj?.__typename) throw new Error('__typename is missing in "isRegenerateKeyPayload"');
1702
+ return RegenerateKeyPayload_possibleTypes.includes(obj.__typename);
1703
+ };
1704
+ var Relationship_possibleTypes = ["Relationship"];
1705
+ var isRelationship = (obj) => {
1706
+ if (!obj?.__typename) throw new Error('__typename is missing in "isRelationship"');
1707
+ return Relationship_possibleTypes.includes(obj.__typename);
1708
+ };
1709
+ var Siege_possibleTypes = ["Siege"];
1710
+ var isSiege = (obj) => {
1711
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSiege"');
1712
+ return Siege_possibleTypes.includes(obj.__typename);
1713
+ };
1714
+ var SpyDeployment_possibleTypes = ["SpyDeployment"];
1715
+ var isSpyDeployment = (obj) => {
1716
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSpyDeployment"');
1717
+ return SpyDeployment_possibleTypes.includes(obj.__typename);
1718
+ };
1719
+ var StandingOrder_possibleTypes = ["StandingOrder"];
1720
+ var isStandingOrder = (obj) => {
1721
+ if (!obj?.__typename) throw new Error('__typename is missing in "isStandingOrder"');
1722
+ return StandingOrder_possibleTypes.includes(obj.__typename);
1723
+ };
1724
+ var Subscription_possibleTypes = ["Subscription"];
1725
+ var isSubscription = (obj) => {
1726
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSubscription"');
1727
+ return Subscription_possibleTypes.includes(obj.__typename);
1728
+ };
1729
+ var Unit_possibleTypes = ["Unit"];
1730
+ var isUnit = (obj) => {
1731
+ if (!obj?.__typename) throw new Error('__typename is missing in "isUnit"');
1732
+ return Unit_possibleTypes.includes(obj.__typename);
1733
+ };
1734
+ var Whisper_possibleTypes = ["Whisper"];
1735
+ var isWhisper = (obj) => {
1736
+ if (!obj?.__typename) throw new Error('__typename is missing in "isWhisper"');
1737
+ return Whisper_possibleTypes.includes(obj.__typename);
1738
+ };
1739
+ var enumApplicationStatus = {
1740
+ ACCEPTED: "ACCEPTED",
1741
+ PENDING: "PENDING",
1742
+ REJECTED: "REJECTED"
1743
+ };
1744
+ var enumClanPactType = {
1745
+ MILITARY_ALLIANCE: "MILITARY_ALLIANCE",
1746
+ NON_AGGRESSION: "NON_AGGRESSION"
1747
+ };
1748
+ var enumClanStatus = {
1749
+ ACTIVE: "ACTIVE",
1750
+ DISSOLVED: "DISSOLVED"
1751
+ };
1752
+ var enumGovernanceType = {
1753
+ AUTOCRACY: "AUTOCRACY",
1754
+ COUNCIL: "COUNCIL",
1755
+ DEMOCRACY: "DEMOCRACY"
1756
+ };
1757
+ var enumMembershipPolicy = {
1758
+ APPLICATION: "APPLICATION",
1759
+ CLOSED: "CLOSED",
1760
+ FULLY_OPEN: "FULLY_OPEN",
1761
+ INVITATION_ONLY: "INVITATION_ONLY"
1762
+ };
1763
+ var enumPactStatus = {
1764
+ ACTIVE: "ACTIVE",
1765
+ BROKEN: "BROKEN",
1766
+ EXPIRED: "EXPIRED",
1767
+ PROPOSED: "PROPOSED"
1768
+ };
1769
+ var enumPoolType = {
1770
+ KELP_FOREST: "KELP_FOREST",
1771
+ REEF: "REEF",
1772
+ SHALLOWS: "SHALLOWS",
1773
+ SPAWNING_GROUND: "SPAWNING_GROUND",
1774
+ TRENCH: "TRENCH"
1775
+ };
1776
+ var enumPrimaryGoal = {
1777
+ ATTACK: "ATTACK",
1778
+ DEFEND: "DEFEND",
1779
+ EXPAND: "EXPAND",
1780
+ FORTIFY: "FORTIFY",
1781
+ IDLE: "IDLE",
1782
+ MOLT: "MOLT",
1783
+ SPY: "SPY"
1784
+ };
1785
+ var enumSiegeStatus = {
1786
+ ACTIVE: "ACTIVE",
1787
+ FAILED: "FAILED",
1788
+ WITHDRAWN: "WITHDRAWN",
1789
+ WON: "WON"
1790
+ };
1791
+ var enumSpecies = {
1792
+ COCONUT_CRAB: "COCONUT_CRAB",
1793
+ HERMIT_CRAB: "HERMIT_CRAB",
1794
+ KING_CRAB: "KING_CRAB",
1795
+ LOBSTER: "LOBSTER",
1796
+ MANTIS_SHRIMP: "MANTIS_SHRIMP",
1797
+ PISTOL_SHRIMP: "PISTOL_SHRIMP"
1798
+ };
1799
+ var enumUnitType = {
1800
+ BUILDER: "BUILDER",
1801
+ FIGHTER: "FIGHTER",
1802
+ HARVESTER: "HARVESTER",
1803
+ SPY: "SPY"
1804
+ };
1805
+
1806
+ // generated/index.ts
1807
+ var typeMap = linkTypeMap(types_default);
1808
+ var createClient2 = function(options) {
1809
+ return createClient({
1810
+ url: void 0,
1811
+ ...options,
1812
+ queryRoot: typeMap.Query,
1813
+ mutationRoot: typeMap.Mutation,
1814
+ subscriptionRoot: typeMap.Subscription
1815
+ });
1816
+ };
1817
+ var everything = {
1818
+ __scalar: true
1819
+ };
1820
+ var generateQueryOp = function(fields) {
1821
+ return generateGraphqlOperation("query", typeMap.Query, fields);
1822
+ };
1823
+ var generateMutationOp = function(fields) {
1824
+ return generateGraphqlOperation("mutation", typeMap.Mutation, fields);
1825
+ };
1826
+ var generateSubscriptionOp = function(fields) {
1827
+ return generateGraphqlOperation(
1828
+ "subscription",
1829
+ typeMap.Subscription,
1830
+ fields
1831
+ );
1832
+ };
1833
+ // Annotate the CommonJS export names for ESM import in node:
1834
+ 0 && (module.exports = {
1835
+ GenqlError,
1836
+ createClient,
1837
+ enumApplicationStatus,
1838
+ enumClanPactType,
1839
+ enumClanStatus,
1840
+ enumGovernanceType,
1841
+ enumMembershipPolicy,
1842
+ enumPactStatus,
1843
+ enumPoolType,
1844
+ enumPrimaryGoal,
1845
+ enumSiegeStatus,
1846
+ enumSpecies,
1847
+ enumUnitType,
1848
+ everything,
1849
+ generateMutationOp,
1850
+ generateQueryOp,
1851
+ generateSubscriptionOp,
1852
+ isClan,
1853
+ isClanApplication,
1854
+ isClanPact,
1855
+ isClaw,
1856
+ isClawSummary,
1857
+ isCreateClawPayload,
1858
+ isGameEvent,
1859
+ isMutation,
1860
+ isPlayer,
1861
+ isPlayerProfile,
1862
+ isPool,
1863
+ isPublicClaw,
1864
+ isQuery,
1865
+ isRegenerateKeyPayload,
1866
+ isRelationship,
1867
+ isSiege,
1868
+ isSpyDeployment,
1869
+ isStandingOrder,
1870
+ isSubscription,
1871
+ isUnit,
1872
+ isWhisper
1873
+ });