@timardex/cluemart-server-shared 1.0.177 → 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-FSEMFTFQ.mjs → chunk-QHPLDTUG.mjs} +478 -61
- package/dist/chunk-QHPLDTUG.mjs.map +1 -0
- package/dist/index.cjs +490 -60
- 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 +489 -60
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +477 -60
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +490 -60
- 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 +13 -1
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-FSEMFTFQ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1872,9 +1872,7 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1872
1872
|
*
|
|
1873
1873
|
* Enumerable, and appears in the result of JSON.stringify().
|
|
1874
1874
|
*/
|
|
1875
|
-
/**
|
|
1876
|
-
* An array of GraphQL AST Nodes corresponding to this error.
|
|
1877
|
-
*/
|
|
1875
|
+
/** An array of GraphQL AST Nodes corresponding to this error. */
|
|
1878
1876
|
/**
|
|
1879
1877
|
* The source GraphQL document for the first location of this error.
|
|
1880
1878
|
*
|
|
@@ -1885,13 +1883,89 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1885
1883
|
* An array of character offsets within the source GraphQL document
|
|
1886
1884
|
* which correspond to this error.
|
|
1887
1885
|
*/
|
|
1886
|
+
/** Original error that caused this GraphQLError, if one exists. */
|
|
1887
|
+
/** Extension fields to add to the formatted error. */
|
|
1888
1888
|
/**
|
|
1889
|
-
*
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
*
|
|
1889
|
+
* Creates a GraphQLError instance.
|
|
1890
|
+
* @param message - Human-readable error message.
|
|
1891
|
+
* @param options - Error metadata such as source locations, response path, original error, and extensions.
|
|
1892
|
+
* This positional-arguments constructor overload is deprecated. Use the
|
|
1893
|
+
* `GraphQLError(message, options)` overload instead.
|
|
1894
|
+
* @example
|
|
1895
|
+
* ```ts
|
|
1896
|
+
* // Create an error from AST nodes and response metadata.
|
|
1897
|
+
* import { parse } from 'graphql/language';
|
|
1898
|
+
* import { GraphQLError } from 'graphql/error';
|
|
1899
|
+
*
|
|
1900
|
+
* const document = parse('{ greeting }');
|
|
1901
|
+
* const fieldNode = document.definitions[0].selectionSet.selections[0];
|
|
1902
|
+
* const error = new GraphQLError('Cannot query this field.', {
|
|
1903
|
+
* nodes: fieldNode,
|
|
1904
|
+
* path: ['greeting'],
|
|
1905
|
+
* extensions: { code: 'FORBIDDEN' },
|
|
1906
|
+
* });
|
|
1907
|
+
*
|
|
1908
|
+
* error.message; // => 'Cannot query this field.'
|
|
1909
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
1910
|
+
* error.path; // => ['greeting']
|
|
1911
|
+
* error.extensions; // => { code: 'FORBIDDEN' }
|
|
1912
|
+
* ```
|
|
1913
|
+
* @example
|
|
1914
|
+
* ```ts
|
|
1915
|
+
* // This variant derives locations from source positions and preserves the original error.
|
|
1916
|
+
* import { Source } from 'graphql/language';
|
|
1917
|
+
* import { GraphQLError } from 'graphql/error';
|
|
1918
|
+
*
|
|
1919
|
+
* const source = new Source('{ greeting }');
|
|
1920
|
+
* const originalError = new Error('Database unavailable.');
|
|
1921
|
+
* const error = new GraphQLError('Resolver failed.', {
|
|
1922
|
+
* source,
|
|
1923
|
+
* positions: [2],
|
|
1924
|
+
* path: ['greeting'],
|
|
1925
|
+
* originalError,
|
|
1926
|
+
* });
|
|
1927
|
+
*
|
|
1928
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
1929
|
+
* error.path; // => ['greeting']
|
|
1930
|
+
* error.originalError; // => originalError
|
|
1931
|
+
* ```
|
|
1893
1932
|
*/
|
|
1894
1933
|
/**
|
|
1934
|
+
* Creates a GraphQLError instance using the legacy positional constructor.
|
|
1935
|
+
* This deprecated overload will be removed in v17. Prefer the
|
|
1936
|
+
* `GraphQLErrorOptions` object overload, which keeps optional error metadata
|
|
1937
|
+
* in a single options bag.
|
|
1938
|
+
* @param message - Human-readable error message.
|
|
1939
|
+
* @param nodes - AST node or nodes associated with this error.
|
|
1940
|
+
* @param source - Source document used to derive error locations.
|
|
1941
|
+
* @param positions - Character offsets in the source document associated with
|
|
1942
|
+
* this error.
|
|
1943
|
+
* @param path - Response path where this error occurred during execution.
|
|
1944
|
+
* @param originalError - Original error that caused this GraphQLError, if one
|
|
1945
|
+
* exists.
|
|
1946
|
+
* @param extensions - Extension fields to include in the formatted error.
|
|
1947
|
+
* @example
|
|
1948
|
+
* ```ts
|
|
1949
|
+
* import { Source } from 'graphql/language';
|
|
1950
|
+
* import { GraphQLError } from 'graphql/error';
|
|
1951
|
+
*
|
|
1952
|
+
* const source = new Source('{ greeting }');
|
|
1953
|
+
* const originalError = new Error('Database unavailable.');
|
|
1954
|
+
* const error = new GraphQLError(
|
|
1955
|
+
* 'Resolver failed.',
|
|
1956
|
+
* undefined,
|
|
1957
|
+
* source,
|
|
1958
|
+
* [2],
|
|
1959
|
+
* ['greeting'],
|
|
1960
|
+
* originalError,
|
|
1961
|
+
* { code: 'INTERNAL' },
|
|
1962
|
+
* );
|
|
1963
|
+
*
|
|
1964
|
+
* error.locations; // => [{ line: 1, column: 3 }]
|
|
1965
|
+
* error.path; // => ['greeting']
|
|
1966
|
+
* error.originalError; // => originalError
|
|
1967
|
+
* error.extensions; // => { code: 'INTERNAL' }
|
|
1968
|
+
* ```
|
|
1895
1969
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
1896
1970
|
*/
|
|
1897
1971
|
constructor(message, ...rawArgs) {
|
|
@@ -1951,9 +2025,29 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1951
2025
|
});
|
|
1952
2026
|
}
|
|
1953
2027
|
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2030
|
+
* @returns The built-in string tag for this object.
|
|
2031
|
+
*/
|
|
1954
2032
|
get [Symbol.toStringTag]() {
|
|
1955
2033
|
return "GraphQLError";
|
|
1956
2034
|
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Returns this error as a human-readable message with source locations.
|
|
2037
|
+
* @returns The formatted error string.
|
|
2038
|
+
* @example
|
|
2039
|
+
* ```ts
|
|
2040
|
+
* import { Source } from 'graphql/language';
|
|
2041
|
+
* import { GraphQLError } from 'graphql/error';
|
|
2042
|
+
*
|
|
2043
|
+
* const error = new GraphQLError('Cannot query field "name".', {
|
|
2044
|
+
* source: new Source('{ name }'),
|
|
2045
|
+
* positions: [2],
|
|
2046
|
+
* });
|
|
2047
|
+
*
|
|
2048
|
+
* error.toString(); // => 'Cannot query field "name".\n\nGraphQL request:1:3\n1 | { name }\n | ^'
|
|
2049
|
+
* ```
|
|
2050
|
+
*/
|
|
1957
2051
|
toString() {
|
|
1958
2052
|
let output = this.message;
|
|
1959
2053
|
if (this.nodes) {
|
|
@@ -1969,6 +2063,21 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
1969
2063
|
}
|
|
1970
2064
|
return output;
|
|
1971
2065
|
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Returns the JSON representation used when this object is serialized.
|
|
2068
|
+
* @returns The JSON-serializable representation.
|
|
2069
|
+
* @example
|
|
2070
|
+
* ```ts
|
|
2071
|
+
* import { GraphQLError } from 'graphql/error';
|
|
2072
|
+
*
|
|
2073
|
+
* const error = new GraphQLError('Resolver failed.', {
|
|
2074
|
+
* path: ['viewer', 'name'],
|
|
2075
|
+
* extensions: { code: 'INTERNAL' },
|
|
2076
|
+
* });
|
|
2077
|
+
*
|
|
2078
|
+
* error.toJSON(); // => { message: 'Resolver failed.', path: ['viewer', 'name'], extensions: { code: 'INTERNAL' } }
|
|
2079
|
+
* ```
|
|
2080
|
+
*/
|
|
1972
2081
|
toJSON() {
|
|
1973
2082
|
const formattedError = {
|
|
1974
2083
|
message: this.message
|
|
@@ -1999,20 +2108,29 @@ function syntaxError(source, position, description) {
|
|
|
1999
2108
|
|
|
2000
2109
|
// node_modules/graphql/language/ast.mjs
|
|
2001
2110
|
var Location = class {
|
|
2111
|
+
/** The character offset at which this Node begins. */
|
|
2112
|
+
/** The character offset at which this Node ends. */
|
|
2113
|
+
/** The Token at which this Node begins. */
|
|
2114
|
+
/** The Token at which this Node ends. */
|
|
2115
|
+
/** The Source document the AST represents. */
|
|
2002
2116
|
/**
|
|
2003
|
-
*
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
*
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
*
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
*
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
*
|
|
2117
|
+
* Creates a Location instance.
|
|
2118
|
+
* @param startToken - The start token.
|
|
2119
|
+
* @param endToken - The end token.
|
|
2120
|
+
* @param source - Source document used to derive error locations.
|
|
2121
|
+
* @example
|
|
2122
|
+
* ```ts
|
|
2123
|
+
* import { Location, Source, Token, TokenKind } from 'graphql/language';
|
|
2124
|
+
*
|
|
2125
|
+
* const source = new Source('{ hello }');
|
|
2126
|
+
* const startToken = new Token(TokenKind.BRACE_L, 0, 1, 1, 1);
|
|
2127
|
+
* const endToken = new Token(TokenKind.BRACE_R, 8, 9, 1, 9);
|
|
2128
|
+
* const location = new Location(startToken, endToken, source);
|
|
2129
|
+
*
|
|
2130
|
+
* location.start; // => 0
|
|
2131
|
+
* location.end; // => 9
|
|
2132
|
+
* location.source.body; // => '{ hello }'
|
|
2133
|
+
* ```
|
|
2016
2134
|
*/
|
|
2017
2135
|
constructor(startToken, endToken, source) {
|
|
2018
2136
|
this.start = startToken.start;
|
|
@@ -2021,9 +2139,26 @@ var Location = class {
|
|
|
2021
2139
|
this.endToken = endToken;
|
|
2022
2140
|
this.source = source;
|
|
2023
2141
|
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2144
|
+
* @returns The built-in string tag for this object.
|
|
2145
|
+
*/
|
|
2024
2146
|
get [Symbol.toStringTag]() {
|
|
2025
2147
|
return "Location";
|
|
2026
2148
|
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Returns a JSON representation of this location.
|
|
2151
|
+
* @returns The JSON-serializable representation.
|
|
2152
|
+
* @example
|
|
2153
|
+
* ```ts
|
|
2154
|
+
* import { parse } from 'graphql/language';
|
|
2155
|
+
*
|
|
2156
|
+
* const document = parse('{ hello }');
|
|
2157
|
+
* const location = document.loc?.toJSON();
|
|
2158
|
+
*
|
|
2159
|
+
* location; // => { start: 0, end: 9 }
|
|
2160
|
+
* ```
|
|
2161
|
+
*/
|
|
2027
2162
|
toJSON() {
|
|
2028
2163
|
return {
|
|
2029
2164
|
start: this.start,
|
|
@@ -2032,21 +2167,11 @@ var Location = class {
|
|
|
2032
2167
|
}
|
|
2033
2168
|
};
|
|
2034
2169
|
var Token = class {
|
|
2035
|
-
/**
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
/**
|
|
2039
|
-
|
|
2040
|
-
*/
|
|
2041
|
-
/**
|
|
2042
|
-
* The character offset at which this Node ends.
|
|
2043
|
-
*/
|
|
2044
|
-
/**
|
|
2045
|
-
* The 1-indexed line number on which this Token appears.
|
|
2046
|
-
*/
|
|
2047
|
-
/**
|
|
2048
|
-
* The 1-indexed column number at which this Token begins.
|
|
2049
|
-
*/
|
|
2170
|
+
/** The kind of Token. */
|
|
2171
|
+
/** The character offset at which this Node begins. */
|
|
2172
|
+
/** The character offset at which this Node ends. */
|
|
2173
|
+
/** The 1-indexed line number on which this Token appears. */
|
|
2174
|
+
/** The 1-indexed column number at which this Token begins. */
|
|
2050
2175
|
/**
|
|
2051
2176
|
* For non-punctuation tokens, represents the interpreted value of the token.
|
|
2052
2177
|
*
|
|
@@ -2058,6 +2183,26 @@ var Token = class {
|
|
|
2058
2183
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
2059
2184
|
* the last.
|
|
2060
2185
|
*/
|
|
2186
|
+
/** Next token in the token stream, including ignored tokens. */
|
|
2187
|
+
/**
|
|
2188
|
+
* Creates a Token instance.
|
|
2189
|
+
* @param kind - Token kind produced by lexical analysis.
|
|
2190
|
+
* @param start - Character offset where this token begins.
|
|
2191
|
+
* @param end - Character offset where this token ends.
|
|
2192
|
+
* @param line - One-indexed line number where this token begins.
|
|
2193
|
+
* @param column - One-indexed column number where this token begins.
|
|
2194
|
+
* @param value - Interpreted value for non-punctuation tokens.
|
|
2195
|
+
* @example
|
|
2196
|
+
* ```ts
|
|
2197
|
+
* import { Token, TokenKind } from 'graphql/language';
|
|
2198
|
+
*
|
|
2199
|
+
* const token = new Token(TokenKind.NAME, 2, 7, 1, 3, 'hello');
|
|
2200
|
+
*
|
|
2201
|
+
* token.kind; // => TokenKind.NAME
|
|
2202
|
+
* token.value; // => 'hello'
|
|
2203
|
+
* token.toJSON(); // => { kind: 'Name', value: 'hello', line: 1, column: 3 }
|
|
2204
|
+
* ```
|
|
2205
|
+
*/
|
|
2061
2206
|
constructor(kind, start, end, line, column, value) {
|
|
2062
2207
|
this.kind = kind;
|
|
2063
2208
|
this.start = start;
|
|
@@ -2068,9 +2213,26 @@ var Token = class {
|
|
|
2068
2213
|
this.prev = null;
|
|
2069
2214
|
this.next = null;
|
|
2070
2215
|
}
|
|
2216
|
+
/**
|
|
2217
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2218
|
+
* @returns The built-in string tag for this object.
|
|
2219
|
+
*/
|
|
2071
2220
|
get [Symbol.toStringTag]() {
|
|
2072
2221
|
return "Token";
|
|
2073
2222
|
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Returns a JSON representation of this token.
|
|
2225
|
+
* @returns The JSON-serializable representation.
|
|
2226
|
+
* @example
|
|
2227
|
+
* ```ts
|
|
2228
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2229
|
+
*
|
|
2230
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2231
|
+
* const token = lexer.advance().toJSON();
|
|
2232
|
+
*
|
|
2233
|
+
* token; // => { kind: '{', value: undefined, line: 1, column: 1 }
|
|
2234
|
+
* ```
|
|
2235
|
+
*/
|
|
2074
2236
|
toJSON() {
|
|
2075
2237
|
return {
|
|
2076
2238
|
kind: this.kind,
|
|
@@ -2154,8 +2316,15 @@ var QueryDocumentKeys = {
|
|
|
2154
2316
|
EnumTypeDefinition: ["description", "name", "directives", "values"],
|
|
2155
2317
|
EnumValueDefinition: ["description", "name", "directives"],
|
|
2156
2318
|
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
|
|
2157
|
-
DirectiveDefinition: [
|
|
2319
|
+
DirectiveDefinition: [
|
|
2320
|
+
"description",
|
|
2321
|
+
"name",
|
|
2322
|
+
"arguments",
|
|
2323
|
+
"directives",
|
|
2324
|
+
"locations"
|
|
2325
|
+
],
|
|
2158
2326
|
SchemaExtension: ["directives", "operationTypes"],
|
|
2327
|
+
DirectiveExtension: ["name", "directives"],
|
|
2159
2328
|
ScalarTypeExtension: ["name", "directives"],
|
|
2160
2329
|
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
2161
2330
|
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
@@ -2198,6 +2367,7 @@ var DirectiveLocation;
|
|
|
2198
2367
|
DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE";
|
|
2199
2368
|
DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT";
|
|
2200
2369
|
DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
|
|
2370
|
+
DirectiveLocation2["DIRECTIVE_DEFINITION"] = "DIRECTIVE_DEFINITION";
|
|
2201
2371
|
})(DirectiveLocation || (DirectiveLocation = {}));
|
|
2202
2372
|
|
|
2203
2373
|
// node_modules/graphql/language/kinds.mjs
|
|
@@ -2240,6 +2410,7 @@ var Kind;
|
|
|
2240
2410
|
Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
|
|
2241
2411
|
Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
|
|
2242
2412
|
Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
|
|
2413
|
+
Kind2["DIRECTIVE_EXTENSION"] = "DirectiveExtension";
|
|
2243
2414
|
Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
|
|
2244
2415
|
Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
|
|
2245
2416
|
Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
|
|
@@ -2333,17 +2504,25 @@ var TokenKind;
|
|
|
2333
2504
|
|
|
2334
2505
|
// node_modules/graphql/language/lexer.mjs
|
|
2335
2506
|
var Lexer = class {
|
|
2507
|
+
/** Source document used to derive error locations. */
|
|
2508
|
+
/** Most recent non-ignored token returned by the lexer. */
|
|
2509
|
+
/** Current non-ignored token at the lexer cursor. */
|
|
2510
|
+
/** The (1-indexed) line containing the current token. */
|
|
2511
|
+
/** Character offset where the current line starts. */
|
|
2336
2512
|
/**
|
|
2337
|
-
*
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
*
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
*
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
*
|
|
2513
|
+
* Creates a Lexer instance.
|
|
2514
|
+
* @param source - Source document used to derive error locations.
|
|
2515
|
+
* @example
|
|
2516
|
+
* ```ts
|
|
2517
|
+
* import { Lexer, Source, TokenKind } from 'graphql/language';
|
|
2518
|
+
*
|
|
2519
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2520
|
+
*
|
|
2521
|
+
* lexer.token.kind; // => TokenKind.SOF
|
|
2522
|
+
* lexer.advance().kind; // => TokenKind.BRACE_L
|
|
2523
|
+
* lexer.advance().value; // => 'hello'
|
|
2524
|
+
* lexer.advance().kind; // => TokenKind.BRACE_R
|
|
2525
|
+
* ```
|
|
2347
2526
|
*/
|
|
2348
2527
|
constructor(source) {
|
|
2349
2528
|
const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);
|
|
@@ -2353,11 +2532,26 @@ var Lexer = class {
|
|
|
2353
2532
|
this.line = 1;
|
|
2354
2533
|
this.lineStart = 0;
|
|
2355
2534
|
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
2537
|
+
* @returns The built-in string tag for this object.
|
|
2538
|
+
*/
|
|
2356
2539
|
get [Symbol.toStringTag]() {
|
|
2357
2540
|
return "Lexer";
|
|
2358
2541
|
}
|
|
2359
2542
|
/**
|
|
2360
2543
|
* Advances the token stream to the next non-ignored token.
|
|
2544
|
+
* @returns The next non-ignored token.
|
|
2545
|
+
* @example
|
|
2546
|
+
* ```ts
|
|
2547
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2548
|
+
*
|
|
2549
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2550
|
+
* const token = lexer.advance();
|
|
2551
|
+
*
|
|
2552
|
+
* token.kind; // => '{'
|
|
2553
|
+
* lexer.token; // => token
|
|
2554
|
+
* ```
|
|
2361
2555
|
*/
|
|
2362
2556
|
advance() {
|
|
2363
2557
|
this.lastToken = this.token;
|
|
@@ -2367,6 +2561,17 @@ var Lexer = class {
|
|
|
2367
2561
|
/**
|
|
2368
2562
|
* Looks ahead and returns the next non-ignored token, but does not change
|
|
2369
2563
|
* the state of Lexer.
|
|
2564
|
+
* @returns The next non-ignored token without advancing the lexer.
|
|
2565
|
+
* @example
|
|
2566
|
+
* ```ts
|
|
2567
|
+
* import { Lexer, Source } from 'graphql/language';
|
|
2568
|
+
*
|
|
2569
|
+
* const lexer = new Lexer(new Source('{ hello }'));
|
|
2570
|
+
* const token = lexer.lookahead();
|
|
2571
|
+
*
|
|
2572
|
+
* token.kind; // => '{'
|
|
2573
|
+
* lexer.token.kind; // => '<SOF>'
|
|
2574
|
+
* ```
|
|
2370
2575
|
*/
|
|
2371
2576
|
lookahead() {
|
|
2372
2577
|
let token = this.token;
|
|
@@ -2987,6 +3192,29 @@ spurious results.`);
|
|
|
2987
3192
|
|
|
2988
3193
|
// node_modules/graphql/language/source.mjs
|
|
2989
3194
|
var Source = class {
|
|
3195
|
+
/** The GraphQL source text. */
|
|
3196
|
+
/** Name used in diagnostics for this source, such as a file path or request name. */
|
|
3197
|
+
/** One-indexed line and column where this source begins. */
|
|
3198
|
+
/**
|
|
3199
|
+
* Creates a Source instance.
|
|
3200
|
+
* @param body - The GraphQL source text.
|
|
3201
|
+
* @param name - Name used in diagnostics for this source.
|
|
3202
|
+
* @param locationOffset - One-indexed line and column where this source begins.
|
|
3203
|
+
* @example
|
|
3204
|
+
* ```ts
|
|
3205
|
+
* import { Source } from 'graphql/language';
|
|
3206
|
+
*
|
|
3207
|
+
* const source = new Source(
|
|
3208
|
+
* 'type Query { greeting: String }',
|
|
3209
|
+
* 'schema.graphql',
|
|
3210
|
+
* { line: 10, column: 1 },
|
|
3211
|
+
* );
|
|
3212
|
+
*
|
|
3213
|
+
* source.body; // => 'type Query { greeting: String }'
|
|
3214
|
+
* source.name; // => 'schema.graphql'
|
|
3215
|
+
* source.locationOffset; // => { line: 10, column: 1 }
|
|
3216
|
+
* ```
|
|
3217
|
+
*/
|
|
2990
3218
|
constructor(body, name = "GraphQL request", locationOffset = {
|
|
2991
3219
|
line: 1,
|
|
2992
3220
|
column: 1
|
|
@@ -3004,6 +3232,10 @@ var Source = class {
|
|
|
3004
3232
|
"column in locationOffset is 1-indexed and must be positive."
|
|
3005
3233
|
);
|
|
3006
3234
|
}
|
|
3235
|
+
/**
|
|
3236
|
+
* Returns the value used by `Object.prototype.toString`.
|
|
3237
|
+
* @returns The built-in string tag for this object.
|
|
3238
|
+
*/
|
|
3007
3239
|
get [Symbol.toStringTag]() {
|
|
3008
3240
|
return "Source";
|
|
3009
3241
|
}
|
|
@@ -3039,6 +3271,8 @@ var Parser = class {
|
|
|
3039
3271
|
}
|
|
3040
3272
|
/**
|
|
3041
3273
|
* Converts a name lex token into a name parse node.
|
|
3274
|
+
*
|
|
3275
|
+
* @internal
|
|
3042
3276
|
*/
|
|
3043
3277
|
parseName() {
|
|
3044
3278
|
const token = this.expectToken(TokenKind.NAME);
|
|
@@ -3050,6 +3284,8 @@ var Parser = class {
|
|
|
3050
3284
|
// Implements the parsing rules in the Document section.
|
|
3051
3285
|
/**
|
|
3052
3286
|
* Document : Definition+
|
|
3287
|
+
*
|
|
3288
|
+
* @internal
|
|
3053
3289
|
*/
|
|
3054
3290
|
parseDocument() {
|
|
3055
3291
|
return this.node(this._lexer.token, {
|
|
@@ -3083,6 +3319,8 @@ var Parser = class {
|
|
|
3083
3319
|
* - UnionTypeDefinition
|
|
3084
3320
|
* - EnumTypeDefinition
|
|
3085
3321
|
* - InputObjectTypeDefinition
|
|
3322
|
+
*
|
|
3323
|
+
* @internal
|
|
3086
3324
|
*/
|
|
3087
3325
|
parseDefinition() {
|
|
3088
3326
|
if (this.peek(TokenKind.BRACE_L)) {
|
|
@@ -3143,6 +3381,8 @@ var Parser = class {
|
|
|
3143
3381
|
* OperationDefinition :
|
|
3144
3382
|
* - SelectionSet
|
|
3145
3383
|
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
|
|
3384
|
+
*
|
|
3385
|
+
* @internal
|
|
3146
3386
|
*/
|
|
3147
3387
|
parseOperationDefinition() {
|
|
3148
3388
|
const start = this._lexer.token;
|
|
@@ -3175,6 +3415,8 @@ var Parser = class {
|
|
|
3175
3415
|
}
|
|
3176
3416
|
/**
|
|
3177
3417
|
* OperationType : one of query mutation subscription
|
|
3418
|
+
*
|
|
3419
|
+
* @internal
|
|
3178
3420
|
*/
|
|
3179
3421
|
parseOperationType() {
|
|
3180
3422
|
const operationToken = this.expectToken(TokenKind.NAME);
|
|
@@ -3190,6 +3432,8 @@ var Parser = class {
|
|
|
3190
3432
|
}
|
|
3191
3433
|
/**
|
|
3192
3434
|
* VariableDefinitions : ( VariableDefinition+ )
|
|
3435
|
+
*
|
|
3436
|
+
* @internal
|
|
3193
3437
|
*/
|
|
3194
3438
|
parseVariableDefinitions() {
|
|
3195
3439
|
return this.optionalMany(
|
|
@@ -3200,6 +3444,8 @@ var Parser = class {
|
|
|
3200
3444
|
}
|
|
3201
3445
|
/**
|
|
3202
3446
|
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
|
|
3447
|
+
*
|
|
3448
|
+
* @internal
|
|
3203
3449
|
*/
|
|
3204
3450
|
parseVariableDefinition() {
|
|
3205
3451
|
return this.node(this._lexer.token, {
|
|
@@ -3213,6 +3459,8 @@ var Parser = class {
|
|
|
3213
3459
|
}
|
|
3214
3460
|
/**
|
|
3215
3461
|
* Variable : $ Name
|
|
3462
|
+
*
|
|
3463
|
+
* @internal
|
|
3216
3464
|
*/
|
|
3217
3465
|
parseVariable() {
|
|
3218
3466
|
const start = this._lexer.token;
|
|
@@ -3226,6 +3474,8 @@ var Parser = class {
|
|
|
3226
3474
|
* ```
|
|
3227
3475
|
* SelectionSet : { Selection+ }
|
|
3228
3476
|
* ```
|
|
3477
|
+
*
|
|
3478
|
+
* @internal
|
|
3229
3479
|
*/
|
|
3230
3480
|
parseSelectionSet() {
|
|
3231
3481
|
return this.node(this._lexer.token, {
|
|
@@ -3242,6 +3492,8 @@ var Parser = class {
|
|
|
3242
3492
|
* - Field
|
|
3243
3493
|
* - FragmentSpread
|
|
3244
3494
|
* - InlineFragment
|
|
3495
|
+
*
|
|
3496
|
+
* @internal
|
|
3245
3497
|
*/
|
|
3246
3498
|
parseSelection() {
|
|
3247
3499
|
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
|
|
@@ -3250,6 +3502,8 @@ var Parser = class {
|
|
|
3250
3502
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
3251
3503
|
*
|
|
3252
3504
|
* Alias : Name :
|
|
3505
|
+
*
|
|
3506
|
+
* @internal
|
|
3253
3507
|
*/
|
|
3254
3508
|
parseField() {
|
|
3255
3509
|
const start = this._lexer.token;
|
|
@@ -3273,6 +3527,8 @@ var Parser = class {
|
|
|
3273
3527
|
}
|
|
3274
3528
|
/**
|
|
3275
3529
|
* Arguments[Const] : ( Argument[?Const]+ )
|
|
3530
|
+
*
|
|
3531
|
+
* @internal
|
|
3276
3532
|
*/
|
|
3277
3533
|
parseArguments(isConst) {
|
|
3278
3534
|
const item = isConst ? this.parseConstArgument : this.parseArgument;
|
|
@@ -3280,6 +3536,8 @@ var Parser = class {
|
|
|
3280
3536
|
}
|
|
3281
3537
|
/**
|
|
3282
3538
|
* Argument[Const] : Name : Value[?Const]
|
|
3539
|
+
*
|
|
3540
|
+
* @internal
|
|
3283
3541
|
*/
|
|
3284
3542
|
parseArgument(isConst = false) {
|
|
3285
3543
|
const start = this._lexer.token;
|
|
@@ -3301,6 +3559,8 @@ var Parser = class {
|
|
|
3301
3559
|
* FragmentSpread : ... FragmentName Directives?
|
|
3302
3560
|
*
|
|
3303
3561
|
* InlineFragment : ... TypeCondition? Directives? SelectionSet
|
|
3562
|
+
*
|
|
3563
|
+
* @internal
|
|
3304
3564
|
*/
|
|
3305
3565
|
parseFragment() {
|
|
3306
3566
|
const start = this._lexer.token;
|
|
@@ -3325,6 +3585,8 @@ var Parser = class {
|
|
|
3325
3585
|
* - fragment FragmentName on TypeCondition Directives? SelectionSet
|
|
3326
3586
|
*
|
|
3327
3587
|
* TypeCondition : NamedType
|
|
3588
|
+
*
|
|
3589
|
+
* @internal
|
|
3328
3590
|
*/
|
|
3329
3591
|
parseFragmentDefinition() {
|
|
3330
3592
|
const start = this._lexer.token;
|
|
@@ -3352,6 +3614,8 @@ var Parser = class {
|
|
|
3352
3614
|
}
|
|
3353
3615
|
/**
|
|
3354
3616
|
* FragmentName : Name but not `on`
|
|
3617
|
+
*
|
|
3618
|
+
* @internal
|
|
3355
3619
|
*/
|
|
3356
3620
|
parseFragmentName() {
|
|
3357
3621
|
if (this._lexer.token.value === "on") {
|
|
@@ -3377,6 +3641,8 @@ var Parser = class {
|
|
|
3377
3641
|
* NullValue : `null`
|
|
3378
3642
|
*
|
|
3379
3643
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
3644
|
+
*
|
|
3645
|
+
* @internal
|
|
3380
3646
|
*/
|
|
3381
3647
|
parseValueLiteral(isConst) {
|
|
3382
3648
|
const token = this._lexer.token;
|
|
@@ -3458,6 +3724,8 @@ var Parser = class {
|
|
|
3458
3724
|
* ListValue[Const] :
|
|
3459
3725
|
* - [ ]
|
|
3460
3726
|
* - [ Value[?Const]+ ]
|
|
3727
|
+
*
|
|
3728
|
+
* @internal
|
|
3461
3729
|
*/
|
|
3462
3730
|
parseList(isConst) {
|
|
3463
3731
|
const item = () => this.parseValueLiteral(isConst);
|
|
@@ -3472,6 +3740,8 @@ var Parser = class {
|
|
|
3472
3740
|
* - { }
|
|
3473
3741
|
* - { ObjectField[?Const]+ }
|
|
3474
3742
|
* ```
|
|
3743
|
+
*
|
|
3744
|
+
* @internal
|
|
3475
3745
|
*/
|
|
3476
3746
|
parseObject(isConst) {
|
|
3477
3747
|
const item = () => this.parseObjectField(isConst);
|
|
@@ -3482,6 +3752,8 @@ var Parser = class {
|
|
|
3482
3752
|
}
|
|
3483
3753
|
/**
|
|
3484
3754
|
* ObjectField[Const] : Name : Value[?Const]
|
|
3755
|
+
*
|
|
3756
|
+
* @internal
|
|
3485
3757
|
*/
|
|
3486
3758
|
parseObjectField(isConst) {
|
|
3487
3759
|
const start = this._lexer.token;
|
|
@@ -3496,6 +3768,8 @@ var Parser = class {
|
|
|
3496
3768
|
// Implements the parsing rules in the Directives section.
|
|
3497
3769
|
/**
|
|
3498
3770
|
* Directives[Const] : Directive[?Const]+
|
|
3771
|
+
*
|
|
3772
|
+
* @internal
|
|
3499
3773
|
*/
|
|
3500
3774
|
parseDirectives(isConst) {
|
|
3501
3775
|
const directives = [];
|
|
@@ -3511,6 +3785,8 @@ var Parser = class {
|
|
|
3511
3785
|
* ```
|
|
3512
3786
|
* Directive[Const] : @ Name Arguments[?Const]?
|
|
3513
3787
|
* ```
|
|
3788
|
+
*
|
|
3789
|
+
* @internal
|
|
3514
3790
|
*/
|
|
3515
3791
|
parseDirective(isConst) {
|
|
3516
3792
|
const start = this._lexer.token;
|
|
@@ -3527,6 +3803,8 @@ var Parser = class {
|
|
|
3527
3803
|
* - NamedType
|
|
3528
3804
|
* - ListType
|
|
3529
3805
|
* - NonNullType
|
|
3806
|
+
*
|
|
3807
|
+
* @internal
|
|
3530
3808
|
*/
|
|
3531
3809
|
parseTypeReference() {
|
|
3532
3810
|
const start = this._lexer.token;
|
|
@@ -3551,6 +3829,8 @@ var Parser = class {
|
|
|
3551
3829
|
}
|
|
3552
3830
|
/**
|
|
3553
3831
|
* NamedType : Name
|
|
3832
|
+
*
|
|
3833
|
+
* @internal
|
|
3554
3834
|
*/
|
|
3555
3835
|
parseNamedType() {
|
|
3556
3836
|
return this.node(this._lexer.token, {
|
|
@@ -3564,6 +3844,8 @@ var Parser = class {
|
|
|
3564
3844
|
}
|
|
3565
3845
|
/**
|
|
3566
3846
|
* Description : StringValue
|
|
3847
|
+
*
|
|
3848
|
+
* @internal
|
|
3567
3849
|
*/
|
|
3568
3850
|
parseDescription() {
|
|
3569
3851
|
if (this.peekDescription()) {
|
|
@@ -3574,6 +3856,8 @@ var Parser = class {
|
|
|
3574
3856
|
* ```
|
|
3575
3857
|
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
|
|
3576
3858
|
* ```
|
|
3859
|
+
*
|
|
3860
|
+
* @internal
|
|
3577
3861
|
*/
|
|
3578
3862
|
parseSchemaDefinition() {
|
|
3579
3863
|
const start = this._lexer.token;
|
|
@@ -3594,6 +3878,8 @@ var Parser = class {
|
|
|
3594
3878
|
}
|
|
3595
3879
|
/**
|
|
3596
3880
|
* OperationTypeDefinition : OperationType : NamedType
|
|
3881
|
+
*
|
|
3882
|
+
* @internal
|
|
3597
3883
|
*/
|
|
3598
3884
|
parseOperationTypeDefinition() {
|
|
3599
3885
|
const start = this._lexer.token;
|
|
@@ -3608,6 +3894,8 @@ var Parser = class {
|
|
|
3608
3894
|
}
|
|
3609
3895
|
/**
|
|
3610
3896
|
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
|
|
3897
|
+
*
|
|
3898
|
+
* @internal
|
|
3611
3899
|
*/
|
|
3612
3900
|
parseScalarTypeDefinition() {
|
|
3613
3901
|
const start = this._lexer.token;
|
|
@@ -3626,6 +3914,8 @@ var Parser = class {
|
|
|
3626
3914
|
* ObjectTypeDefinition :
|
|
3627
3915
|
* Description?
|
|
3628
3916
|
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
|
|
3917
|
+
*
|
|
3918
|
+
* @internal
|
|
3629
3919
|
*/
|
|
3630
3920
|
parseObjectTypeDefinition() {
|
|
3631
3921
|
const start = this._lexer.token;
|
|
@@ -3648,6 +3938,8 @@ var Parser = class {
|
|
|
3648
3938
|
* ImplementsInterfaces :
|
|
3649
3939
|
* - implements `&`? NamedType
|
|
3650
3940
|
* - ImplementsInterfaces & NamedType
|
|
3941
|
+
*
|
|
3942
|
+
* @internal
|
|
3651
3943
|
*/
|
|
3652
3944
|
parseImplementsInterfaces() {
|
|
3653
3945
|
return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : [];
|
|
@@ -3656,6 +3948,8 @@ var Parser = class {
|
|
|
3656
3948
|
* ```
|
|
3657
3949
|
* FieldsDefinition : { FieldDefinition+ }
|
|
3658
3950
|
* ```
|
|
3951
|
+
*
|
|
3952
|
+
* @internal
|
|
3659
3953
|
*/
|
|
3660
3954
|
parseFieldsDefinition() {
|
|
3661
3955
|
return this.optionalMany(
|
|
@@ -3667,6 +3961,8 @@ var Parser = class {
|
|
|
3667
3961
|
/**
|
|
3668
3962
|
* FieldDefinition :
|
|
3669
3963
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
3964
|
+
*
|
|
3965
|
+
* @internal
|
|
3670
3966
|
*/
|
|
3671
3967
|
parseFieldDefinition() {
|
|
3672
3968
|
const start = this._lexer.token;
|
|
@@ -3687,6 +3983,8 @@ var Parser = class {
|
|
|
3687
3983
|
}
|
|
3688
3984
|
/**
|
|
3689
3985
|
* ArgumentsDefinition : ( InputValueDefinition+ )
|
|
3986
|
+
*
|
|
3987
|
+
* @internal
|
|
3690
3988
|
*/
|
|
3691
3989
|
parseArgumentDefs() {
|
|
3692
3990
|
return this.optionalMany(
|
|
@@ -3698,6 +3996,8 @@ var Parser = class {
|
|
|
3698
3996
|
/**
|
|
3699
3997
|
* InputValueDefinition :
|
|
3700
3998
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
3999
|
+
*
|
|
4000
|
+
* @internal
|
|
3701
4001
|
*/
|
|
3702
4002
|
parseInputValueDef() {
|
|
3703
4003
|
const start = this._lexer.token;
|
|
@@ -3722,6 +4022,8 @@ var Parser = class {
|
|
|
3722
4022
|
/**
|
|
3723
4023
|
* InterfaceTypeDefinition :
|
|
3724
4024
|
* - Description? interface Name Directives[Const]? FieldsDefinition?
|
|
4025
|
+
*
|
|
4026
|
+
* @internal
|
|
3725
4027
|
*/
|
|
3726
4028
|
parseInterfaceTypeDefinition() {
|
|
3727
4029
|
const start = this._lexer.token;
|
|
@@ -3743,6 +4045,8 @@ var Parser = class {
|
|
|
3743
4045
|
/**
|
|
3744
4046
|
* UnionTypeDefinition :
|
|
3745
4047
|
* - Description? union Name Directives[Const]? UnionMemberTypes?
|
|
4048
|
+
*
|
|
4049
|
+
* @internal
|
|
3746
4050
|
*/
|
|
3747
4051
|
parseUnionTypeDefinition() {
|
|
3748
4052
|
const start = this._lexer.token;
|
|
@@ -3763,6 +4067,8 @@ var Parser = class {
|
|
|
3763
4067
|
* UnionMemberTypes :
|
|
3764
4068
|
* - = `|`? NamedType
|
|
3765
4069
|
* - UnionMemberTypes | NamedType
|
|
4070
|
+
*
|
|
4071
|
+
* @internal
|
|
3766
4072
|
*/
|
|
3767
4073
|
parseUnionMemberTypes() {
|
|
3768
4074
|
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
|
|
@@ -3770,6 +4076,8 @@ var Parser = class {
|
|
|
3770
4076
|
/**
|
|
3771
4077
|
* EnumTypeDefinition :
|
|
3772
4078
|
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
|
|
4079
|
+
*
|
|
4080
|
+
* @internal
|
|
3773
4081
|
*/
|
|
3774
4082
|
parseEnumTypeDefinition() {
|
|
3775
4083
|
const start = this._lexer.token;
|
|
@@ -3790,6 +4098,8 @@ var Parser = class {
|
|
|
3790
4098
|
* ```
|
|
3791
4099
|
* EnumValuesDefinition : { EnumValueDefinition+ }
|
|
3792
4100
|
* ```
|
|
4101
|
+
*
|
|
4102
|
+
* @internal
|
|
3793
4103
|
*/
|
|
3794
4104
|
parseEnumValuesDefinition() {
|
|
3795
4105
|
return this.optionalMany(
|
|
@@ -3800,6 +4110,8 @@ var Parser = class {
|
|
|
3800
4110
|
}
|
|
3801
4111
|
/**
|
|
3802
4112
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
4113
|
+
*
|
|
4114
|
+
* @internal
|
|
3803
4115
|
*/
|
|
3804
4116
|
parseEnumValueDefinition() {
|
|
3805
4117
|
const start = this._lexer.token;
|
|
@@ -3815,6 +4127,8 @@ var Parser = class {
|
|
|
3815
4127
|
}
|
|
3816
4128
|
/**
|
|
3817
4129
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
4130
|
+
*
|
|
4131
|
+
* @internal
|
|
3818
4132
|
*/
|
|
3819
4133
|
parseEnumValueName() {
|
|
3820
4134
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") {
|
|
@@ -3831,6 +4145,8 @@ var Parser = class {
|
|
|
3831
4145
|
/**
|
|
3832
4146
|
* InputObjectTypeDefinition :
|
|
3833
4147
|
* - Description? input Name Directives[Const]? InputFieldsDefinition?
|
|
4148
|
+
*
|
|
4149
|
+
* @internal
|
|
3834
4150
|
*/
|
|
3835
4151
|
parseInputObjectTypeDefinition() {
|
|
3836
4152
|
const start = this._lexer.token;
|
|
@@ -3851,6 +4167,8 @@ var Parser = class {
|
|
|
3851
4167
|
* ```
|
|
3852
4168
|
* InputFieldsDefinition : { InputValueDefinition+ }
|
|
3853
4169
|
* ```
|
|
4170
|
+
*
|
|
4171
|
+
* @internal
|
|
3854
4172
|
*/
|
|
3855
4173
|
parseInputFieldsDefinition() {
|
|
3856
4174
|
return this.optionalMany(
|
|
@@ -3871,6 +4189,9 @@ var Parser = class {
|
|
|
3871
4189
|
* - UnionTypeExtension
|
|
3872
4190
|
* - EnumTypeExtension
|
|
3873
4191
|
* - InputObjectTypeDefinition
|
|
4192
|
+
* - DirectiveDefinitionExtension
|
|
4193
|
+
*
|
|
4194
|
+
* @internal
|
|
3874
4195
|
*/
|
|
3875
4196
|
parseTypeSystemExtension() {
|
|
3876
4197
|
const keywordToken = this._lexer.lookahead();
|
|
@@ -3890,6 +4211,11 @@ var Parser = class {
|
|
|
3890
4211
|
return this.parseEnumTypeExtension();
|
|
3891
4212
|
case "input":
|
|
3892
4213
|
return this.parseInputObjectTypeExtension();
|
|
4214
|
+
case "directive":
|
|
4215
|
+
if (this._options.experimentalDirectivesOnDirectiveDefinitions) {
|
|
4216
|
+
return this.parseDirectiveDefinitionExtension();
|
|
4217
|
+
}
|
|
4218
|
+
break;
|
|
3893
4219
|
}
|
|
3894
4220
|
}
|
|
3895
4221
|
throw this.unexpected(keywordToken);
|
|
@@ -3900,6 +4226,8 @@ var Parser = class {
|
|
|
3900
4226
|
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
|
|
3901
4227
|
* - extend schema Directives[Const]
|
|
3902
4228
|
* ```
|
|
4229
|
+
*
|
|
4230
|
+
* @internal
|
|
3903
4231
|
*/
|
|
3904
4232
|
parseSchemaExtension() {
|
|
3905
4233
|
const start = this._lexer.token;
|
|
@@ -3923,6 +4251,8 @@ var Parser = class {
|
|
|
3923
4251
|
/**
|
|
3924
4252
|
* ScalarTypeExtension :
|
|
3925
4253
|
* - extend scalar Name Directives[Const]
|
|
4254
|
+
*
|
|
4255
|
+
* @internal
|
|
3926
4256
|
*/
|
|
3927
4257
|
parseScalarTypeExtension() {
|
|
3928
4258
|
const start = this._lexer.token;
|
|
@@ -3944,6 +4274,8 @@ var Parser = class {
|
|
|
3944
4274
|
* - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
3945
4275
|
* - extend type Name ImplementsInterfaces? Directives[Const]
|
|
3946
4276
|
* - extend type Name ImplementsInterfaces
|
|
4277
|
+
*
|
|
4278
|
+
* @internal
|
|
3947
4279
|
*/
|
|
3948
4280
|
parseObjectTypeExtension() {
|
|
3949
4281
|
const start = this._lexer.token;
|
|
@@ -3969,6 +4301,8 @@ var Parser = class {
|
|
|
3969
4301
|
* - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
3970
4302
|
* - extend interface Name ImplementsInterfaces? Directives[Const]
|
|
3971
4303
|
* - extend interface Name ImplementsInterfaces
|
|
4304
|
+
*
|
|
4305
|
+
* @internal
|
|
3972
4306
|
*/
|
|
3973
4307
|
parseInterfaceTypeExtension() {
|
|
3974
4308
|
const start = this._lexer.token;
|
|
@@ -3993,6 +4327,8 @@ var Parser = class {
|
|
|
3993
4327
|
* UnionTypeExtension :
|
|
3994
4328
|
* - extend union Name Directives[Const]? UnionMemberTypes
|
|
3995
4329
|
* - extend union Name Directives[Const]
|
|
4330
|
+
*
|
|
4331
|
+
* @internal
|
|
3996
4332
|
*/
|
|
3997
4333
|
parseUnionTypeExtension() {
|
|
3998
4334
|
const start = this._lexer.token;
|
|
@@ -4015,6 +4351,8 @@ var Parser = class {
|
|
|
4015
4351
|
* EnumTypeExtension :
|
|
4016
4352
|
* - extend enum Name Directives[Const]? EnumValuesDefinition
|
|
4017
4353
|
* - extend enum Name Directives[Const]
|
|
4354
|
+
*
|
|
4355
|
+
* @internal
|
|
4018
4356
|
*/
|
|
4019
4357
|
parseEnumTypeExtension() {
|
|
4020
4358
|
const start = this._lexer.token;
|
|
@@ -4037,6 +4375,8 @@ var Parser = class {
|
|
|
4037
4375
|
* InputObjectTypeExtension :
|
|
4038
4376
|
* - extend input Name Directives[Const]? InputFieldsDefinition
|
|
4039
4377
|
* - extend input Name Directives[Const]
|
|
4378
|
+
*
|
|
4379
|
+
* @internal
|
|
4040
4380
|
*/
|
|
4041
4381
|
parseInputObjectTypeExtension() {
|
|
4042
4382
|
const start = this._lexer.token;
|
|
@@ -4055,11 +4395,29 @@ var Parser = class {
|
|
|
4055
4395
|
fields
|
|
4056
4396
|
});
|
|
4057
4397
|
}
|
|
4398
|
+
parseDirectiveDefinitionExtension() {
|
|
4399
|
+
const start = this._lexer.token;
|
|
4400
|
+
this.expectKeyword("extend");
|
|
4401
|
+
this.expectKeyword("directive");
|
|
4402
|
+
this.expectToken(TokenKind.AT);
|
|
4403
|
+
const name = this.parseName();
|
|
4404
|
+
const directives = this.parseConstDirectives();
|
|
4405
|
+
if (directives.length === 0) {
|
|
4406
|
+
throw this.unexpected();
|
|
4407
|
+
}
|
|
4408
|
+
return this.node(start, {
|
|
4409
|
+
kind: Kind.DIRECTIVE_EXTENSION,
|
|
4410
|
+
name,
|
|
4411
|
+
directives
|
|
4412
|
+
});
|
|
4413
|
+
}
|
|
4058
4414
|
/**
|
|
4059
4415
|
* ```
|
|
4060
4416
|
* DirectiveDefinition :
|
|
4061
4417
|
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
|
|
4062
4418
|
* ```
|
|
4419
|
+
*
|
|
4420
|
+
* @internal
|
|
4063
4421
|
*/
|
|
4064
4422
|
parseDirectiveDefinition() {
|
|
4065
4423
|
const start = this._lexer.token;
|
|
@@ -4068,6 +4426,7 @@ var Parser = class {
|
|
|
4068
4426
|
this.expectToken(TokenKind.AT);
|
|
4069
4427
|
const name = this.parseName();
|
|
4070
4428
|
const args = this.parseArgumentDefs();
|
|
4429
|
+
const directives = this._options.experimentalDirectivesOnDirectiveDefinitions ? this.parseConstDirectives() : [];
|
|
4071
4430
|
const repeatable = this.expectOptionalKeyword("repeatable");
|
|
4072
4431
|
this.expectKeyword("on");
|
|
4073
4432
|
const locations = this.parseDirectiveLocations();
|
|
@@ -4076,6 +4435,7 @@ var Parser = class {
|
|
|
4076
4435
|
description,
|
|
4077
4436
|
name,
|
|
4078
4437
|
arguments: args,
|
|
4438
|
+
directives,
|
|
4079
4439
|
repeatable,
|
|
4080
4440
|
locations
|
|
4081
4441
|
});
|
|
@@ -4084,6 +4444,8 @@ var Parser = class {
|
|
|
4084
4444
|
* DirectiveLocations :
|
|
4085
4445
|
* - `|`? DirectiveLocation
|
|
4086
4446
|
* - DirectiveLocations | DirectiveLocation
|
|
4447
|
+
*
|
|
4448
|
+
* @internal
|
|
4087
4449
|
*/
|
|
4088
4450
|
parseDirectiveLocations() {
|
|
4089
4451
|
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
|
|
@@ -4114,6 +4476,7 @@ var Parser = class {
|
|
|
4114
4476
|
* `ENUM_VALUE`
|
|
4115
4477
|
* `INPUT_OBJECT`
|
|
4116
4478
|
* `INPUT_FIELD_DEFINITION`
|
|
4479
|
+
* `DIRECTIVE_DEFINITION`
|
|
4117
4480
|
*/
|
|
4118
4481
|
parseDirectiveLocation() {
|
|
4119
4482
|
const start = this._lexer.token;
|
|
@@ -4131,6 +4494,19 @@ var Parser = class {
|
|
|
4131
4494
|
* - Name . Name ( Name : )
|
|
4132
4495
|
* - \@ Name
|
|
4133
4496
|
* - \@ Name ( Name : )
|
|
4497
|
+
* @returns Parsed schema coordinate AST.
|
|
4498
|
+
* @example
|
|
4499
|
+
* ```ts
|
|
4500
|
+
* import { Parser, Source } from 'graphql/language';
|
|
4501
|
+
*
|
|
4502
|
+
* const typeCoordinate = new Parser(new Source('User.name')).parseSchemaCoordinate();
|
|
4503
|
+
* const directiveCoordinate = new Parser(new Source('@include(if:)')).parseSchemaCoordinate();
|
|
4504
|
+
*
|
|
4505
|
+
* typeCoordinate.name.value; // => 'User'
|
|
4506
|
+
* typeCoordinate.memberName?.value; // => 'name'
|
|
4507
|
+
* directiveCoordinate.name.value; // => 'deprecated'
|
|
4508
|
+
* directiveCoordinate.argumentName?.value; // => 'reason'
|
|
4509
|
+
* ```
|
|
4134
4510
|
*/
|
|
4135
4511
|
parseSchemaCoordinate() {
|
|
4136
4512
|
const start = this._lexer.token;
|
|
@@ -4183,6 +4559,8 @@ var Parser = class {
|
|
|
4183
4559
|
* Returns a node that, if configured to do so, sets a "loc" field as a
|
|
4184
4560
|
* location object, used to identify the place in the source that created a
|
|
4185
4561
|
* given parsed object.
|
|
4562
|
+
*
|
|
4563
|
+
* @internal
|
|
4186
4564
|
*/
|
|
4187
4565
|
node(startToken, node) {
|
|
4188
4566
|
if (this._options.noLocation !== true) {
|
|
@@ -4196,6 +4574,8 @@ var Parser = class {
|
|
|
4196
4574
|
}
|
|
4197
4575
|
/**
|
|
4198
4576
|
* Determines if the next token is of a given kind
|
|
4577
|
+
*
|
|
4578
|
+
* @internal
|
|
4199
4579
|
*/
|
|
4200
4580
|
peek(kind) {
|
|
4201
4581
|
return this._lexer.token.kind === kind;
|
|
@@ -4203,6 +4583,8 @@ var Parser = class {
|
|
|
4203
4583
|
/**
|
|
4204
4584
|
* If the next token is of the given kind, return that token after advancing the lexer.
|
|
4205
4585
|
* Otherwise, do not change the parser state and throw an error.
|
|
4586
|
+
*
|
|
4587
|
+
* @internal
|
|
4206
4588
|
*/
|
|
4207
4589
|
expectToken(kind) {
|
|
4208
4590
|
const token = this._lexer.token;
|
|
@@ -4219,6 +4601,8 @@ var Parser = class {
|
|
|
4219
4601
|
/**
|
|
4220
4602
|
* If the next token is of the given kind, return "true" after advancing the lexer.
|
|
4221
4603
|
* Otherwise, do not change the parser state and return "false".
|
|
4604
|
+
*
|
|
4605
|
+
* @internal
|
|
4222
4606
|
*/
|
|
4223
4607
|
expectOptionalToken(kind) {
|
|
4224
4608
|
const token = this._lexer.token;
|
|
@@ -4231,6 +4615,8 @@ var Parser = class {
|
|
|
4231
4615
|
/**
|
|
4232
4616
|
* If the next token is a given keyword, advance the lexer.
|
|
4233
4617
|
* Otherwise, do not change the parser state and throw an error.
|
|
4618
|
+
*
|
|
4619
|
+
* @internal
|
|
4234
4620
|
*/
|
|
4235
4621
|
expectKeyword(value) {
|
|
4236
4622
|
const token = this._lexer.token;
|
|
@@ -4247,6 +4633,8 @@ var Parser = class {
|
|
|
4247
4633
|
/**
|
|
4248
4634
|
* If the next token is a given keyword, return "true" after advancing the lexer.
|
|
4249
4635
|
* Otherwise, do not change the parser state and return "false".
|
|
4636
|
+
*
|
|
4637
|
+
* @internal
|
|
4250
4638
|
*/
|
|
4251
4639
|
expectOptionalKeyword(value) {
|
|
4252
4640
|
const token = this._lexer.token;
|
|
@@ -4258,6 +4646,8 @@ var Parser = class {
|
|
|
4258
4646
|
}
|
|
4259
4647
|
/**
|
|
4260
4648
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
4649
|
+
*
|
|
4650
|
+
* @internal
|
|
4261
4651
|
*/
|
|
4262
4652
|
unexpected(atToken) {
|
|
4263
4653
|
const token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
|
|
@@ -4271,6 +4661,8 @@ var Parser = class {
|
|
|
4271
4661
|
* Returns a possibly empty list of parse nodes, determined by the parseFn.
|
|
4272
4662
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4273
4663
|
* Advances the parser to the next lex token after the closing token.
|
|
4664
|
+
*
|
|
4665
|
+
* @internal
|
|
4274
4666
|
*/
|
|
4275
4667
|
any(openKind, parseFn, closeKind) {
|
|
4276
4668
|
this.expectToken(openKind);
|
|
@@ -4285,6 +4677,8 @@ var Parser = class {
|
|
|
4285
4677
|
* It can be empty only if open token is missing otherwise it will always return non-empty list
|
|
4286
4678
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4287
4679
|
* Advances the parser to the next lex token after the closing token.
|
|
4680
|
+
*
|
|
4681
|
+
* @internal
|
|
4288
4682
|
*/
|
|
4289
4683
|
optionalMany(openKind, parseFn, closeKind) {
|
|
4290
4684
|
if (this.expectOptionalToken(openKind)) {
|
|
@@ -4300,6 +4694,8 @@ var Parser = class {
|
|
|
4300
4694
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
4301
4695
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
4302
4696
|
* Advances the parser to the next lex token after the closing token.
|
|
4697
|
+
*
|
|
4698
|
+
* @internal
|
|
4303
4699
|
*/
|
|
4304
4700
|
many(openKind, parseFn, closeKind) {
|
|
4305
4701
|
this.expectToken(openKind);
|
|
@@ -4313,6 +4709,8 @@ var Parser = class {
|
|
|
4313
4709
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
4314
4710
|
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
|
|
4315
4711
|
* Advances the parser to the next lex token after last item in the list.
|
|
4712
|
+
*
|
|
4713
|
+
* @internal
|
|
4316
4714
|
*/
|
|
4317
4715
|
delimitedMany(delimiterKind, parseFn) {
|
|
4318
4716
|
this.expectOptionalToken(delimiterKind);
|
|
@@ -4406,7 +4804,8 @@ function parseDocument(source) {
|
|
|
4406
4804
|
if (!docCache.has(cacheKey)) {
|
|
4407
4805
|
var parsed = parse(source, {
|
|
4408
4806
|
experimentalFragmentVariables,
|
|
4409
|
-
allowLegacyFragmentVariables: experimentalFragmentVariables
|
|
4807
|
+
allowLegacyFragmentVariables: experimentalFragmentVariables,
|
|
4808
|
+
experimentalFragmentArguments: experimentalFragmentVariables
|
|
4410
4809
|
});
|
|
4411
4810
|
if (!parsed || parsed.kind !== "Document") {
|
|
4412
4811
|
throw new Error("Not a valid GraphQL document.");
|
|
@@ -6741,6 +7140,8 @@ var EnumOSPlatform = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
6741
7140
|
})(EnumOSPlatform || {});
|
|
6742
7141
|
var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
|
|
6743
7142
|
EnumRelationResource22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
|
|
7143
|
+
EnumRelationResource22["EVENT_UPDATE_RELATION_TO_VENDOR"] = "event_update_relation_to_vendor";
|
|
7144
|
+
EnumRelationResource22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
|
|
6744
7145
|
EnumRelationResource22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
|
|
6745
7146
|
return EnumRelationResource22;
|
|
6746
7147
|
})(EnumRelationResource || {});
|
|
@@ -6766,6 +7167,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
6766
7167
|
EnumNotificationResourceType22["DOWNGRADED_VENDOR"] = "downgraded_vendor";
|
|
6767
7168
|
EnumNotificationResourceType22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
|
|
6768
7169
|
EnumNotificationResourceType22["EVENT_STARTING_SOON"] = "event_starting_soon";
|
|
7170
|
+
EnumNotificationResourceType22["EVENT_UPDATE_RELATION_TO_VENDOR"] = "event_update_relation_to_vendor";
|
|
6769
7171
|
EnumNotificationResourceType22["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
|
|
6770
7172
|
EnumNotificationResourceType22["EXPIRATION_REMINDER_PARTNER"] = "expiration_reminder_partner";
|
|
6771
7173
|
EnumNotificationResourceType22["EXPIRATION_REMINDER_VENDOR"] = "expiration_reminder_vendor";
|
|
@@ -6774,6 +7176,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
6774
7176
|
EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
|
|
6775
7177
|
EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
|
|
6776
7178
|
EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
|
|
7179
|
+
EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
|
|
6777
7180
|
return EnumNotificationResourceType22;
|
|
6778
7181
|
})(EnumNotificationResourceType || {});
|
|
6779
7182
|
var EnumNotificationType = /* @__PURE__ */ ((EnumNotificationType22) => {
|
|
@@ -10282,8 +10685,12 @@ var START_GAME_MUTATION = gql`
|
|
|
10282
10685
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10283
10686
|
`;
|
|
10284
10687
|
var LEAVE_GAME_MUTATION = gql`
|
|
10285
|
-
mutation leaveGame(
|
|
10286
|
-
|
|
10688
|
+
mutation leaveGame(
|
|
10689
|
+
$_id: ID!
|
|
10690
|
+
$gameType: GameTypeEnumType!
|
|
10691
|
+
$gameTypeId: ID!
|
|
10692
|
+
) {
|
|
10693
|
+
leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId)
|
|
10287
10694
|
}
|
|
10288
10695
|
`;
|
|
10289
10696
|
var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
@@ -10444,6 +10851,20 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
10444
10851
|
return true;
|
|
10445
10852
|
};
|
|
10446
10853
|
};
|
|
10854
|
+
var toOptionalNumber = (originalValue) => {
|
|
10855
|
+
if (originalValue === "" || originalValue === null || originalValue === void 0) {
|
|
10856
|
+
return void 0;
|
|
10857
|
+
}
|
|
10858
|
+
let parsed;
|
|
10859
|
+
if (typeof originalValue === "number") {
|
|
10860
|
+
parsed = originalValue;
|
|
10861
|
+
} else if (typeof originalValue === "string") {
|
|
10862
|
+
parsed = Number(originalValue.replace(",", "."));
|
|
10863
|
+
} else {
|
|
10864
|
+
parsed = void 0;
|
|
10865
|
+
}
|
|
10866
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
10867
|
+
};
|
|
10447
10868
|
dayjs2.extend(isSameOrAfter2);
|
|
10448
10869
|
dayjs2.extend(customParseFormat2);
|
|
10449
10870
|
var emailRequiredSchema = create$6().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
@@ -10538,12 +10959,12 @@ var dateTimeSchema = create$3().shape({
|
|
|
10538
10959
|
});
|
|
10539
10960
|
var stallTypesSchema = create$3({
|
|
10540
10961
|
label: create$6().trim().label("Stall Type").required("Stall type is required"),
|
|
10541
|
-
price: create$5().label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
|
|
10962
|
+
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(
|
|
10542
10963
|
"no-leading-zeros",
|
|
10543
10964
|
"",
|
|
10544
10965
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10545
10966
|
),
|
|
10546
|
-
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"))
|
|
10967
|
+
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"))
|
|
10547
10968
|
});
|
|
10548
10969
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10549
10970
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10667,8 +11088,8 @@ var eventInfoSchema = create$3().shape({
|
|
|
10667
11088
|
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")),
|
|
10668
11089
|
dateTime: create$2().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
10669
11090
|
eventId: create$6().trim().required("Event ID is required"),
|
|
10670
|
-
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")),
|
|
10671
|
-
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(
|
|
11091
|
+
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")),
|
|
11092
|
+
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(
|
|
10672
11093
|
"payment-before-deadline",
|
|
10673
11094
|
"Payment due hours must be less than application deadline hours",
|
|
10674
11095
|
function(value) {
|
|
@@ -11039,7 +11460,7 @@ var schoolSchema = create$3().shape({
|
|
|
11039
11460
|
name: create$6().trim().required("Name is required"),
|
|
11040
11461
|
region: create$6().trim().required("Region is required"),
|
|
11041
11462
|
socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
|
|
11042
|
-
studentCount: create$5().
|
|
11463
|
+
studentCount: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
|
|
11043
11464
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
11044
11465
|
`Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
|
|
11045
11466
|
).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
|
|
@@ -11055,11 +11476,7 @@ var posterIds = [
|
|
|
11055
11476
|
"poster1",
|
|
11056
11477
|
"poster2",
|
|
11057
11478
|
"poster3",
|
|
11058
|
-
|
|
11059
|
-
"poster4",
|
|
11060
|
-
"poster5",
|
|
11061
|
-
"poster6",
|
|
11062
|
-
"poster7"
|
|
11479
|
+
"poster4"
|
|
11063
11480
|
];
|
|
11064
11481
|
var posterFiles = Object.fromEntries(
|
|
11065
11482
|
posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -11895,7 +12312,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
11895
12312
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
11896
12313
|
var NotificationModel = mongoose8.models.Notification || mongoose8.model("Notification", schema4);
|
|
11897
12314
|
|
|
11898
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
12315
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-JMOGW4IX.mjs
|
|
11899
12316
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
11900
12317
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
11901
12318
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -12714,6 +13131,7 @@ var connectToDatabase = async ({
|
|
|
12714
13131
|
// src/service/saveNotificationsInDb.ts
|
|
12715
13132
|
async function saveNotificationsInDb(payload) {
|
|
12716
13133
|
const { data, message, title, type, userIds } = payload;
|
|
13134
|
+
console.log("NOTIFICATION DATA", JSON.stringify(payload, null, 2));
|
|
12717
13135
|
try {
|
|
12718
13136
|
const notifications = userIds.map((userId) => ({
|
|
12719
13137
|
data,
|
|
@@ -13068,6 +13486,16 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
13068
13486
|
}
|
|
13069
13487
|
|
|
13070
13488
|
// src/service/relations.ts
|
|
13489
|
+
function didRemoveAnyEventDates(previousDateTime, nextDateTime) {
|
|
13490
|
+
if (!previousDateTime?.length) {
|
|
13491
|
+
return false;
|
|
13492
|
+
}
|
|
13493
|
+
return previousDateTime.some(
|
|
13494
|
+
(prev) => !nextDateTime?.some(
|
|
13495
|
+
(next) => next.startDate === prev.startDate && next.startTime === prev.startTime
|
|
13496
|
+
)
|
|
13497
|
+
);
|
|
13498
|
+
}
|
|
13071
13499
|
function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
13072
13500
|
return relationDates.map((relationDate) => {
|
|
13073
13501
|
const existsInEvent = eventDateTime?.some(
|
|
@@ -13125,6 +13553,7 @@ export {
|
|
|
13125
13553
|
connectToDatabase,
|
|
13126
13554
|
convertObjectIdsToStrings,
|
|
13127
13555
|
dateTimeSchema3 as dateTimeSchema,
|
|
13556
|
+
didRemoveAnyEventDates,
|
|
13128
13557
|
express,
|
|
13129
13558
|
findEventOrImportedMarketById,
|
|
13130
13559
|
locationGeoSchema,
|