@ownzones/connect-sdk 0.1.1 → 0.1.2
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/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/queries.d.ts +228 -0
- package/dist/src/queries.d.ts.map +1 -0
- package/dist/src/queries.js +123 -0
- package/dist/src/queries.js.map +1 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@
|
|
|
19
19
|
export { createConnectClient, type ConnectClientOptions } from './helpers/connect-client.js';
|
|
20
20
|
export { createConnectClientToken, type TokenClientOptions, } from './helpers/connect-client-token.js';
|
|
21
21
|
export { createConnectClientApiKey, type ApiKeyClientOptions, } from './helpers/connect-client-api-key.js';
|
|
22
|
+
export { createQueries, type ListFilesParams, type ListTitlesParams } from './queries.js';
|
|
22
23
|
export * from '../sdk/index.js';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,GACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,KAAK,mBAAmB,GACzB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,GACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,EACzB,KAAK,mBAAmB,GACzB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG1F,cAAc,iBAAiB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
export { createConnectClient } from './helpers/connect-client.js';
|
|
20
20
|
export { createConnectClientToken, } from './helpers/connect-client-token.js';
|
|
21
21
|
export { createConnectClientApiKey, } from './helpers/connect-client-api-key.js';
|
|
22
|
+
export { createQueries } from './queries.js';
|
|
22
23
|
// Re-export everything from generated SDK
|
|
23
24
|
export * from '../sdk/index.js';
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EACL,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,GAE1B,MAAM,qCAAqC,CAAC;AAE7C,0CAA0C;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EACL,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yBAAyB,GAE1B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,aAAa,EAA+C,MAAM,cAAc,CAAC;AAE1F,0CAA0C;AAC1C,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { Client } from '../sdk/index.js';
|
|
2
|
+
export interface ListFilesParams {
|
|
3
|
+
first?: number;
|
|
4
|
+
skip?: number;
|
|
5
|
+
search?: string;
|
|
6
|
+
titleId?: string;
|
|
7
|
+
origin?: string;
|
|
8
|
+
orderBy?: Array<Record<string, string>>;
|
|
9
|
+
}
|
|
10
|
+
export interface ListTitlesParams {
|
|
11
|
+
first?: number;
|
|
12
|
+
skip?: number;
|
|
13
|
+
search?: string;
|
|
14
|
+
orderBy?: Array<Record<string, string>>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createQueries(client: Client): {
|
|
17
|
+
listFiles(params?: ListFilesParams): Promise<{
|
|
18
|
+
items: import("./index.js").FieldsSelection<import("./index.js").File | null, {
|
|
19
|
+
readonly id: true;
|
|
20
|
+
readonly filename: true;
|
|
21
|
+
readonly status: true;
|
|
22
|
+
readonly size: true;
|
|
23
|
+
readonly type: true;
|
|
24
|
+
readonly origin: true;
|
|
25
|
+
readonly createdAt: true;
|
|
26
|
+
readonly language: true;
|
|
27
|
+
readonly extension: true;
|
|
28
|
+
readonly thumbnails: {
|
|
29
|
+
readonly medium: {
|
|
30
|
+
readonly signedUrl: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly title: {
|
|
34
|
+
readonly id: true;
|
|
35
|
+
readonly name: true;
|
|
36
|
+
};
|
|
37
|
+
}>[];
|
|
38
|
+
totalCount: number;
|
|
39
|
+
}>;
|
|
40
|
+
getFile(id: string): Promise<Pick<{
|
|
41
|
+
adBreaks: import("./index.js").AdBreak[];
|
|
42
|
+
ancillaryFiles: import("./index.js").CplAncillaryFile[];
|
|
43
|
+
annotations: import("./index.js").Annotation[];
|
|
44
|
+
archiveWorkflow: (import("./index.js").Workflow | null);
|
|
45
|
+
archiveWorkflowId: (import("./index.js").Scalars["ID"] | null);
|
|
46
|
+
autoQcProperties: (import("./index.js").Scalars["Object"] | null);
|
|
47
|
+
autoQcWorkflow: (import("./index.js").Workflow | null);
|
|
48
|
+
autoQcWorkflowId: (import("./index.js").Scalars["ID"] | null);
|
|
49
|
+
body: (import("./index.js").Scalars["String"] | null);
|
|
50
|
+
bpmWorkflowExecution: (import("./index.js").WorkflowExecution | null);
|
|
51
|
+
bpmWorkflowExecutionId: (import("./index.js").Scalars["ID"] | null);
|
|
52
|
+
children: import("./index.js").File[];
|
|
53
|
+
clips: import("./index.js").Clip[];
|
|
54
|
+
comments: import("./index.js").Comment[];
|
|
55
|
+
createdAt: (import("./index.js").Scalars["Date"] | null);
|
|
56
|
+
createdBy: (import("./index.js").User | null);
|
|
57
|
+
createdById: (import("./index.js").Scalars["ID"] | null);
|
|
58
|
+
customFields: import("./index.js").BulkCustomFields[];
|
|
59
|
+
demuxProfileId: (import("./index.js").Scalars["ID"] | null);
|
|
60
|
+
downloadUrl: (import("./index.js").Scalars["String"] | null);
|
|
61
|
+
entityId: (import("./index.js").Scalars["ID"] | null);
|
|
62
|
+
entityType: (import("./index.js").MetadataSetEntityType | null);
|
|
63
|
+
entityTypeId: (import("./index.js").Scalars["ID"] | null);
|
|
64
|
+
errors: (import("./index.js").Scalars["String"][] | null);
|
|
65
|
+
etag: (import("./index.js").Scalars["String"] | null);
|
|
66
|
+
extension: (import("./index.js").Scalars["String"] | null);
|
|
67
|
+
ffprobeProperties: (import("./index.js").Scalars["String"] | null);
|
|
68
|
+
fileDesignations: (import("./index.js").FileFileDesignationConnection | null);
|
|
69
|
+
fileLocator: (import("./index.js").FileLocator | null);
|
|
70
|
+
filename: (import("./index.js").Scalars["String"] | null);
|
|
71
|
+
generatedReason: (import("./index.js").FileGeneratedReason | null);
|
|
72
|
+
generatorWorkflow: (import("./index.js").Workflow | null);
|
|
73
|
+
generatorWorkflowId: (import("./index.js").Scalars["ID"] | null);
|
|
74
|
+
id: import("./index.js").Scalars["ID"];
|
|
75
|
+
imfEssenceType: (import("./index.js").ImfEssenceType | null);
|
|
76
|
+
info: (import("./index.js").Scalars["String"] | null);
|
|
77
|
+
ingestWorkflow: (import("./index.js").Workflow | null);
|
|
78
|
+
ingestWorkflowId: (import("./index.js").Scalars["ID"] | null);
|
|
79
|
+
isIngested: (import("./index.js").Scalars["Boolean"] | null);
|
|
80
|
+
language: (import("./index.js").Scalars["String"] | null);
|
|
81
|
+
languages: import("./index.js").Scalars["String"][];
|
|
82
|
+
locale: (import("./index.js").Scalars["String"] | null);
|
|
83
|
+
locatorUrl: (import("./index.js").Scalars["String"] | null);
|
|
84
|
+
lowResProxy: (import("./index.js").File | null);
|
|
85
|
+
mcaAudioStoredLabels: (import("./index.js").McaAudioStored | null);
|
|
86
|
+
md5: (import("./index.js").Scalars["String"] | null);
|
|
87
|
+
mediainfoProperties: import("./index.js").FieldsSelection<import("./index.js").MediaInfoProperties | null, {
|
|
88
|
+
readonly __scalar: true;
|
|
89
|
+
}>;
|
|
90
|
+
mxfIndexLocator: (import("./index.js").FileLocator | null);
|
|
91
|
+
notes: (import("./index.js").Scalars["String"] | null);
|
|
92
|
+
organization: (import("./index.js").Organization | null);
|
|
93
|
+
organizationId: (import("./index.js").Scalars["ID"] | null);
|
|
94
|
+
origin: (import("./index.js").FileOrigin | null);
|
|
95
|
+
pHashLocator: (import("./index.js").FileLocator | null);
|
|
96
|
+
parent: (import("./index.js").File | null);
|
|
97
|
+
parentId: (import("./index.js").Scalars["ID"] | null);
|
|
98
|
+
playable: (import("./index.js").Scalars["Boolean"] | null);
|
|
99
|
+
previewUrl: (import("./index.js").Scalars["String"] | null);
|
|
100
|
+
properties: import("./index.js").FieldsSelection<import("./index.js").FileProperties | null, {
|
|
101
|
+
readonly __scalar: true;
|
|
102
|
+
}>;
|
|
103
|
+
qcNotes: (import("./index.js").Scalars["String"] | null);
|
|
104
|
+
qcRequired: (import("./index.js").Scalars["Boolean"] | null);
|
|
105
|
+
readOnly: (import("./index.js").Scalars["Boolean"] | null);
|
|
106
|
+
requireDrm: (import("./index.js").Scalars["Boolean"] | null);
|
|
107
|
+
scanWorkflow: (import("./index.js").Workflow | null);
|
|
108
|
+
scanWorkflowId: (import("./index.js").Scalars["ID"] | null);
|
|
109
|
+
sha1: (import("./index.js").Scalars["String"] | null);
|
|
110
|
+
size: (import("./index.js").Scalars["Float"] | null);
|
|
111
|
+
status: (import("./index.js").FileStatus | null);
|
|
112
|
+
statusUpdatedAt: (import("./index.js").Scalars["Date"] | null);
|
|
113
|
+
statusUpdatedBy: (import("./index.js").User | null);
|
|
114
|
+
statusUpdatedById: (import("./index.js").Scalars["ID"] | null);
|
|
115
|
+
storageClass: (import("./index.js").Scalars["String"] | null);
|
|
116
|
+
textedSceneDetectionWorkflow: (import("./index.js").Workflow | null);
|
|
117
|
+
thumbnails: Pick<{
|
|
118
|
+
medium: Pick<{
|
|
119
|
+
fileLocator: (import("./index.js").FileLocator | null);
|
|
120
|
+
height: (import("./index.js").Scalars["Int"] | null);
|
|
121
|
+
signedUrl: (import("./index.js").Scalars["String"] | null);
|
|
122
|
+
width: (import("./index.js").Scalars["Int"] | null);
|
|
123
|
+
__typename: "ThumbnailProperties";
|
|
124
|
+
}, "signedUrl">;
|
|
125
|
+
small: import("./index.js").ThumbnailProperties;
|
|
126
|
+
__typename: "Thumbnails";
|
|
127
|
+
}, "medium">;
|
|
128
|
+
title: import("./index.js").FieldsSelection<import("./index.js").Title | null, {
|
|
129
|
+
readonly id: true;
|
|
130
|
+
readonly name: true;
|
|
131
|
+
}>;
|
|
132
|
+
titleId: (import("./index.js").Scalars["ID"] | null);
|
|
133
|
+
trackingProperties: (import("./index.js").TrackingProperties | null);
|
|
134
|
+
tracks: import("./index.js").Track[];
|
|
135
|
+
transcoderProfile: (import("./index.js").TranscoderProfile | null);
|
|
136
|
+
transcoderProfileId: (import("./index.js").Scalars["ID"] | null);
|
|
137
|
+
type: (import("./index.js").FileType | null);
|
|
138
|
+
updatedAt: (import("./index.js").Scalars["Date"] | null);
|
|
139
|
+
updatedBy: (import("./index.js").User | null);
|
|
140
|
+
updatedById: (import("./index.js").Scalars["ID"] | null);
|
|
141
|
+
userProperties: (import("./index.js").FileUserProperties | null);
|
|
142
|
+
virtualFolderId: (import("./index.js").Scalars["ID"] | null);
|
|
143
|
+
workflowEngine: import("./index.js").FileWorkflowEngine;
|
|
144
|
+
workflows: (import("./index.js").WorkflowConnection | null);
|
|
145
|
+
__typename: "File";
|
|
146
|
+
}, "origin" | "title" | "createdAt" | "etag" | "extension" | "filename" | "id" | "isIngested" | "language" | "locatorUrl" | "md5" | "mediainfoProperties" | "notes" | "playable" | "previewUrl" | "properties" | "qcNotes" | "sha1" | "size" | "status" | "thumbnails" | "type"> | null>;
|
|
147
|
+
listTitles(params?: ListTitlesParams): Promise<{
|
|
148
|
+
items: import("./index.js").FieldsSelection<import("./index.js").Title | null, {
|
|
149
|
+
readonly id: true;
|
|
150
|
+
readonly name: true;
|
|
151
|
+
readonly createdAt: true;
|
|
152
|
+
readonly updatedAt: true;
|
|
153
|
+
}>[];
|
|
154
|
+
totalCount: number;
|
|
155
|
+
}>;
|
|
156
|
+
getTitle(id: string): Promise<Pick<{
|
|
157
|
+
appleCatalog: (import("./index.js").AppleCatalogTitle | null);
|
|
158
|
+
comments: import("./index.js").Comment[];
|
|
159
|
+
createdAt: (import("./index.js").Scalars["Date"] | null);
|
|
160
|
+
createdBy: (import("./index.js").User | null);
|
|
161
|
+
createdById: (import("./index.js").Scalars["ID"] | null);
|
|
162
|
+
customFields: import("./index.js").BulkCustomFields[];
|
|
163
|
+
entityId: (import("./index.js").Scalars["ID"] | null);
|
|
164
|
+
entityType: (import("./index.js").MetadataSetEntityType | null);
|
|
165
|
+
entityTypeId: (import("./index.js").Scalars["ID"] | null);
|
|
166
|
+
entityTypeName: (import("./index.js").Scalars["String"] | null);
|
|
167
|
+
fileDesignations: (import("./index.js").TitleDesignationConnection | null);
|
|
168
|
+
files: (import("./index.js").FileConnection | null);
|
|
169
|
+
hasChildren: (import("./index.js").Scalars["Boolean"] | null);
|
|
170
|
+
head: (import("./index.js").TitleConnection | null);
|
|
171
|
+
headers: (import("./index.js").TitleHeadersType | null);
|
|
172
|
+
hierarchyFileCount: (import("./index.js").Scalars["Int"] | null);
|
|
173
|
+
houseId: import("./index.js").Scalars["String"];
|
|
174
|
+
id: import("./index.js").Scalars["ID"];
|
|
175
|
+
name: import("./index.js").Scalars["String"];
|
|
176
|
+
nodeTypeId: (import("./index.js").Scalars["ID"] | null);
|
|
177
|
+
organization: (import("./index.js").Organization | null);
|
|
178
|
+
organizationId: (import("./index.js").Scalars["ID"] | null);
|
|
179
|
+
ownFileCount: import("./index.js").Scalars["Int"];
|
|
180
|
+
packages: import("./index.js").Package[];
|
|
181
|
+
parent: (import("./index.js").File | null);
|
|
182
|
+
parentId: (import("./index.js").Scalars["ID"] | null);
|
|
183
|
+
slug: import("./index.js").Scalars["String"];
|
|
184
|
+
tail: (import("./index.js").TitleConnection | null);
|
|
185
|
+
thumbnail: (import("./index.js").Scalars["String"] | null);
|
|
186
|
+
thumbnailId: (import("./index.js").Scalars["ID"] | null);
|
|
187
|
+
updatedAt: (import("./index.js").Scalars["Date"] | null);
|
|
188
|
+
updatedBy: (import("./index.js").User | null);
|
|
189
|
+
updatedById: (import("./index.js").Scalars["ID"] | null);
|
|
190
|
+
__typename: "Title";
|
|
191
|
+
}, "createdAt" | "id" | "updatedAt" | "houseId" | "name" | "ownFileCount" | "slug"> | null>;
|
|
192
|
+
listOrganizations(): Promise<(import("./index.js").Organization | null)[] | Pick<{
|
|
193
|
+
adobePanelTranscoderProfileId: (import("./index.js").Scalars["ID"] | null);
|
|
194
|
+
artifactsFileLocator: import("./index.js").FileLocator;
|
|
195
|
+
autoQcOnIngest: (import("./index.js").Scalars["Boolean"] | null);
|
|
196
|
+
children: ((import("./index.js").Organization | null)[] | null);
|
|
197
|
+
createdAt: (import("./index.js").Scalars["Date"] | null);
|
|
198
|
+
createdBy: (import("./index.js").User | null);
|
|
199
|
+
createdById: (import("./index.js").Scalars["ID"] | null);
|
|
200
|
+
defaultLanguage: (import("./index.js").DefaultLanguage | null);
|
|
201
|
+
deletedAt: (import("./index.js").Scalars["Date"] | null);
|
|
202
|
+
deliverableLowResProxyTranscoderProfile: (import("./index.js").TranscoderProfile | null);
|
|
203
|
+
deliverableLowResProxyTranscoderProfileId: (import("./index.js").Scalars["ID"] | null);
|
|
204
|
+
deliverablesFileLocator: import("./index.js").FileLocator;
|
|
205
|
+
fileLocations: import("./index.js").FileLocations;
|
|
206
|
+
filesFileLocator: import("./index.js").FileLocator;
|
|
207
|
+
id: import("./index.js").Scalars["ID"];
|
|
208
|
+
intermediatesFileLocator: import("./index.js").FileLocator;
|
|
209
|
+
logoUrl: (import("./index.js").Scalars["String"] | null);
|
|
210
|
+
mediaViewCacheFileLocator: import("./index.js").FileLocator;
|
|
211
|
+
name: (import("./index.js").Scalars["String"] | null);
|
|
212
|
+
organizationOptions: (import("./index.js").OrganizationOptions | null);
|
|
213
|
+
organizationRights: (import("./index.js").OrganizationRights | null);
|
|
214
|
+
parent: (import("./index.js").Organization | null);
|
|
215
|
+
parentId: (import("./index.js").Scalars["ID"] | null);
|
|
216
|
+
requireSourcesQc: (import("./index.js").Scalars["Boolean"] | null);
|
|
217
|
+
searchIndex: (import("./index.js").SearchIndex | null);
|
|
218
|
+
slug: (import("./index.js").Scalars["String"] | null);
|
|
219
|
+
sourceLowResProxyTranscoderProfile: (import("./index.js").TranscoderProfile | null);
|
|
220
|
+
sourceLowResProxyTranscoderProfileId: (import("./index.js").Scalars["ID"] | null);
|
|
221
|
+
updatedAt: (import("./index.js").Scalars["Date"] | null);
|
|
222
|
+
updatedBy: (import("./index.js").User | null);
|
|
223
|
+
updatedById: (import("./index.js").Scalars["ID"] | null);
|
|
224
|
+
uploadsFileLocator: import("./index.js").FileLocator;
|
|
225
|
+
__typename: "Organization";
|
|
226
|
+
}, "id" | "name" | "slug" | "logoUrl">[]>;
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACzC;AA6DD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM;uBAEhB,eAAe;;;;;;;;;;;;;;;;;;;;;;;gBAwBrB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAWC,gBAAgB;;;;;;;;;iBAsBtB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB5B"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const FILE_LIST_FIELDS = {
|
|
2
|
+
id: true,
|
|
3
|
+
filename: true,
|
|
4
|
+
status: true,
|
|
5
|
+
size: true,
|
|
6
|
+
type: true,
|
|
7
|
+
origin: true,
|
|
8
|
+
createdAt: true,
|
|
9
|
+
language: true,
|
|
10
|
+
extension: true,
|
|
11
|
+
thumbnails: {
|
|
12
|
+
medium: { signedUrl: true },
|
|
13
|
+
},
|
|
14
|
+
title: {
|
|
15
|
+
id: true,
|
|
16
|
+
name: true,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const FILE_DETAIL_FIELDS = {
|
|
20
|
+
...FILE_LIST_FIELDS,
|
|
21
|
+
locatorUrl: true,
|
|
22
|
+
notes: true,
|
|
23
|
+
qcNotes: true,
|
|
24
|
+
properties: {
|
|
25
|
+
__scalar: true,
|
|
26
|
+
},
|
|
27
|
+
mediainfoProperties: {
|
|
28
|
+
__scalar: true,
|
|
29
|
+
},
|
|
30
|
+
etag: true,
|
|
31
|
+
md5: true,
|
|
32
|
+
sha1: true,
|
|
33
|
+
isIngested: true,
|
|
34
|
+
playable: true,
|
|
35
|
+
previewUrl: true,
|
|
36
|
+
};
|
|
37
|
+
const TITLE_LIST_FIELDS = {
|
|
38
|
+
id: true,
|
|
39
|
+
name: true,
|
|
40
|
+
createdAt: true,
|
|
41
|
+
updatedAt: true,
|
|
42
|
+
};
|
|
43
|
+
const TITLE_DETAIL_FIELDS = {
|
|
44
|
+
...TITLE_LIST_FIELDS,
|
|
45
|
+
slug: true,
|
|
46
|
+
houseId: true,
|
|
47
|
+
ownFileCount: true,
|
|
48
|
+
};
|
|
49
|
+
const ORGANIZATION_FIELDS = {
|
|
50
|
+
id: true,
|
|
51
|
+
name: true,
|
|
52
|
+
slug: true,
|
|
53
|
+
logoUrl: true,
|
|
54
|
+
};
|
|
55
|
+
export function createQueries(client) {
|
|
56
|
+
return {
|
|
57
|
+
async listFiles(params = {}) {
|
|
58
|
+
const { first = 50, skip = 0, search, titleId, origin, orderBy } = params;
|
|
59
|
+
const result = await client.query({
|
|
60
|
+
files: {
|
|
61
|
+
__args: {
|
|
62
|
+
first,
|
|
63
|
+
skip,
|
|
64
|
+
...(search != null && { search }),
|
|
65
|
+
...(titleId != null && { titleId }),
|
|
66
|
+
...(origin != null && { origin: origin }),
|
|
67
|
+
...(orderBy != null && { orderBy: orderBy }),
|
|
68
|
+
},
|
|
69
|
+
totalCount: true,
|
|
70
|
+
edges: { node: FILE_LIST_FIELDS },
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
items: result.files?.edges?.map((edge) => edge.node) ?? [],
|
|
75
|
+
totalCount: result.files?.totalCount ?? 0,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
async getFile(id) {
|
|
79
|
+
const result = await client.query({
|
|
80
|
+
file: {
|
|
81
|
+
__args: { id },
|
|
82
|
+
...FILE_DETAIL_FIELDS,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
return result.file ?? null;
|
|
86
|
+
},
|
|
87
|
+
async listTitles(params = {}) {
|
|
88
|
+
const { first = 50, skip = 0, search, orderBy } = params;
|
|
89
|
+
const result = await client.query({
|
|
90
|
+
titles: {
|
|
91
|
+
__args: {
|
|
92
|
+
first,
|
|
93
|
+
skip,
|
|
94
|
+
...(search != null && { search }),
|
|
95
|
+
...(orderBy != null && { orderBy: orderBy }),
|
|
96
|
+
},
|
|
97
|
+
totalCount: true,
|
|
98
|
+
edges: { node: TITLE_LIST_FIELDS },
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
items: result.titles?.edges?.map((edge) => edge.node) ?? [],
|
|
103
|
+
totalCount: result.titles?.totalCount ?? 0,
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
async getTitle(id) {
|
|
107
|
+
const result = await client.query({
|
|
108
|
+
title: {
|
|
109
|
+
__args: { id },
|
|
110
|
+
...TITLE_DETAIL_FIELDS,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
return result.title ?? null;
|
|
114
|
+
},
|
|
115
|
+
async listOrganizations() {
|
|
116
|
+
const result = await client.query({
|
|
117
|
+
allOrganizations: ORGANIZATION_FIELDS,
|
|
118
|
+
});
|
|
119
|
+
return result.allOrganizations ?? [];
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/queries.ts"],"names":[],"mappings":"AAkBA,MAAM,gBAAgB,GAAG;IACvB,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC5B;IACD,KAAK,EAAE;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,IAAI;KACX;CACO,CAAC;AAEX,MAAM,kBAAkB,GAAG;IACzB,GAAG,gBAAgB;IACnB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,IAAI;KACf;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;CACR,CAAC;AAEX,MAAM,iBAAiB,GAAG;IACxB,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;CACP,CAAC;AAEX,MAAM,mBAAmB,GAAG;IAC1B,GAAG,iBAAiB;IACpB,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;CACV,CAAC;AAEX,MAA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