@carddb/core 0.1.2 → 0.1.3
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/index.cjs +212 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -1
- package/dist/index.d.ts +103 -1
- package/dist/index.js +212 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -145,12 +145,15 @@ interface DatasetRecord {
|
|
|
145
145
|
updatedAt: string;
|
|
146
146
|
}
|
|
147
147
|
type DeckVisibility = 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
|
|
148
|
+
type DeckCollaboratorRole = 'VIEWER' | 'EDITOR';
|
|
148
149
|
interface Deck {
|
|
149
150
|
id: string;
|
|
150
151
|
accountId: string;
|
|
151
152
|
apiApplicationId: string | null;
|
|
152
153
|
gameId: string;
|
|
153
154
|
game: Game;
|
|
155
|
+
slug: string;
|
|
156
|
+
identifier: string;
|
|
154
157
|
title: string;
|
|
155
158
|
description: string | null;
|
|
156
159
|
formatKey: string | null;
|
|
@@ -159,9 +162,56 @@ interface Deck {
|
|
|
159
162
|
sourceUrl: string | null;
|
|
160
163
|
metadata: Record<string, unknown>;
|
|
161
164
|
entries: DeckEntry[];
|
|
165
|
+
latestPublishedVersion: DeckVersion | null;
|
|
166
|
+
publishedAt: string | null;
|
|
167
|
+
hasUnpublishedChanges: boolean;
|
|
162
168
|
createdAt: string;
|
|
163
169
|
updatedAt: string;
|
|
164
170
|
}
|
|
171
|
+
interface DeckVersion {
|
|
172
|
+
id: string;
|
|
173
|
+
deckId: string;
|
|
174
|
+
versionNumber: number;
|
|
175
|
+
slug: string;
|
|
176
|
+
identifier: string;
|
|
177
|
+
title: string;
|
|
178
|
+
description: string | null;
|
|
179
|
+
formatKey: string | null;
|
|
180
|
+
visibility: DeckVisibility;
|
|
181
|
+
externalRef: string | null;
|
|
182
|
+
sourceUrl: string | null;
|
|
183
|
+
metadata: Record<string, unknown>;
|
|
184
|
+
entries: DeckEntry[];
|
|
185
|
+
publishNote: string | null;
|
|
186
|
+
computedDiff: Record<string, unknown>;
|
|
187
|
+
publishedByAccountId: string | null;
|
|
188
|
+
publishedByApiApplicationId: string | null;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
}
|
|
191
|
+
type DeckVersionConnection = Connection<DeckVersion>;
|
|
192
|
+
interface DeckCollaborator {
|
|
193
|
+
id: string;
|
|
194
|
+
deckId: string;
|
|
195
|
+
accountId: string;
|
|
196
|
+
role: DeckCollaboratorRole;
|
|
197
|
+
createdByAccountId: string | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
}
|
|
201
|
+
interface DeckPreviewToken {
|
|
202
|
+
id: string;
|
|
203
|
+
deckId: string;
|
|
204
|
+
label: string | null;
|
|
205
|
+
expiresAt: string | null;
|
|
206
|
+
revokedAt: string | null;
|
|
207
|
+
lastUsedAt: string | null;
|
|
208
|
+
createdAt: string;
|
|
209
|
+
updatedAt: string;
|
|
210
|
+
}
|
|
211
|
+
interface DeckPreviewTokenCreatePayload {
|
|
212
|
+
token: string;
|
|
213
|
+
previewToken: DeckPreviewToken;
|
|
214
|
+
}
|
|
165
215
|
interface DeckEntry {
|
|
166
216
|
id: string;
|
|
167
217
|
datasetId: string;
|
|
@@ -203,6 +253,14 @@ interface DeckUpdateInput {
|
|
|
203
253
|
metadata?: Record<string, unknown>;
|
|
204
254
|
entries?: DeckEntryInput[];
|
|
205
255
|
}
|
|
256
|
+
interface DeckPublishInput {
|
|
257
|
+
note?: string;
|
|
258
|
+
}
|
|
259
|
+
interface DeckPreviewTokenCreateInput {
|
|
260
|
+
deckId: string;
|
|
261
|
+
label?: string;
|
|
262
|
+
expiresAt?: string;
|
|
263
|
+
}
|
|
206
264
|
interface HydrateDeckEntryInput {
|
|
207
265
|
identifier: string;
|
|
208
266
|
quantity: number;
|
|
@@ -626,6 +684,10 @@ interface ListDecksParams {
|
|
|
626
684
|
first?: number;
|
|
627
685
|
after?: string;
|
|
628
686
|
}
|
|
687
|
+
interface ListDeckVersionsParams {
|
|
688
|
+
first?: number;
|
|
689
|
+
after?: string;
|
|
690
|
+
}
|
|
629
691
|
declare const QueryBuilder: {
|
|
630
692
|
searchPublishers(params?: SearchPublishersParams): {
|
|
631
693
|
query: string;
|
|
@@ -689,9 +751,31 @@ declare const QueryBuilder: {
|
|
|
689
751
|
fetchDeckById(): {
|
|
690
752
|
query: string;
|
|
691
753
|
};
|
|
754
|
+
myDeck(): {
|
|
755
|
+
query: string;
|
|
756
|
+
};
|
|
757
|
+
fetchDeckBySlug(): {
|
|
758
|
+
query: string;
|
|
759
|
+
};
|
|
692
760
|
fetchDeckByExternalRef(): {
|
|
693
761
|
query: string;
|
|
694
762
|
};
|
|
763
|
+
deckVersion(): {
|
|
764
|
+
query: string;
|
|
765
|
+
};
|
|
766
|
+
deckVersions(params?: ListDeckVersionsParams): {
|
|
767
|
+
query: string;
|
|
768
|
+
variables: Record<string, unknown>;
|
|
769
|
+
};
|
|
770
|
+
deckPreview(): {
|
|
771
|
+
query: string;
|
|
772
|
+
};
|
|
773
|
+
deckCollaborators(): {
|
|
774
|
+
query: string;
|
|
775
|
+
};
|
|
776
|
+
deckPreviewTokens(): {
|
|
777
|
+
query: string;
|
|
778
|
+
};
|
|
695
779
|
createDeck(): {
|
|
696
780
|
query: string;
|
|
697
781
|
};
|
|
@@ -701,8 +785,26 @@ declare const QueryBuilder: {
|
|
|
701
785
|
deleteDeck(): {
|
|
702
786
|
query: string;
|
|
703
787
|
};
|
|
788
|
+
publishDeck(): {
|
|
789
|
+
query: string;
|
|
790
|
+
};
|
|
791
|
+
upsertDeckCollaborator(): {
|
|
792
|
+
query: string;
|
|
793
|
+
};
|
|
794
|
+
removeDeckCollaborator(): {
|
|
795
|
+
query: string;
|
|
796
|
+
};
|
|
797
|
+
createDeckPreviewToken(): {
|
|
798
|
+
query: string;
|
|
799
|
+
};
|
|
800
|
+
revokeDeckPreviewToken(): {
|
|
801
|
+
query: string;
|
|
802
|
+
};
|
|
704
803
|
deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
|
|
705
804
|
deckUpdateVariables(id: string, input: DeckUpdateInput): Record<string, unknown>;
|
|
805
|
+
deckPublishVariables(id: string, input?: DeckPublishInput): Record<string, unknown>;
|
|
806
|
+
deckCollaboratorVariables(deckId: string, accountId: string, role?: DeckCollaboratorRole): Record<string, unknown>;
|
|
807
|
+
deckPreviewTokenCreateVariables(input: DeckPreviewTokenCreateInput): Record<string, unknown>;
|
|
706
808
|
fetchMe(): {
|
|
707
809
|
query: string;
|
|
708
810
|
};
|
|
@@ -838,4 +940,4 @@ declare class Collection<T> implements AsyncIterable<T> {
|
|
|
838
940
|
each(): AsyncIterable<T>;
|
|
839
941
|
}
|
|
840
942
|
|
|
841
|
-
export { type APIAccount, type APIApplication, type APIKeyInfo, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckCreateInput, type DeckEntry, type DeckEntryInput, type DeckUpdateInput, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
|
943
|
+
export { type APIAccount, type APIApplication, type APIKeyInfo, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckCollaborator, type DeckCollaboratorRole, type DeckCreateInput, type DeckEntry, type DeckEntryInput, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckUpdateInput, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
package/dist/index.d.ts
CHANGED
|
@@ -145,12 +145,15 @@ interface DatasetRecord {
|
|
|
145
145
|
updatedAt: string;
|
|
146
146
|
}
|
|
147
147
|
type DeckVisibility = 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
|
|
148
|
+
type DeckCollaboratorRole = 'VIEWER' | 'EDITOR';
|
|
148
149
|
interface Deck {
|
|
149
150
|
id: string;
|
|
150
151
|
accountId: string;
|
|
151
152
|
apiApplicationId: string | null;
|
|
152
153
|
gameId: string;
|
|
153
154
|
game: Game;
|
|
155
|
+
slug: string;
|
|
156
|
+
identifier: string;
|
|
154
157
|
title: string;
|
|
155
158
|
description: string | null;
|
|
156
159
|
formatKey: string | null;
|
|
@@ -159,9 +162,56 @@ interface Deck {
|
|
|
159
162
|
sourceUrl: string | null;
|
|
160
163
|
metadata: Record<string, unknown>;
|
|
161
164
|
entries: DeckEntry[];
|
|
165
|
+
latestPublishedVersion: DeckVersion | null;
|
|
166
|
+
publishedAt: string | null;
|
|
167
|
+
hasUnpublishedChanges: boolean;
|
|
162
168
|
createdAt: string;
|
|
163
169
|
updatedAt: string;
|
|
164
170
|
}
|
|
171
|
+
interface DeckVersion {
|
|
172
|
+
id: string;
|
|
173
|
+
deckId: string;
|
|
174
|
+
versionNumber: number;
|
|
175
|
+
slug: string;
|
|
176
|
+
identifier: string;
|
|
177
|
+
title: string;
|
|
178
|
+
description: string | null;
|
|
179
|
+
formatKey: string | null;
|
|
180
|
+
visibility: DeckVisibility;
|
|
181
|
+
externalRef: string | null;
|
|
182
|
+
sourceUrl: string | null;
|
|
183
|
+
metadata: Record<string, unknown>;
|
|
184
|
+
entries: DeckEntry[];
|
|
185
|
+
publishNote: string | null;
|
|
186
|
+
computedDiff: Record<string, unknown>;
|
|
187
|
+
publishedByAccountId: string | null;
|
|
188
|
+
publishedByApiApplicationId: string | null;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
}
|
|
191
|
+
type DeckVersionConnection = Connection<DeckVersion>;
|
|
192
|
+
interface DeckCollaborator {
|
|
193
|
+
id: string;
|
|
194
|
+
deckId: string;
|
|
195
|
+
accountId: string;
|
|
196
|
+
role: DeckCollaboratorRole;
|
|
197
|
+
createdByAccountId: string | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
}
|
|
201
|
+
interface DeckPreviewToken {
|
|
202
|
+
id: string;
|
|
203
|
+
deckId: string;
|
|
204
|
+
label: string | null;
|
|
205
|
+
expiresAt: string | null;
|
|
206
|
+
revokedAt: string | null;
|
|
207
|
+
lastUsedAt: string | null;
|
|
208
|
+
createdAt: string;
|
|
209
|
+
updatedAt: string;
|
|
210
|
+
}
|
|
211
|
+
interface DeckPreviewTokenCreatePayload {
|
|
212
|
+
token: string;
|
|
213
|
+
previewToken: DeckPreviewToken;
|
|
214
|
+
}
|
|
165
215
|
interface DeckEntry {
|
|
166
216
|
id: string;
|
|
167
217
|
datasetId: string;
|
|
@@ -203,6 +253,14 @@ interface DeckUpdateInput {
|
|
|
203
253
|
metadata?: Record<string, unknown>;
|
|
204
254
|
entries?: DeckEntryInput[];
|
|
205
255
|
}
|
|
256
|
+
interface DeckPublishInput {
|
|
257
|
+
note?: string;
|
|
258
|
+
}
|
|
259
|
+
interface DeckPreviewTokenCreateInput {
|
|
260
|
+
deckId: string;
|
|
261
|
+
label?: string;
|
|
262
|
+
expiresAt?: string;
|
|
263
|
+
}
|
|
206
264
|
interface HydrateDeckEntryInput {
|
|
207
265
|
identifier: string;
|
|
208
266
|
quantity: number;
|
|
@@ -626,6 +684,10 @@ interface ListDecksParams {
|
|
|
626
684
|
first?: number;
|
|
627
685
|
after?: string;
|
|
628
686
|
}
|
|
687
|
+
interface ListDeckVersionsParams {
|
|
688
|
+
first?: number;
|
|
689
|
+
after?: string;
|
|
690
|
+
}
|
|
629
691
|
declare const QueryBuilder: {
|
|
630
692
|
searchPublishers(params?: SearchPublishersParams): {
|
|
631
693
|
query: string;
|
|
@@ -689,9 +751,31 @@ declare const QueryBuilder: {
|
|
|
689
751
|
fetchDeckById(): {
|
|
690
752
|
query: string;
|
|
691
753
|
};
|
|
754
|
+
myDeck(): {
|
|
755
|
+
query: string;
|
|
756
|
+
};
|
|
757
|
+
fetchDeckBySlug(): {
|
|
758
|
+
query: string;
|
|
759
|
+
};
|
|
692
760
|
fetchDeckByExternalRef(): {
|
|
693
761
|
query: string;
|
|
694
762
|
};
|
|
763
|
+
deckVersion(): {
|
|
764
|
+
query: string;
|
|
765
|
+
};
|
|
766
|
+
deckVersions(params?: ListDeckVersionsParams): {
|
|
767
|
+
query: string;
|
|
768
|
+
variables: Record<string, unknown>;
|
|
769
|
+
};
|
|
770
|
+
deckPreview(): {
|
|
771
|
+
query: string;
|
|
772
|
+
};
|
|
773
|
+
deckCollaborators(): {
|
|
774
|
+
query: string;
|
|
775
|
+
};
|
|
776
|
+
deckPreviewTokens(): {
|
|
777
|
+
query: string;
|
|
778
|
+
};
|
|
695
779
|
createDeck(): {
|
|
696
780
|
query: string;
|
|
697
781
|
};
|
|
@@ -701,8 +785,26 @@ declare const QueryBuilder: {
|
|
|
701
785
|
deleteDeck(): {
|
|
702
786
|
query: string;
|
|
703
787
|
};
|
|
788
|
+
publishDeck(): {
|
|
789
|
+
query: string;
|
|
790
|
+
};
|
|
791
|
+
upsertDeckCollaborator(): {
|
|
792
|
+
query: string;
|
|
793
|
+
};
|
|
794
|
+
removeDeckCollaborator(): {
|
|
795
|
+
query: string;
|
|
796
|
+
};
|
|
797
|
+
createDeckPreviewToken(): {
|
|
798
|
+
query: string;
|
|
799
|
+
};
|
|
800
|
+
revokeDeckPreviewToken(): {
|
|
801
|
+
query: string;
|
|
802
|
+
};
|
|
704
803
|
deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
|
|
705
804
|
deckUpdateVariables(id: string, input: DeckUpdateInput): Record<string, unknown>;
|
|
805
|
+
deckPublishVariables(id: string, input?: DeckPublishInput): Record<string, unknown>;
|
|
806
|
+
deckCollaboratorVariables(deckId: string, accountId: string, role?: DeckCollaboratorRole): Record<string, unknown>;
|
|
807
|
+
deckPreviewTokenCreateVariables(input: DeckPreviewTokenCreateInput): Record<string, unknown>;
|
|
706
808
|
fetchMe(): {
|
|
707
809
|
query: string;
|
|
708
810
|
};
|
|
@@ -838,4 +940,4 @@ declare class Collection<T> implements AsyncIterable<T> {
|
|
|
838
940
|
each(): AsyncIterable<T>;
|
|
839
941
|
}
|
|
840
942
|
|
|
841
|
-
export { type APIAccount, type APIApplication, type APIKeyInfo, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckCreateInput, type DeckEntry, type DeckEntryInput, type DeckUpdateInput, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
|
943
|
+
export { type APIAccount, type APIApplication, type APIKeyInfo, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckCollaborator, type DeckCollaboratorRole, type DeckCreateInput, type DeckEntry, type DeckEntryInput, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckUpdateInput, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
package/dist/index.js
CHANGED
|
@@ -368,11 +368,64 @@ var RECORD_FIELDS = `
|
|
|
368
368
|
publisherId
|
|
369
369
|
}
|
|
370
370
|
`;
|
|
371
|
+
var DECK_VERSION_FIELDS = `
|
|
372
|
+
id
|
|
373
|
+
deckId
|
|
374
|
+
versionNumber
|
|
375
|
+
slug
|
|
376
|
+
identifier
|
|
377
|
+
title
|
|
378
|
+
description
|
|
379
|
+
formatKey
|
|
380
|
+
visibility
|
|
381
|
+
externalRef
|
|
382
|
+
sourceUrl
|
|
383
|
+
metadata
|
|
384
|
+
publishNote
|
|
385
|
+
computedDiff
|
|
386
|
+
publishedByAccountId
|
|
387
|
+
publishedByApiApplicationId
|
|
388
|
+
createdAt
|
|
389
|
+
entries {
|
|
390
|
+
id
|
|
391
|
+
datasetId
|
|
392
|
+
recordId
|
|
393
|
+
identifier
|
|
394
|
+
quantity
|
|
395
|
+
section
|
|
396
|
+
sortOrder
|
|
397
|
+
annotations
|
|
398
|
+
record {
|
|
399
|
+
${RECORD_FIELDS}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
`;
|
|
403
|
+
var DECK_COLLABORATOR_FIELDS = `
|
|
404
|
+
id
|
|
405
|
+
deckId
|
|
406
|
+
accountId
|
|
407
|
+
role
|
|
408
|
+
createdByAccountId
|
|
409
|
+
createdAt
|
|
410
|
+
updatedAt
|
|
411
|
+
`;
|
|
412
|
+
var DECK_PREVIEW_TOKEN_FIELDS = `
|
|
413
|
+
id
|
|
414
|
+
deckId
|
|
415
|
+
label
|
|
416
|
+
expiresAt
|
|
417
|
+
revokedAt
|
|
418
|
+
lastUsedAt
|
|
419
|
+
createdAt
|
|
420
|
+
updatedAt
|
|
421
|
+
`;
|
|
371
422
|
var DECK_FIELDS = `
|
|
372
423
|
id
|
|
373
424
|
accountId
|
|
374
425
|
apiApplicationId
|
|
375
426
|
gameId
|
|
427
|
+
slug
|
|
428
|
+
identifier
|
|
376
429
|
title
|
|
377
430
|
description
|
|
378
431
|
formatKey
|
|
@@ -380,6 +433,11 @@ var DECK_FIELDS = `
|
|
|
380
433
|
externalRef
|
|
381
434
|
sourceUrl
|
|
382
435
|
metadata
|
|
436
|
+
latestPublishedVersion {
|
|
437
|
+
${DECK_VERSION_FIELDS}
|
|
438
|
+
}
|
|
439
|
+
publishedAt
|
|
440
|
+
hasUnpublishedChanges
|
|
383
441
|
createdAt
|
|
384
442
|
updatedAt
|
|
385
443
|
game {
|
|
@@ -794,6 +852,28 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
794
852
|
`
|
|
795
853
|
};
|
|
796
854
|
},
|
|
855
|
+
myDeck() {
|
|
856
|
+
return {
|
|
857
|
+
query: `
|
|
858
|
+
query MyDeck($id: UUID!) {
|
|
859
|
+
myDeck(id: $id) {
|
|
860
|
+
${DECK_FIELDS}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
`
|
|
864
|
+
};
|
|
865
|
+
},
|
|
866
|
+
fetchDeckBySlug() {
|
|
867
|
+
return {
|
|
868
|
+
query: `
|
|
869
|
+
query FetchDeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
|
|
870
|
+
fetchDeckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
|
|
871
|
+
${DECK_FIELDS}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
`
|
|
875
|
+
};
|
|
876
|
+
},
|
|
797
877
|
fetchDeckByExternalRef() {
|
|
798
878
|
return {
|
|
799
879
|
query: `
|
|
@@ -805,6 +885,75 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
805
885
|
`
|
|
806
886
|
};
|
|
807
887
|
},
|
|
888
|
+
deckVersion() {
|
|
889
|
+
return {
|
|
890
|
+
query: `
|
|
891
|
+
query DeckVersion($id: UUID!) {
|
|
892
|
+
deckVersion(id: $id) {
|
|
893
|
+
${DECK_VERSION_FIELDS}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
`
|
|
897
|
+
};
|
|
898
|
+
},
|
|
899
|
+
deckVersions(params = {}) {
|
|
900
|
+
const variables = {};
|
|
901
|
+
const args = ["deckId: $deckId"];
|
|
902
|
+
const defs = ["$deckId: UUID!"];
|
|
903
|
+
if (params.first !== void 0) {
|
|
904
|
+
defs.push("$first: Int");
|
|
905
|
+
args.push("first: $first");
|
|
906
|
+
variables["first"] = params.first;
|
|
907
|
+
}
|
|
908
|
+
if (params.after !== void 0) {
|
|
909
|
+
defs.push("$after: String");
|
|
910
|
+
args.push("after: $after");
|
|
911
|
+
variables["after"] = params.after;
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
query: `
|
|
915
|
+
query DeckVersions(${defs.join(", ")}) {
|
|
916
|
+
deckVersions(${args.join(", ")}) {
|
|
917
|
+
${connectionFields(DECK_VERSION_FIELDS)}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
`,
|
|
921
|
+
variables
|
|
922
|
+
};
|
|
923
|
+
},
|
|
924
|
+
deckPreview() {
|
|
925
|
+
return {
|
|
926
|
+
query: `
|
|
927
|
+
query DeckPreview($token: String!) {
|
|
928
|
+
deckPreview(token: $token) {
|
|
929
|
+
${DECK_FIELDS}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
`
|
|
933
|
+
};
|
|
934
|
+
},
|
|
935
|
+
deckCollaborators() {
|
|
936
|
+
return {
|
|
937
|
+
query: `
|
|
938
|
+
query DeckCollaborators($deckId: UUID!) {
|
|
939
|
+
deckCollaborators(deckId: $deckId) {
|
|
940
|
+
${DECK_COLLABORATOR_FIELDS}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
`
|
|
944
|
+
};
|
|
945
|
+
},
|
|
946
|
+
deckPreviewTokens() {
|
|
947
|
+
return {
|
|
948
|
+
query: `
|
|
949
|
+
query DeckPreviewTokens($deckId: UUID!) {
|
|
950
|
+
deckPreviewTokens(deckId: $deckId) {
|
|
951
|
+
${DECK_PREVIEW_TOKEN_FIELDS}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
`
|
|
955
|
+
};
|
|
956
|
+
},
|
|
808
957
|
createDeck() {
|
|
809
958
|
return {
|
|
810
959
|
query: `
|
|
@@ -836,12 +985,75 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
836
985
|
`
|
|
837
986
|
};
|
|
838
987
|
},
|
|
988
|
+
publishDeck() {
|
|
989
|
+
return {
|
|
990
|
+
query: `
|
|
991
|
+
mutation DeckPublish($id: UUID!, $input: DeckPublishInput!) {
|
|
992
|
+
deckPublish(id: $id, input: $input) {
|
|
993
|
+
${DECK_VERSION_FIELDS}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
`
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
upsertDeckCollaborator() {
|
|
1000
|
+
return {
|
|
1001
|
+
query: `
|
|
1002
|
+
mutation DeckCollaboratorUpsert($deckId: UUID!, $accountId: UUID!, $role: DeckCollaboratorRole!) {
|
|
1003
|
+
deckCollaboratorUpsert(deckId: $deckId, accountId: $accountId, role: $role) {
|
|
1004
|
+
${DECK_COLLABORATOR_FIELDS}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
`
|
|
1008
|
+
};
|
|
1009
|
+
},
|
|
1010
|
+
removeDeckCollaborator() {
|
|
1011
|
+
return {
|
|
1012
|
+
query: `
|
|
1013
|
+
mutation DeckCollaboratorRemove($deckId: UUID!, $accountId: UUID!) {
|
|
1014
|
+
deckCollaboratorRemove(deckId: $deckId, accountId: $accountId)
|
|
1015
|
+
}
|
|
1016
|
+
`
|
|
1017
|
+
};
|
|
1018
|
+
},
|
|
1019
|
+
createDeckPreviewToken() {
|
|
1020
|
+
return {
|
|
1021
|
+
query: `
|
|
1022
|
+
mutation DeckPreviewTokenCreate($input: DeckPreviewTokenCreateInput!) {
|
|
1023
|
+
deckPreviewTokenCreate(input: $input) {
|
|
1024
|
+
token
|
|
1025
|
+
previewToken {
|
|
1026
|
+
${DECK_PREVIEW_TOKEN_FIELDS}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
`
|
|
1031
|
+
};
|
|
1032
|
+
},
|
|
1033
|
+
revokeDeckPreviewToken() {
|
|
1034
|
+
return {
|
|
1035
|
+
query: `
|
|
1036
|
+
mutation DeckPreviewTokenRevoke($id: UUID!) {
|
|
1037
|
+
deckPreviewTokenRevoke(id: $id)
|
|
1038
|
+
}
|
|
1039
|
+
`
|
|
1040
|
+
};
|
|
1041
|
+
},
|
|
839
1042
|
deckCreateVariables(input) {
|
|
840
1043
|
return { input };
|
|
841
1044
|
},
|
|
842
1045
|
deckUpdateVariables(id, input) {
|
|
843
1046
|
return { id, input };
|
|
844
1047
|
},
|
|
1048
|
+
deckPublishVariables(id, input = {}) {
|
|
1049
|
+
return { id, input };
|
|
1050
|
+
},
|
|
1051
|
+
deckCollaboratorVariables(deckId, accountId, role) {
|
|
1052
|
+
return role === void 0 ? { deckId, accountId } : { deckId, accountId, role };
|
|
1053
|
+
},
|
|
1054
|
+
deckPreviewTokenCreateVariables(input) {
|
|
1055
|
+
return { input };
|
|
1056
|
+
},
|
|
845
1057
|
// API Key Info
|
|
846
1058
|
fetchMe() {
|
|
847
1059
|
return {
|