@vertikalx/vtx-backend-client 3.0.1-dev-max.7 → 3.1.0
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/package.json +1 -1
- package/src/api/api-call-headers.js.map +1 -1
- package/src/api/backend-response.js.map +1 -1
- package/src/api/domains.js.map +1 -1
- package/src/api/response-builder.js.map +1 -1
- package/src/api/types.js.map +1 -1
- package/src/api/vtx-apikey-api.js.map +1 -1
- package/src/api/vtx-base-api.d.ts +0 -38
- package/src/api/vtx-base-api.js +1 -73
- package/src/api/vtx-base-api.js.map +1 -1
- package/src/api/vtx-mobile-api.js.map +1 -1
- package/src/api/vtx-web-browser-api.js.map +1 -1
- package/src/api/vtx-web-server-api.js.map +1 -1
- package/src/client/schema.graphql +4578 -0
- package/src/generated/graphql.d.ts +111 -1833
- package/src/generated/graphql.js +13 -561
- package/src/generated/graphql.js.map +1 -1
- package/src/index.js.map +1 -1
- package/src/operations/admin.graphql +19 -0
- package/src/operations/ai-coach.graphql +117 -0
- package/src/operations/athlete.graphql +1764 -0
- package/src/operations/auth.graphql +301 -0
- package/src/operations/campaign.graphql +822 -0
- package/src/operations/email-campaign.graphql +160 -0
- package/src/operations/followers.graphql +45 -0
- package/src/operations/integrations.graphql +216 -0
- package/src/operations/leaderboard.graphql +54 -0
- package/src/operations/media.graphql +179 -0
- package/src/operations/notifications.graphql +93 -0
- package/src/operations/offers.graphql +368 -0
- package/src/operations/onboarding.graphql +29 -0
- package/src/operations/sponsor.graphql +368 -0
- package/src/operations/sport.graphql +132 -0
- package/src/operations/teams-clubs.graphql +398 -0
- package/src/operations/user.graphql +446 -0
- package/tsconfig.lib.json +10 -0
- package/src/client/index.d.ts +0 -25
- package/src/client/index.js +0 -44
- package/src/client/index.js.map +0 -1
- package/src/client/runtime/batcher.d.ts +0 -36
- package/src/client/runtime/batcher.js +0 -123
- package/src/client/runtime/batcher.js.map +0 -1
- package/src/client/runtime/createClient.d.ts +0 -17
- package/src/client/runtime/createClient.js +0 -28
- package/src/client/runtime/createClient.js.map +0 -1
- package/src/client/runtime/error.d.ts +0 -15
- package/src/client/runtime/error.js +0 -19
- package/src/client/runtime/error.js.map +0 -1
- package/src/client/runtime/fetcher.d.ts +0 -10
- package/src/client/runtime/fetcher.js +0 -68
- package/src/client/runtime/fetcher.js.map +0 -1
- package/src/client/runtime/generateGraphqlOperation.d.ts +0 -30
- package/src/client/runtime/generateGraphqlOperation.js +0 -134
- package/src/client/runtime/generateGraphqlOperation.js.map +0 -1
- package/src/client/runtime/index.d.ts +0 -11
- package/src/client/runtime/index.js +0 -17
- package/src/client/runtime/index.js.map +0 -1
- package/src/client/runtime/linkTypeMap.d.ts +0 -9
- package/src/client/runtime/linkTypeMap.js +0 -95
- package/src/client/runtime/linkTypeMap.js.map +0 -1
- package/src/client/runtime/typeSelection.d.ts +0 -28
- package/src/client/runtime/typeSelection.js +0 -3
- package/src/client/runtime/typeSelection.js.map +0 -1
- package/src/client/runtime/types.d.ts +0 -55
- package/src/client/runtime/types.js +0 -3
- package/src/client/runtime/types.js.map +0 -1
- package/src/client/schema.d.ts +0 -8244
- package/src/client/schema.js +0 -1746
- package/src/client/schema.js.map +0 -1
- package/src/client/types.d.ts +0 -4369
- package/src/client/types.js +0 -11480
- package/src/client/types.js.map +0 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
# User query/management operations
|
|
2
|
+
# Extracted from vtx-base-api.ts
|
|
3
|
+
|
|
4
|
+
query FindUserByEmail($email: String!) {
|
|
5
|
+
findUserByEmail(email: $email) {
|
|
6
|
+
_id
|
|
7
|
+
loginEmail
|
|
8
|
+
suspended
|
|
9
|
+
domains {
|
|
10
|
+
_id
|
|
11
|
+
name
|
|
12
|
+
description
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
query FindVtxUser($input: FindVtxUserDto!) {
|
|
18
|
+
findVtxUser(input: $input) {
|
|
19
|
+
_id
|
|
20
|
+
loginEmail
|
|
21
|
+
suspended
|
|
22
|
+
domains {
|
|
23
|
+
_id
|
|
24
|
+
name
|
|
25
|
+
description
|
|
26
|
+
tenant {
|
|
27
|
+
_id
|
|
28
|
+
name
|
|
29
|
+
tenant_uri
|
|
30
|
+
domain {
|
|
31
|
+
_id
|
|
32
|
+
name
|
|
33
|
+
description
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
query GetUserImagesFromEmail($loginEmail: String!) {
|
|
41
|
+
getUserImagesFromEmail(loginEmail: $loginEmail) {
|
|
42
|
+
profilePictureUrl
|
|
43
|
+
cardPictureUrl
|
|
44
|
+
bannerPictureUrl
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
mutation RegisterNewDomainTenant($tenant: CreateTenantInput!) {
|
|
49
|
+
registerNewDomainTenant(tenant: $tenant) {
|
|
50
|
+
_id
|
|
51
|
+
name
|
|
52
|
+
email
|
|
53
|
+
tenant_uri
|
|
54
|
+
owner {
|
|
55
|
+
_id
|
|
56
|
+
loginEmail
|
|
57
|
+
suspended
|
|
58
|
+
}
|
|
59
|
+
domain {
|
|
60
|
+
_id
|
|
61
|
+
name
|
|
62
|
+
description
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
mutation RegisterNewDomainTenantWithLogin($tenant: CreateTenantInput!) {
|
|
68
|
+
registerNewDomainTenantWithLogin(tenant: $tenant) {
|
|
69
|
+
_id
|
|
70
|
+
name
|
|
71
|
+
email
|
|
72
|
+
tenant_uri
|
|
73
|
+
owner {
|
|
74
|
+
_id
|
|
75
|
+
loginEmail
|
|
76
|
+
suspended
|
|
77
|
+
}
|
|
78
|
+
domain {
|
|
79
|
+
_id
|
|
80
|
+
name
|
|
81
|
+
description
|
|
82
|
+
}
|
|
83
|
+
user {
|
|
84
|
+
_id
|
|
85
|
+
loginEmail
|
|
86
|
+
suspended
|
|
87
|
+
domains {
|
|
88
|
+
_id
|
|
89
|
+
name
|
|
90
|
+
description
|
|
91
|
+
}
|
|
92
|
+
token {
|
|
93
|
+
actualToken
|
|
94
|
+
refreshToken
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
mutation RegisterUserToDomainFromEmail($input: RegisterUserToDomainFromEmailInput!) {
|
|
101
|
+
registerUserToDomainFromEmail(input: $input) {
|
|
102
|
+
_id
|
|
103
|
+
loginEmail
|
|
104
|
+
suspended
|
|
105
|
+
domains {
|
|
106
|
+
_id
|
|
107
|
+
name
|
|
108
|
+
description
|
|
109
|
+
tenant {
|
|
110
|
+
_id
|
|
111
|
+
name
|
|
112
|
+
tenant_uri
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
mutation RegisterMember($input: RegisterMemberDto!) {
|
|
119
|
+
registerMember(input: $input) {
|
|
120
|
+
_id
|
|
121
|
+
fullName
|
|
122
|
+
screenName
|
|
123
|
+
memberPicture {
|
|
124
|
+
_id
|
|
125
|
+
name
|
|
126
|
+
contentType
|
|
127
|
+
size
|
|
128
|
+
useType
|
|
129
|
+
url
|
|
130
|
+
key
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
query FindMemberForUser($loginEmail: String!) {
|
|
136
|
+
findMemberForUser(loginEmail: $loginEmail) {
|
|
137
|
+
_id
|
|
138
|
+
fullName
|
|
139
|
+
screenName
|
|
140
|
+
memberPicture {
|
|
141
|
+
_id
|
|
142
|
+
name
|
|
143
|
+
contentType
|
|
144
|
+
size
|
|
145
|
+
useType
|
|
146
|
+
url
|
|
147
|
+
key
|
|
148
|
+
pendingDelete
|
|
149
|
+
}
|
|
150
|
+
donations {
|
|
151
|
+
checkoutSessionId
|
|
152
|
+
fundingCheckoutSessionDataId
|
|
153
|
+
donationMode
|
|
154
|
+
completed
|
|
155
|
+
confirmed
|
|
156
|
+
donationAmount
|
|
157
|
+
completedDate
|
|
158
|
+
createdDate
|
|
159
|
+
athleteId
|
|
160
|
+
athleteName
|
|
161
|
+
message
|
|
162
|
+
campaignReference {
|
|
163
|
+
_id
|
|
164
|
+
title
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
query FindSponsorAthleteInvitation($input: FindSponsorAthleteInvitationDto!) {
|
|
171
|
+
findSponsorAthleteInvitation(input: $input) {
|
|
172
|
+
_id
|
|
173
|
+
name
|
|
174
|
+
email
|
|
175
|
+
dateSent
|
|
176
|
+
sponsor {
|
|
177
|
+
_id
|
|
178
|
+
name
|
|
179
|
+
description
|
|
180
|
+
approved
|
|
181
|
+
}
|
|
182
|
+
magicLink {
|
|
183
|
+
_id
|
|
184
|
+
code
|
|
185
|
+
type
|
|
186
|
+
url
|
|
187
|
+
expires
|
|
188
|
+
isExpired
|
|
189
|
+
}
|
|
190
|
+
brand {
|
|
191
|
+
_id
|
|
192
|
+
name
|
|
193
|
+
slogan
|
|
194
|
+
website
|
|
195
|
+
description
|
|
196
|
+
approved
|
|
197
|
+
published
|
|
198
|
+
logo {
|
|
199
|
+
_id
|
|
200
|
+
name
|
|
201
|
+
contentType
|
|
202
|
+
size
|
|
203
|
+
useType
|
|
204
|
+
url
|
|
205
|
+
key
|
|
206
|
+
}
|
|
207
|
+
banner {
|
|
208
|
+
_id
|
|
209
|
+
name
|
|
210
|
+
contentType
|
|
211
|
+
size
|
|
212
|
+
useType
|
|
213
|
+
url
|
|
214
|
+
key
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
status
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
mutation SendAthleteInvitations($input: InviteAthletesDto!) {
|
|
222
|
+
sendAthleteInvitations(input: $input) {
|
|
223
|
+
_id
|
|
224
|
+
name
|
|
225
|
+
email
|
|
226
|
+
dateSent
|
|
227
|
+
sponsor {
|
|
228
|
+
_id
|
|
229
|
+
name
|
|
230
|
+
tenant {
|
|
231
|
+
_id
|
|
232
|
+
name
|
|
233
|
+
tenant_uri
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
magicLink {
|
|
237
|
+
_id
|
|
238
|
+
code
|
|
239
|
+
type
|
|
240
|
+
url
|
|
241
|
+
expires
|
|
242
|
+
data
|
|
243
|
+
isExpired
|
|
244
|
+
}
|
|
245
|
+
brand {
|
|
246
|
+
_id
|
|
247
|
+
name
|
|
248
|
+
logo {
|
|
249
|
+
_id
|
|
250
|
+
name
|
|
251
|
+
contentType
|
|
252
|
+
url
|
|
253
|
+
useType
|
|
254
|
+
}
|
|
255
|
+
website
|
|
256
|
+
}
|
|
257
|
+
status
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
query FindCitiesStartingWith($text: String!) {
|
|
262
|
+
findCitiesStartingWith(text: $text) {
|
|
263
|
+
_id
|
|
264
|
+
name
|
|
265
|
+
localizedName
|
|
266
|
+
state {
|
|
267
|
+
_id
|
|
268
|
+
name
|
|
269
|
+
country {
|
|
270
|
+
_id
|
|
271
|
+
name
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
latitude
|
|
275
|
+
longitude
|
|
276
|
+
timezone
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
query FindCityById($cityId: String!) {
|
|
281
|
+
findCityById(cityId: $cityId) {
|
|
282
|
+
_id
|
|
283
|
+
name
|
|
284
|
+
localizedName
|
|
285
|
+
state {
|
|
286
|
+
_id
|
|
287
|
+
name
|
|
288
|
+
country {
|
|
289
|
+
_id
|
|
290
|
+
name
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
latitude
|
|
294
|
+
longitude
|
|
295
|
+
timezone
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
query ScreenNameAvailability($input: existValueDto!) {
|
|
300
|
+
screenNameAvailability(input: $input) {
|
|
301
|
+
exist
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
query GetAllUsers {
|
|
306
|
+
getAllUsers {
|
|
307
|
+
_id
|
|
308
|
+
loginEmail
|
|
309
|
+
firstName
|
|
310
|
+
lastName
|
|
311
|
+
screenName
|
|
312
|
+
suspended
|
|
313
|
+
domains {
|
|
314
|
+
_id
|
|
315
|
+
name
|
|
316
|
+
description
|
|
317
|
+
}
|
|
318
|
+
athlete {
|
|
319
|
+
_id
|
|
320
|
+
firstName
|
|
321
|
+
lastName
|
|
322
|
+
screenName
|
|
323
|
+
dob
|
|
324
|
+
competitionGender
|
|
325
|
+
country {
|
|
326
|
+
_id
|
|
327
|
+
name
|
|
328
|
+
}
|
|
329
|
+
location {
|
|
330
|
+
_id
|
|
331
|
+
cityNameGeocode
|
|
332
|
+
stateNameGeocode
|
|
333
|
+
countryIso2CodeGeocode
|
|
334
|
+
city {
|
|
335
|
+
_id
|
|
336
|
+
name
|
|
337
|
+
localizedName
|
|
338
|
+
state {
|
|
339
|
+
_id
|
|
340
|
+
name
|
|
341
|
+
country {
|
|
342
|
+
_id
|
|
343
|
+
name
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
mainSport {
|
|
349
|
+
_id
|
|
350
|
+
name
|
|
351
|
+
}
|
|
352
|
+
mainSportLevel {
|
|
353
|
+
_id
|
|
354
|
+
label
|
|
355
|
+
}
|
|
356
|
+
allSports {
|
|
357
|
+
_id
|
|
358
|
+
name
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
member {
|
|
362
|
+
_id
|
|
363
|
+
fullName
|
|
364
|
+
screenName
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
query GetUsersPaginated($query: UserQueryDto) {
|
|
370
|
+
getUsersPaginated(query: $query) {
|
|
371
|
+
items {
|
|
372
|
+
_id
|
|
373
|
+
loginEmail
|
|
374
|
+
firstName
|
|
375
|
+
lastName
|
|
376
|
+
screenName
|
|
377
|
+
suspended
|
|
378
|
+
domains {
|
|
379
|
+
_id
|
|
380
|
+
name
|
|
381
|
+
description
|
|
382
|
+
}
|
|
383
|
+
athlete {
|
|
384
|
+
_id
|
|
385
|
+
mainSport {
|
|
386
|
+
_id
|
|
387
|
+
name
|
|
388
|
+
}
|
|
389
|
+
mainSportLevel {
|
|
390
|
+
_id
|
|
391
|
+
label
|
|
392
|
+
}
|
|
393
|
+
competitionGender
|
|
394
|
+
dob
|
|
395
|
+
country {
|
|
396
|
+
_id
|
|
397
|
+
name
|
|
398
|
+
}
|
|
399
|
+
location {
|
|
400
|
+
city {
|
|
401
|
+
_id
|
|
402
|
+
name
|
|
403
|
+
state {
|
|
404
|
+
_id
|
|
405
|
+
name
|
|
406
|
+
country {
|
|
407
|
+
_id
|
|
408
|
+
name
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
cityNameGeocode
|
|
413
|
+
stateNameGeocode
|
|
414
|
+
}
|
|
415
|
+
aboutMe
|
|
416
|
+
allSports {
|
|
417
|
+
_id
|
|
418
|
+
name
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
member {
|
|
422
|
+
_id
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
pagination {
|
|
426
|
+
currentPage
|
|
427
|
+
totalPages
|
|
428
|
+
totalItems
|
|
429
|
+
itemsPerPage
|
|
430
|
+
hasNextPage
|
|
431
|
+
hasPreviousPage
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
query GetDatabaseTextFile($input: GetDatabaseFileDto!) {
|
|
437
|
+
getDatabaseTextFile(input: $input) {
|
|
438
|
+
_id
|
|
439
|
+
identifier
|
|
440
|
+
version
|
|
441
|
+
contentType
|
|
442
|
+
updated
|
|
443
|
+
created
|
|
444
|
+
content
|
|
445
|
+
}
|
|
446
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"outDir": "../../dist/libs/vtx-backend-client",
|
|
6
|
+
"paths":{}
|
|
7
|
+
},
|
|
8
|
+
"include": ["src/**/*", "LICENSE.md", "README.md"],
|
|
9
|
+
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
|
10
|
+
}
|
package/src/client/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { QueryGenqlSelection, Query, MutationGenqlSelection, Mutation } from './schema';
|
|
2
|
-
import { type FieldsSelection, type GraphqlOperation, type ClientOptions, GenqlError } from './runtime';
|
|
3
|
-
export type { FieldsSelection } from './runtime';
|
|
4
|
-
export { GenqlError };
|
|
5
|
-
export * from './schema';
|
|
6
|
-
export interface Client {
|
|
7
|
-
query<R extends QueryGenqlSelection>(request: R & {
|
|
8
|
-
__name?: string;
|
|
9
|
-
}): Promise<FieldsSelection<Query, R>>;
|
|
10
|
-
mutation<R extends MutationGenqlSelection>(request: R & {
|
|
11
|
-
__name?: string;
|
|
12
|
-
}): Promise<FieldsSelection<Mutation, R>>;
|
|
13
|
-
}
|
|
14
|
-
export declare const createClient: (options?: ClientOptions) => Client;
|
|
15
|
-
export declare const everything: {
|
|
16
|
-
__scalar: boolean;
|
|
17
|
-
};
|
|
18
|
-
export type QueryResult<fields extends QueryGenqlSelection> = FieldsSelection<Query, fields>;
|
|
19
|
-
export declare const generateQueryOp: (fields: QueryGenqlSelection & {
|
|
20
|
-
__name?: string;
|
|
21
|
-
}) => GraphqlOperation;
|
|
22
|
-
export type MutationResult<fields extends MutationGenqlSelection> = FieldsSelection<Mutation, fields>;
|
|
23
|
-
export declare const generateMutationOp: (fields: MutationGenqlSelection & {
|
|
24
|
-
__name?: string;
|
|
25
|
-
}) => GraphqlOperation;
|
package/src/client/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.generateMutationOp = exports.generateQueryOp = exports.everything = exports.createClient = exports.GenqlError = void 0;
|
|
18
|
-
const runtime_1 = require("./runtime");
|
|
19
|
-
Object.defineProperty(exports, "GenqlError", { enumerable: true, get: function () { return runtime_1.GenqlError; } });
|
|
20
|
-
const types_1 = require("./types");
|
|
21
|
-
__exportStar(require("./schema"), exports);
|
|
22
|
-
const typeMap = (0, runtime_1.linkTypeMap)(types_1.default);
|
|
23
|
-
const createClient = function (options) {
|
|
24
|
-
return (0, runtime_1.createClient)({
|
|
25
|
-
url: undefined,
|
|
26
|
-
...options,
|
|
27
|
-
queryRoot: typeMap.Query,
|
|
28
|
-
mutationRoot: typeMap.Mutation,
|
|
29
|
-
subscriptionRoot: typeMap.Subscription,
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
exports.createClient = createClient;
|
|
33
|
-
exports.everything = {
|
|
34
|
-
__scalar: true,
|
|
35
|
-
};
|
|
36
|
-
const generateQueryOp = function (fields) {
|
|
37
|
-
return (0, runtime_1.generateGraphqlOperation)('query', typeMap.Query, fields);
|
|
38
|
-
};
|
|
39
|
-
exports.generateQueryOp = generateQueryOp;
|
|
40
|
-
const generateMutationOp = function (fields) {
|
|
41
|
-
return (0, runtime_1.generateGraphqlOperation)('mutation', typeMap.Mutation, fields);
|
|
42
|
-
};
|
|
43
|
-
exports.generateMutationOp = generateMutationOp;
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
package/src/client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/vtx-backend-client/src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAOA,uCAQkB;AAET,2FAHP,oBAAU,OAGO;AAEnB,mCAA2B;AAC3B,2CAAwB;AACxB,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,eAAY,CAAC,CAAA;AAYlC,MAAM,YAAY,GAAG,UAAU,OAAuB;IAC3D,OAAO,IAAA,sBAAoB,EAAC;QAC1B,GAAG,EAAE,SAAS;QAEd,GAAG,OAAO;QACV,SAAS,EAAE,OAAO,CAAC,KAAM;QACzB,YAAY,EAAE,OAAO,CAAC,QAAS;QAC/B,gBAAgB,EAAE,OAAO,CAAC,YAAa;KACxC,CAAQ,CAAA;AACX,CAAC,CAAA;AATY,QAAA,YAAY,gBASxB;AAEY,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAE,IAAI;CACf,CAAA;AAMM,MAAM,eAAe,GAEJ,UAAU,MAAM;IACtC,OAAO,IAAA,kCAAwB,EAAC,OAAO,EAAE,OAAO,CAAC,KAAM,EAAE,MAAa,CAAC,CAAA;AACzE,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAIM,MAAM,kBAAkB,GAEP,UAAU,MAAM;IACtC,OAAO,IAAA,kCAAwB,EAAC,UAAU,EAAE,OAAO,CAAC,QAAS,EAAE,MAAa,CAAC,CAAA;AAC/E,CAAC,CAAA;AAJY,QAAA,kBAAkB,sBAI9B"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { GraphqlOperation } from './generateGraphqlOperation';
|
|
2
|
-
type Variables = Record<string, any>;
|
|
3
|
-
type QueryError = Error & {
|
|
4
|
-
message: string;
|
|
5
|
-
locations?: Array<{
|
|
6
|
-
line: number;
|
|
7
|
-
column: number;
|
|
8
|
-
}>;
|
|
9
|
-
path?: any;
|
|
10
|
-
rid: string;
|
|
11
|
-
details?: Record<string, any>;
|
|
12
|
-
};
|
|
13
|
-
type Result = {
|
|
14
|
-
data: Record<string, any>;
|
|
15
|
-
errors: Array<QueryError>;
|
|
16
|
-
};
|
|
17
|
-
type Fetcher = (batchedQuery: GraphqlOperation | Array<GraphqlOperation>) => Promise<Array<Result>>;
|
|
18
|
-
type Options = {
|
|
19
|
-
batchInterval?: number;
|
|
20
|
-
shouldBatch?: boolean;
|
|
21
|
-
maxBatchSize?: number;
|
|
22
|
-
};
|
|
23
|
-
type Queue = Array<{
|
|
24
|
-
request: GraphqlOperation;
|
|
25
|
-
resolve: (...args: Array<any>) => any;
|
|
26
|
-
reject: (...args: Array<any>) => any;
|
|
27
|
-
}>;
|
|
28
|
-
export declare class QueryBatcher {
|
|
29
|
-
fetcher: Fetcher;
|
|
30
|
-
_options: Options;
|
|
31
|
-
_queue: Queue;
|
|
32
|
-
constructor(fetcher: Fetcher, { batchInterval, shouldBatch, maxBatchSize, }?: Options);
|
|
33
|
-
fetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
|
|
34
|
-
forceFetch(query: string, variables?: Variables, operationName?: string, overrides?: Options): Promise<Result>;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueryBatcher = void 0;
|
|
4
|
-
const error_1 = require("./error");
|
|
5
|
-
function dispatchQueueBatch(client, queue) {
|
|
6
|
-
let batchedQuery = queue.map((item) => item.request);
|
|
7
|
-
if (batchedQuery.length === 1) {
|
|
8
|
-
batchedQuery = batchedQuery[0];
|
|
9
|
-
}
|
|
10
|
-
(() => {
|
|
11
|
-
try {
|
|
12
|
-
return client.fetcher(batchedQuery);
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
return Promise.reject(e);
|
|
16
|
-
}
|
|
17
|
-
})().then((responses) => {
|
|
18
|
-
if (queue.length === 1 && !Array.isArray(responses)) {
|
|
19
|
-
if (responses.errors && responses.errors.length) {
|
|
20
|
-
queue[0].reject(new error_1.GenqlError(responses.errors, responses.data));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
queue[0].resolve(responses);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
else if (responses.length !== queue.length) {
|
|
27
|
-
throw new Error('response length did not match query length');
|
|
28
|
-
}
|
|
29
|
-
for (let i = 0; i < queue.length; i++) {
|
|
30
|
-
if (responses[i].errors && responses[i].errors.length) {
|
|
31
|
-
queue[i].reject(new error_1.GenqlError(responses[i].errors, responses[i].data));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
queue[i].resolve(responses[i]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
.catch((e) => {
|
|
39
|
-
for (let i = 0; i < queue.length; i++) {
|
|
40
|
-
queue[i].reject(e);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function dispatchQueue(client, options) {
|
|
45
|
-
const queue = client._queue;
|
|
46
|
-
const maxBatchSize = options.maxBatchSize || 0;
|
|
47
|
-
client._queue = [];
|
|
48
|
-
if (maxBatchSize > 0 && maxBatchSize < queue.length) {
|
|
49
|
-
for (let i = 0; i < queue.length / maxBatchSize; i++) {
|
|
50
|
-
dispatchQueueBatch(client, queue.slice(i * maxBatchSize, (i + 1) * maxBatchSize));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
dispatchQueueBatch(client, queue);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
class QueryBatcher {
|
|
58
|
-
constructor(fetcher, { batchInterval = 6, shouldBatch = true, maxBatchSize = 0, } = {}) {
|
|
59
|
-
this.fetcher = fetcher;
|
|
60
|
-
this._options = {
|
|
61
|
-
batchInterval,
|
|
62
|
-
shouldBatch,
|
|
63
|
-
maxBatchSize,
|
|
64
|
-
};
|
|
65
|
-
this._queue = [];
|
|
66
|
-
}
|
|
67
|
-
fetch(query, variables, operationName, overrides = {}) {
|
|
68
|
-
const request = {
|
|
69
|
-
query,
|
|
70
|
-
};
|
|
71
|
-
const options = Object.assign({}, this._options, overrides);
|
|
72
|
-
if (variables) {
|
|
73
|
-
request.variables = variables;
|
|
74
|
-
}
|
|
75
|
-
if (operationName) {
|
|
76
|
-
request.operationName = operationName;
|
|
77
|
-
}
|
|
78
|
-
const promise = new Promise((resolve, reject) => {
|
|
79
|
-
this._queue.push({
|
|
80
|
-
request,
|
|
81
|
-
resolve,
|
|
82
|
-
reject,
|
|
83
|
-
});
|
|
84
|
-
if (this._queue.length === 1) {
|
|
85
|
-
if (options.shouldBatch) {
|
|
86
|
-
setTimeout(() => dispatchQueue(this, options), options.batchInterval);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
dispatchQueue(this, options);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
return promise;
|
|
94
|
-
}
|
|
95
|
-
forceFetch(query, variables, operationName, overrides = {}) {
|
|
96
|
-
const request = {
|
|
97
|
-
query,
|
|
98
|
-
};
|
|
99
|
-
const options = Object.assign({}, this._options, overrides, {
|
|
100
|
-
shouldBatch: false,
|
|
101
|
-
});
|
|
102
|
-
if (variables) {
|
|
103
|
-
request.variables = variables;
|
|
104
|
-
}
|
|
105
|
-
if (operationName) {
|
|
106
|
-
request.operationName = operationName;
|
|
107
|
-
}
|
|
108
|
-
const promise = new Promise((resolve, reject) => {
|
|
109
|
-
const client = new QueryBatcher(this.fetcher, this._options);
|
|
110
|
-
client._queue = [
|
|
111
|
-
{
|
|
112
|
-
request,
|
|
113
|
-
resolve,
|
|
114
|
-
reject,
|
|
115
|
-
},
|
|
116
|
-
];
|
|
117
|
-
dispatchQueue(client, options);
|
|
118
|
-
});
|
|
119
|
-
return promise;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.QueryBatcher = QueryBatcher;
|
|
123
|
-
//# sourceMappingURL=batcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batcher.js","sourceRoot":"","sources":["../../../../../../libs/vtx-backend-client/src/client/runtime/batcher.ts"],"names":[],"mappings":";;;AAEA,mCAAoC;AAwCpC,SAAS,kBAAkB,CAAC,MAAoB,EAAE,KAAY;IAC1D,IAAI,YAAY,GAAQ,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEzD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;IAClC,CAAC;IACD,CAAC,GAAG,EAAE;QACF,IAAI,CAAC;YACD,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACxC,CAAC;QAAC,OAAM,CAAC,EAAE,CAAC;YACR,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAc,EAAE,EAAE;QACzB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAClD,IAAI,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC9C,KAAK,CAAC,C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,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAClB,CAAC;CACJ;AA9ID,oCA8IC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type BatchOptions } from './fetcher';
|
|
2
|
-
import type { ExecutionResult, LinkedType } from './types';
|
|
3
|
-
import { type GraphqlOperation } from './generateGraphqlOperation';
|
|
4
|
-
export type Headers = HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
|
|
5
|
-
export type BaseFetcher = (operation: GraphqlOperation | GraphqlOperation[]) => Promise<ExecutionResult | ExecutionResult[]>;
|
|
6
|
-
export type ClientOptions = Omit<RequestInit, 'body' | 'headers'> & {
|
|
7
|
-
url?: string;
|
|
8
|
-
batch?: BatchOptions | boolean;
|
|
9
|
-
fetcher?: BaseFetcher;
|
|
10
|
-
fetch?: Function;
|
|
11
|
-
headers?: Headers;
|
|
12
|
-
};
|
|
13
|
-
export declare const createClient: ({ queryRoot, mutationRoot, subscriptionRoot, ...options }: ClientOptions & {
|
|
14
|
-
queryRoot?: LinkedType;
|
|
15
|
-
mutationRoot?: LinkedType;
|
|
16
|
-
subscriptionRoot?: LinkedType;
|
|
17
|
-
}) => any;
|