@carddb/core 0.1.1 → 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 +214 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +214 -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;
|
|
@@ -236,6 +294,7 @@ interface FieldInfo {
|
|
|
236
294
|
isIdentifier: boolean;
|
|
237
295
|
itemType: FieldType | null;
|
|
238
296
|
displayFormat: string | null;
|
|
297
|
+
semanticType: string | null;
|
|
239
298
|
allowedValues: string[] | null;
|
|
240
299
|
nestedFields: FieldInfo[] | null;
|
|
241
300
|
}
|
|
@@ -625,6 +684,10 @@ interface ListDecksParams {
|
|
|
625
684
|
first?: number;
|
|
626
685
|
after?: string;
|
|
627
686
|
}
|
|
687
|
+
interface ListDeckVersionsParams {
|
|
688
|
+
first?: number;
|
|
689
|
+
after?: string;
|
|
690
|
+
}
|
|
628
691
|
declare const QueryBuilder: {
|
|
629
692
|
searchPublishers(params?: SearchPublishersParams): {
|
|
630
693
|
query: string;
|
|
@@ -688,9 +751,31 @@ declare const QueryBuilder: {
|
|
|
688
751
|
fetchDeckById(): {
|
|
689
752
|
query: string;
|
|
690
753
|
};
|
|
754
|
+
myDeck(): {
|
|
755
|
+
query: string;
|
|
756
|
+
};
|
|
757
|
+
fetchDeckBySlug(): {
|
|
758
|
+
query: string;
|
|
759
|
+
};
|
|
691
760
|
fetchDeckByExternalRef(): {
|
|
692
761
|
query: string;
|
|
693
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
|
+
};
|
|
694
779
|
createDeck(): {
|
|
695
780
|
query: string;
|
|
696
781
|
};
|
|
@@ -700,8 +785,26 @@ declare const QueryBuilder: {
|
|
|
700
785
|
deleteDeck(): {
|
|
701
786
|
query: string;
|
|
702
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
|
+
};
|
|
703
803
|
deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
|
|
704
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>;
|
|
705
808
|
fetchMe(): {
|
|
706
809
|
query: string;
|
|
707
810
|
};
|
|
@@ -837,4 +940,4 @@ declare class Collection<T> implements AsyncIterable<T> {
|
|
|
837
940
|
each(): AsyncIterable<T>;
|
|
838
941
|
}
|
|
839
942
|
|
|
840
|
-
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;
|
|
@@ -236,6 +294,7 @@ interface FieldInfo {
|
|
|
236
294
|
isIdentifier: boolean;
|
|
237
295
|
itemType: FieldType | null;
|
|
238
296
|
displayFormat: string | null;
|
|
297
|
+
semanticType: string | null;
|
|
239
298
|
allowedValues: string[] | null;
|
|
240
299
|
nestedFields: FieldInfo[] | null;
|
|
241
300
|
}
|
|
@@ -625,6 +684,10 @@ interface ListDecksParams {
|
|
|
625
684
|
first?: number;
|
|
626
685
|
after?: string;
|
|
627
686
|
}
|
|
687
|
+
interface ListDeckVersionsParams {
|
|
688
|
+
first?: number;
|
|
689
|
+
after?: string;
|
|
690
|
+
}
|
|
628
691
|
declare const QueryBuilder: {
|
|
629
692
|
searchPublishers(params?: SearchPublishersParams): {
|
|
630
693
|
query: string;
|
|
@@ -688,9 +751,31 @@ declare const QueryBuilder: {
|
|
|
688
751
|
fetchDeckById(): {
|
|
689
752
|
query: string;
|
|
690
753
|
};
|
|
754
|
+
myDeck(): {
|
|
755
|
+
query: string;
|
|
756
|
+
};
|
|
757
|
+
fetchDeckBySlug(): {
|
|
758
|
+
query: string;
|
|
759
|
+
};
|
|
691
760
|
fetchDeckByExternalRef(): {
|
|
692
761
|
query: string;
|
|
693
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
|
+
};
|
|
694
779
|
createDeck(): {
|
|
695
780
|
query: string;
|
|
696
781
|
};
|
|
@@ -700,8 +785,26 @@ declare const QueryBuilder: {
|
|
|
700
785
|
deleteDeck(): {
|
|
701
786
|
query: string;
|
|
702
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
|
+
};
|
|
703
803
|
deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
|
|
704
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>;
|
|
705
808
|
fetchMe(): {
|
|
706
809
|
query: string;
|
|
707
810
|
};
|
|
@@ -837,4 +940,4 @@ declare class Collection<T> implements AsyncIterable<T> {
|
|
|
837
940
|
each(): AsyncIterable<T>;
|
|
838
941
|
}
|
|
839
942
|
|
|
840
|
-
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
|
@@ -329,6 +329,7 @@ var SCHEMA_FIELDS = `
|
|
|
329
329
|
isIdentifier
|
|
330
330
|
itemType
|
|
331
331
|
displayFormat
|
|
332
|
+
semanticType
|
|
332
333
|
allowedValues
|
|
333
334
|
nestedFields {
|
|
334
335
|
key
|
|
@@ -339,6 +340,7 @@ var SCHEMA_FIELDS = `
|
|
|
339
340
|
filterable
|
|
340
341
|
searchable
|
|
341
342
|
itemType
|
|
343
|
+
semanticType
|
|
342
344
|
}
|
|
343
345
|
}
|
|
344
346
|
filterableFields
|
|
@@ -366,11 +368,64 @@ var RECORD_FIELDS = `
|
|
|
366
368
|
publisherId
|
|
367
369
|
}
|
|
368
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
|
+
`;
|
|
369
422
|
var DECK_FIELDS = `
|
|
370
423
|
id
|
|
371
424
|
accountId
|
|
372
425
|
apiApplicationId
|
|
373
426
|
gameId
|
|
427
|
+
slug
|
|
428
|
+
identifier
|
|
374
429
|
title
|
|
375
430
|
description
|
|
376
431
|
formatKey
|
|
@@ -378,6 +433,11 @@ var DECK_FIELDS = `
|
|
|
378
433
|
externalRef
|
|
379
434
|
sourceUrl
|
|
380
435
|
metadata
|
|
436
|
+
latestPublishedVersion {
|
|
437
|
+
${DECK_VERSION_FIELDS}
|
|
438
|
+
}
|
|
439
|
+
publishedAt
|
|
440
|
+
hasUnpublishedChanges
|
|
381
441
|
createdAt
|
|
382
442
|
updatedAt
|
|
383
443
|
game {
|
|
@@ -792,6 +852,28 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
792
852
|
`
|
|
793
853
|
};
|
|
794
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
|
+
},
|
|
795
877
|
fetchDeckByExternalRef() {
|
|
796
878
|
return {
|
|
797
879
|
query: `
|
|
@@ -803,6 +885,75 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
803
885
|
`
|
|
804
886
|
};
|
|
805
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
|
+
},
|
|
806
957
|
createDeck() {
|
|
807
958
|
return {
|
|
808
959
|
query: `
|
|
@@ -834,12 +985,75 @@ ${RESOLVED_LINKS_FIELDS}` : RECORD_FIELDS;
|
|
|
834
985
|
`
|
|
835
986
|
};
|
|
836
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
|
+
},
|
|
837
1042
|
deckCreateVariables(input) {
|
|
838
1043
|
return { input };
|
|
839
1044
|
},
|
|
840
1045
|
deckUpdateVariables(id, input) {
|
|
841
1046
|
return { id, input };
|
|
842
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
|
+
},
|
|
843
1057
|
// API Key Info
|
|
844
1058
|
fetchMe() {
|
|
845
1059
|
return {
|