@timardex/cluemart-server-shared 1.0.178 → 1.0.179

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.
@@ -1675,6 +1675,7 @@ var service_exports = {};
1675
1675
  __export(service_exports, {
1676
1676
  connectToDatabase: () => connectToDatabase,
1677
1677
  convertObjectIdsToStrings: () => convertObjectIdsToStrings,
1678
+ didRemoveAnyEventDates: () => didRemoveAnyEventDates,
1678
1679
  findEventOrImportedMarketById: () => findEventOrImportedMarketById,
1679
1680
  saveNotificationsInDb: () => saveNotificationsInDb,
1680
1681
  sendPushNotifications: () => sendPushNotifications,
@@ -1917,9 +1918,7 @@ var GraphQLError = class _GraphQLError extends Error {
1917
1918
  *
1918
1919
  * Enumerable, and appears in the result of JSON.stringify().
1919
1920
  */
1920
- /**
1921
- * An array of GraphQL AST Nodes corresponding to this error.
1922
- */
1921
+ /** An array of GraphQL AST Nodes corresponding to this error. */
1923
1922
  /**
1924
1923
  * The source GraphQL document for the first location of this error.
1925
1924
  *
@@ -1930,13 +1929,89 @@ var GraphQLError = class _GraphQLError extends Error {
1930
1929
  * An array of character offsets within the source GraphQL document
1931
1930
  * which correspond to this error.
1932
1931
  */
1932
+ /** Original error that caused this GraphQLError, if one exists. */
1933
+ /** Extension fields to add to the formatted error. */
1933
1934
  /**
1934
- * The original error thrown from a field resolver during execution.
1935
- */
1936
- /**
1937
- * Extension fields to add to the formatted error.
1935
+ * Creates a GraphQLError instance.
1936
+ * @param message - Human-readable error message.
1937
+ * @param options - Error metadata such as source locations, response path, original error, and extensions.
1938
+ * This positional-arguments constructor overload is deprecated. Use the
1939
+ * `GraphQLError(message, options)` overload instead.
1940
+ * @example
1941
+ * ```ts
1942
+ * // Create an error from AST nodes and response metadata.
1943
+ * import { parse } from 'graphql/language';
1944
+ * import { GraphQLError } from 'graphql/error';
1945
+ *
1946
+ * const document = parse('{ greeting }');
1947
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
1948
+ * const error = new GraphQLError('Cannot query this field.', {
1949
+ * nodes: fieldNode,
1950
+ * path: ['greeting'],
1951
+ * extensions: { code: 'FORBIDDEN' },
1952
+ * });
1953
+ *
1954
+ * error.message; // => 'Cannot query this field.'
1955
+ * error.locations; // => [{ line: 1, column: 3 }]
1956
+ * error.path; // => ['greeting']
1957
+ * error.extensions; // => { code: 'FORBIDDEN' }
1958
+ * ```
1959
+ * @example
1960
+ * ```ts
1961
+ * // This variant derives locations from source positions and preserves the original error.
1962
+ * import { Source } from 'graphql/language';
1963
+ * import { GraphQLError } from 'graphql/error';
1964
+ *
1965
+ * const source = new Source('{ greeting }');
1966
+ * const originalError = new Error('Database unavailable.');
1967
+ * const error = new GraphQLError('Resolver failed.', {
1968
+ * source,
1969
+ * positions: [2],
1970
+ * path: ['greeting'],
1971
+ * originalError,
1972
+ * });
1973
+ *
1974
+ * error.locations; // => [{ line: 1, column: 3 }]
1975
+ * error.path; // => ['greeting']
1976
+ * error.originalError; // => originalError
1977
+ * ```
1938
1978
  */
1939
1979
  /**
1980
+ * Creates a GraphQLError instance using the legacy positional constructor.
1981
+ * This deprecated overload will be removed in v17. Prefer the
1982
+ * `GraphQLErrorOptions` object overload, which keeps optional error metadata
1983
+ * in a single options bag.
1984
+ * @param message - Human-readable error message.
1985
+ * @param nodes - AST node or nodes associated with this error.
1986
+ * @param source - Source document used to derive error locations.
1987
+ * @param positions - Character offsets in the source document associated with
1988
+ * this error.
1989
+ * @param path - Response path where this error occurred during execution.
1990
+ * @param originalError - Original error that caused this GraphQLError, if one
1991
+ * exists.
1992
+ * @param extensions - Extension fields to include in the formatted error.
1993
+ * @example
1994
+ * ```ts
1995
+ * import { Source } from 'graphql/language';
1996
+ * import { GraphQLError } from 'graphql/error';
1997
+ *
1998
+ * const source = new Source('{ greeting }');
1999
+ * const originalError = new Error('Database unavailable.');
2000
+ * const error = new GraphQLError(
2001
+ * 'Resolver failed.',
2002
+ * undefined,
2003
+ * source,
2004
+ * [2],
2005
+ * ['greeting'],
2006
+ * originalError,
2007
+ * { code: 'INTERNAL' },
2008
+ * );
2009
+ *
2010
+ * error.locations; // => [{ line: 1, column: 3 }]
2011
+ * error.path; // => ['greeting']
2012
+ * error.originalError; // => originalError
2013
+ * error.extensions; // => { code: 'INTERNAL' }
2014
+ * ```
1940
2015
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
1941
2016
  */
1942
2017
  constructor(message, ...rawArgs) {
@@ -1996,9 +2071,29 @@ var GraphQLError = class _GraphQLError extends Error {
1996
2071
  });
1997
2072
  }
1998
2073
  }
2074
+ /**
2075
+ * Returns the value used by `Object.prototype.toString`.
2076
+ * @returns The built-in string tag for this object.
2077
+ */
1999
2078
  get [Symbol.toStringTag]() {
2000
2079
  return "GraphQLError";
2001
2080
  }
2081
+ /**
2082
+ * Returns this error as a human-readable message with source locations.
2083
+ * @returns The formatted error string.
2084
+ * @example
2085
+ * ```ts
2086
+ * import { Source } from 'graphql/language';
2087
+ * import { GraphQLError } from 'graphql/error';
2088
+ *
2089
+ * const error = new GraphQLError('Cannot query field "name".', {
2090
+ * source: new Source('{ name }'),
2091
+ * positions: [2],
2092
+ * });
2093
+ *
2094
+ * error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^'
2095
+ * ```
2096
+ */
2002
2097
  toString() {
2003
2098
  let output = this.message;
2004
2099
  if (this.nodes) {
@@ -2014,6 +2109,21 @@ var GraphQLError = class _GraphQLError extends Error {
2014
2109
  }
2015
2110
  return output;
2016
2111
  }
2112
+ /**
2113
+ * Returns the JSON representation used when this object is serialized.
2114
+ * @returns The JSON-serializable representation.
2115
+ * @example
2116
+ * ```ts
2117
+ * import { GraphQLError } from 'graphql/error';
2118
+ *
2119
+ * const error = new GraphQLError('Resolver failed.', {
2120
+ * path: ['viewer', 'name'],
2121
+ * extensions: { code: 'INTERNAL' },
2122
+ * });
2123
+ *
2124
+ * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }
2125
+ * ```
2126
+ */
2017
2127
  toJSON() {
2018
2128
  const formattedError = {
2019
2129
  message: this.message
@@ -2044,20 +2154,29 @@ function syntaxError(source, position, description) {
2044
2154
 
2045
2155
  // node_modules/graphql/language/ast.mjs
2046
2156
  var Location = class {
2157
+ /** The character offset at which this Node begins. */
2158
+ /** The character offset at which this Node ends. */
2159
+ /** The Token at which this Node begins. */
2160
+ /** The Token at which this Node ends. */
2161
+ /** The Source document the AST represents. */
2047
2162
  /**
2048
- * The character offset at which this Node begins.
2049
- */
2050
- /**
2051
- * The character offset at which this Node ends.
2052
- */
2053
- /**
2054
- * The Token at which this Node begins.
2055
- */
2056
- /**
2057
- * The Token at which this Node ends.
2058
- */
2059
- /**
2060
- * The Source document the AST represents.
2163
+ * Creates a Location instance.
2164
+ * @param startToken - The start token.
2165
+ * @param endToken - The end token.
2166
+ * @param source - Source document used to derive error locations.
2167
+ * @example
2168
+ * ```ts
2169
+ * import { Location, Source, Token, TokenKind } from 'graphql/language';
2170
+ *
2171
+ * const source = new Source('{ hello }');
2172
+ * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);
2173
+ * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);
2174
+ * const location = new Location(startToken, endToken, source);
2175
+ *
2176
+ * location.start; // => 0
2177
+ * location.end; // => 9
2178
+ * location.source.body; // => '{ hello }'
2179
+ * ```
2061
2180
  */
2062
2181
  constructor(startToken, endToken, source) {
2063
2182
  this.start = startToken.start;
@@ -2066,9 +2185,26 @@ var Location = class {
2066
2185
  this.endToken = endToken;
2067
2186
  this.source = source;
2068
2187
  }
2188
+ /**
2189
+ * Returns the value used by `Object.prototype.toString`.
2190
+ * @returns The built-in string tag for this object.
2191
+ */
2069
2192
  get [Symbol.toStringTag]() {
2070
2193
  return "Location";
2071
2194
  }
2195
+ /**
2196
+ * Returns a JSON representation of this location.
2197
+ * @returns The JSON-serializable representation.
2198
+ * @example
2199
+ * ```ts
2200
+ * import { parse } from 'graphql/language';
2201
+ *
2202
+ * const document = parse('{ hello }');
2203
+ * const location = document.loc?.toJSON();
2204
+ *
2205
+ * location; // => { start: 0, end: 9 }
2206
+ * ```
2207
+ */
2072
2208
  toJSON() {
2073
2209
  return {
2074
2210
  start: this.start,
@@ -2077,21 +2213,11 @@ var Location = class {
2077
2213
  }
2078
2214
  };
2079
2215
  var Token = class {
2080
- /**
2081
- * The kind of Token.
2082
- */
2083
- /**
2084
- * The character offset at which this Node begins.
2085
- */
2086
- /**
2087
- * The character offset at which this Node ends.
2088
- */
2089
- /**
2090
- * The 1-indexed line number on which this Token appears.
2091
- */
2092
- /**
2093
- * The 1-indexed column number at which this Token begins.
2094
- */
2216
+ /** The kind of Token. */
2217
+ /** The character offset at which this Node begins. */
2218
+ /** The character offset at which this Node ends. */
2219
+ /** The 1-indexed line number on which this Token appears. */
2220
+ /** The 1-indexed column number at which this Token begins. */
2095
2221
  /**
2096
2222
  * For non-punctuation tokens, represents the interpreted value of the token.
2097
2223
  *
@@ -2103,6 +2229,26 @@ var Token = class {
2103
2229
  * including ignored tokens. <SOF> is always the first node and <EOF>
2104
2230
  * the last.
2105
2231
  */
2232
+ /** Next token in the token stream, including ignored tokens. */
2233
+ /**
2234
+ * Creates a Token instance.
2235
+ * @param kind - Token kind produced by lexical analysis.
2236
+ * @param start - Character offset where this token begins.
2237
+ * @param end - Character offset where this token ends.
2238
+ * @param line - One-indexed line number where this token begins.
2239
+ * @param column - One-indexed column number where this token begins.
2240
+ * @param value - Interpreted value for non-punctuation tokens.
2241
+ * @example
2242
+ * ```ts
2243
+ * import { Token, TokenKind } from 'graphql/language';
2244
+ *
2245
+ * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');
2246
+ *
2247
+ * token.kind; // => TokenKind.NAME
2248
+ * token.value; // => 'hello'
2249
+ * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }
2250
+ * ```
2251
+ */
2106
2252
  constructor(kind, start, end, line, column, value) {
2107
2253
  this.kind = kind;
2108
2254
  this.start = start;
@@ -2113,9 +2259,26 @@ var Token = class {
2113
2259
  this.prev = null;
2114
2260
  this.next = null;
2115
2261
  }
2262
+ /**
2263
+ * Returns the value used by `Object.prototype.toString`.
2264
+ * @returns The built-in string tag for this object.
2265
+ */
2116
2266
  get [Symbol.toStringTag]() {
2117
2267
  return "Token";
2118
2268
  }
2269
+ /**
2270
+ * Returns a JSON representation of this token.
2271
+ * @returns The JSON-serializable representation.
2272
+ * @example
2273
+ * ```ts
2274
+ * import { Lexer, Source } from 'graphql/language';
2275
+ *
2276
+ * const lexer = new Lexer(new Source('{ hello }'));
2277
+ * const token = lexer.advance().toJSON();
2278
+ *
2279
+ * token; // => { kind: '{', value: undefined, line: 1, column: 1 }
2280
+ * ```
2281
+ */
2119
2282
  toJSON() {
2120
2283
  return {
2121
2284
  kind: this.kind,
@@ -2199,8 +2362,15 @@ var QueryDocumentKeys = {
2199
2362
  EnumTypeDefinition: ["description", "name", "directives", "values"],
2200
2363
  EnumValueDefinition: ["description", "name", "directives"],
2201
2364
  InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
2202
- DirectiveDefinition: ["description", "name", "arguments", "locations"],
2365
+ DirectiveDefinition: [
2366
+ "description",
2367
+ "name",
2368
+ "arguments",
2369
+ "directives",
2370
+ "locations"
2371
+ ],
2203
2372
  SchemaExtension: ["directives", "operationTypes"],
2373
+ DirectiveExtension: ["name", "directives"],
2204
2374
  ScalarTypeExtension: ["name", "directives"],
2205
2375
  ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
2206
2376
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
@@ -2243,6 +2413,7 @@ var DirectiveLocation;
2243
2413
  DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE";
2244
2414
  DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT";
2245
2415
  DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
2416
+ DirectiveLocation2["DIRECTIVE_DEFINITION"] = "DIRECTIVE_DEFINITION";
2246
2417
  })(DirectiveLocation || (DirectiveLocation = {}));
2247
2418
 
2248
2419
  // node_modules/graphql/language/kinds.mjs
@@ -2285,6 +2456,7 @@ var Kind;
2285
2456
  Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
2286
2457
  Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
2287
2458
  Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
2459
+ Kind2["DIRECTIVE_EXTENSION"] = "DirectiveExtension";
2288
2460
  Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
2289
2461
  Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
2290
2462
  Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
@@ -2378,17 +2550,25 @@ var TokenKind;
2378
2550
 
2379
2551
  // node_modules/graphql/language/lexer.mjs
2380
2552
  var Lexer = class {
2553
+ /** Source document used to derive error locations. */
2554
+ /** Most recent non-ignored token returned by the lexer. */
2555
+ /** Current non-ignored token at the lexer cursor. */
2556
+ /** The (1-indexed) line containing the current token. */
2557
+ /** Character offset where the current line starts. */
2381
2558
  /**
2382
- * The previously focused non-ignored token.
2383
- */
2384
- /**
2385
- * The currently focused non-ignored token.
2386
- */
2387
- /**
2388
- * The (1-indexed) line containing the current token.
2389
- */
2390
- /**
2391
- * The character offset at which the current line begins.
2559
+ * Creates a Lexer instance.
2560
+ * @param source - Source document used to derive error locations.
2561
+ * @example
2562
+ * ```ts
2563
+ * import { Lexer, Source, TokenKind } from 'graphql/language';
2564
+ *
2565
+ * const lexer = new Lexer(new Source('{ hello }'));
2566
+ *
2567
+ * lexer.token.kind; // => TokenKind.SOF
2568
+ * lexer.advance().kind; // => TokenKind.BRACE_L
2569
+ * lexer.advance().value; // => 'hello'
2570
+ * lexer.advance().kind; // => TokenKind.BRACE_R
2571
+ * ```
2392
2572
  */
2393
2573
  constructor(source) {
2394
2574
  const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);
@@ -2398,11 +2578,26 @@ var Lexer = class {
2398
2578
  this.line = 1;
2399
2579
  this.lineStart = 0;
2400
2580
  }
2581
+ /**
2582
+ * Returns the value used by `Object.prototype.toString`.
2583
+ * @returns The built-in string tag for this object.
2584
+ */
2401
2585
  get [Symbol.toStringTag]() {
2402
2586
  return "Lexer";
2403
2587
  }
2404
2588
  /**
2405
2589
  * Advances the token stream to the next non-ignored token.
2590
+ * @returns The next non-ignored token.
2591
+ * @example
2592
+ * ```ts
2593
+ * import { Lexer, Source } from 'graphql/language';
2594
+ *
2595
+ * const lexer = new Lexer(new Source('{ hello }'));
2596
+ * const token = lexer.advance();
2597
+ *
2598
+ * token.kind; // => '{'
2599
+ * lexer.token; // => token
2600
+ * ```
2406
2601
  */
2407
2602
  advance() {
2408
2603
  this.lastToken = this.token;
@@ -2412,6 +2607,17 @@ var Lexer = class {
2412
2607
  /**
2413
2608
  * Looks ahead and returns the next non-ignored token, but does not change
2414
2609
  * the state of Lexer.
2610
+ * @returns The next non-ignored token without advancing the lexer.
2611
+ * @example
2612
+ * ```ts
2613
+ * import { Lexer, Source } from 'graphql/language';
2614
+ *
2615
+ * const lexer = new Lexer(new Source('{ hello }'));
2616
+ * const token = lexer.lookahead();
2617
+ *
2618
+ * token.kind; // => '{'
2619
+ * lexer.token.kind; // => '<SOF>'
2620
+ * ```
2415
2621
  */
2416
2622
  lookahead() {
2417
2623
  let token = this.token;
@@ -3032,6 +3238,29 @@ spurious results.`);
3032
3238
 
3033
3239
  // node_modules/graphql/language/source.mjs
3034
3240
  var Source = class {
3241
+ /** The GraphQL source text. */
3242
+ /** Name used in diagnostics for this source, such as a file path or request name. */
3243
+ /** One-indexed line and column where this source begins. */
3244
+ /**
3245
+ * Creates a Source instance.
3246
+ * @param body - The GraphQL source text.
3247
+ * @param name - Name used in diagnostics for this source.
3248
+ * @param locationOffset - One-indexed line and column where this source begins.
3249
+ * @example
3250
+ * ```ts
3251
+ * import { Source } from 'graphql/language';
3252
+ *
3253
+ * const source = new Source(
3254
+ * 'type Query { greeting: String }',
3255
+ * 'schema.graphql',
3256
+ * { line: 10, column: 1 },
3257
+ * );
3258
+ *
3259
+ * source.body; // => 'type Query { greeting: String }'
3260
+ * source.name; // => 'schema.graphql'
3261
+ * source.locationOffset; // => { line: 10, column: 1 }
3262
+ * ```
3263
+ */
3035
3264
  constructor(body, name = "GraphQL request", locationOffset = {
3036
3265
  line: 1,
3037
3266
  column: 1
@@ -3049,6 +3278,10 @@ var Source = class {
3049
3278
  "column in locationOffset is 1-indexed and must be positive."
3050
3279
  );
3051
3280
  }
3281
+ /**
3282
+ * Returns the value used by `Object.prototype.toString`.
3283
+ * @returns The built-in string tag for this object.
3284
+ */
3052
3285
  get [Symbol.toStringTag]() {
3053
3286
  return "Source";
3054
3287
  }
@@ -3084,6 +3317,8 @@ var Parser = class {
3084
3317
  }
3085
3318
  /**
3086
3319
  * Converts a name lex token into a name parse node.
3320
+ *
3321
+ * @internal
3087
3322
  */
3088
3323
  parseName() {
3089
3324
  const token = this.expectToken(TokenKind.NAME);
@@ -3095,6 +3330,8 @@ var Parser = class {
3095
3330
  // Implements the parsing rules in the Document section.
3096
3331
  /**
3097
3332
  * Document : Definition+
3333
+ *
3334
+ * @internal
3098
3335
  */
3099
3336
  parseDocument() {
3100
3337
  return this.node(this._lexer.token, {
@@ -3128,6 +3365,8 @@ var Parser = class {
3128
3365
  * - UnionTypeDefinition
3129
3366
  * - EnumTypeDefinition
3130
3367
  * - InputObjectTypeDefinition
3368
+ *
3369
+ * @internal
3131
3370
  */
3132
3371
  parseDefinition() {
3133
3372
  if (this.peek(TokenKind.BRACE_L)) {
@@ -3188,6 +3427,8 @@ var Parser = class {
3188
3427
  * OperationDefinition :
3189
3428
  * - SelectionSet
3190
3429
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
3430
+ *
3431
+ * @internal
3191
3432
  */
3192
3433
  parseOperationDefinition() {
3193
3434
  const start = this._lexer.token;
@@ -3220,6 +3461,8 @@ var Parser = class {
3220
3461
  }
3221
3462
  /**
3222
3463
  * OperationType : one of query mutation subscription
3464
+ *
3465
+ * @internal
3223
3466
  */
3224
3467
  parseOperationType() {
3225
3468
  const operationToken = this.expectToken(TokenKind.NAME);
@@ -3235,6 +3478,8 @@ var Parser = class {
3235
3478
  }
3236
3479
  /**
3237
3480
  * VariableDefinitions : ( VariableDefinition+ )
3481
+ *
3482
+ * @internal
3238
3483
  */
3239
3484
  parseVariableDefinitions() {
3240
3485
  return this.optionalMany(
@@ -3245,6 +3490,8 @@ var Parser = class {
3245
3490
  }
3246
3491
  /**
3247
3492
  * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
3493
+ *
3494
+ * @internal
3248
3495
  */
3249
3496
  parseVariableDefinition() {
3250
3497
  return this.node(this._lexer.token, {
@@ -3258,6 +3505,8 @@ var Parser = class {
3258
3505
  }
3259
3506
  /**
3260
3507
  * Variable : $ Name
3508
+ *
3509
+ * @internal
3261
3510
  */
3262
3511
  parseVariable() {
3263
3512
  const start = this._lexer.token;
@@ -3271,6 +3520,8 @@ var Parser = class {
3271
3520
  * ```
3272
3521
  * SelectionSet : { Selection+ }
3273
3522
  * ```
3523
+ *
3524
+ * @internal
3274
3525
  */
3275
3526
  parseSelectionSet() {
3276
3527
  return this.node(this._lexer.token, {
@@ -3287,6 +3538,8 @@ var Parser = class {
3287
3538
  * - Field
3288
3539
  * - FragmentSpread
3289
3540
  * - InlineFragment
3541
+ *
3542
+ * @internal
3290
3543
  */
3291
3544
  parseSelection() {
3292
3545
  return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
@@ -3295,6 +3548,8 @@ var Parser = class {
3295
3548
  * Field : Alias? Name Arguments? Directives? SelectionSet?
3296
3549
  *
3297
3550
  * Alias : Name :
3551
+ *
3552
+ * @internal
3298
3553
  */
3299
3554
  parseField() {
3300
3555
  const start = this._lexer.token;
@@ -3318,6 +3573,8 @@ var Parser = class {
3318
3573
  }
3319
3574
  /**
3320
3575
  * Arguments[Const] : ( Argument[?Const]+ )
3576
+ *
3577
+ * @internal
3321
3578
  */
3322
3579
  parseArguments(isConst) {
3323
3580
  const item = isConst ? this.parseConstArgument : this.parseArgument;
@@ -3325,6 +3582,8 @@ var Parser = class {
3325
3582
  }
3326
3583
  /**
3327
3584
  * Argument[Const] : Name : Value[?Const]
3585
+ *
3586
+ * @internal
3328
3587
  */
3329
3588
  parseArgument(isConst = false) {
3330
3589
  const start = this._lexer.token;
@@ -3346,6 +3605,8 @@ var Parser = class {
3346
3605
  * FragmentSpread : ... FragmentName Directives?
3347
3606
  *
3348
3607
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
3608
+ *
3609
+ * @internal
3349
3610
  */
3350
3611
  parseFragment() {
3351
3612
  const start = this._lexer.token;
@@ -3370,6 +3631,8 @@ var Parser = class {
3370
3631
  * - fragment FragmentName on TypeCondition Directives? SelectionSet
3371
3632
  *
3372
3633
  * TypeCondition : NamedType
3634
+ *
3635
+ * @internal
3373
3636
  */
3374
3637
  parseFragmentDefinition() {
3375
3638
  const start = this._lexer.token;
@@ -3397,6 +3660,8 @@ var Parser = class {
3397
3660
  }
3398
3661
  /**
3399
3662
  * FragmentName : Name but not `on`
3663
+ *
3664
+ * @internal
3400
3665
  */
3401
3666
  parseFragmentName() {
3402
3667
  if (this._lexer.token.value === "on") {
@@ -3422,6 +3687,8 @@ var Parser = class {
3422
3687
  * NullValue : `null`
3423
3688
  *
3424
3689
  * EnumValue : Name but not `true`, `false` or `null`
3690
+ *
3691
+ * @internal
3425
3692
  */
3426
3693
  parseValueLiteral(isConst) {
3427
3694
  const token = this._lexer.token;
@@ -3503,6 +3770,8 @@ var Parser = class {
3503
3770
  * ListValue[Const] :
3504
3771
  * - [ ]
3505
3772
  * - [ Value[?Const]+ ]
3773
+ *
3774
+ * @internal
3506
3775
  */
3507
3776
  parseList(isConst) {
3508
3777
  const item = () => this.parseValueLiteral(isConst);
@@ -3517,6 +3786,8 @@ var Parser = class {
3517
3786
  * - { }
3518
3787
  * - { ObjectField[?Const]+ }
3519
3788
  * ```
3789
+ *
3790
+ * @internal
3520
3791
  */
3521
3792
  parseObject(isConst) {
3522
3793
  const item = () => this.parseObjectField(isConst);
@@ -3527,6 +3798,8 @@ var Parser = class {
3527
3798
  }
3528
3799
  /**
3529
3800
  * ObjectField[Const] : Name : Value[?Const]
3801
+ *
3802
+ * @internal
3530
3803
  */
3531
3804
  parseObjectField(isConst) {
3532
3805
  const start = this._lexer.token;
@@ -3541,6 +3814,8 @@ var Parser = class {
3541
3814
  // Implements the parsing rules in the Directives section.
3542
3815
  /**
3543
3816
  * Directives[Const] : Directive[?Const]+
3817
+ *
3818
+ * @internal
3544
3819
  */
3545
3820
  parseDirectives(isConst) {
3546
3821
  const directives = [];
@@ -3556,6 +3831,8 @@ var Parser = class {
3556
3831
  * ```
3557
3832
  * Directive[Const] : @ Name Arguments[?Const]?
3558
3833
  * ```
3834
+ *
3835
+ * @internal
3559
3836
  */
3560
3837
  parseDirective(isConst) {
3561
3838
  const start = this._lexer.token;
@@ -3572,6 +3849,8 @@ var Parser = class {
3572
3849
  * - NamedType
3573
3850
  * - ListType
3574
3851
  * - NonNullType
3852
+ *
3853
+ * @internal
3575
3854
  */
3576
3855
  parseTypeReference() {
3577
3856
  const start = this._lexer.token;
@@ -3596,6 +3875,8 @@ var Parser = class {
3596
3875
  }
3597
3876
  /**
3598
3877
  * NamedType : Name
3878
+ *
3879
+ * @internal
3599
3880
  */
3600
3881
  parseNamedType() {
3601
3882
  return this.node(this._lexer.token, {
@@ -3609,6 +3890,8 @@ var Parser = class {
3609
3890
  }
3610
3891
  /**
3611
3892
  * Description : StringValue
3893
+ *
3894
+ * @internal
3612
3895
  */
3613
3896
  parseDescription() {
3614
3897
  if (this.peekDescription()) {
@@ -3619,6 +3902,8 @@ var Parser = class {
3619
3902
  * ```
3620
3903
  * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
3621
3904
  * ```
3905
+ *
3906
+ * @internal
3622
3907
  */
3623
3908
  parseSchemaDefinition() {
3624
3909
  const start = this._lexer.token;
@@ -3639,6 +3924,8 @@ var Parser = class {
3639
3924
  }
3640
3925
  /**
3641
3926
  * OperationTypeDefinition : OperationType : NamedType
3927
+ *
3928
+ * @internal
3642
3929
  */
3643
3930
  parseOperationTypeDefinition() {
3644
3931
  const start = this._lexer.token;
@@ -3653,6 +3940,8 @@ var Parser = class {
3653
3940
  }
3654
3941
  /**
3655
3942
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
3943
+ *
3944
+ * @internal
3656
3945
  */
3657
3946
  parseScalarTypeDefinition() {
3658
3947
  const start = this._lexer.token;
@@ -3671,6 +3960,8 @@ var Parser = class {
3671
3960
  * ObjectTypeDefinition :
3672
3961
  * Description?
3673
3962
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
3963
+ *
3964
+ * @internal
3674
3965
  */
3675
3966
  parseObjectTypeDefinition() {
3676
3967
  const start = this._lexer.token;
@@ -3693,6 +3984,8 @@ var Parser = class {
3693
3984
  * ImplementsInterfaces :
3694
3985
  * - implements `&`? NamedType
3695
3986
  * - ImplementsInterfaces & NamedType
3987
+ *
3988
+ * @internal
3696
3989
  */
3697
3990
  parseImplementsInterfaces() {
3698
3991
  return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : [];
@@ -3701,6 +3994,8 @@ var Parser = class {
3701
3994
  * ```
3702
3995
  * FieldsDefinition : { FieldDefinition+ }
3703
3996
  * ```
3997
+ *
3998
+ * @internal
3704
3999
  */
3705
4000
  parseFieldsDefinition() {
3706
4001
  return this.optionalMany(
@@ -3712,6 +4007,8 @@ var Parser = class {
3712
4007
  /**
3713
4008
  * FieldDefinition :
3714
4009
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
4010
+ *
4011
+ * @internal
3715
4012
  */
3716
4013
  parseFieldDefinition() {
3717
4014
  const start = this._lexer.token;
@@ -3732,6 +4029,8 @@ var Parser = class {
3732
4029
  }
3733
4030
  /**
3734
4031
  * ArgumentsDefinition : ( InputValueDefinition+ )
4032
+ *
4033
+ * @internal
3735
4034
  */
3736
4035
  parseArgumentDefs() {
3737
4036
  return this.optionalMany(
@@ -3743,6 +4042,8 @@ var Parser = class {
3743
4042
  /**
3744
4043
  * InputValueDefinition :
3745
4044
  * - Description? Name : Type DefaultValue? Directives[Const]?
4045
+ *
4046
+ * @internal
3746
4047
  */
3747
4048
  parseInputValueDef() {
3748
4049
  const start = this._lexer.token;
@@ -3767,6 +4068,8 @@ var Parser = class {
3767
4068
  /**
3768
4069
  * InterfaceTypeDefinition :
3769
4070
  * - Description? interface Name Directives[Const]? FieldsDefinition?
4071
+ *
4072
+ * @internal
3770
4073
  */
3771
4074
  parseInterfaceTypeDefinition() {
3772
4075
  const start = this._lexer.token;
@@ -3788,6 +4091,8 @@ var Parser = class {
3788
4091
  /**
3789
4092
  * UnionTypeDefinition :
3790
4093
  * - Description? union Name Directives[Const]? UnionMemberTypes?
4094
+ *
4095
+ * @internal
3791
4096
  */
3792
4097
  parseUnionTypeDefinition() {
3793
4098
  const start = this._lexer.token;
@@ -3808,6 +4113,8 @@ var Parser = class {
3808
4113
  * UnionMemberTypes :
3809
4114
  * - = `|`? NamedType
3810
4115
  * - UnionMemberTypes | NamedType
4116
+ *
4117
+ * @internal
3811
4118
  */
3812
4119
  parseUnionMemberTypes() {
3813
4120
  return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
@@ -3815,6 +4122,8 @@ var Parser = class {
3815
4122
  /**
3816
4123
  * EnumTypeDefinition :
3817
4124
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
4125
+ *
4126
+ * @internal
3818
4127
  */
3819
4128
  parseEnumTypeDefinition() {
3820
4129
  const start = this._lexer.token;
@@ -3835,6 +4144,8 @@ var Parser = class {
3835
4144
  * ```
3836
4145
  * EnumValuesDefinition : { EnumValueDefinition+ }
3837
4146
  * ```
4147
+ *
4148
+ * @internal
3838
4149
  */
3839
4150
  parseEnumValuesDefinition() {
3840
4151
  return this.optionalMany(
@@ -3845,6 +4156,8 @@ var Parser = class {
3845
4156
  }
3846
4157
  /**
3847
4158
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
4159
+ *
4160
+ * @internal
3848
4161
  */
3849
4162
  parseEnumValueDefinition() {
3850
4163
  const start = this._lexer.token;
@@ -3860,6 +4173,8 @@ var Parser = class {
3860
4173
  }
3861
4174
  /**
3862
4175
  * EnumValue : Name but not `true`, `false` or `null`
4176
+ *
4177
+ * @internal
3863
4178
  */
3864
4179
  parseEnumValueName() {
3865
4180
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") {
@@ -3876,6 +4191,8 @@ var Parser = class {
3876
4191
  /**
3877
4192
  * InputObjectTypeDefinition :
3878
4193
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
4194
+ *
4195
+ * @internal
3879
4196
  */
3880
4197
  parseInputObjectTypeDefinition() {
3881
4198
  const start = this._lexer.token;
@@ -3896,6 +4213,8 @@ var Parser = class {
3896
4213
  * ```
3897
4214
  * InputFieldsDefinition : { InputValueDefinition+ }
3898
4215
  * ```
4216
+ *
4217
+ * @internal
3899
4218
  */
3900
4219
  parseInputFieldsDefinition() {
3901
4220
  return this.optionalMany(
@@ -3916,6 +4235,9 @@ var Parser = class {
3916
4235
  * - UnionTypeExtension
3917
4236
  * - EnumTypeExtension
3918
4237
  * - InputObjectTypeDefinition
4238
+ * - DirectiveDefinitionExtension
4239
+ *
4240
+ * @internal
3919
4241
  */
3920
4242
  parseTypeSystemExtension() {
3921
4243
  const keywordToken = this._lexer.lookahead();
@@ -3935,6 +4257,11 @@ var Parser = class {
3935
4257
  return this.parseEnumTypeExtension();
3936
4258
  case "input":
3937
4259
  return this.parseInputObjectTypeExtension();
4260
+ case "directive":
4261
+ if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
4262
+ return this.parseDirectiveDefinitionExtension();
4263
+ }
4264
+ break;
3938
4265
  }
3939
4266
  }
3940
4267
  throw this.unexpected(keywordToken);
@@ -3945,6 +4272,8 @@ var Parser = class {
3945
4272
  * - extend schema Directives[Const]? { OperationTypeDefinition+ }
3946
4273
  * - extend schema Directives[Const]
3947
4274
  * ```
4275
+ *
4276
+ * @internal
3948
4277
  */
3949
4278
  parseSchemaExtension() {
3950
4279
  const start = this._lexer.token;
@@ -3968,6 +4297,8 @@ var Parser = class {
3968
4297
  /**
3969
4298
  * ScalarTypeExtension :
3970
4299
  * - extend scalar Name Directives[Const]
4300
+ *
4301
+ * @internal
3971
4302
  */
3972
4303
  parseScalarTypeExtension() {
3973
4304
  const start = this._lexer.token;
@@ -3989,6 +4320,8 @@ var Parser = class {
3989
4320
  * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
3990
4321
  * - extend type Name ImplementsInterfaces? Directives[Const]
3991
4322
  * - extend type Name ImplementsInterfaces
4323
+ *
4324
+ * @internal
3992
4325
  */
3993
4326
  parseObjectTypeExtension() {
3994
4327
  const start = this._lexer.token;
@@ -4014,6 +4347,8 @@ var Parser = class {
4014
4347
  * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
4015
4348
  * - extend interface Name ImplementsInterfaces? Directives[Const]
4016
4349
  * - extend interface Name ImplementsInterfaces
4350
+ *
4351
+ * @internal
4017
4352
  */
4018
4353
  parseInterfaceTypeExtension() {
4019
4354
  const start = this._lexer.token;
@@ -4038,6 +4373,8 @@ var Parser = class {
4038
4373
  * UnionTypeExtension :
4039
4374
  * - extend union Name Directives[Const]? UnionMemberTypes
4040
4375
  * - extend union Name Directives[Const]
4376
+ *
4377
+ * @internal
4041
4378
  */
4042
4379
  parseUnionTypeExtension() {
4043
4380
  const start = this._lexer.token;
@@ -4060,6 +4397,8 @@ var Parser = class {
4060
4397
  * EnumTypeExtension :
4061
4398
  * - extend enum Name Directives[Const]? EnumValuesDefinition
4062
4399
  * - extend enum Name Directives[Const]
4400
+ *
4401
+ * @internal
4063
4402
  */
4064
4403
  parseEnumTypeExtension() {
4065
4404
  const start = this._lexer.token;
@@ -4082,6 +4421,8 @@ var Parser = class {
4082
4421
  * InputObjectTypeExtension :
4083
4422
  * - extend input Name Directives[Const]? InputFieldsDefinition
4084
4423
  * - extend input Name Directives[Const]
4424
+ *
4425
+ * @internal
4085
4426
  */
4086
4427
  parseInputObjectTypeExtension() {
4087
4428
  const start = this._lexer.token;
@@ -4100,11 +4441,29 @@ var Parser = class {
4100
4441
  fields
4101
4442
  });
4102
4443
  }
4444
+ parseDirectiveDefinitionExtension() {
4445
+ const start = this._lexer.token;
4446
+ this.expectKeyword("extend");
4447
+ this.expectKeyword("directive");
4448
+ this.expectToken(TokenKind.AT);
4449
+ const name = this.parseName();
4450
+ const directives = this.parseConstDirectives();
4451
+ if (directives.length === 0) {
4452
+ throw this.unexpected();
4453
+ }
4454
+ return this.node(start, {
4455
+ kind: Kind.DIRECTIVE_EXTENSION,
4456
+ name,
4457
+ directives
4458
+ });
4459
+ }
4103
4460
  /**
4104
4461
  * ```
4105
4462
  * DirectiveDefinition :
4106
4463
  * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
4107
4464
  * ```
4465
+ *
4466
+ * @internal
4108
4467
  */
4109
4468
  parseDirectiveDefinition() {
4110
4469
  const start = this._lexer.token;
@@ -4113,6 +4472,7 @@ var Parser = class {
4113
4472
  this.expectToken(TokenKind.AT);
4114
4473
  const name = this.parseName();
4115
4474
  const args = this.parseArgumentDefs();
4475
+ const directives = this._options.experimentalDirectivesOnDirectiveDefinitions ? this.parseConstDirectives() : [];
4116
4476
  const repeatable = this.expectOptionalKeyword("repeatable");
4117
4477
  this.expectKeyword("on");
4118
4478
  const locations = this.parseDirectiveLocations();
@@ -4121,6 +4481,7 @@ var Parser = class {
4121
4481
  description,
4122
4482
  name,
4123
4483
  arguments: args,
4484
+ directives,
4124
4485
  repeatable,
4125
4486
  locations
4126
4487
  });
@@ -4129,6 +4490,8 @@ var Parser = class {
4129
4490
  * DirectiveLocations :
4130
4491
  * - `|`? DirectiveLocation
4131
4492
  * - DirectiveLocations | DirectiveLocation
4493
+ *
4494
+ * @internal
4132
4495
  */
4133
4496
  parseDirectiveLocations() {
4134
4497
  return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
@@ -4159,6 +4522,7 @@ var Parser = class {
4159
4522
  * `ENUM_VALUE`
4160
4523
  * `INPUT_OBJECT`
4161
4524
  * `INPUT_FIELD_DEFINITION`
4525
+ * `DIRECTIVE_DEFINITION`
4162
4526
  */
4163
4527
  parseDirectiveLocation() {
4164
4528
  const start = this._lexer.token;
@@ -4176,6 +4540,19 @@ var Parser = class {
4176
4540
  * - Name . Name ( Name : )
4177
4541
  * - \@ Name
4178
4542
  * - \@ Name ( Name : )
4543
+ * @returns Parsed schema coordinate AST.
4544
+ * @example
4545
+ * ```ts
4546
+ * import { Parser, Source } from 'graphql/language';
4547
+ *
4548
+ * const typeCoordinate = new Parser(new Source('User.name')).parseSchemaCoordinate();
4549
+ * const directiveCoordinate = new Parser(new Source('@include(if:)')).parseSchemaCoordinate();
4550
+ *
4551
+ * typeCoordinate.name.value; // => 'User'
4552
+ * typeCoordinate.memberName?.value; // => 'name'
4553
+ * directiveCoordinate.name.value; // => 'deprecated'
4554
+ * directiveCoordinate.argumentName?.value; // => 'reason'
4555
+ * ```
4179
4556
  */
4180
4557
  parseSchemaCoordinate() {
4181
4558
  const start = this._lexer.token;
@@ -4228,6 +4605,8 @@ var Parser = class {
4228
4605
  * Returns a node that, if configured to do so, sets a "loc" field as a
4229
4606
  * location object, used to identify the place in the source that created a
4230
4607
  * given parsed object.
4608
+ *
4609
+ * @internal
4231
4610
  */
4232
4611
  node(startToken, node) {
4233
4612
  if (this._options.noLocation !== true) {
@@ -4241,6 +4620,8 @@ var Parser = class {
4241
4620
  }
4242
4621
  /**
4243
4622
  * Determines if the next token is of a given kind
4623
+ *
4624
+ * @internal
4244
4625
  */
4245
4626
  peek(kind) {
4246
4627
  return this._lexer.token.kind === kind;
@@ -4248,6 +4629,8 @@ var Parser = class {
4248
4629
  /**
4249
4630
  * If the next token is of the given kind, return that token after advancing the lexer.
4250
4631
  * Otherwise, do not change the parser state and throw an error.
4632
+ *
4633
+ * @internal
4251
4634
  */
4252
4635
  expectToken(kind) {
4253
4636
  const token = this._lexer.token;
@@ -4264,6 +4647,8 @@ var Parser = class {
4264
4647
  /**
4265
4648
  * If the next token is of the given kind, return "true" after advancing the lexer.
4266
4649
  * Otherwise, do not change the parser state and return "false".
4650
+ *
4651
+ * @internal
4267
4652
  */
4268
4653
  expectOptionalToken(kind) {
4269
4654
  const token = this._lexer.token;
@@ -4276,6 +4661,8 @@ var Parser = class {
4276
4661
  /**
4277
4662
  * If the next token is a given keyword, advance the lexer.
4278
4663
  * Otherwise, do not change the parser state and throw an error.
4664
+ *
4665
+ * @internal
4279
4666
  */
4280
4667
  expectKeyword(value) {
4281
4668
  const token = this._lexer.token;
@@ -4292,6 +4679,8 @@ var Parser = class {
4292
4679
  /**
4293
4680
  * If the next token is a given keyword, return "true" after advancing the lexer.
4294
4681
  * Otherwise, do not change the parser state and return "false".
4682
+ *
4683
+ * @internal
4295
4684
  */
4296
4685
  expectOptionalKeyword(value) {
4297
4686
  const token = this._lexer.token;
@@ -4303,6 +4692,8 @@ var Parser = class {
4303
4692
  }
4304
4693
  /**
4305
4694
  * Helper function for creating an error when an unexpected lexed token is encountered.
4695
+ *
4696
+ * @internal
4306
4697
  */
4307
4698
  unexpected(atToken) {
4308
4699
  const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
@@ -4316,6 +4707,8 @@ var Parser = class {
4316
4707
  * Returns a possibly empty list of parse nodes, determined by the parseFn.
4317
4708
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
4318
4709
  * Advances the parser to the next lex token after the closing token.
4710
+ *
4711
+ * @internal
4319
4712
  */
4320
4713
  any(openKind, parseFn, closeKind) {
4321
4714
  this.expectToken(openKind);
@@ -4330,6 +4723,8 @@ var Parser = class {
4330
4723
  * It can be empty only if open token is missing otherwise it will always return non-empty list
4331
4724
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
4332
4725
  * Advances the parser to the next lex token after the closing token.
4726
+ *
4727
+ * @internal
4333
4728
  */
4334
4729
  optionalMany(openKind, parseFn, closeKind) {
4335
4730
  if (this.expectOptionalToken(openKind)) {
@@ -4345,6 +4740,8 @@ var Parser = class {
4345
4740
  * Returns a non-empty list of parse nodes, determined by the parseFn.
4346
4741
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
4347
4742
  * Advances the parser to the next lex token after the closing token.
4743
+ *
4744
+ * @internal
4348
4745
  */
4349
4746
  many(openKind, parseFn, closeKind) {
4350
4747
  this.expectToken(openKind);
@@ -4358,6 +4755,8 @@ var Parser = class {
4358
4755
  * Returns a non-empty list of parse nodes, determined by the parseFn.
4359
4756
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
4360
4757
  * Advances the parser to the next lex token after last item in the list.
4758
+ *
4759
+ * @internal
4361
4760
  */
4362
4761
  delimitedMany(delimiterKind, parseFn) {
4363
4762
  this.expectOptionalToken(delimiterKind);
@@ -4451,7 +4850,8 @@ function parseDocument(source) {
4451
4850
  if (!docCache.has(cacheKey)) {
4452
4851
  var parsed = parse(source, {
4453
4852
  experimentalFragmentVariables,
4454
- allowLegacyFragmentVariables: experimentalFragmentVariables
4853
+ allowLegacyFragmentVariables: experimentalFragmentVariables,
4854
+ experimentalFragmentArguments: experimentalFragmentVariables
4455
4855
  });
4456
4856
  if (!parsed || parsed.kind !== "Document") {
4457
4857
  throw new Error("Not a valid GraphQL document.");
@@ -10331,8 +10731,12 @@ var START_GAME_MUTATION = gql`
10331
10731
  ${GAME_DOC_FIELDS_FRAGMENT}
10332
10732
  `;
10333
10733
  var LEAVE_GAME_MUTATION = gql`
10334
- mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
10335
- leaveGame(_id: $_id, gameType: $gameType)
10734
+ mutation leaveGame(
10735
+ $_id: ID!
10736
+ $gameType: GameTypeEnumType!
10737
+ $gameTypeId: ID!
10738
+ ) {
10739
+ leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId)
10336
10740
  }
10337
10741
  `;
10338
10742
  var UPDATE_DAILY_CLUE_MUTATION = gql`
@@ -10493,6 +10897,20 @@ var noLeadingZeros = (fieldName, options = {}) => {
10493
10897
  return true;
10494
10898
  };
10495
10899
  };
10900
+ var toOptionalNumber = (originalValue) => {
10901
+ if (originalValue === "" || originalValue === null || originalValue === void 0) {
10902
+ return void 0;
10903
+ }
10904
+ let parsed;
10905
+ if (typeof originalValue === "number") {
10906
+ parsed = originalValue;
10907
+ } else if (typeof originalValue === "string") {
10908
+ parsed = Number(originalValue.replace(",", "."));
10909
+ } else {
10910
+ parsed = void 0;
10911
+ }
10912
+ return Number.isNaN(parsed) ? void 0 : parsed;
10913
+ };
10496
10914
  import_dayjs2.default.extend(import_isSameOrAfter2.default);
10497
10915
  import_dayjs2.default.extend(import_customParseFormat2.default);
10498
10916
  var emailRequiredSchema = create$6().email("Invalid email address").required("Email is required").label("Email").transform(
@@ -10587,12 +11005,12 @@ var dateTimeSchema = create$3().shape({
10587
11005
  });
10588
11006
  var stallTypesSchema = create$3({
10589
11007
  label: create$6().trim().label("Stall Type").required("Stall type is required"),
10590
- price: create$5().label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
11008
+ price: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
10591
11009
  "no-leading-zeros",
10592
11010
  "",
10593
11011
  noLeadingZeros("Stall price", { allowDecimal: true })
10594
11012
  ),
10595
- stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
11013
+ stallCapacity: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
10596
11014
  });
10597
11015
  var dateTimeWithPriceSchema = dateTimeSchema.shape({
10598
11016
  stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
@@ -10716,8 +11134,8 @@ var eventInfoSchema = create$3().shape({
10716
11134
  applicationDeadlineHours: create$5().label("Application Deadline Hours").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
10717
11135
  dateTime: create$2().of(dateTimeWithPriceSchema).required("DateTime is required"),
10718
11136
  eventId: create$6().trim().required("Event ID is required"),
10719
- packInTime: create$5().label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
10720
- paymentDueHours: create$5().label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")).test(
11137
+ packInTime: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Pack In Time").typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
11138
+ paymentDueHours: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Payment Due Hours").typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")).test(
10721
11139
  "payment-before-deadline",
10722
11140
  "Payment due hours must be less than application deadline hours",
10723
11141
  function(value) {
@@ -11088,7 +11506,7 @@ var schoolSchema = create$3().shape({
11088
11506
  name: create$6().trim().required("Name is required"),
11089
11507
  region: create$6().trim().required("Region is required"),
11090
11508
  socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
11091
- studentCount: create$5().label("Student Count").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Student count must be a number").min(
11509
+ studentCount: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
11092
11510
  SCHOOL_MIN_STUDENT_COUNT,
11093
11511
  `Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
11094
11512
  ).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
@@ -11104,11 +11522,7 @@ var posterIds = [
11104
11522
  "poster1",
11105
11523
  "poster2",
11106
11524
  "poster3",
11107
- // New
11108
- "poster4",
11109
- "poster5",
11110
- "poster6",
11111
- "poster7"
11525
+ "poster4"
11112
11526
  ];
11113
11527
  var posterFiles = Object.fromEntries(
11114
11528
  posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
@@ -13095,6 +13509,16 @@ async function findEventOrImportedMarketById(resourceId) {
13095
13509
  }
13096
13510
 
13097
13511
  // src/service/relations.ts
13512
+ function didRemoveAnyEventDates(previousDateTime, nextDateTime) {
13513
+ if (!previousDateTime?.length) {
13514
+ return false;
13515
+ }
13516
+ return previousDateTime.some(
13517
+ (prev) => !nextDateTime?.some(
13518
+ (next) => next.startDate === prev.startDate && next.startTime === prev.startTime
13519
+ )
13520
+ );
13521
+ }
13098
13522
  function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
13099
13523
  return relationDates.map((relationDate) => {
13100
13524
  const existsInEvent = eventDateTime?.some(
@@ -13110,6 +13534,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
13110
13534
  0 && (module.exports = {
13111
13535
  connectToDatabase,
13112
13536
  convertObjectIdsToStrings,
13537
+ didRemoveAnyEventDates,
13113
13538
  findEventOrImportedMarketById,
13114
13539
  saveNotificationsInDb,
13115
13540
  sendPushNotifications,