@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.
@@ -1922,9 +1922,7 @@ var GraphQLError = class _GraphQLError extends Error {
1922
1922
  *
1923
1923
  * Enumerable, and appears in the result of JSON.stringify().
1924
1924
  */
1925
- /**
1926
- * An array of GraphQL AST Nodes corresponding to this error.
1927
- */
1925
+ /** An array of GraphQL AST Nodes corresponding to this error. */
1928
1926
  /**
1929
1927
  * The source GraphQL document for the first location of this error.
1930
1928
  *
@@ -1935,13 +1933,89 @@ var GraphQLError = class _GraphQLError extends Error {
1935
1933
  * An array of character offsets within the source GraphQL document
1936
1934
  * which correspond to this error.
1937
1935
  */
1936
+ /** Original error that caused this GraphQLError, if one exists. */
1937
+ /** Extension fields to add to the formatted error. */
1938
1938
  /**
1939
- * The original error thrown from a field resolver during execution.
1940
- */
1941
- /**
1942
- * Extension fields to add to the formatted error.
1939
+ * Creates a GraphQLError instance.
1940
+ * @param message - Human-readable error message.
1941
+ * @param options - Error metadata such as source locations, response path, original error, and extensions.
1942
+ * This positional-arguments constructor overload is deprecated. Use the
1943
+ * `GraphQLError(message, options)` overload instead.
1944
+ * @example
1945
+ * ```ts
1946
+ * // Create an error from AST nodes and response metadata.
1947
+ * import { parse } from 'graphql/language';
1948
+ * import { GraphQLError } from 'graphql/error';
1949
+ *
1950
+ * const document = parse('{ greeting }');
1951
+ * const fieldNode = document.definitions[0].selectionSet.selections[0];
1952
+ * const error = new GraphQLError('Cannot query this field.', {
1953
+ * nodes: fieldNode,
1954
+ * path: ['greeting'],
1955
+ * extensions: { code: 'FORBIDDEN' },
1956
+ * });
1957
+ *
1958
+ * error.message; // => 'Cannot query this field.'
1959
+ * error.locations; // => [{ line: 1, column: 3 }]
1960
+ * error.path; // => ['greeting']
1961
+ * error.extensions; // => { code: 'FORBIDDEN' }
1962
+ * ```
1963
+ * @example
1964
+ * ```ts
1965
+ * // This variant derives locations from source positions and preserves the original error.
1966
+ * import { Source } from 'graphql/language';
1967
+ * import { GraphQLError } from 'graphql/error';
1968
+ *
1969
+ * const source = new Source('{ greeting }');
1970
+ * const originalError = new Error('Database unavailable.');
1971
+ * const error = new GraphQLError('Resolver failed.', {
1972
+ * source,
1973
+ * positions: [2],
1974
+ * path: ['greeting'],
1975
+ * originalError,
1976
+ * });
1977
+ *
1978
+ * error.locations; // => [{ line: 1, column: 3 }]
1979
+ * error.path; // => ['greeting']
1980
+ * error.originalError; // => originalError
1981
+ * ```
1943
1982
  */
1944
1983
  /**
1984
+ * Creates a GraphQLError instance using the legacy positional constructor.
1985
+ * This deprecated overload will be removed in v17. Prefer the
1986
+ * `GraphQLErrorOptions` object overload, which keeps optional error metadata
1987
+ * in a single options bag.
1988
+ * @param message - Human-readable error message.
1989
+ * @param nodes - AST node or nodes associated with this error.
1990
+ * @param source - Source document used to derive error locations.
1991
+ * @param positions - Character offsets in the source document associated with
1992
+ * this error.
1993
+ * @param path - Response path where this error occurred during execution.
1994
+ * @param originalError - Original error that caused this GraphQLError, if one
1995
+ * exists.
1996
+ * @param extensions - Extension fields to include in the formatted error.
1997
+ * @example
1998
+ * ```ts
1999
+ * import { Source } from 'graphql/language';
2000
+ * import { GraphQLError } from 'graphql/error';
2001
+ *
2002
+ * const source = new Source('{ greeting }');
2003
+ * const originalError = new Error('Database unavailable.');
2004
+ * const error = new GraphQLError(
2005
+ * 'Resolver failed.',
2006
+ * undefined,
2007
+ * source,
2008
+ * [2],
2009
+ * ['greeting'],
2010
+ * originalError,
2011
+ * { code: 'INTERNAL' },
2012
+ * );
2013
+ *
2014
+ * error.locations; // => [{ line: 1, column: 3 }]
2015
+ * error.path; // => ['greeting']
2016
+ * error.originalError; // => originalError
2017
+ * error.extensions; // => { code: 'INTERNAL' }
2018
+ * ```
1945
2019
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
1946
2020
  */
1947
2021
  constructor(message, ...rawArgs) {
@@ -2001,9 +2075,29 @@ var GraphQLError = class _GraphQLError extends Error {
2001
2075
  });
2002
2076
  }
2003
2077
  }
2078
+ /**
2079
+ * Returns the value used by `Object.prototype.toString`.
2080
+ * @returns The built-in string tag for this object.
2081
+ */
2004
2082
  get [Symbol.toStringTag]() {
2005
2083
  return "GraphQLError";
2006
2084
  }
