@timardex/cluemart-server-shared 1.0.178 → 1.0.200
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/{Chat-Ctmtatmi.d.mts → Chat-DYkhie3G.d.mts} +2 -4
- package/dist/{Chat-Ctmtatmi.d.ts → Chat-DYkhie3G.d.ts} +2 -4
- package/dist/{Relation-BQhULTU-.d.mts → Relation-1llDbRjW.d.ts} +4 -4
- package/dist/{Relation-Dvgd2CFi.d.ts → Relation-BBXiEM1-.d.mts} +4 -4
- package/dist/{chunk-EM5UZAAN.mjs → chunk-MBUS572I.mjs} +550 -89
- package/dist/chunk-MBUS572I.mjs.map +1 -0
- package/dist/index.cjs +563 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +15 -23
- package/dist/index.d.ts +15 -23
- package/dist/index.mjs +562 -90
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +549 -88
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +4 -13
- package/dist/mongoose/index.d.ts +4 -13
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +563 -90
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +12 -9
- package/dist/service/index.d.ts +12 -9
- package/dist/service/index.mjs +14 -3
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-EM5UZAAN.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.");
|
|
@@ -6882,7 +7281,12 @@ var gameScreenIdentifierList = [
|
|
|
6882
7281
|
match: "/events/events-near-me"
|
|
6883
7282
|
},
|
|
6884
7283
|
{
|
|
6885
|
-
clue: "
|
|
7284
|
+
clue: "Where events appear as pins on a map.",
|
|
7285
|
+
id: "events-map",
|
|
7286
|
+
match: "/events/events-map"
|
|
7287
|
+
},
|
|
7288
|
+
{
|
|
7289
|
+
clue: "A collection of events worth attending.",
|
|
6886
7290
|
id: "events",
|
|
6887
7291
|
match: "/events"
|
|
6888
7292
|
},
|
|
@@ -6975,6 +7379,7 @@ function normalizeUrl(url) {
|
|
|
6975
7379
|
}
|
|
6976
7380
|
return url;
|
|
6977
7381
|
}
|
|
7382
|
+
var CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
|
|
6978
7383
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
6979
7384
|
var packagingTypes = [
|
|
6980
7385
|
"Biodegradable",
|
|
@@ -8380,7 +8785,6 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8380
8785
|
platform
|
|
8381
8786
|
preferredRegion
|
|
8382
8787
|
promoCodes
|
|
8383
|
-
refreshToken
|
|
8384
8788
|
role
|
|
8385
8789
|
school
|
|
8386
8790
|
termsAgreement {
|
|
@@ -8630,7 +9034,10 @@ var GET_EVENT_BY_PLACE_ID = gql`
|
|
|
8630
9034
|
${EVENT_LIST_ITEM}
|
|
8631
9035
|
`;
|
|
8632
9036
|
var GET_EVENTS_BY_REGION = gql`
|
|
8633
|
-
query getEventsByRegion(
|
|
9037
|
+
query getEventsByRegion(
|
|
9038
|
+
$region: String!
|
|
9039
|
+
$options: ResourcesByRegionOptions
|
|
9040
|
+
) {
|
|
8634
9041
|
eventsByRegion(region: $region, options: $options) {
|
|
8635
9042
|
...EventListItemFields
|
|
8636
9043
|
}
|
|
@@ -8638,7 +9045,7 @@ var GET_EVENTS_BY_REGION = gql`
|
|
|
8638
9045
|
${EVENT_LIST_ITEM}
|
|
8639
9046
|
`;
|
|
8640
9047
|
var SEARCH_EVENTS = gql`
|
|
8641
|
-
query searchEvents($region: String, $search: String
|
|
9048
|
+
query searchEvents($region: String, $search: String, $tags: [String]) {
|
|
8642
9049
|
eventsSearch(region: $region, search: $search, tags: $tags) {
|
|
8643
9050
|
...EventListItemFields
|
|
8644
9051
|
}
|
|
@@ -8862,8 +9269,11 @@ var GET_VENDOR = gql`
|
|
|
8862
9269
|
${VENDOR}
|
|
8863
9270
|
`;
|
|
8864
9271
|
var GET_VENDORS_BY_REGION = gql`
|
|
8865
|
-
query getVendorsByRegion(
|
|
8866
|
-
|
|
9272
|
+
query getVendorsByRegion(
|
|
9273
|
+
$region: String!
|
|
9274
|
+
$options: ResourcesByRegionOptions
|
|
9275
|
+
) {
|
|
9276
|
+
vendorsByRegion(region: $region, options: $options) {
|
|
8867
9277
|
...VendorFields
|
|
8868
9278
|
}
|
|
8869
9279
|
}
|
|
@@ -9259,8 +9669,11 @@ var GET_PARTNER = gql`
|
|
|
9259
9669
|
${PARTNER}
|
|
9260
9670
|
`;
|
|
9261
9671
|
var GET_PARTNERS_BY_REGION = gql`
|
|
9262
|
-
query getPartnersByRegion(
|
|
9263
|
-
|
|
9672
|
+
query getPartnersByRegion(
|
|
9673
|
+
$region: String!
|
|
9674
|
+
$options: ResourcesByRegionOptions
|
|
9675
|
+
) {
|
|
9676
|
+
partnersByRegion(region: $region, options: $options) {
|
|
9264
9677
|
...PartnerFields
|
|
9265
9678
|
}
|
|
9266
9679
|
}
|
|
@@ -10286,8 +10699,12 @@ var START_GAME_MUTATION = gql`
|
|
|
10286
10699
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10287
10700
|
`;
|
|
10288
10701
|
var LEAVE_GAME_MUTATION = gql`
|
|
10289
|
-
mutation leaveGame(
|
|
10290
|
-
|
|
10702
|
+
mutation leaveGame(
|
|
10703
|
+
$_id: ID!
|
|
10704
|
+
$gameType: GameTypeEnumType!
|
|
10705
|
+
$gameTypeId: ID!
|
|
10706
|
+
) {
|
|
10707
|
+
leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId)
|
|
10291
10708
|
}
|
|
10292
10709
|
`;
|
|
10293
10710
|
var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
@@ -10448,6 +10865,20 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
10448
10865
|
return true;
|
|
10449
10866
|
};
|
|
10450
10867
|
};
|
|
10868
|
+
var toOptionalNumber = (originalValue) => {
|
|
10869
|
+
if (originalValue === "" || originalValue === null || originalValue === void 0) {
|
|
10870
|
+
return void 0;
|
|
10871
|
+
}
|
|
10872
|
+
let parsed;
|
|
10873
|
+
if (typeof originalValue === "number") {
|
|
10874
|
+
parsed = originalValue;
|
|
10875
|
+
} else if (typeof originalValue === "string") {
|
|
10876
|
+
parsed = Number(originalValue.replace(",", "."));
|
|
10877
|
+
} else {
|
|
10878
|
+
parsed = void 0;
|
|
10879
|
+
}
|
|
10880
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
10881
|
+
};
|
|
10451
10882
|
dayjs2.extend(isSameOrAfter2);
|
|
10452
10883
|
dayjs2.extend(customParseFormat2);
|
|
10453
10884
|
var emailRequiredSchema = create$6().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
@@ -10461,7 +10892,7 @@ var emailOptionalSchema = create$6().nullable().notRequired().transform(
|
|
|
10461
10892
|
(value) => !value || create$6().email().isValidSync(value)
|
|
10462
10893
|
).label("Email");
|
|
10463
10894
|
var mobileRegex = /^02\d{7,9}$/;
|
|
10464
|
-
var landlineRegex = /^
|
|
10895
|
+
var landlineRegex = /^0[34679]\d{7}$/;
|
|
10465
10896
|
var mobilePhoneSchema = create$6().label("Mobile Phone").nullable().notRequired().test(
|
|
10466
10897
|
"mobile-phone",
|
|
10467
10898
|
"Mobile must start with 02 and be 9\u201311 digits",
|
|
@@ -10542,12 +10973,12 @@ var dateTimeSchema = create$3().shape({
|
|
|
10542
10973
|
});
|
|
10543
10974
|
var stallTypesSchema = create$3({
|
|
10544
10975
|
label: create$6().trim().label("Stall Type").required("Stall type is required"),
|
|
10545
|
-
price: create$5().label("Stall Price").min(0.1, "Stall price must be at least 0.1").required("Stall price is required").test(
|
|
10976
|
+
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(
|
|
10546
10977
|
"no-leading-zeros",
|
|
10547
10978
|
"",
|
|
10548
10979
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10549
10980
|
),
|
|
10550
|
-
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"))
|
|
10981
|
+
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"))
|
|
10551
10982
|
});
|
|
10552
10983
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10553
10984
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10671,8 +11102,8 @@ var eventInfoSchema = create$3().shape({
|
|
|
10671
11102
|
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")),
|
|
10672
11103
|
dateTime: create$2().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
10673
11104
|
eventId: create$6().trim().required("Event ID is required"),
|
|
10674
|
-
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")),
|
|
10675
|
-
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(
|
|
11105
|
+
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")),
|
|
11106
|
+
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(
|
|
10676
11107
|
"payment-before-deadline",
|
|
10677
11108
|
"Payment due hours must be less than application deadline hours",
|
|
10678
11109
|
function(value) {
|
|
@@ -10846,12 +11277,12 @@ var validateVerificationTokenSchema = create$3().shape({
|
|
|
10846
11277
|
email: emailRequiredSchema,
|
|
10847
11278
|
verificationToken: create$6().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
10848
11279
|
});
|
|
10849
|
-
var EnumAdShowOn = /* @__PURE__ */ ((
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
return
|
|
11280
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
11281
|
+
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
11282
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
11283
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
11284
|
+
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
11285
|
+
return EnumAdShowOn2;
|
|
10855
11286
|
})(EnumAdShowOn || {});
|
|
10856
11287
|
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
10857
11288
|
EnumAdStatus2["ACTIVE"] = "Active";
|
|
@@ -10870,15 +11301,15 @@ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
|
10870
11301
|
return EnumAdStyle2;
|
|
10871
11302
|
})(EnumAdStyle || {});
|
|
10872
11303
|
var adResourceSchema = create$3({
|
|
10873
|
-
adDescription: create$6().
|
|
10874
|
-
adImage: create$6().
|
|
10875
|
-
adStyle: create$8().
|
|
10876
|
-
adTitle: create$6().
|
|
10877
|
-
adType: create$8().
|
|
10878
|
-
resourceId: create$6().
|
|
10879
|
-
resourceName: create$6().
|
|
10880
|
-
resourceRegion: create$6().
|
|
10881
|
-
resourceType: create$8().
|
|
11304
|
+
adDescription: create$6().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
11305
|
+
adImage: create$6().required("Ad image is required"),
|
|
11306
|
+
adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
11307
|
+
adTitle: create$6().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
11308
|
+
adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
11309
|
+
resourceId: create$6().required("Resource ID is required"),
|
|
11310
|
+
resourceName: create$6().required("Resource name is required"),
|
|
11311
|
+
resourceRegion: create$6().required("Resource region is required"),
|
|
11312
|
+
resourceType: create$8().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
|
|
10882
11313
|
});
|
|
10883
11314
|
var adSchema = create$3().shape({
|
|
10884
11315
|
active: create$7().required("Active status is required"),
|
|
@@ -10908,7 +11339,8 @@ var adSchema = create$3().shape({
|
|
|
10908
11339
|
if (!value) return false;
|
|
10909
11340
|
return value > /* @__PURE__ */ new Date();
|
|
10910
11341
|
}),
|
|
10911
|
-
|
|
11342
|
+
// Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
|
|
11343
|
+
otherwise: () => create$4().notRequired()
|
|
10912
11344
|
}),
|
|
10913
11345
|
targetRegion: create$2().of(create$6().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
10914
11346
|
});
|
|
@@ -11036,6 +11468,31 @@ var contactUsSchema = create$3().shape({
|
|
|
11036
11468
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
11037
11469
|
message: create$6().label("Message").required("Message is required")
|
|
11038
11470
|
});
|
|
11471
|
+
var defaultValues8 = {
|
|
11472
|
+
active: true,
|
|
11473
|
+
// Use a future default so yup "future date" rules pass on first submit.
|
|
11474
|
+
end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
|
|
11475
|
+
resource: {
|
|
11476
|
+
adDescription: "",
|
|
11477
|
+
adImage: "",
|
|
11478
|
+
adStyle: "Bloom",
|
|
11479
|
+
adTitle: "",
|
|
11480
|
+
adType: "Sponsored",
|
|
11481
|
+
resourceId: "",
|
|
11482
|
+
resourceName: "",
|
|
11483
|
+
resourceRegion: "",
|
|
11484
|
+
resourceType: "event"
|
|
11485
|
+
/* EVENT */
|
|
11486
|
+
},
|
|
11487
|
+
showOn: [
|
|
11488
|
+
"Front_page"
|
|
11489
|
+
/* FRONT_PAGE */
|
|
11490
|
+
],
|
|
11491
|
+
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
11492
|
+
start: void 0,
|
|
11493
|
+
status: "Active",
|
|
11494
|
+
targetRegion: []
|
|
11495
|
+
};
|
|
11039
11496
|
var schoolSchema = create$3().shape({
|
|
11040
11497
|
active: create$7().required("Active is required"),
|
|
11041
11498
|
contactDetails: contactDetailsSchema,
|
|
@@ -11043,7 +11500,7 @@ var schoolSchema = create$3().shape({
|
|
|
11043
11500
|
name: create$6().trim().required("Name is required"),
|
|
11044
11501
|
region: create$6().trim().required("Region is required"),
|
|
11045
11502
|
socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
|
|
11046
|
-
studentCount: create$5().
|
|
11503
|
+
studentCount: create$5().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Student Count").nullable().typeError("Student count must be a number").min(
|
|
11047
11504
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
11048
11505
|
`Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
|
|
11049
11506
|
).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
|
|
@@ -11059,11 +11516,7 @@ var posterIds = [
|
|
|
11059
11516
|
"poster1",
|
|
11060
11517
|
"poster2",
|
|
11061
11518
|
"poster3",
|
|
11062
|
-
|
|
11063
|
-
"poster4",
|
|
11064
|
-
"poster5",
|
|
11065
|
-
"poster6",
|
|
11066
|
-
"poster7"
|
|
11519
|
+
"poster4"
|
|
11067
11520
|
];
|
|
11068
11521
|
var posterFiles = Object.fromEntries(
|
|
11069
11522
|
posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -11101,8 +11554,9 @@ var badgeFiles = Object.fromEntries(
|
|
|
11101
11554
|
var logoIds = [
|
|
11102
11555
|
"googleMaps-logo-dark",
|
|
11103
11556
|
"googleMaps-logo-light",
|
|
11104
|
-
"logo",
|
|
11105
|
-
"logo-
|
|
11557
|
+
"logo-atr",
|
|
11558
|
+
"logo-dark",
|
|
11559
|
+
"logo"
|
|
11106
11560
|
];
|
|
11107
11561
|
var logoFiles = Object.fromEntries(
|
|
11108
11562
|
logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -11110,6 +11564,7 @@ var logoFiles = Object.fromEntries(
|
|
|
11110
11564
|
var otherImagesIds = [
|
|
11111
11565
|
"banner-horizontal",
|
|
11112
11566
|
"banner-vertical",
|
|
11567
|
+
"gazebo-top",
|
|
11113
11568
|
"qr-code",
|
|
11114
11569
|
"store-android",
|
|
11115
11570
|
"store-ios"
|
|
@@ -11137,7 +11592,7 @@ var otherImages = Object.fromEntries(
|
|
|
11137
11592
|
);
|
|
11138
11593
|
var RELATION_SHARE_INVITATION = "invitation";
|
|
11139
11594
|
var RELATION_SHARE_APPLICATION = "application";
|
|
11140
|
-
var SHARE_SITE_URL =
|
|
11595
|
+
var SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;
|
|
11141
11596
|
var SHARE_CALENDAR_ICON = "\u{1F4C5}";
|
|
11142
11597
|
var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
|
|
11143
11598
|
var SHARE_CHECKMARK_ICON = "\u2705";
|
|
@@ -11477,6 +11932,7 @@ var refundPolicySchema = new MongooseSchema4(
|
|
|
11477
11932
|
);
|
|
11478
11933
|
var schema2 = new MongooseSchema4(
|
|
11479
11934
|
{
|
|
11935
|
+
active: { default: true, type: Boolean },
|
|
11480
11936
|
applicationDeadlineHours: { required: true, type: Number },
|
|
11481
11937
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
11482
11938
|
eventId: {
|
|
@@ -11918,7 +12374,11 @@ var schema5 = new MongooseSchema9(
|
|
|
11918
12374
|
type: String
|
|
11919
12375
|
},
|
|
11920
12376
|
token: { required: true, type: String },
|
|
11921
|
-
userId: {
|
|
12377
|
+
userId: {
|
|
12378
|
+
ref: "User",
|
|
12379
|
+
required: true,
|
|
12380
|
+
type: mongoose9.Schema.Types.ObjectId
|
|
12381
|
+
}
|
|
11922
12382
|
},
|
|
11923
12383
|
{ timestamps: true }
|
|
11924
12384
|
);
|
|
@@ -12261,6 +12721,7 @@ var AttributesSchema = new MongooseSchema14(
|
|
|
12261
12721
|
);
|
|
12262
12722
|
var schema10 = new MongooseSchema14(
|
|
12263
12723
|
{
|
|
12724
|
+
active: { default: true, type: Boolean },
|
|
12264
12725
|
compliance: {
|
|
12265
12726
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
12266
12727
|
liabilityInsurance: { default: false, required: false, type: Boolean }
|
|
@@ -12992,12 +13453,12 @@ async function removeAssociateFromResource({
|
|
|
12992
13453
|
// src/service/vendor.ts
|
|
12993
13454
|
async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
12994
13455
|
try {
|
|
12995
|
-
const user = await UserModel.findById(userId).select("vendor").lean();
|
|
13456
|
+
const user = await UserModel.findById(userId).select("vendor").lean().exec();
|
|
12996
13457
|
if (!user?.vendor) {
|
|
12997
13458
|
console.warn(`[updateVendor] No vendor found for userId=${userId}`);
|
|
12998
13459
|
return;
|
|
12999
13460
|
}
|
|
13000
|
-
const vendor = await VendorModel.findById(user.vendor).lean();
|
|
13461
|
+
const vendor = await VendorModel.findById(user.vendor).lean().exec();
|
|
13001
13462
|
if (!vendor) {
|
|
13002
13463
|
console.warn(`[updateVendor] Vendor not found for id=${user.vendor}`);
|
|
13003
13464
|
return;
|
|
@@ -13073,6 +13534,16 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
13073
13534
|
}
|
|
13074
13535
|
|
|
13075
13536
|
// src/service/relations.ts
|
|
13537
|
+
function didRemoveAnyEventDates(previousDateTime, nextDateTime) {
|
|
13538
|
+
if (!previousDateTime?.length) {
|
|
13539
|
+
return false;
|
|
13540
|
+
}
|
|
13541
|
+
return previousDateTime.some(
|
|
13542
|
+
(prev) => !nextDateTime?.some(
|
|
13543
|
+
(next) => next.startDate === prev.startDate && next.startTime === prev.startTime
|
|
13544
|
+
)
|
|
13545
|
+
);
|
|
13546
|
+
}
|
|
13076
13547
|
function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
13077
13548
|
return relationDates.map((relationDate) => {
|
|
13078
13549
|
const existsInEvent = eventDateTime?.some(
|
|
@@ -13130,6 +13601,7 @@ export {
|
|
|
13130
13601
|
connectToDatabase,
|
|
13131
13602
|
convertObjectIdsToStrings,
|
|
13132
13603
|
dateTimeSchema3 as dateTimeSchema,
|
|
13604
|
+
didRemoveAnyEventDates,
|
|
13133
13605
|
express,
|
|
13134
13606
|
findEventOrImportedMarketById,
|
|
13135
13607
|
locationGeoSchema,
|