@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.
- package/dist/{chunk-EM5UZAAN.mjs → chunk-QHPLDTUG.mjs} +473 -60
- package/dist/chunk-QHPLDTUG.mjs.map +1 -0
- package/dist/index.cjs +484 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +483 -59
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +472 -59
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +484 -59
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +8 -2
- package/dist/service/index.d.ts +8 -2
- package/dist/service/index.mjs +12 -1
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-EM5UZAAN.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1707,6 +1707,7 @@ __export(index_exports, {
|
|
|
1707
1707
|
connectToDatabase: () => connectToDatabase,
|
|
1708
1708
|
convertObjectIdsToStrings: () => convertObjectIdsToStrings,
|
|
1709
1709
|
dateTimeSchema: () => dateTimeSchema3,
|
|
1710
|
+
didRemoveAnyEventDates: () => didRemoveAnyEventDates,
|
|
1710
1711
|
express: () => import_express.default,
|
|
1711
1712
|
findEventOrImportedMarketById: () => findEventOrImportedMarketById,
|
|
1712
1713
|
locationGeoSchema: () => locationGeoSchema,
|
|
@@ -1933,9 +1934,7 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1933
1934
|
*
|
|
1934
1935
|
* Enumerable, and appears in the result of JSON.stringify().
|
|
1935
1936
|
*/
|
|
1936
|
-
/**
|
|
1937
|
-
* An array of GraphQL AST Nodes corresponding to this error.
|
|
1938
|
-
*/
|
|
1937
|
+
/** An array of GraphQL AST Nodes corresponding to this error. */
|
|
1939
1938
|
/**
|
|
1940
1939
|
* The source GraphQL document for the first location of this error.
|
|
1941
1940
|
*
|
|
@@ -1946,13 +1945,89 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1946
1945
|
* An array of character offsets within the source GraphQL document
|
|
1947
1946
|
* which correspond to this error.
|
|
1948
1947
|
*/
|
|
1948
|
+
/** Original error that caused this GraphQLError, if one exists. */
|
|
1949
|
+
/** Extension fields to add to the formatted error. */
|
|
1949
1950
|
/**
|
|
1950
|
-
*
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
*
|
|
1951
|
+
* Creates a GraphQLError instance.
|
|
1952
|
+
* @param message - Human-readable error message.
|
|
1953
|
+
* @param options - Error metadata such as source locations, response path, original error, and extensions.
|
|
1954
|
+
* This positional-arguments constructor overload is deprecated. Use the
|
|
1955
|
+
* `GraphQLError(message, options)` overload instead.
|
|
1956
|
+
* @example
|
|
1957
|
+
* ```ts
|
|
1958
|
+
* // Create an error from AST nodes and response metadata.
|
|
1959
|
+
* import { parse } from 'graphql/language';
|
|
1960
|
+
* import { GraphQLError } from 'graphql/error';
|
|
1961
|
+
*
|
|
1962
|
+
* const document = parse('{ greeting }');
|
|
1963
|
+
* const fieldNode = document.definitions[0].selectionSet.selections[0];
|
|
1964
|
+
* const error = new GraphQLError('Cannot query this field.', {
|
|
1965
|
+
* nodes: fieldNode,
|
|
1966
|
+
* path: ['greeting'],
|
|
1967
|
+
* extensions: { code: 'FORBIDDEN' },
|
|
1968
|
+
* });
|
|
1969
|
+
*
|
|
1970
|
+
* error.message; // => 'Cannot query this field.'
|
|
1971
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
1972
|
+
* error.path; // => ['greeting']
|
|
1973
|
+
* error.extensions; // => { code: 'FORBIDDEN' }
|
|
1974
|
+
* ```
|
|
1975
|
+
* @example
|
|
1976
|
+
* ```ts
|
|
1977
|
+
* // This variant derives locations from source positions and preserves the original error.
|
|
1978
|
+
* import { Source } from 'graphql/language';
|
|
1979
|
+
* import { GraphQLError } from 'graphql/error';
|
|
1980
|
+
*
|
|
1981
|
+
* const source = new Source('{ greeting }');
|
|
1982
|
+
* const originalError = new Error('Database unavailable.');
|
|
1983
|
+
* const error = new GraphQLError('Resolver failed.', {
|
|
1984
|
+
* source,
|
|
1985
|
+
* positions: [2],
|
|
1986
|
+
* path: ['greeting'],
|
|
1987
|
+
* originalError,
|
|
1988
|
+
* });
|
|
1989
|
+
*
|
|
1990
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
1991
|
+
* error.path; // => ['greeting']
|
|
1992
|
+
* error.originalError; // => originalError
|
|
1993
|
+
* ```
|
|
1954
1994
|
*/
|
|
1955
1995
|
/**
|
|
1996
|
+
* Creates a GraphQLError instance using the legacy positional constructor.
|
|
1997
|
+
* This deprecated overload will be removed in v17. Prefer the
|
|
1998
|
+
* `GraphQLErrorOptions` object overload, which keeps optional error metadata
|
|
1999
|
+
* in a single options bag.
|
|
2000
|
+
* @param message - Human-readable error message.
|
|
2001
|
+
* @param nodes - AST node or nodes associated with this error.
|
|
2002
|
+
* @param source - Source document used to derive error locations.
|
|
2003
|
+
* @param positions - Character offsets in the source document associated with
|
|
2004
|
+
* this error.
|
|
2005
|
+
* @param path - Response path where this error occurred during execution.
|
|
2006
|
+
* @param originalError - Original error that caused this GraphQLError, if one
|
|
2007
|
+
* exists.
|
|
2008
|
+
* @param extensions - Extension fields to include in the formatted error.
|
|
2009
|
+
* @example
|
|
2010
|
+
* ```ts
|
|
2011
|
+
* import { Source } from 'graphql/language';
|
|
2012
|
+
* import { GraphQLError } from 'graphql/error';
|
|
2013
|
+
*
|
|
2014
|
+
* const source = new Source('{ greeting }');
|
|
2015
|
+
* const originalError = new Error('Database unavailable.');
|
|
2016
|
+
* const error = new GraphQLError(
|
|
2017
|
+
* 'Resolver failed.',
|
|
2018
|
+
* undefined,
|
|
2019
|
+
* source,
|
|
2020
|
+
* [2],
|
|
2021
|
+
* ['greeting'],
|
|
2022
|
+
* originalError,
|
|
2023
|
+
* { code: 'INTERNAL' },
|
|
2024
|
+
* );
|
|
2025
|
+
*
|
|
2026
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
2027
|
+
* error.path; // => ['greeting']
|
|
2028
|
+
* error.originalError; // => originalError
|
|
2029
|
+
* error.extensions; // => { code: 'INTERNAL' }
|
|
2030
|
+
* ```
|
|
1956
2031
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
1957
2032
|
*/
|
|
1958
2033
|
constructor(message, ...rawArgs) {
|
|
@@ -2012,9 +2087,29 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
2012
2087
|
});
|
|
2013
2088
|
}
|
|
2014
2089
|
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2092
|
+
* @returns The built-in string tag for this object.
|
|
2093
|
+
*/
|
|
2015
2094
|
get [Symbol.toStringTag]() {
|
|
2016
2095
|
return "GraphQLError";
|
|
2017
2096
|
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Returns this error as a human-readable message with source locations.
|
|
2099
|
+
* @returns The formatted error string.
|
|
2100
|
+
* @example
|
|
2101
|
+
* ```ts
|
|
2102
|
+
* import { Source } from 'graphql/language';
|
|
2103
|
+
* import { GraphQLError } from 'graphql/error';
|
|
2104
|
+
*
|
|
2105
|
+
* const error = new GraphQLError('Cannot query field "name".', {
|
|
2106
|
+
* source: new Source('{ name }'),
|
|
2107
|
+
* positions: [2],
|
|
2108
|
+
* });
|
|
2109
|
+
*
|
|
2110
|
+
* error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^'
|
|
2111
|
+
* ```
|
|
2112
|
+
*/
|
|
2018
2113
|
toString() {
|
|
2019
2114
|
let output = this.message;
|
|
2020
2115
|
if (this.nodes) {
|
|
@@ -2030,6 +2125,21 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
2030
2125
|
}
|
|
2031
2126
|
return output;
|
|
2032
2127
|
}
|
|
2128
|
+
/**
|
|
2129
|
+
* Returns the JSON representation used when this object is serialized.
|
|
2130
|
+
* @returns The JSON-serializable representation.
|
|
2131
|
+
* @example
|
|
2132
|
+
* ```ts
|
|
2133
|
+
* import { GraphQLError } from 'graphql/error';
|
|
2134
|
+
*
|
|
2135
|
+
* const error = new GraphQLError('Resolver failed.', {
|
|
2136
|
+
* path: ['viewer', 'name'],
|
|
2137
|
+
* extensions: { code: 'INTERNAL' },
|
|
2138
|
+
* });
|
|
2139
|
+
*
|
|
2140
|
+
* error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }
|
|
2141
|
+
* ```
|
|
2142
|
+
*/
|
|
2033
2143
|
toJSON() {
|
|
2034
2144
|
const formattedError = {
|
|
2035
2145
|
message: this.message
|
|
@@ -2060,20 +2170,29 @@ function syntaxError(source, position, description) {
|
|
|
2060
2170
|
|
|
2061
2171
|
// node_modules/graphql/language/ast.mjs
|
|
2062
2172
|
var Location = class {
|
|
2173
|
+
/** The character offset at which this Node begins. */
|
|
2174
|
+
/** The character offset at which this Node ends. */
|
|
2175
|
+
/** The Token at which this Node begins. */
|
|
2176
|
+
/** The Token at which this Node ends. */
|
|
2177
|
+
/** The Source document the AST represents. */
|
|
2063
2178
|
/**
|
|
2064
|
-
*
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
*
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
*
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
*
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
*
|
|
2179
|
+
* Creates a Location instance.
|
|
2180
|
+
* @param startToken - The start token.
|
|
2181
|
+
* @param endToken - The end token.
|
|
2182
|
+
* @param source - Source document used to derive error locations.
|
|
2183
|
+
* @example
|
|
2184
|
+
* ```ts
|
|
2185
|
+
* import { Location, Source, Token, TokenKind } from 'graphql/language';
|
|
2186
|
+
*
|
|
2187
|
+
* const source = new Source('{ hello }');
|
|
2188
|
+
* const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);
|
|
2189
|
+
* const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);
|
|
2190
|
+
* const location = new Location(startToken, endToken, source);
|
|
2191
|
+
*
|
|
2192
|
+
* location.start; // => 0
|
|
2193
|
+
* location.end; // => 9
|
|
2194
|
+
* location.source.body; // => '{ hello }'
|
|
2195
|
+
* ```
|
|
2077
2196
|
*/
|
|
2078
2197
|
constructor(startToken, endToken, source) {
|
|
2079
2198
|
this.start = startToken.start;
|
|
@@ -2082,9 +2201,26 @@ var Location = class {
|
|
|
2082
2201
|
this.endToken = endToken;
|
|
2083
2202
|
this.source = source;
|
|
2084
2203
|
}
|
|
2204
|
+
/**
|
|
2205
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2206
|
+
* @returns The built-in string tag for this object.
|
|
2207
|
+
*/
|
|
2085
2208
|
get [Symbol.toStringTag]() {
|
|
2086
2209
|
return "Location";
|
|
2087
2210
|
}
|
|
2211
|
+
/**
|
|
2212
|
+
* Returns a JSON representation of this location.
|
|
2213
|
+
* @returns The JSON-serializable representation.
|
|
2214
|
+
* @example
|
|
2215
|
+
* ```ts
|
|
2216
|
+
* import { parse } from 'graphql/language';
|
|
2217
|
+
*
|
|
2218
|
+
* const document = parse('{ hello }');
|
|
2219
|
+
* const location = document.loc?.toJSON();
|
|
2220
|
+
*
|
|
2221
|
+
* location; // => { start: 0, end: 9 }
|
|
2222
|
+
* ```
|
|
2223
|
+
*/
|
|
2088
2224
|
toJSON() {
|
|
2089
2225
|
return {
|
|
2090
2226
|
start: this.start,
|
|
@@ -2093,21 +2229,11 @@ var Location = class {
|
|
|
2093
2229
|
}
|
|
2094
2230
|
};
|
|
2095
2231
|
var Token = class {
|
|
2096
|
-
/**
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
/**
|
|
2100
|
-
|
|
2101
|
-
*/
|
|
2102
|
-
/**
|
|
2103
|
-
* The character offset at which this Node ends.
|
|
2104
|
-
*/
|
|
2105
|
-
/**
|
|
2106
|
-
* The 1-indexed line number on which this Token appears.
|
|
2107
|
-
*/
|
|
2108
|
-
/**
|
|
2109
|
-
* The 1-indexed column number at which this Token begins.
|
|
2110
|
-
*/
|
|
2232
|
+
/** The kind of Token. */
|
|
2233
|
+
/** The character offset at which this Node begins. */
|
|
2234
|
+
/** The character offset at which this Node ends. */
|
|
2235
|
+
/** The 1-indexed line number on which this Token appears. */
|
|
2236
|
+
/** The 1-indexed column number at which this Token begins. */
|
|
2111
2237
|
/**
|
|
2112
2238
|
* For non-punctuation tokens, represents the interpreted value of the token.
|
|
2113
2239
|
*
|
|
@@ -2119,6 +2245,26 @@ var Token = class {
|
|
|
2119
2245
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
2120
2246
|
* the last.
|
|
2121
2247
|
*/
|
|
2248
|
+
/** Next token in the token stream, including ignored tokens. */
|
|
2249
|
+
/**
|
|
2250
|
+
* Creates a Token instance.
|
|
2251
|
+
* @param kind - Token kind produced by lexical analysis.
|
|
2252
|
+
* @param start - Character offset where this token begins.
|
|
2253
|
+
* @param end - Character offset where this token ends.
|
|
2254
|
+
* @param line - One-indexed line number where this token begins.
|
|
2255
|
+
* @param column - One-indexed column number where this token begins.
|
|
2256
|
+
* @param value - Interpreted value for non-punctuation tokens.
|
|
2257
|
+
* @example
|
|
2258
|
+
* ```ts
|
|
2259
|
+
* import { Token, TokenKind } from 'graphql/language';
|
|
2260
|
+
*
|
|
2261
|
+
* const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');
|
|
2262
|
+
*
|
|
2263
|
+
* token.kind; // => TokenKind.NAME
|
|
2264
|
+
* token.value; // => 'hello'
|
|
2265
|
+
* token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }
|
|
2266
|
+
* ```
|
|
2267
|
+
*/
|
|
2122
2268
|
constructor(kind, start, end, line, column, value) {
|
|
2123
2269
|
this.kind = kind;
|
|
2124
2270
|
this.start = start;
|
|
@@ -2129,9 +2275,26 @@ var Token = class {
|
|
|
2129
2275
|
this.prev = null;
|
|
2130
2276
|
this.next = null;
|
|
2131
2277
|
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2280
|
+
* @returns The built-in string tag for this object.
|
|
2281
|
+
*/
|
|
2132
2282
|
get [Symbol.toStringTag]() {
|
|
2133
2283
|
return "Token";
|
|
2134
2284
|
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Returns a JSON representation of this token.
|
|
2287
|
+
* @returns The JSON-serializable representation.
|
|
2288
|
+
* @example
|
|
2289
|
+
* ```ts
|
|
2290
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2291
|
+
*
|
|
2292
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2293
|
+
* const token = lexer.advance().toJSON();
|
|
2294
|
+
*
|
|
2295
|
+
* token; // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
2296
|
+
* ```
|
|
2297
|
+
*/
|
|
2135
2298
|
toJSON() {
|
|
2136
2299
|
return {
|
|
2137
2300
|
kind: this.kind,
|
|
@@ -2215,8 +2378,15 @@ var QueryDocumentKeys = {
|
|
|
2215
2378
|
EnumTypeDefinition: ["description", "name", "directives", "values"],
|
|
2216
2379
|
EnumValueDefinition: ["description", "name", "directives"],
|
|
2217
2380
|
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
|
|
2218
|
-
DirectiveDefinition: [
|
|
2381
|
+
DirectiveDefinition: [
|
|
2382
|
+
"description",
|
|
2383
|
+
"name",
|
|
2384
|
+
"arguments",
|
|
2385
|
+
"directives",
|
|
2386
|
+
"locations"
|
|
2387
|
+
],
|
|
2219
2388
|
SchemaExtension: ["directives", "operationTypes"],
|
|
2389
|
+
DirectiveExtension: ["name", "directives"],
|
|
2220
2390
|
ScalarTypeExtension: ["name", "directives"],
|
|
2221
2391
|
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
2222
2392
|
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
@@ -2259,6 +2429,7 @@ var DirectiveLocation;
|
|
|
2259
2429
|
DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE";
|
|
2260
2430
|
DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT";
|
|
2261
2431
|
DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
|
|
2432
|
+
DirectiveLocation2["DIRECTIVE_DEFINITION"] = "DIRECTIVE_DEFINITION";
|
|
2262
2433
|
})(DirectiveLocation || (DirectiveLocation = {}));
|
|
2263
2434
|
|
|
2264
2435
|
// node_modules/graphql/language/kinds.mjs
|
|
@@ -2301,6 +2472,7 @@ var Kind;
|
|
|
2301
2472
|
Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
|
|
2302
2473
|
Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
|
|
2303
2474
|
Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
|
|
2475
|
+
Kind2["DIRECTIVE_EXTENSION"] = "DirectiveExtension";
|
|
2304
2476
|
Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
|
|
2305
2477
|
Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
|
|
2306
2478
|
Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
|
|
@@ -2394,17 +2566,25 @@ var TokenKind;
|
|
|
2394
2566
|
|
|
2395
2567
|
// node_modules/graphql/language/lexer.mjs
|
|
2396
2568
|
var Lexer = class {
|
|
2569
|
+
/** Source document used to derive error locations. */
|
|
2570
|
+
/** Most recent non-ignored token returned by the lexer. */
|
|
2571
|
+
/** Current non-ignored token at the lexer cursor. */
|
|
2572
|
+
/** The (1-indexed) line containing the current token. */
|
|
2573
|
+
/** Character offset where the current line starts. */
|
|
2397
2574
|
/**
|
|
2398
|
-
*
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
*
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
*
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
*
|
|
2575
|
+
* Creates a Lexer instance.
|
|
2576
|
+
* @param source - Source document used to derive error locations.
|
|
2577
|
+
* @example
|
|
2578
|
+
* ```ts
|
|
2579
|
+
* import { Lexer, Source, TokenKind } from 'graphql/language';
|
|
2580
|
+
*
|
|
2581
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2582
|
+
*
|
|
2583
|
+
* lexer.token.kind; // => TokenKind.SOF
|
|
2584
|
+
* lexer.advance().kind; // => TokenKind.BRACE_L
|
|
2585
|
+
* lexer.advance().value; // => 'hello'
|
|
2586
|
+
* lexer.advance().kind; // => TokenKind.BRACE_R
|
|
2587
|
+
* ```
|
|
2408
2588
|
*/
|
|
2409
2589
|
constructor(source) {
|
|
2410
2590
|
const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);
|
|
@@ -2414,11 +2594,26 @@ var Lexer = class {
|
|
|
2414
2594
|
this.line = 1;
|
|
2415
2595
|
this.lineStart = 0;
|
|
2416
2596
|
}
|
|
2597
|
+
/**
|
|
2598
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2599
|
+
* @returns The built-in string tag for this object.
|
|
2600
|
+
*/
|
|
2417
2601
|
get [Symbol.toStringTag]() {
|
|
2418
2602
|
return "Lexer";
|
|
2419
2603
|
}
|
|
2420
2604
|
/**
|
|
2421
2605
|
* Advances the token stream to the next non-ignored token.
|
|
2606
|
+
* @returns The next non-ignored token.
|
|
2607
|
+
* @example
|
|
2608
|
+
* ```ts
|
|
2609
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2610
|
+
*
|
|
2611
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2612
|
+
* const token = lexer.advance();
|
|
2613
|
+
*
|
|
2614
|
+
* token.kind; // => '{'
|
|
2615
|
+
* lexer.token; // => token
|
|
2616
|
+
* ```
|
|
2422
2617
|
*/
|
|
2423
2618
|
advance() {
|
|
2424
2619
|
this.lastToken = this.token;
|
|
@@ -2428,6 +2623,17 @@ var Lexer = class {
|
|
|
2428
2623
|
/**
|
|
2429
2624
|
* Looks ahead and returns the next non-ignored token, but does not change
|
|
2430
2625
|
* the state of Lexer.
|
|
2626
|
+
* @returns The next non-ignored token without advancing the lexer.
|
|
2627
|
+
* @example
|
|
2628
|
+
* ```ts
|
|
2629
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2630
|
+
*
|
|
2631
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2632
|
+
* const token = lexer.lookahead();
|
|
2633
|
+
*
|
|
2634
|
+
* token.kind; // => '{'
|
|
2635
|
+
* lexer.token.kind; // => '<SOF>'
|
|
2636
|
+
* ```
|
|
2431
2637
|
*/
|
|
2432
2638
|
lookahead() {
|
|
2433
2639
|
let token = this.token;
|
|
@@ -3048,6 +3254,29 @@ spurious results.`);
|
|
|
3048
3254
|
|
|
3049
3255
|
// node_modules/graphql/language/source.mjs
|
|
3050
3256
|
var Source = class {
|
|
3257
|
+
/** The GraphQL source text. */
|
|
3258
|
+
/** Name used in diagnostics for this source, such as a file path or request name. */
|
|
3259
|
+
/** One-indexed line and column where this source begins. */
|
|
3260
|
+
/**
|
|
3261
|
+
* Creates a Source instance.
|
|
3262
|
+
* @param body - The GraphQL source text.
|
|
3263
|
+
* @param name - Name used in diagnostics for this source.
|
|
3264
|
+
* @param locationOffset - One-indexed line and column where this source begins.
|
|
3265
|
+
* @example
|
|
3266
|
+
* ```ts
|
|
3267
|
+
* import { Source } from 'graphql/language';
|
|
3268
|
+
*
|
|
3269
|
+
* const source = new Source(
|
|
3270
|
+
* 'type Query { greeting: String }',
|
|
3271
|
+
* 'schema.graphql',
|
|
3272
|
+
* { line: 10, column: 1 },
|
|
3273
|
+
* );
|
|
3274
|
+
*
|
|
3275
|
+
* source.body; // => 'type Query { greeting: String }'
|
|
3276
|
+
* source.name; // => 'schema.graphql'
|
|
3277
|
+
* source.locationOffset; // => { line: 10, column: 1 }
|
|
3278
|
+
* ```
|
|
3279
|
+
*/
|
|
3051
3280
|
constructor(body, name = "GraphQL request", locationOffset = {
|
|
3052
3281
|
line: 1,
|
|
3053
3282
|
column: 1
|
|
@@ -3065,6 +3294,10 @@ var Source = class {
|
|
|
3065
3294
|
"column in locationOffset is 1-indexed and must be positive."
|
|
3066
3295
|
);
|
|
3067
3296
|
}
|
|
3297
|
+
/**
|
|
3298
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
3299
|
+
* @returns The built-in string tag for this object.
|
|
3300
|
+
*/
|
|
3068
3301
|
get [Symbol.toStringTag]() {
|
|
3069
3302
|
return "Source";
|
|
3070
3303
|
}
|
|
@@ -3100,6 +3333,8 @@ var Parser = class {
|
|
|
3100
3333
|
}
|
|
3101
3334
|
/**
|
|
3102
3335
|
* Converts a name lex token into a name parse node.
|
|
3336
|
+
*
|
|
3337
|
+
* @internal
|
|
3103
3338
|
*/
|
|
3104
3339
|
parseName() {
|
|
3105
3340
|
const token = this.expectToken(TokenKind.NAME);
|
|
@@ -3111,6 +3346,8 @@ var Parser = class {
|
|
|
3111
3346
|
// Implements the parsing rules in the Document section.
|
|
3112
3347
|
/**
|
|
3113
3348
|
* Document : Definition+
|
|
3349
|
+
*
|
|
3350
|
+
* @internal
|
|
3114
3351
|
*/
|
|
3115
3352
|
parseDocument() {
|
|
3116
3353
|
return this.node(this._lexer.token, {
|
|
@@ -3144,6 +3381,8 @@ var Parser = class {
|
|
|
3144
3381
|
* - UnionTypeDefinition
|
|
3145
3382
|
* - EnumTypeDefinition
|
|
3146
3383
|
* - InputObjectTypeDefinition
|
|
3384
|
+
*
|
|
3385
|
+
* @internal
|
|
3147
3386
|
*/
|
|
3148
3387
|
parseDefinition() {
|
|
3149
3388
|
if (this.peek(TokenKind.BRACE_L)) {
|
|
@@ -3204,6 +3443,8 @@ var Parser = class {
|
|
|
3204
3443
|
* OperationDefinition :
|
|
3205
3444
|
* - SelectionSet
|
|
3206
3445
|
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
|
|
3446
|
+
*
|
|
3447
|
+
* @internal
|
|
3207
3448
|
*/
|
|
3208
3449
|
parseOperationDefinition() {
|
|
3209
3450
|
const start = this._lexer.token;
|
|
@@ -3236,6 +3477,8 @@ var Parser = class {
|
|
|
3236
3477
|
}
|
|
3237
3478
|
/**
|
|
3238
3479
|
* OperationType : one of query mutation subscription
|
|
3480
|
+
*
|
|
3481
|
+
* @internal
|
|
3239
3482
|
*/
|
|
3240
3483
|
parseOperationType() {
|
|
3241
3484
|
const operationToken = this.expectToken(TokenKind.NAME);
|
|
@@ -3251,6 +3494,8 @@ var Parser = class {
|
|
|
3251
3494
|
}
|
|
3252
3495
|
/**
|
|
3253
3496
|
* VariableDefinitions : ( VariableDefinition+ )
|
|
3497
|
+
*
|
|
3498
|
+
* @internal
|
|
3254
3499
|
*/
|
|
3255
3500
|
parseVariableDefinitions() {
|
|
3256
3501
|
return this.optionalMany(
|
|
@@ -3261,6 +3506,8 @@ var Parser = class {
|
|
|
3261
3506
|
}
|
|
3262
3507
|
/**
|
|
3263
3508
|
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
|
|
3509
|
+
*
|
|
3510
|
+
* @internal
|
|
3264
3511
|
*/
|
|
3265
3512
|
parseVariableDefinition() {
|
|
3266
3513
|
return this.node(this._lexer.token, {
|
|
@@ -3274,6 +3521,8 @@ var Parser = class {
|
|
|
3274
3521
|
}
|
|
3275
3522
|
/**
|
|
3276
3523
|
* Variable : $ Name
|
|
3524
|
+
*
|
|
3525
|
+
* @internal
|
|
3277
3526
|
*/
|
|
3278
3527
|
parseVariable() {
|
|
3279
3528
|
const start = this._lexer.token;
|
|
@@ -3287,6 +3536,8 @@ var Parser = class {
|
|
|
3287
3536
|
* ```
|
|
3288
3537
|
* SelectionSet : { Selection+ }
|
|
3289
3538
|
* ```
|
|
3539
|
+
*
|
|
3540
|
+
* @internal
|
|
3290
3541
|
*/
|
|
3291
3542
|
parseSelectionSet() {
|
|
3292
3543
|
return this.node(this._lexer.token, {
|
|
@@ -3303,6 +3554,8 @@ var Parser = class {
|
|
|
3303
3554
|
* - Field
|
|
3304
3555
|
* - FragmentSpread
|
|
3305
3556
|
* - InlineFragment
|
|
3557
|
+
*
|
|
3558
|
+
* @internal
|
|
3306
3559
|
*/
|
|
3307
3560
|
parseSelection() {
|
|
3308
3561
|
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
|
|
@@ -3311,6 +3564,8 @@ var Parser = class {
|
|
|
3311
3564
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
3312
3565
|
*
|
|
3313
3566
|
* Alias : Name :
|
|
3567
|
+
*
|
|
3568
|
+
* @internal
|
|
3314
3569
|
*/
|
|
3315
3570
|
parseField() {
|
|
3316
3571
|
const start = this._lexer.token;
|
|
@@ -3334,6 +3589,8 @@ var Parser = class {
|
|
|
3334
3589
|
}
|
|
3335
3590
|
/**
|
|
3336
3591
|
* Arguments[Const] : ( Argument[?Const]+ )
|
|
3592
|
+
*
|
|
3593
|
+
* @internal
|
|
3337
3594
|
*/
|
|
3338
3595
|
parseArguments(isConst) {
|
|
3339
3596
|
const item = isConst ? this.parseConstArgument : this.parseArgument;
|
|
@@ -3341,6 +3598,8 @@ var Parser = class {
|
|
|
3341
3598
|
}
|
|
3342
3599
|
/**
|
|
3343
3600
|
* Argument[Const] : Name : Value[?Const]
|
|
3601
|
+
*
|
|
3602
|
+
* @internal
|
|
3344
3603
|
*/
|
|
3345
3604
|
parseArgument(isConst = false) {
|
|
3346
3605
|
const start = this._lexer.token;
|
|
@@ -3362,6 +3621,8 @@ var Parser = class {
|
|
|
3362
3621
|
* FragmentSpread : ... FragmentName Directives?
|
|
3363
3622
|
*
|
|
3364
3623
|
* InlineFragment : ... TypeCondition? Directives? SelectionSet
|
|
3624
|
+
*
|
|
3625
|
+
* @internal
|
|
3365
3626
|
*/
|
|
3366
3627
|
parseFragment() {
|
|
3367
3628
|
const start = this._lexer.token;
|
|
@@ -3386,6 +3647,8 @@ var Parser = class {
|
|
|
3386
3647
|
* - fragment FragmentName on TypeCondition Directives? SelectionSet
|
|
3387
3648
|
*
|
|
3388
3649
|
* TypeCondition : NamedType
|
|
3650
|
+
*
|
|
3651
|
+
* @internal
|
|
3389
3652
|
*/
|
|
3390
3653
|
parseFragmentDefinition() {
|
|
3391
3654
|
const start = this._lexer.token;
|
|
@@ -3413,6 +3676,8 @@ var Parser = class {
|
|
|
3413
3676
|
}
|
|
3414
3677
|
/**
|
|
3415
3678
|
* FragmentName : Name but not `on`
|
|
3679
|
+
*
|
|
3680
|
+
* @internal
|
|
3416
3681
|
*/
|
|
3417
3682
|
parseFragmentName() {
|
|
3418
3683
|
if (this._lexer.token.value === "on") {
|
|
@@ -3438,6 +3703,8 @@ var Parser = class {
|
|
|
3438
3703
|
* NullValue : `null`
|
|
3439
3704
|
*
|
|
3440
3705
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
3706
|
+
*
|
|
3707
|
+
* @internal
|
|
3441
3708
|
*/
|
|
3442
3709
|
parseValueLiteral(isConst) {
|
|
3443
3710
|
const token = this._lexer.token;
|
|
@@ -3519,6 +3786,8 @@ var Parser = class {
|
|
|
3519
3786
|
* ListValue[Const] :
|
|
3520
3787
|
* - [ ]
|
|
3521
3788
|
* - [ Value[?Const]+ ]
|
|
3789
|
+
*
|
|
3790
|
+
* @internal
|
|
3522
3791
|
*/
|
|
3523
3792
|
parseList(isConst) {
|
|
3524
3793
|
const item = () => this.parseValueLiteral(isConst);
|
|
@@ -3533,6 +3802,8 @@ var Parser = class {
|
|
|
3533
3802
|
* - { }
|
|
3534
3803
|
* - { ObjectField[?Const]+ }
|
|
3535
3804
|
* ```
|
|
3805
|
+
*
|
|
3806
|
+
* @internal
|
|
3536
3807
|
*/
|
|
3537
3808
|
parseObject(isConst) {
|
|
3538
3809
|
const item = () => this.parseObjectField(isConst);
|
|
@@ -3543,6 +3814,8 @@ var Parser = class {
|
|
|
3543
3814
|
}
|
|
3544
3815
|
/**
|
|
3545
3816
|
* ObjectField[Const] : Name : Value[?Const]
|
|
3817
|
+
*
|
|
3818
|
+
* @internal
|
|
3546
3819
|
*/
|
|
3547
3820
|
parseObjectField(isConst) {
|
|
3548
3821
|
const start = this._lexer.token;
|
|
@@ -3557,6 +3830,8 @@ var Parser = class {
|
|
|
3557
3830
|
// Implements the parsing rules in the Directives section.
|
|
3558
3831
|
/**
|
|
3559
3832
|
* Directives[Const] : Directive[?Const]+
|
|
3833
|
+
*
|
|
3834
|
+
* @internal
|
|
3560
3835
|
*/
|
|
3561
3836
|
parseDirectives(isConst) {
|
|
3562
3837
|
const directives = [];
|
|
@@ -3572,6 +3847,8 @@ var Parser = class {
|
|
|
3572
3847
|
* ```
|
|
3573
3848
|
* Directive[Const] : @ Name Arguments[?Const]?
|
|
3574
3849
|
* ```
|
|
3850
|
+
*
|
|
3851
|
+
* @internal
|
|
3575
3852
|
*/
|
|
3576
3853
|
parseDirective(isConst) {
|
|
3577
3854
|
const start = this._lexer.token;
|
|
@@ -3588,6 +3865,8 @@ var Parser = class {
|
|
|
3588
3865
|
* - NamedType
|
|
3589
3866
|
* - ListType
|
|
3590
3867
|
* - NonNullType
|
|
3868
|
+
*
|
|
3869
|
+
* @internal
|
|
3591
3870
|
*/
|
|
3592
3871
|
parseTypeReference() {
|
|
3593
3872
|
const start = this._lexer.token;
|
|
@@ -3612,6 +3891,8 @@ var Parser = class {
|
|
|
3612
3891
|
}
|
|
3613
3892
|
/**
|
|
3614
3893
|
* NamedType : Name
|
|
3894
|
+
*
|
|
3895
|
+
* @internal
|
|
3615
3896
|
*/
|
|
3616
3897
|
parseNamedType() {
|
|
3617
3898
|
return this.node(this._lexer.token, {
|
|
@@ -3625,6 +3906,8 @@ var Parser = class {
|
|
|
3625
3906
|
}
|
|
3626
3907
|
/**
|
|
3627
3908
|
* Description : StringValue
|
|
3909
|
+
*
|
|
3910
|
+
* @internal
|
|
3628
3911
|
*/
|
|
3629
3912
|
parseDescription() {
|
|
3630
3913
|
if (this.peekDescription()) {
|
|
@@ -3635,6 +3918,8 @@ var Parser = class {
|
|
|
3635
3918
|
* ```
|
|
3636
3919
|
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
|
|
3637
3920
|
* ```
|
|
3921
|
+
*
|
|
3922
|
+
* @internal
|
|
3638
3923
|
*/
|
|
3639
3924
|
parseSchemaDefinition() {
|
|
3640
3925
|
const start = this._lexer.token;
|
|
@@ -3655,6 +3940,8 @@ var Parser = class {
|
|
|
3655
3940
|
}
|
|
3656
3941
|
/**
|
|
3657
3942
|
* OperationTypeDefinition : OperationType : NamedType
|
|
3943
|
+
*
|
|
3944
|
+
* @internal
|
|
3658
3945
|
*/
|
|
3659
3946
|
parseOperationTypeDefinition() {
|
|
3660
3947
|
const start = this._lexer.token;
|
|
@@ -3669,6 +3956,8 @@ var Parser = class {
|
|
|
3669
3956
|
}
|
|
3670
3957
|
/**
|
|
3671
3958
|
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
|
|
3959
|
+
*
|
|
3960
|
+
* @internal
|
|
3672
3961
|
*/
|
|
3673
3962
|
parseScalarTypeDefinition() {
|
|
3674
3963
|
const start = this._lexer.token;
|
|
@@ -3687,6 +3976,8 @@ var Parser = class {
|
|
|
3687
3976
|
* ObjectTypeDefinition :
|
|
3688
3977
|
* Description?
|
|
3689
3978
|
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
|
|
3979
|
+
*
|
|
3980
|
+
* @internal
|
|
3690
3981
|
*/
|
|
3691
3982
|
parseObjectTypeDefinition() {
|
|
3692
3983
|
const start = this._lexer.token;
|
|
@@ -3709,6 +4000,8 @@ var Parser = class {
|
|
|
3709
4000
|
* ImplementsInterfaces :
|
|
3710
4001
|
* - implements `&`? NamedType
|
|
3711
4002
|
* - ImplementsInterfaces & NamedType
|
|
4003
|
+
*
|
|
4004
|
+
* @internal
|
|
3712
4005
|
*/
|
|
3713
4006
|
parseImplementsInterfaces() {
|
|
3714
4007
|
return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : [];
|
|
@@ -3717,6 +4010,8 @@ var Parser = class {
|
|
|
3717
4010
|
* ```
|
|
3718
4011
|
* FieldsDefinition : { FieldDefinition+ }
|
|
3719
4012
|
* ```
|
|
4013
|
+
*
|
|
4014
|
+
* @internal
|
|
3720
4015
|
*/
|
|
3721
4016
|
parseFieldsDefinition() {
|
|
3722
4017
|
return this.optionalMany(
|
|
@@ -3728,6 +4023,8 @@ var Parser = class {
|
|
|
3728
4023
|
/**
|
|
3729
4024
|
* FieldDefinition :
|
|
3730
4025
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
4026
|
+
*
|
|
4027
|
+
* @internal
|
|
3731
4028
|
*/
|
|
3732
4029
|
parseFieldDefinition() {
|
|
3733
4030
|
const start = this._lexer.token;
|
|
@@ -3748,6 +4045,8 @@ var Parser = class {
|
|
|
3748
4045
|
}
|
|
3749
4046
|
/**
|
|
3750
4047
|
* ArgumentsDefinition : ( InputValueDefinition+ )
|
|
4048
|
+
*
|
|
4049
|
+
* @internal
|
|
3751
4050
|
*/
|
|
3752
4051
|
parseArgumentDefs() {
|
|
3753
4052
|
return this.optionalMany(
|
|
@@ -3759,6 +4058,8 @@ var Parser = class {
|
|
|
3759
4058
|
/**
|
|
3760
4059
|
* InputValueDefinition :
|
|
3761
4060
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
4061
|
+
*
|
|
4062
|
+
* @internal
|
|
3762
4063
|
*/
|
|
3763
4064
|
parseInputValueDef() {
|
|
3764
4065
|
const start = this._lexer.token;
|
|
@@ -3783,6 +4084,8 @@ var Parser = class {
|
|
|
3783
4084
|
/**
|
|
3784
4085
|
* InterfaceTypeDefinition :
|
|
3785
4086
|
* - Description? interface Name Directives[Const]? FieldsDefinition?
|
|
4087
|
+
*
|
|
4088
|
+
* @internal
|
|
3786
4089
|
*/
|
|
3787
4090
|
parseInterfaceTypeDefinition() {
|
|
3788
4091
|
const start = this._lexer.token;
|
|
@@ -3804,6 +4107,8 @@ var Parser = class {
|
|
|
3804
4107
|
/**
|
|
3805
4108
|
* UnionTypeDefinition :
|
|
3806
4109
|
* - Description? union Name Directives[Const]? UnionMemberTypes?
|
|
4110
|
+
*
|
|
4111
|
+
* @internal
|
|
3807
4112
|
*/
|
|
3808
4113
|
parseUnionTypeDefinition() {
|
|
3809
4114
|
const start = this._lexer.token;
|
|
@@ -3824,6 +4129,8 @@ var Parser = class {
|
|
|
3824
4129
|
* UnionMemberTypes :
|
|
3825
4130
|
* - = `|`? NamedType
|
|
3826
4131
|
* - UnionMemberTypes | NamedType
|
|
4132
|
+
*
|
|
4133
|
+
* @internal
|
|
3827
4134
|
*/
|
|
3828
4135
|
parseUnionMemberTypes() {
|
|
3829
4136
|
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
|
|
@@ -3831,6 +4138,8 @@ var Parser = class {
|
|
|
3831
4138
|
/**
|
|
3832
4139
|
* EnumTypeDefinition :
|
|
3833
4140
|
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
|
|
4141
|
+
*
|
|
4142
|
+
* @internal
|
|
3834
4143
|
*/
|
|
3835
4144
|
parseEnumTypeDefinition() {
|
|
3836
4145
|
const start = this._lexer.token;
|
|
@@ -3851,6 +4160,8 @@ var Parser = class {
|
|
|
3851
4160
|
* ```
|
|
3852
4161
|
* EnumValuesDefinition : { EnumValueDefinition+ }
|
|
3853
4162
|
* ```
|
|
4163
|
+
*
|
|
4164
|
+
* @internal
|
|
3854
4165
|
*/
|
|
3855
4166
|
parseEnumValuesDefinition() {
|
|
3856
4167
|
return this.optionalMany(
|
|
@@ -3861,6 +4172,8 @@ var Parser = class {
|
|
|
3861
4172
|
}
|
|
3862
4173
|
/**
|
|
3863
4174
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
4175
|
+
*
|
|
4176
|
+
* @internal
|
|
3864
4177
|
*/
|
|
3865
4178
|
parseEnumValueDefinition() {
|
|
3866
4179
|
const start = this._lexer.token;
|
|
@@ -3876,6 +4189,8 @@ var Parser = class {
|
|
|
3876
4189
|
}
|
|
3877
4190
|
/**
|
|
3878
4191
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
4192
|
+
*
|
|
4193
|
+
* @internal
|
|
3879
4194
|
*/
|
|
3880
4195
|
parseEnumValueName() {
|
|
3881
4196
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") {
|
|
@@ -3892,6 +4207,8 @@ var Parser = class {
|
|
|
3892
4207
|
/**
|
|
3893
4208
|
* InputObjectTypeDefinition :
|
|
3894
4209
|
* - Description? input Name Directives[Const]? InputFieldsDefinition?
|
|
4210
|
+
*
|
|
4211
|
+
* @internal
|
|
3895
4212
|
*/
|
|
3896
4213
|
parseInputObjectTypeDefinition() {
|
|
3897
4214
|
const start = this._lexer.token;
|
|
@@ -3912,6 +4229,8 @@ var Parser = class {
|
|
|
3912
4229
|
* ```
|
|
3913
4230
|
* InputFieldsDefinition : { InputValueDefinition+ }
|
|
3914
4231
|
* ```
|
|
4232
|
+
*
|
|
4233
|
+
* @internal
|
|
3915
4234
|
*/
|
|
3916
4235
|
parseInputFieldsDefinition() {
|
|
3917
4236
|
return this.optionalMany(
|
|
@@ -3932,6 +4251,9 @@ var Parser = class {
|
|
|
3932
4251
|
* - UnionTypeExtension
|
|
3933
4252
|
* - EnumTypeExtension
|
|
3934
4253
|
* - InputObjectTypeDefinition
|
|
4254
|
+
* - DirectiveDefinitionExtension
|
|
4255
|
+
*
|
|
4256
|
+
* @internal
|
|
3935
4257
|
*/
|
|
3936
4258
|
parseTypeSystemExtension() {
|
|
3937
4259
|
const keywordToken = this._lexer.lookahead();
|
|
@@ -3951,6 +4273,11 @@ var Parser = class {
|
|
|
3951
4273
|
return this.parseEnumTypeExtension();
|
|
3952
4274
|
case "input":
|
|
3953
4275
|
return this.parseInputObjectTypeExtension();
|
|
4276
|
+
case "directive":
|
|
4277
|
+
if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
|
|
4278
|
+
return this.parseDirectiveDefinitionExtension();
|
|
4279
|
+
}
|
|
4280
|
+
break;
|
|
3954
4281
|
}
|
|
3955
4282
|
}
|
|
3956
4283
|
throw this.unexpected(keywordToken);
|
|
@@ -3961,6 +4288,8 @@ var Parser = class {
|
|
|
3961
4288
|
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
|
|
3962
4289
|
* - extend schema Directives[Const]
|
|
3963
4290
|
* ```
|
|
4291
|
+
*
|
|
4292
|
+
* @internal
|
|
3964
4293
|
*/
|
|
3965
4294
|
parseSchemaExtension() {
|
|
3966
4295
|
const start = this._lexer.token;
|
|
@@ -3984,6 +4313,8 @@ var Parser = class {
|
|
|
3984
4313
|
/**
|
|
3985
4314
|
* ScalarTypeExtension :
|
|
3986
4315
|
* - extend scalar Name Directives[Const]
|
|
4316
|
+
*
|
|
4317
|
+
* @internal
|
|
3987
4318
|
*/
|
|
3988
4319
|
parseScalarTypeExtension() {
|
|
3989
4320
|
const start = this._lexer.token;
|
|
@@ -4005,6 +4336,8 @@ var Parser = class {
|
|
|
4005
4336
|
* - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
4006
4337
|
* - extend type Name ImplementsInterfaces? Directives[Const]
|
|
4007
4338
|
* - extend type Name ImplementsInterfaces
|
|
4339
|
+
*
|
|
4340
|
+
* @internal
|
|
4008
4341
|
*/
|
|
4009
4342
|
parseObjectTypeExtension() {
|
|
4010
4343
|
const start = this._lexer.token;
|
|
@@ -4030,6 +4363,8 @@ var Parser = class {
|
|
|
4030
4363
|
* - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
4031
4364
|
* - extend interface Name ImplementsInterfaces? Directives[Const]
|
|
4032
4365
|
* - extend interface Name ImplementsInterfaces
|
|
4366
|
+
*
|
|
4367
|
+
* @internal
|
|
4033
4368
|
*/
|
|
4034
4369
|
parseInterfaceTypeExtension() {
|
|
4035
4370
|
const start = this._lexer.token;
|
|
@@ -4054,6 +4389,8 @@ var Parser = class {
|
|
|
4054
4389
|
* UnionTypeExtension :
|
|
4055
4390
|
* - extend union Name Directives[Const]? UnionMemberTypes
|
|
4056
4391
|
* - extend union Name Directives[Const]
|
|
4392
|
+
*
|
|
4393
|
+
* @internal
|
|
4057
4394
|
*/
|
|
4058
4395
|
parseUnionTypeExtension() {
|
|
4059
4396
|
const start = this._lexer.token;
|
|
@@ -4076,6 +4413,8 @@ var Parser = class {
|
|
|
4076
4413
|
* EnumTypeExtension :
|
|
4077
4414
|
* - extend enum Name Directives[Const]? EnumValuesDefinition
|
|
4078
4415
|
* - extend enum Name Directives[Const]
|
|
4416
|
+
*
|
|
4417
|
+
* @internal
|
|
4079
4418
|
*/
|
|
4080
4419
|
parseEnumTypeExtension() {
|
|
4081
4420
|
const start = this._lexer.token;
|
|
@@ -4098,6 +4437,8 @@ var Parser = class {
|
|
|
4098
4437
|
* InputObjectTypeExtension :
|
|
4099
4438
|
* - extend input Name Directives[Const]? InputFieldsDefinition
|
|
4100
4439
|
* - extend input Name Directives[Const]
|
|
4440
|
+
*
|
|
4441
|
+
* @internal
|
|
4101
4442
|
*/
|
|
4102
4443
|
parseInputObjectTypeExtension() {
|
|
4103
4444
|
const start = this._lexer.token;
|
|
@@ -4116,11 +4457,29 @@ var Parser = class {
|
|
|
4116
4457
|
fields
|
|
4117
4458
|
});
|
|
4118
4459
|
}
|
|
4460
|
+
parseDirectiveDefinitionExtension() {
|
|
4461
|
+
const start = this._lexer.token;
|
|
4462
|
+
this.expectKeyword("extend");
|
|
4463
|
+
this.expectKeyword("directive");
|
|
4464
|
+
this.expectToken(TokenKind.AT);
|
|
4465
|
+
const name = this.parseName();
|
|
4466
|
+
const directives = this.parseConstDirectives();
|
|
4467
|
+
if (directives.length === 0) {
|
|
4468
|
+
throw this.unexpected();
|
|
4469
|
+
}
|
|
4470
|
+
return this.node(start, {
|
|
4471
|
+
kind: Kind.DIRECTIVE_EXTENSION,
|
|
4472
|
+
name,
|
|
4473
|
+
directives
|
|
4474
|
+
});
|
|
4475
|
+
}
|
|
4119
4476
|
/**
|
|
4120
4477
|
* ```
|
|
4121
4478
|
* DirectiveDefinition :
|
|
4122
4479
|
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
|
|
4123
4480
|
* ```
|
|
4481
|
+
*
|
|
4482
|
+
* @internal
|
|
4124
4483
|
*/
|
|
4125
4484
|
parseDirectiveDefinition() {
|
|
4126
4485
|
const start = this._lexer.token;
|
|
@@ -4129,6 +4488,7 @@ var Parser = class {
|
|
|
4129
4488
|
this.expectToken(TokenKind.AT);
|
|
4130
4489
|
const name = this.parseName();
|
|
4131
4490
|
const args = this.parseArgumentDefs();
|
|
4491
|
+
const directives = this._options.experimentalDirectivesOnDirectiveDefinitions ? this.parseConstDirectives() : [];
|
|
4132
4492
|
const repeatable = this.expectOptionalKeyword("repeatable");
|
|
4133
4493
|
this.expectKeyword("on");
|
|
4134
4494
|
const locations = this.parseDirectiveLocations();
|
|
@@ -4137,6 +4497,7 @@ var Parser = class {
|
|
|
4137
4497
|
description,
|
|
4138
4498
|
name,
|
|
4139
4499
|
arguments: args,
|
|
4500
|
+
directives,
|
|
4140
4501
|
repeatable,
|
|
4141
4502
|
locations
|
|
4142
4503
|
});
|
|
@@ -4145,6 +4506,8 @@ var Parser = class {
|
|
|
4145
4506
|
* DirectiveLocations :
|
|
4146
4507
|
* - `|`? DirectiveLocation
|
|
4147
4508
|
* - DirectiveLocations | DirectiveLocation
|
|
4509
|
+
*
|
|
4510
|
+
* @internal
|
|
4148
4511
|
*/
|
|
4149
4512
|
parseDirectiveLocations() {
|
|
4150
4513
|
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
|
|
@@ -4175,6 +4538,7 @@ var Parser = class {
|
|
|
4175
4538
|
* `ENUM_VALUE`
|
|
4176
4539
|
* `INPUT_OBJECT`
|
|
4177
4540
|
* `INPUT_FIELD_DEFINITION`
|
|
4541
|
+
* `DIRECTIVE_DEFINITION`
|
|
4178
4542
|
*/
|
|
4179
4543
|
parseDirectiveLocation() {
|
|
4180
4544
|
const start = this._lexer.token;
|
|
@@ -4192,6 +4556,19 @@ var Parser = class {
|
|
|
4192
4556
|
* - Name . Name ( Name : )
|
|
4193
4557
|
* - \@ Name
|
|
4194
4558
|
* - \@ Name ( Name : )
|
|
4559
|
+
* @returns Parsed schema coordinate AST.
|
|
4560
|
+
* @example
|
|
4561
|
+
* ```ts
|
|
4562
|
+
* import { Parser, Source } from 'graphql/language';
|
|
4563
|
+
*
|
|
4564
|
+
* const typeCoordinate = new Parser(new Source('User.name')).parseSchemaCoordinate();
|
|
4565
|
+
* const directiveCoordinate = new Parser(new Source('@include(if:)')).parseSchemaCoordinate();
|
|
4566
|
+
*
|
|
4567
|
+
* typeCoordinate.name.value; // => 'User'
|
|
4568
|
+
* typeCoordinate.memberName?.value; // => 'name'
|
|
4569
|
+
* directiveCoordinate.name.value; // => 'deprecated'
|
|
4570
|
+
* directiveCoordinate.argumentName?.value; // => 'reason'
|
|
4571
|
+
* ```
|
|
4195
4572
|
*/
|
|
4196
4573
|
parseSchemaCoordinate() {
|
|
4197
4574
|
const start = this._lexer.token;
|
|
@@ -4244,6 +4621,8 @@ var Parser = class {
|
|
|
4244
4621
|
* Returns a node that, if configured to do so, sets a "loc" field as a
|
|
4245
4622
|
* location object, used to identify the place in the source that created a
|
|
4246
4623
|
* given parsed object.
|
|
4624
|
+
*
|
|
4625
|
+
* @internal
|
|
4247
4626
|
*/
|
|
4248
4627
|
node(startToken, node) {
|
|
4249
4628
|
if (this._options.noLocation !== true) {
|
|
@@ -4257,6 +4636,8 @@ var Parser = class {
|
|
|
4257
4636
|
}
|
|
4258
4637
|
/**
|
|
4259
4638
|
* Determines if the next token is of a given kind
|
|
4639
|
+
*
|
|
4640
|
+
* @internal
|
|
4260
4641
|
*/
|
|
4261
4642
|
peek(kind) {
|
|
4262
4643
|
return this._lexer.token.kind === kind;
|
|
@@ -4264,6 +4645,8 @@ var Parser = class {
|
|
|
4264
4645
|
/**
|
|
4265
4646
|
* If the next token is of the given kind, return that token after advancing the lexer.
|
|
4266
4647
|
* Otherwise, do not change the parser state and throw an error.
|
|
4648
|
+
*
|
|
4649
|
+
* @internal
|
|
4267
4650
|
*/
|
|
4268
4651
|
expectToken(kind) {
|
|
4269
4652
|
const token = this._lexer.token;
|
|
@@ -4280,6 +4663,8 @@ var Parser = class {
|
|
|
4280
4663
|
/**
|
|
4281
4664
|
* If the next token is of the given kind, return "true" after advancing the lexer.
|
|
4282
4665
|
* Otherwise, do not change the parser state and return "false".
|
|
4666
|
+
*
|
|
4667
|
+
* @internal
|
|
4283
4668
|
*/
|
|
4284
4669
|
expectOptionalToken(kind) {
|
|
4285
4670
|
const token = this._lexer.token;
|
|
@@ -4292,6 +4677,8 @@ var Parser = class {
|
|
|
4292
4677
|
/**
|
|
4293
4678
|
* If the next token is a given keyword, advance the lexer.
|
|
4294
4679
|
* Otherwise, do not change the parser state and throw an error.
|
|
4680
|
+
*
|
|
4681
|
+
* @internal
|
|
4295
4682
|
*/
|
|
4296
4683
|
expectKeyword(value) {
|
|
4297
4684
|
const token = this._lexer.token;
|
|
@@ -4308,6 +4695,8 @@ var Parser = class {
|
|
|
4308
4695
|
/**
|
|
4309
4696
|
* If the next token is a given keyword, return "true" after advancing the lexer.
|
|
4310
4697
|
* Otherwise, do not change the parser state and return "false".
|
|
4698
|
+
*
|
|
4699
|
+
* @internal
|
|
4311
4700
|
*/
|
|
4312
4701
|
expectOptionalKeyword(value) {
|
|
4313
4702
|
const token = this._lexer.token;
|
|
@@ -4319,6 +4708,8 @@ var Parser = class {
|
|
|
4319
4708
|
}
|
|
4320
4709
|
/**
|
|
4321
4710
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
4711
|
+
*
|
|
4712
|
+
* @internal
|
|
4322
4713
|
*/
|
|
4323
4714
|
unexpected(atToken) {
|
|
4324
4715
|
const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
|
|
@@ -4332,6 +4723,8 @@ var Parser = class {
|
|
|
4332
4723
|
* Returns a possibly empty list of parse nodes, determined by the parseFn.
|
|
4333
4724
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4334
4725
|
* Advances the parser to the next lex token after the closing token.
|
|
4726
|
+
*
|
|
4727
|
+
* @internal
|
|
4335
4728
|
*/
|
|
4336
4729
|
any(openKind, parseFn, closeKind) {
|
|
4337
4730
|
this.expectToken(openKind);
|
|
@@ -4346,6 +4739,8 @@ var Parser = class {
|
|
|
4346
4739
|
* It can be empty only if open token is missing otherwise it will always return non-empty list
|
|
4347
4740
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4348
4741
|
* Advances the parser to the next lex token after the closing token.
|
|
4742
|
+
*
|
|
4743
|
+
* @internal
|
|
4349
4744
|
*/
|
|
4350
4745
|
optionalMany(openKind, parseFn, closeKind) {
|
|
4351
4746
|
if (this.expectOptionalToken(openKind)) {
|
|
@@ -4361,6 +4756,8 @@ var Parser = class {
|
|
|
4361
4756
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
4362
4757
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4363
4758
|
* Advances the parser to the next lex token after the closing token.
|
|
4759
|
+
*
|
|
4760
|
+
* @internal
|
|
4364
4761
|
*/
|
|
4365
4762
|
many(openKind, parseFn, closeKind) {
|
|
4366
4763
|
this.expectToken(openKind);
|
|
@@ -4374,6 +4771,8 @@ var Parser = class {
|
|
|
4374
4771
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
4375
4772
|
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
|
|
4376
4773
|
* Advances the parser to the next lex token after last item in the list.
|
|
4774
|
+
*
|
|
4775
|
+
* @internal
|
|
4377
4776
|
*/
|
|
4378
4777
|
delimitedMany(delimiterKind, parseFn) {
|
|
4379
4778
|
this.expectOptionalToken(delimiterKind);
|
|
@@ -4467,7 +4866,8 @@ function parseDocument(source) {
|
|
|
4467
4866
|
if (!docCache.has(cacheKey)) {
|
|
4468
4867
|
var parsed = parse(source, {
|
|
4469
4868
|
experimentalFragmentVariables,
|
|
4470
|
-
allowLegacyFragmentVariables: experimentalFragmentVariables
|
|
4869
|
+
allowLegacyFragmentVariables: experimentalFragmentVariables,
|
|
4870
|
+
experimentalFragmentArguments: experimentalFragmentVariables
|
|
4471
4871
|
});
|
|
4472
4872
|
if (!parsed || parsed.kind !== "Document") {
|
|
4473
4873
|
throw new Error("Not a valid GraphQL document.");
|
|
@@ -10347,8 +10747,12 @@ var START_GAME_MUTATION = gql`
|
|
|
10347
10747
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10348
10748
|
`;
|
|
10349
10749
|
var LEAVE_GAME_MUTATION = gql`
|
|
10350
|
-
mutation leaveGame(
|
|
10351
|
-
|
|
10750
|
+
mutation leaveGame(
|
|
10751
|
+
$_id: ID!
|
|
10752
|
+
$gameType: GameTypeEnumType!
|
|
10753
|
+
$gameTypeId: ID!
|
|
10754
|
+
) {
|
|
10755
|
+
leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId)
|
|
10352
10756
|
}
|
|
10353
10757
|
`;
|
|
10354
10758
|
var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
@@ -10509,6 +10913,20 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
10509
10913
|
return true;
|
|
10510
10914
|
};
|
|
10511
10915
|
};
|
|
10916
|
+
var toOptionalNumber = (originalValue) => {
|
|
10917
|
+
if (originalValue === "" || originalValue === null || originalValue === void 0) {
|
|
10918
|
+
return void 0;
|
|
10919
|
+
}
|
|
10920
|
+
let parsed;
|
|
10921
|
+
if (typeof originalValue === "number") {
|
|
10922
|
+
parsed = originalValue;
|
|
10923
|
+
} else if (typeof originalValue === "string") {
|
|
10924
|
+
parsed = Number(originalValue.replace(",", "."));
|
|
10925
|
+
} else {
|
|
10926
|
+
parsed = void 0;
|
|
10927
|
+
}
|
|
10928
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
10929
|
+
};
|
|
10512
10930
|
import_dayjs2.default.extend(import_isSameOrAfter2.default);
|
|
10513
10931
|
import_dayjs2.default.extend(import_customParseFormat2.default);
|
|
10514
10932
|
var emailRequiredSchema = create$6().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
@@ -10603,12 +11021,12 @@ var dateTimeSchema = create$3().shape({
|
|
|
10603
11021
|
});
|
|
10604
11022
|
var stallTypesSchema = create$3({
|
|
10605
11023
|
label: create$6().trim().label("Stall Type").required("Stall type is required"),
|
|
10606
|
-
price: create$5().label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
|
|
11024
|
+
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(
|
|
10607
11025
|
"no-leading-zeros",
|
|
10608
11026
|
"",
|
|
10609
11027
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10610
11028
|
),
|
|
10611
|
-
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"))
|
|
11029
|
+
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"))
|
|
10612
11030
|
});
|
|
10613
11031
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10614
11032
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10732,8 +11150,8 @@ var eventInfoSchema = create$3().shape({
|
|
|
10732
11150
|
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")),
|
|
10733
11151
|
dateTime: create$2().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
10734
11152
|
eventId: create$6().trim().required("Event ID is required"),
|
|
10735
|
-
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")),
|
|
10736
|
-
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(
|
|
11153
|
+
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")),
|
|
11154
|
+
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(
|
|
10737
11155
|
"payment-before-deadline",
|
|
10738
11156
|
"Payment due hours must be less than application deadline hours",
|
|
10739
11157
|
function(value) {
|
|
@@ -11104,7 +11522,7 @@ var schoolSchema = create$3().shape({
|
|
|
11104
11522
|
name: create$6().trim().required("Name is required"),
|
|
11105
11523
|
region: create$6().trim().required("Region is required"),
|
|
11106
11524
|
socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
|
|
11107
|
-
studentCount: create$5().
|
|
11525
|
+
studentCount: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
|
|
11108
11526
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
11109
11527
|
`Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
|
|
11110
11528
|
).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
|
|
@@ -11120,11 +11538,7 @@ var posterIds = [
|
|
|
11120
11538
|
"poster1",
|
|
11121
11539
|
"poster2",
|
|
11122
11540
|
"poster3",
|
|
11123
|
-
|
|
11124
|
-
"poster4",
|
|
11125
|
-
"poster5",
|
|
11126
|
-
"poster6",
|
|
11127
|
-
"poster7"
|
|
11541
|
+
"poster4"
|
|
11128
11542
|
];
|
|
11129
11543
|
var posterFiles = Object.fromEntries(
|
|
11130
11544
|
posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -13134,6 +13548,16 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
13134
13548
|
}
|
|
13135
13549
|
|
|
13136
13550
|
// src/service/relations.ts
|
|
13551
|
+
function didRemoveAnyEventDates(previousDateTime, nextDateTime) {
|
|
13552
|
+
if (!previousDateTime?.length) {
|
|
13553
|
+
return false;
|
|
13554
|
+
}
|
|
13555
|
+
return previousDateTime.some(
|
|
13556
|
+
(prev) => !nextDateTime?.some(
|
|
13557
|
+
(next) => next.startDate === prev.startDate && next.startTime === prev.startTime
|
|
13558
|
+
)
|
|
13559
|
+
);
|
|
13560
|
+
}
|
|
13137
13561
|
function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
13138
13562
|
return relationDates.map((relationDate) => {
|
|
13139
13563
|
const existsInEvent = eventDateTime?.some(
|
|
@@ -13192,6 +13616,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
13192
13616
|
connectToDatabase,
|
|
13193
13617
|
convertObjectIdsToStrings,
|
|
13194
13618
|
dateTimeSchema,
|
|
13619
|
+
didRemoveAnyEventDates,
|
|
13195
13620
|
express,
|
|
13196
13621
|
findEventOrImportedMarketById,
|
|
13197
13622
|
locationGeoSchema,
|