2085
+ /**
2086
+ * Returns this error as a human-readable message with source locations.
2087
+ * @returns The formatted error string.
2088
+ * @example
2089
+ * ```ts
2090
+ * import { Source } from 'graphql/language';
2091
+ * import { GraphQLError } from 'graphql/error';
2092
+ *
2093
+ * const error = new GraphQLError('Cannot query field "name".', {
2094
+ * source: new Source('{ name }'),
2095
+ * positions: [2],
2096
+ * });
2097
+ *
2098
+ * error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^'
2099
+ * ```
2100
+ */
2007
2101
  toString() {
2008
2102
  let output = this.message;
2009
2103
  if (this.nodes) {
@@ -2019,6 +2113,21 @@ var GraphQLError = class _GraphQLError extends Error {
2019
2113
  }
2020
2114
  return output;
2021
2115
  }
2116
+ /**
2117
+ * Returns the JSON representation used when this object is serialized.
2118
+ * @returns The JSON-serializable representation.
2119
+ * @example
2120
+ * ```ts
2121
+ * import { GraphQLError } from 'graphql/error';
2122
+ *
2123
+ * const error = new GraphQLError('Resolver failed.', {
2124
+ * path: ['viewer', 'name'],
2125
+ * extensions: { code: 'INTERNAL' },
2126
+ * });
2127
+ *
2128
+ * error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }
2129
+ * ```
2130
+ */
2022
2131
  toJSON() {
2023
2132
  const formattedError = {
2024
2133
  message: this.message
@@ -2049,20 +2158,29 @@ function syntaxError(source, position, description) {
2049
2158
 
2050
2159
  // node_modules/graphql/language/ast.mjs
2051
2160
  var Location = class {
2161
+ /** The character offset at which this Node begins. */
2162
+ /** The character offset at which this Node ends. */
2163
+ /** The Token at which this Node begins. */
2164
+ /** The Token at which this Node ends. */
2165
+ /** The Source document the AST represents. */
2052
2166
  /**
2053
- * The character offset at which this Node begins.
2054
- */
2055
- /**
2056
- * The character offset at which this Node ends.
2057
- */
2058
- /**
2059
- * The Token at which this Node begins.
2060
- */
2061
- /**
2062
- * The Token at which this Node ends.
2063
- */
2064
- /**
2065
- * The Source document the AST represents.
2167
+ * Creates a Location instance.
2168
+ * @param startToken - The start token.
2169
+ * @param endToken - The end token.
2170
+ * @param source - Source document used to derive error locations.
2171
+ * @example
2172
+ * ```ts
2173
+ * import { Location, Source, Token, TokenKind } from 'graphql/language';
2174
+ *
2175
+ * const source = new Source('{ hello }');
2176
+ * const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);
2177
+ * const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);
2178
+ * const location = new Location(startToken, endToken, source);
2179
+ *
2180
+ * location.start; // => 0
2181
+ * location.end; // => 9
2182
+ * location.source.body; // => '{ hello }'
2183
+ * ```
2066
2184
  */
2067
2185
  constructor(startToken, endToken, source) {
2068
2186
  this.start = startToken.start;
@@ -2071,9 +2189,26 @@ var Location = class {
2071
2189
  this.endToken = endToken;
2072
2190
  this.source = source;
2073
2191
  }
2192
+ /**
2193
+ * Returns the value used by `Object.prototype.toString`.
2194
+ * @returns The built-in string tag for this object.
2195
+ */
2074
2196
  get [Symbol.toStringTag]() {
2075
2197
  return "Location";
2076
2198
  }
2199
+ /**
2200
+ * Returns a JSON representation of this location.
2201
+ * @returns The JSON-serializable representation.
2202
+ * @example
2203
+ * ```ts
2204
+ * import { parse } from 'graphql/language';
2205
+ *
2206
+ * const document = parse('{ hello }');
2207
+ * const location = document.loc?.toJSON();
2208
+ *
2209
+ * location; // => { start: 0, end: 9 }
2210
+ * ```
2211
+ */
2077
2212
  toJSON() {
2078
2213
  return {
2079
2214
  start: this.start,
@@ -2082,21 +2217,11 @@ var Location = class {
2082
2217
  }
2083
2218
  };
2084
2219
  var Token = class {
2085
- /**
2086
- * The kind of Token.
2087
- */
2088
- /**
2089
- * The character offset at which this Node begins.
2090
- */
2091
- /**
2092
- * The character offset at which this Node ends.
2093
- */
2094
- /**
2095
- * The 1-indexed line number on which this Token appears.
2096
- */
2097
- /**
2098
- * The 1-indexed column number at which this Token begins.
2099
- */
2220
+ /** The kind of Token. */
2221
+ /** The character offset at which this Node begins. */
2222
+ /** The character offset at which this Node ends. */
2223
+ /** The 1-indexed line number on which this Token appears. */
2224
+ /** The 1-indexed column number at which this Token begins. */
2100
2225
  /**
2101
2226
  * For non-punctuation tokens, represents the interpreted value of the token.
2102
2227
  *
@@ -2108,6 +2233,26 @@ var Token = class {
2108
2233
  * including ignored tokens. <SOF> is always the first node and <EOF>
2109
2234
  * the last.
2110
2235
  */
2236
+ /** Next token in the token stream, including ignored tokens. */
2237
+ /**
2238
+ * Creates a Token instance.
2239
+ * @param kind - Token kind produced by lexical analysis.
2240
+ * @param start - Character offset where this token begins.
2241
+ * @param end - Character offset where this token ends.
2242
+ * @param line - One-indexed line number where this token begins.
2243
+ * @param column - One-indexed column number where this token begins.
2244
+ * @param value - Interpreted value for non-punctuation tokens.
2245
+ * @example
2246
+ * ```ts
2247
+ * import { Token, TokenKind } from 'graphql/language';
2248
+ *
2249
+ * const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');
2250
+ *
2251
+ * token.kind; // => TokenKind.NAME
2252
+ * token.value; // => 'hello'
2253
+ * token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }
2254
+ * ```
2255
+ */
2111
2256
  constructor(kind, start, end, line, column, value) {
2112
2257
  this.kind = kind;
2113
2258
  this.start = start;
@@ -2118,9 +2263,26 @@ var Token = class {
2118
2263
  this.prev = null;
2119
2264
  this.next = null;
2120
2265
  }
2266
+ /**
2267
+ * Returns the value used by `Object.prototype.toString`.
2268
+ * @returns The built-in string tag for this object.
2269
+ */
2121
2270
  get [Symbol.toStringTag]() {
2122
2271
  return "Token";
2123
2272
  }
2273
+ /**
2274
+ * Returns a JSON representation of this token.
2275
+ * @returns The JSON-serializable representation.
2276
+ * @example
2277
+ * ```ts
2278
+ * import { Lexer, Source } from 'graphql/language';
2279
+ *
2280
+ * const lexer = new Lexer(new Source('{ hello }'));
2281
+ * const token = lexer.advance().toJSON();
2282
+ *
2283
+ * token; // => { kind: '{', value: undefined, line: 1, column: 1 }
2284
+ * ```
2285
+ */
2124
2286
  toJSON() {
2125
2287
  return {
2126
2288
  kind: this.kind,
@@ -2204,8 +2366,15 @@ var QueryDocumentKeys = {
2204
2366
  EnumTypeDefinition: ["description", "name", "directives", "values"],
2205
2367
  EnumValueDefinition: ["description", "name", "directives"],
2206
2368
  InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
2207
- DirectiveDefinition: ["description", "name", "arguments", "locations"],
2369
+ DirectiveDefinition: [
2370
+ "description",
2371
+ "name",
2372
+ "arguments",
2373
+ "directives",
2374
+ "locations"
2375
+ ],
2208
2376
  SchemaExtension: ["directives", "operationTypes"],
2377
+ DirectiveExtension: ["name", "directives"],
2209
2378
  ScalarTypeExtension: ["name", "directives"],
2210
2379
  ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
2211
2380
  InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
@@ -2248,6 +2417,7 @@ var DirectiveLocation;
2248
2417
  DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE";
2249
2418
  DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT";
2250
2419
  DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
2420
+ DirectiveLocation2["DIRECTIVE_DEFINITION"] = "DIRECTIVE_DEFINITION";
2251
2421
  })(DirectiveLocation || (DirectiveLocation = {}));
2252
2422
 
2253
2423
  // node_modules/graphql/language/kinds.mjs
@@ -2290,6 +2460,7 @@ var Kind;
2290
2460
  Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
2291
2461
  Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
2292
2462
  Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
2463
+ Kind2["DIRECTIVE_EXTENSION"] = "DirectiveExtension";
2293
2464
  Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
2294
2465
  Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
2295
2466
  Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
@@ -2383,17 +2554,25 @@ var TokenKind;
2383
2554
 
2384
2555
  // node_modules/graphql/language/lexer.mjs
2385
2556
  var Lexer = class {
2557
+ /** Source document used to derive error locations. */
2558
+ /** Most recent non-ignored token returned by the lexer. */
2559
+ /** Current non-ignored token at the lexer cursor. */
2560
+ /** The (1-indexed) line containing the current token. */
2561
+ /** Character offset where the current line starts. */
2386
2562
  /**
2387
- * The previously focused non-ignored token.
2388
- */
2389
- /**
2390
- * The currently focused non-ignored token.
2391
- */
2392
- /**
2393
- * The (1-indexed) line containing the current token.
2394
- */
2395
- /**
2396
- * The character offset at which the current line begins.
2563
+ * Creates a Lexer instance.
2564
+ * @param source - Source document used to derive error locations.
2565
+ * @example
2566
+ * ```ts
2567
+ * import { Lexer, Source, TokenKind } from 'graphql/language';
2568
+ *
2569
+ * const lexer = new Lexer(new Source('{ hello }'));
2570
+ *
2571
+ * lexer.token.kind; // => TokenKind.SOF
2572
+ * lexer.advance().kind; // => TokenKind.BRACE_L
2573
+ * lexer.advance().value; // => 'hello'
2574
+ * lexer.advance().kind; // => TokenKind.BRACE_R
2575
+ * ```
2397
2576
  */
2398
2577
  constructor(source) {
2399
2578
  const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);
@@ -2403,11 +2582,26 @@ var Lexer = class {
2403
2582
  this.line = 1;
2404
2583
  this.lineStart = 0;
2405
2584
  }
2585
+ /**
2586
+ * Returns the value used by `Object.prototype.toString`.
2587
+ * @returns The built-in string tag for this object.
2588
+ */
2406
2589
  get [Symbol.toStringTag]() {
2407
2590
  return "Lexer";
2408
2591
  }
2409
2592
  /**
2410
2593
  * Advances the token stream to the next non-ignored token.
2594
+ * @returns The next non-ignored token.
2595
+ * @example
2596
+ * ```ts
2597
+ * import { Lexer, Source } from 'graphql/language';
2598
+ *
2599
+ * const lexer = new Lexer(new Source('{ hello }'));
2600
+ * const token = lexer.advance();
2601
+ *
2602
+ * token.kind; // => '{'
2603
+ * lexer.token; // => token
2604
+ * ```
2411
2605
  */
2412
2606
  advance() {
2413
2607
  this.lastToken = this.token;
@@ -2417,6 +2611,17 @@ var Lexer = class {
2417
2611
  /**
2418
2612
  * Looks ahead and returns the next non-ignored token, but does not change
2419
2613
  * the state of Lexer.
2614
+ * @returns The next non-ignored token without advancing the lexer.
2615
+ * @example
2616
+ * ```ts
2617
+ * import { Lexer, Source } from 'graphql/language';
2618
+ *
2619
+ * const lexer = new Lexer(new Source('{ hello }'));
2620
+ * const token = lexer.lookahead();
2621
+ *
2622
+ * token.kind; // => '{'
2623
+ * lexer.token.kind; // => '<SOF>'
2624
+ * ```
2420
2625
  */
2421
2626
  lookahead() {
2422
2627
  let token = this.token;
@@ -3037,6 +3242,29 @@ spurious results.`);
3037
3242
 
3038
3243
  // node_modules/graphql/language/source.mjs
3039
3244
  var Source = class {
3245
+ /** The GraphQL source text. */
3246
+ /** Name used in diagnostics for this source, such as a file path or request name. */
3247
+ /** One-indexed line and column where this source begins. */
3248
+ /**
3249
+ * Creates a Source instance.
3250
+ * @param body - The GraphQL source text.
3251
+ * @param name - Name used in diagnostics for this source.
3252
+ * @param locationOffset - One-indexed line and column where this source begins.
3253
+ * @example
3254
+ * ```ts
3255
+ * import { Source } from 'graphql/language';
3256
+ *
3257
+ * const source = new Source(
3258
+ * 'type Query { greeting: String }',
3259
+ * 'schema.graphql',
3260
+ * { line: 10, column: 1 },
3261
+ * );
3262
+ *
3263
+ * source.body; // => 'type Query { greeting: String }'
3264
+ * source.name; // => 'schema.graphql'
3265
+ * source.locationOffset; // => { line: 10, column: 1 }
3266
+ * ```
3267
+ */
3040
3268
  constructor(body, name = "GraphQL request", locationOffset = {
3041
3269
  line: 1,
3042
3270
  column: 1
@@ -3054,6 +3282,10 @@ var Source = class {
3054
3282
  "column in locationOffset is 1-indexed and must be positive."
3055
3283
  );
3056
3284
  }
3285
+ /**
3286
+ * Returns the value used by `Object.prototype.toString`.
3287
+ * @returns The built-in string tag for this object.
3288
+ */
3057
3289
  get [Symbol.toStringTag]() {
3058
3290
  return "Source";
3059
3291
  }
@@ -3089,6 +3321,8 @@ var Parser = class {
3089
3321
  }
3090
3322
  /**
3091
3323
  * Converts a name lex token into a name parse node.
3324
+ *
3325
+ * @internal
3092
3326
  */
3093
3327
  parseName() {
3094
3328
  const token = this.expectToken(TokenKind.NAME);
@@ -3100,6 +3334,8 @@ var Parser = class {
3100
3334
  // Implements the parsing rules in the Document section.
3101
3335
  /**
3102
3336
  * Document : Definition+
3337
+ *
3338
+ * @internal
3103
3339
  */
3104
3340
  parseDocument() {
3105
3341
  return this.node(this._lexer.token, {
@@ -3133,6 +3369,8 @@ var Parser = class {
3133
3369
  * - UnionTypeDefinition
3134
3370
  * - EnumTypeDefinition
3135
3371
  * - InputObjectTypeDefinition
3372
+ *
3373
+ * @internal
3136
3374
  */
3137
3375
  parseDefinition() {
3138
3376
  if (this.peek(TokenKind.BRACE_L)) {
@@ -3193,6 +3431,8 @@ var Parser = class {
3193
3431
  * OperationDefinition :
3194
3432
  * - SelectionSet
3195
3433
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
3434
+ *
3435
+ * @internal
3196
3436
  */
3197
3437
  parseOperationDefinition() {
3198
3438
  const start = this._lexer.token;
@@ -3225,6 +3465,8 @@ var Parser = class {
3225
3465
  }
3226
3466
  /**
3227
3467
  * OperationType : one of query mutation subscription
3468
+ *
3469
+ * @internal
3228
3470
  */
3229
3471
  parseOperationType() {
3230
3472
  const operationToken = this.expectToken(TokenKind.NAME);
@@ -3240,6 +3482,8 @@ var Parser = class {
3240
3482
  }
3241
3483
  /**
3242
3484
  * VariableDefinitions : ( VariableDefinition+ )
3485
+ *
3486
+ * @internal
3243
3487
  */
3244
3488
  parseVariableDefinitions() {
3245
3489
  return this.optionalMany(
@@ -3250,6 +3494,8 @@ var Parser = class {
3250
3494
  }
3251
3495
  /**
3252
3496
  * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
3497
+ *
3498
+ * @internal
3253
3499
  */
3254
3500
  parseVariableDefinition() {
3255
3501
  return this.node(this._lexer.token, {
@@ -3263,6 +3509,8 @@ var Parser = class {
3263
3509
  }
3264
3510
  /**
3265
3511
  * Variable : $ Name
3512
+ *
3513
+ * @internal
3266
3514
  */
3267
3515
  parseVariable() {
3268
3516
  const start = this._lexer.token;
@@ -3276,6 +3524,8 @@ var Parser = class {
3276
3524
  * ```
3277
3525
  * SelectionSet : { Selection+ }
3278
3526
  * ```
3527
+ *
3528
+ * @internal
3279
3529
  */
3280
3530
  parseSelectionSet() {
3281
3531
  return this.node(this._lexer.token, {
@@ -3292,6 +3542,8 @@ var Parser = class {
3292
3542
  * - Field
3293
3543
  * - FragmentSpread
3294
3544
  * - InlineFragment
3545
+ *
3546
+ * @internal
3295
3547
  */
3296
3548
  parseSelection() {
3297
3549
  return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
@@ -3300,6 +3552,8 @@ var Parser = class {
3300
3552
  * Field : Alias? Name Arguments? Directives? SelectionSet?
3301
3553
  *
3302
3554
  * Alias : Name :
3555
+ *
3556
+ * @internal
3303
3557
  */
3304
3558
  parseField() {
3305
3559
  const start = this._lexer.token;
@@ -3323,6 +3577,8 @@ var Parser = class {
3323
3577
  }
3324
3578
  /**
3325
3579
  * Arguments[Const] : ( Argument[?Const]+ )
3580
+ *
3581
+ * @internal
3326
3582
  */
3327
3583
  parseArguments(isConst) {
3328
3584
  const item = isConst ? this.parseConstArgument : this.parseArgument;
@@ -3330,6 +3586,8 @@ var Parser = class {
3330
3586
  }
3331
3587
  /**
3332
3588
  * Argument[Const] : Name : Value[?Const]
3589
+ *
3590
+ * @internal
3333
3591
  */
3334
3592
  parseArgument(isConst = false) {
3335
3593
  const start = this._lexer.token;
@@ -3351,6 +3609,8 @@ var Parser = class {
3351
3609
  * FragmentSpread : ... FragmentName Directives?
3352
3610
  *
3353
3611
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
3612
+ *
3613
+ * @internal
3354
3614
  */
3355
3615
  parseFragment() {
3356
3616
  const start = this._lexer.token;
@@ -3375,6 +3635,8 @@ var Parser = class {
3375
3635
  * - fragment FragmentName on TypeCondition Directives? SelectionSet
3376
3636
  *
3377
3637
  * TypeCondition : NamedType
3638
+ *
3639
+ * @internal
3378
3640
  */
3379
3641
  parseFragmentDefinition() {
3380
3642
  const start = this._lexer.token;
@@ -3402,6 +3664,8 @@ var Parser = class {
3402
3664
  }
3403
3665
  /**
3404
3666
  * FragmentName : Name but not `on`
3667
+ *
3668
+ * @internal
3405
3669
  */
3406
3670
  parseFragmentName() {
3407
3671
  if (this._lexer.token.value === "on") {
@@ -3427,6 +3691,8 @@ var Parser = class {
3427
3691
  * NullValue : `null`
3428
3692
  *
3429
3693
  * EnumValue : Name but not `true`, `false` or `null`
3694
+ *
3695
+ * @internal
3430
3696
  */
3431
3697
  parseValueLiteral(isConst) {
3432
3698
  const token = this._lexer.token;
@@ -3508,6 +3774,8 @@ var Parser = class {
3508
3774
  * ListValue[Const] :
3509
3775
  * - [ ]
3510
3776
  * - [ Value[?Const]+ ]
3777
+ *
3778
+ * @internal
3511
3779
  */
3512
3780
  parseList(isConst) {
3513
3781
  const item = () => this.parseValueLiteral(isConst);
@@ -3522,6 +3790,8 @@ var Parser = class {
3522
3790
  * - { }
3523
3791
  * - { ObjectField[?Const]+ }
3524
3792
  * ```
3793
+ *
3794
+ * @internal
3525
3795
  */
3526
3796
  parseObject(isConst) {
3527
3797
  const item = () => this.parseObjectField(isConst);
@@ -3532,6 +3802,8 @@ var Parser = class {
3532
3802
  }
3533
3803
  /**
3534
3804
  * ObjectField[Const] : Name : Value[?Const]
3805
+ *
3806
+ * @internal
3535
3807
  */
3536
3808
  parseObjectField(isConst) {
3537
3809
  const start = this._lexer.token;
@@ -3546,6 +3818,8 @@ var Parser = class {
3546
3818
  // Implements the parsing rules in the Directives section.
3547
3819
  /**
3548
3820
  * Directives[Const] : Directive[?Const]+
3821
+ *
3822
+ * @internal
3549
3823
  */
3550
3824
  parseDirectives(isConst) {
3551
3825
  const directives = [];
@@ -3561,6 +3835,8 @@ var Parser = class {
3561
3835
  * ```
3562
3836
  * Directive[Const] : @ Name Arguments[?Const]?
3563
3837
  * ```
3838
+ *
3839
+ * @internal
3564
3840
  */
3565
3841
  parseDirective(isConst) {
3566
3842
  const start = this._lexer.token;
@@ -3577,6 +3853,8 @@ var Parser = class {
3577
3853
  * - NamedType
3578
3854
  * - ListType
3579
3855
  * - NonNullType
3856
+ *
3857
+ * @internal
3580
3858
  */
3581
3859
  parseTypeReference() {
3582
3860
  const start = this._lexer.token;
@@ -3601,6 +3879,8 @@ var Parser = class {
3601
3879
  }
3602
3880
  /**
3603
3881
  * NamedType : Name
3882
+ *
3883
+ * @internal
3604
3884
  */
3605
3885
  parseNamedType() {
3606
3886
  return this.node(this._lexer.token, {
@@ -3614,6 +3894,8 @@ var Parser = class {
3614
3894
  }
3615
3895
  /**
3616
3896
  * Description : StringValue
3897
+ *
3898
+ * @internal
3617
3899
  */
3618
3900
  parseDescription() {
3619
3901
  if (this.peekDescription()) {
@@ -3624,6 +3906,8 @@ var Parser = class {
3624
3906
  * ```
3625
3907
  * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
3626
3908
  * ```
3909
+ *
3910
+ * @internal
3627
3911
  */
3628
3912
  parseSchemaDefinition() {
3629
3913
  const start = this._lexer.token;
@@ -3644,6 +3928,8 @@ var Parser = class {
3644
3928
  }
3645
3929
  /**
3646
3930
  * OperationTypeDefinition : OperationType : NamedType
3931
+ *
3932
+ * @internal
3647
3933
  */
3648
3934
  parseOperationTypeDefinition() {
3649
3935
  const start = this._lexer.token;
@@ -3658,6 +3944,8 @@ var Parser = class {
3658
3944
  }
3659
3945
  /**
3660
3946
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
3947
+ *
3948
+ * @internal
3661
3949
  */
3662
3950
  parseScalarTypeDefinition() {
3663
3951
  const start = this._lexer.token;
@@ -3676,6 +3964,8 @@ var Parser = class {
3676
3964
  * ObjectTypeDefinition :
3677
3965
  * Description?
3678
3966
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
3967
+ *
3968
+ * @internal
3679
3969
  */
3680
3970
  parseObjectTypeDefinition() {
3681
3971
  const start = this._lexer.token;
@@ -3698,6 +3988,8 @@ var Parser = class {
3698
3988
  * ImplementsInterfaces :
3699
3989
  * - implements `&`? NamedType
3700
3990
  * - ImplementsInterfaces & NamedType
3991
+ *
3992
+ * @internal
3701
3993
  */
3702
3994
  parseImplementsInterfaces() {
3703
3995
  return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : [];
@@ -3706,6 +3998,8 @@ var Parser = class {
3706
3998
  * ```
3707
3999
  * FieldsDefinition : { FieldDefinition+ }
3708
4000
  * ```
4001
+ *
4002
+ * @internal
3709
4003
  */
3710
4004
  parseFieldsDefinition() {
3711
4005
  return this.optionalMany(
@@ -3717,6 +4011,8 @@ var Parser = class {
3717
4011
  /**
3718
4012
  * FieldDefinition :
3719
4013
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
4014
+ *
4015
+ * @internal
3720
4016
  */
3721
4017
  parseFieldDefinition() {
3722
4018
  const start = this._lexer.token;
@@ -3737,6 +4033,8 @@ var Parser = class {
3737
4033
  }
3738
4034
  /**
3739
4035
  * ArgumentsDefinition : ( InputValueDefinition+ )
4036
+ *
4037
+ * @internal
3740
4038
  */
3741
4039
  parseArgumentDefs() {
3742
4040
  return this.optionalMany(
@@ -3748,6 +4046,8 @@ var Parser = class {
3748
4046
  /**
3749
4047
  * InputValueDefinition :
3750
4048
  * - Description? Name : Type DefaultValue? Directives[Const]?
4049
+ *
4050
+ * @internal
3751
4051
  */
3752
4052
  parseInputValueDef() {
3753
4053
  const start = this._lexer.token;
@@ -3772,6 +4072,8 @@ var Parser = class {
3772
4072
  /**
3773
4073
  * InterfaceTypeDefinition :
3774
4074
  * - Description? interface Name Directives[Const]? FieldsDefinition?
4075
+ *
4076
+ * @internal
3775
4077
  */
3776
4078
  parseInterfaceTypeDefinition() {
3777
4079
  const start = this._lexer.token;
@@ -3793,6 +4095,8 @@ var Parser = class {
3793
4095
  /**
3794
4096
  * UnionTypeDefinition :
3795
4097
  * - Description? union Name Directives[Const]? UnionMemberTypes?
4098
+ *
4099
+ * @internal
3796
4100
  */
3797
4101
  parseUnionTypeDefinition() {
3798
4102
  const start = this._lexer.token;
@@ -3813,6 +4117,8 @@ var Parser = class {
3813
4117
  * UnionMemberTypes :
3814
4118
  * - = `|`? NamedType
3815
4119
  * - UnionMemberTypes | NamedType
4120
+ *
4121
+ * @internal
3816
4122
  */
3817
4123
  parseUnionMemberTypes() {
3818
4124
  return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
@@ -3820,6 +4126,8 @@ var Parser = class {
3820
4126
  /**
3821
4127
  * EnumTypeDefinition :
3822
4128
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
4129
+ *
4130
+ * @internal
3823
4131
  */
3824
4132
  parseEnumTypeDefinition() {
3825
4133
  const start = this._lexer.token;
@@ -3840,6 +4148,8 @@ var Parser = class {
3840
4148
  * ```
3841
4149
  * EnumValuesDefinition : { EnumValueDefinition+ }
3842
4150
  * ```
4151
+ *
4152
+ * @internal
3843
4153
  */
3844
4154
  parseEnumValuesDefinition() {
3845
4155
  return this.optionalMany(
@@ -3850,6 +4160,8 @@ var Parser = class {
3850
4160
  }
3851
4161
  /**
3852
4162
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
4163
+ *
4164
+ * @internal
3853
4165
  */
3854
4166
  parseEnumValueDefinition() {
3855
4167
  const start = this._lexer.token;
@@ -3865,6 +4177,8 @@ var Parser = class {
3865
4177
  }
3866
4178
  /**
3867
4179
  * EnumValue : Name but not `true`, `false` or `null`
4180
+ *
4181
+ * @internal
3868
4182
  */
3869
4183
  parseEnumValueName() {
3870
4184
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") {
@@ -3881,6 +4195,8 @@ var Parser = class {
3881
4195
  /**
3882
4196
  * InputObjectTypeDefinition :
3883
4197
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
4198
+ *
4199
+ * @internal
3884
4200
  */
3885
4201
  parseInputObjectTypeDefinition() {
3886
4202
  const start = this._lexer.token;
@@ -3901,6 +4217,8 @@ var Parser = class {
3901
4217
  * ```
3902
4218
  * InputFieldsDefinition : { InputValueDefinition+ }
3903
4219
  * ```
4220
+ *
4221
+ * @internal
3904
4222
  */
3905
4223
  parseInputFieldsDefinition() {
3906
4224
  return this.optionalMany(
@@ -3921,6 +4239,9 @@ var Parser = class {
3921
4239
  * - UnionTypeExtension
3922
4240
  * - EnumTypeExtension
3923
4241
  * - InputObjectTypeDefinition
4242
+ * - DirectiveDefinitionExtension
4243
+ *
4244
+ * @internal
3924
4245
  */
3925
4246
  parseTypeSystemExtension() {
3926
4247
  const keywordToken = this._lexer.lookahead();
@@ -3940,6 +4261,11 @@ var Parser = class {
3940
4261
  return this.parseEnumTypeExtension();
3941
4262
  case "input":
3942
4263
  return this.parseInputObjectTypeExtension();
4264
+ case "directive":
4265
+ if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
4266
+ return this.parseDirectiveDefinitionExtension();
4267
+ }
4268
+ break;
3943
4269
  }
3944
4270
  }
3945
4271
  throw this.unexpected(keywordToken);
@@ -3950,6 +4276,8 @@ var Parser = class {
3950
4276
  * - extend schema Directives[Const]? { OperationTypeDefinition+ }
3951
4277
  * - extend schema Directives[Const]
3952
4278
  * ```
4279
+ *
4280
+ * @internal
3953
4281
  */
3954
4282
  parseSchemaExtension() {
3955
4283
  const start = this._lexer.token;
@@ -3973,6 +4301,8 @@ var Parser = class {
3973
4301
  /**
3974
4302
  * ScalarTypeExtension :
3975
4303
  * - extend scalar Name Directives[Const]
4304
+ *
4305
+ * @internal
3976
4306
  */
3977
4307
  parseScalarTypeExtension() {
3978
4308
  const start = this._lexer.token;
@@ -3994,6 +4324,8 @@ var Parser = class {
3994
4324
  * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
3995
4325
  * - extend type Name ImplementsInterfaces? Directives[Const]
3996
4326
  * - extend type Name ImplementsInterfaces
4327
+ *
4328
+ * @internal
3997
4329
  */
3998
4330
  parseObjectTypeExtension() {
3999
4331
  const start = this._lexer.token;
@@ -4019,6 +4351,8 @@ var Parser = class {
4019
4351
  * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
4020
4352
  * - extend interface Name ImplementsInterfaces? Directives[Const]
4021
4353
  * - extend interface Name ImplementsInterfaces
4354
+ *
4355
+ * @internal
4022
4356
  */
4023
4357
  parseInterfaceTypeExtension() {
4024
4358
  const start = this._lexer.token;
@@ -4043,6 +4377,8 @@ var Parser = class {
4043
4377
  * UnionTypeExtension :
4044
4378
  * - extend union Name Directives[Const]? UnionMemberTypes
4045
4379
  * - extend union Name Directives[Const]
4380
+ *
4381
+ * @internal
4046
4382
  */
4047
4383
  parseUnionTypeExtension() {
4048
4384
  const start = this._lexer.token;
@@ -4065,6 +4401,8 @@ var Parser = class {
4065
4401
  * EnumTypeExtension :
4066
4402
  * - extend enum Name Directives[Const]? EnumValuesDefinition
4067
4403
  * - extend enum Name Directives[Const]
4404
+ *
4405
+ * @internal
4068
4406
  */
4069
4407
  parseEnumTypeExtension() {
4070
4408
  const start = this._lexer.token;
@@ -4087,6 +4425,8 @@ var Parser = class {
4087
4425
  * InputObjectTypeExtension :
4088
4426
  * - extend input Name Directives[Const]? InputFieldsDefinition
4089
4427
  * - extend input Name Directives[Const]
4428
+ *
4429
+ * @internal
4090
4430
  */
4091
4431
  parseInputObjectTypeExtension() {
4092
4432
  const start = this._lexer.token;
@@ -4105,11 +4445,29 @@ var Parser = class {
4105
4445
  fields
4106
4446
  });
4107
4447
  }
4448
+ parseDirectiveDefinitionExtension() {
4449
+ const start = this._lexer.token;
4450
+ this.expectKeyword("extend");
4451
+ this.expectKeyword("directive");
4452
+ this.expectToken(TokenKind.AT);
4453
+ const name = this.parseName();
4454
+ const directives = this.parseConstDirectives();
4455
+ if (directives.length === 0) {
4456
+ throw this.unexpected();
4457
+ }
4458
+ return this.node(start, {
4459
+ kind: Kind.DIRECTIVE_EXTENSION,
4460
+ name,
4461
+ directives
4462
+ });
4463
+ }
4108
4464
  /**
4109
4465
  * ```
4110
4466
  * DirectiveDefinition :
4111
4467
  * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
4112
4468
  * ```
4469
+ *
4470
+ * @internal
4113
4471
  */
4114
4472
  parseDirectiveDefinition() {
4115
4473
  const start = this._lexer.token;
@@ -4118,6 +4476,7 @@ var Parser = class {
4118
4476
  this.expectToken(TokenKind.AT);
4119
4477
  const name = this.parseName();
4120
4478
  const args = this.parseArgumentDefs();
4479
+ const directives = this._options.experimentalDirectivesOnDirectiveDefinitions ? this.parseConstDirectives() : [];
4121
4480
  const repeatable = this.expectOptionalKeyword("repeatable");
4122
4481
  this.expectKeyword("on");
4123
4482
  const locations = this.parseDirectiveLocations();
@@ -4126,6 +4485,7 @@ var Parser = class {
4126
4485
  description,
4127
4486
  name,
4128
4487
  arguments: args,
4488
+ directives,
4129
4489
  repeatable,
4130
4490
  locations
4131
4491
  });
@@ -4134,6 +4494,8 @@ var Parser = class {
4134
4494
  * DirectiveLocations :
4135
4495
  * - `|`? DirectiveLocation
4136
4496
  * - DirectiveLocations | DirectiveLocation
4497
+ *
4498
+ * @internal
4137
4499
  */
4138
4500
  parseDirectiveLocations() {
4139
4501
  return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
@@ -4164,6 +4526,7 @@ var Parser = class {
4164
4526
  * `ENUM_VALUE`
4165
4527
  * `INPUT_OBJECT`
4166
4528
  * `INPUT_FIELD_DEFINITION`
4529
+ * `DIRECTIVE_DEFINITION`
4167
4530
  */
4168
4531
  parseDirectiveLocation() {
4169
4532
  const start = this._lexer.token;
@@ -4181,6 +4544,19 @@ var Parser = class {
4181
4544
  * - Name . Name ( Name : )
4182
4545
  * - \@ Name
4183
4546
  * - \@ Name ( Name : )
4547
+ * @returns Parsed schema coordinate AST.
4548
+ * @example
4549
+ * ```ts
4550
+ * import { Parser, Source } from 'graphql/language';
4551
+ *
4552
+ * const typeCoordinate = new Parser(new Source('User.name')).parseSchemaCoordinate();
4553
+ * const directiveCoordinate = new Parser(new Source('@include(if:)')).parseSchemaCoordinate();
4554
+ *
4555
+ * typeCoordinate.name.value; // => 'User'
4556
+ * typeCoordinate.memberName?.value; // => 'name'
4557
+ * directiveCoordinate.name.value; // => 'deprecated'
4558
+ * directiveCoordinate.argumentName?.value; // => 'reason'
4559
+ * ```
4184
4560
  */
4185
4561
  parseSchemaCoordinate() {
4186
4562
  const start = this._lexer.token;
@@ -4233,6 +4609,8 @@ var Parser = class {
4233
4609
  * Returns a node that, if configured to do so, sets a "loc" field as a
4234
4610
  * location object, used to identify the place in the source that created a
4235
4611
  * given parsed object.
4612
+ *
4613
+ * @internal
4236
4614
  */
4237
4615
  node(startToken, node) {
4238
4616
  if (this._options.noLocation !== true) {
@@ -4246,6 +4624,8 @@ var Parser = class {
4246
4624
  }
4247
4625
  /**
4248
4626
  * Determines if the next token is of a given kind
4627
+ *
4628
+ * @internal
4249
4629
  */
4250
4630
  peek(kind) {
4251
4631
  return this._lexer.token.kind === kind;
@@ -4253,6 +4633,8 @@ var Parser = class {
4253
4633
  /**
4254
4634
  * If the next token is of the given kind, return that token after advancing the lexer.
4255
4635
  * Otherwise, do not change the parser state and throw an error.
4636
+ *
4637
+ * @internal
4256
4638
  */
4257
4639
  expectToken(kind) {
4258
4640
  const token = this._lexer.token;
@@ -4269,6 +4651,8 @@ var Parser = class {
4269
4651
  /**
4270
4652
  * If the next token is of the given kind, return "true" after advancing the lexer.
4271
4653
  * Otherwise, do not change the parser state and return "false".
4654
+ *
4655
+ * @internal
4272
4656
  */
4273
4657
  expectOptionalToken(kind) {
4274
4658
  const token = this._lexer.token;
@@ -4281,6 +4665,8 @@ var Parser = class {
4281
4665
  /**
4282
4666
  * If the next token is a given keyword, advance the lexer.
4283
4667
  * Otherwise, do not change the parser state and throw an error.
4668
+ *
4669
+ * @internal
4284
4670
  */
4285
4671
  expectKeyword(value) {
4286
4672
  const token = this._lexer.token;
@@ -4297,6 +4683,8 @@ var Parser = class {
4297
4683
  /**
4298
4684
  * If the next token is a given keyword, return "true" after advancing the lexer.
4299
4685
  * Otherwise, do not change the parser state and return "false".
4686
+ *
4687
+ * @internal
4300
4688
  */
4301
4689
  expectOptionalKeyword(value) {
4302
4690
  const token = this._lexer.token;
@@ -4308,6 +4696,8 @@ var Parser = class {
4308
4696
  }
4309
4697
  /**
4310
4698
  * Helper function for creating an error when an unexpected lexed token is encountered.
4699
+ *
4700
+ * @internal
4311
4701
  */
4312
4702
  unexpected(atToken) {
4313
4703
  const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
@@ -4321,6 +4711,8 @@ var Parser = class {
4321
4711
  * Returns a possibly empty list of parse nodes, determined by the parseFn.
4322
4712
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
4323
4713
  * Advances the parser to the next lex token after the closing token.
4714
+ *
4715
+ * @internal
4324
4716
  */
4325
4717
  any(openKind, parseFn, closeKind) {
4326
4718
  this.expectToken(openKind);
@@ -4335,6 +4727,8 @@ var Parser = class {
4335
4727
  * It can be empty only if open token is missing otherwise it will always return non-empty list
4336
4728
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
4337
4729
  * Advances the parser to the next lex token after the closing token.
4730
+ *
4731
+ * @internal
4338
4732
  */
4339
4733
  optionalMany(openKind, parseFn, closeKind) {
4340
4734
  if (this.expectOptionalToken(openKind)) {
@@ -4350,6 +4744,8 @@ var Parser = class {
4350
4744
  * Returns a non-empty list of parse nodes, determined by the parseFn.
4351
4745
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
4352
4746
  * Advances the parser to the next lex token after the closing token.
4747
+ *
4748
+ * @internal
4353
4749
  */
4354
4750
  many(openKind, parseFn, closeKind) {
4355
4751
  this.expectToken(openKind);
@@ -4363,6 +4759,8 @@ var Parser = class {
4363
4759
  * Returns a non-empty list of parse nodes, determined by the parseFn.
4364
4760
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
4365
4761
  * Advances the parser to the next lex token after last item in the list.
4762
+ *
4763
+ * @internal
4366
4764
  */
4367
4765
  delimitedMany(delimiterKind, parseFn) {
4368
4766
  this.expectOptionalToken(delimiterKind);
@@ -4456,7 +4854,8 @@ function parseDocument(source) {
4456
4854
  if (!docCache.has(cacheKey)) {
4457
4855
  var parsed = parse(source, {
4458
4856
  experimentalFragmentVariables,
4459
- allowLegacyFragmentVariables: experimentalFragmentVariables
4857
+ allowLegacyFragmentVariables: experimentalFragmentVariables,
4858
+ experimentalFragmentArguments: experimentalFragmentVariables
4460
4859
  });
4461
4860
  if (!parsed || parsed.kind !== "Document") {
4462
4861
  throw new Error("Not a valid GraphQL document.");
@@ -10336,8 +10735,12 @@ var START_GAME_MUTATION = gql`
10336
10735
  ${GAME_DOC_FIELDS_FRAGMENT}
10337
10736
  `;
10338
10737
  var LEAVE_GAME_MUTATION = gql`
10339
- mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
10340
- leaveGame(_id: $_id, gameType: $gameType)
10738
+ mutation leaveGame(
10739
+ $_id: ID!
10740
+ $gameType: GameTypeEnumType!
10741
+ $gameTypeId: ID!
10742
+ ) {
10743
+ leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId)
10341
10744
  }
10342
10745
  `;
10343
10746
  var UPDATE_DAILY_CLUE_MUTATION = gql`
@@ -10498,6 +10901,20 @@ var noLeadingZeros = (fieldName, options = {}) => {
10498
10901
  return true;
10499
10902
  };
10500
10903
  };
10904
+ var toOptionalNumber = (originalValue) => {
10905
+ if (originalValue === "" || originalValue === null || originalValue === void 0) {
10906
+ return void 0;
10907
+ }
10908
+ let parsed;
10909
+ if (typeof originalValue === "number") {
10910
+ parsed = originalValue;
10911
+ } else if (typeof originalValue === "string") {
10912
+ parsed = Number(originalValue.replace(",", "."));
10913
+ } else {
10914
+ parsed = void 0;
10915
+ }
10916
+ return Number.isNaN(parsed) ? void 0 : parsed;
10917
+ };
10501
10918
  import_dayjs2.default.extend(import_isSameOrAfter2.default);
10502
10919
  import_dayjs2.default.extend(import_customParseFormat2.default);
10503
10920
  var emailRequiredSchema = create$6().email("Invalid email address").required("Email is required").label("Email").transform(
@@ -10592,12 +11009,12 @@ var dateTimeSchema = create$3().shape({
10592
11009
  });
10593
11010
  var stallTypesSchema = create$3({
10594
11011
  label: create$6().trim().label("Stall Type").required("Stall type is required"),
10595
- price: create$5().label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
11012
+ 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(
10596
11013
  "no-leading-zeros",
10597
11014
  "",
10598
11015
  noLeadingZeros("Stall price", { allowDecimal: true })
10599
11016
  ),
10600
- 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"))
11017
+ 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"))
10601
11018
  });
10602
11019
  var dateTimeWithPriceSchema = dateTimeSchema.shape({
10603
11020
  stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
@@ -10721,8 +11138,8 @@ var eventInfoSchema = create$3().shape({
10721
11138
  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")),
10722
11139
  dateTime: create$2().of(dateTimeWithPriceSchema).required("DateTime is required"),
10723
11140
  eventId: create$6().trim().required("Event ID is required"),
10724
- 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")),
10725
- 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(
11141
+ 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")),
11142
+ 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(
10726
11143
  "payment-before-deadline",
10727
11144
  "Payment due hours must be less than application deadline hours",
10728
11145
  function(value) {
@@ -11093,7 +11510,7 @@ var schoolSchema = create$3().shape({
11093
11510
  name: create$6().trim().required("Name is required"),
11094
11511
  region: create$6().trim().required("Region is required"),
11095
11512
  socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
11096
- studentCount: create$5().label("Student Count").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Student count must be a number").min(
11513
+ studentCount: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
11097
11514
  SCHOOL_MIN_STUDENT_COUNT,
11098
11515
  `Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
11099
11516
  ).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
@@ -11109,11 +11526,7 @@ var posterIds = [
11109
11526
  "poster1",
11110
11527
  "poster2",
11111
11528
  "poster3",
11112
- // New
11113
- "poster4",
11114
- "poster5",
11115
- "poster6",
11116
- "poster7"
11529
+ "poster4"
11117
11530
  ];
11118
11531
  var posterFiles = Object.fromEntries(
11119
11532
  posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])