@knkcs/mediahub-ui 0.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/dist/index.d.ts +1686 -0
- package/dist/index.js +4357 -0
- package/dist/index.js.map +1 -0
- package/dist/testing.d.ts +487 -0
- package/dist/testing.js +413 -0
- package/dist/testing.js.map +1 -0
- package/package.json +71 -0
package/dist/testing.js
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
const u = "ws_1", y = "user_1", f = /* @__PURE__ */ new Date("2026-01-01T00:00:00Z");
|
|
2
|
+
function R(n = {}) {
|
|
3
|
+
return {
|
|
4
|
+
id: "ver_1",
|
|
5
|
+
versionNumber: 1,
|
|
6
|
+
originalFilename: "sample.png",
|
|
7
|
+
storageKey: `${u}/asset_1/1/sample.png`,
|
|
8
|
+
fileSize: 12345,
|
|
9
|
+
mimeType: "image/png",
|
|
10
|
+
createdBy: y,
|
|
11
|
+
comment: "",
|
|
12
|
+
createdAt: f,
|
|
13
|
+
...n
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function g(n = {}) {
|
|
17
|
+
return {
|
|
18
|
+
id: "asset_1",
|
|
19
|
+
workspaceId: u,
|
|
20
|
+
name: "Sample Asset",
|
|
21
|
+
description: "",
|
|
22
|
+
statusSlug: "",
|
|
23
|
+
currentVersion: 1,
|
|
24
|
+
metadata: {},
|
|
25
|
+
assetTypeId: "type_1",
|
|
26
|
+
folderId: "",
|
|
27
|
+
createdBy: y,
|
|
28
|
+
updatedBy: y,
|
|
29
|
+
createdAt: f,
|
|
30
|
+
updatedAt: f,
|
|
31
|
+
versions: [R()],
|
|
32
|
+
tagIds: [],
|
|
33
|
+
collectionIds: [],
|
|
34
|
+
analyzeWithAi: !1,
|
|
35
|
+
...n
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function _(n = {}) {
|
|
39
|
+
return {
|
|
40
|
+
id: "folder_1",
|
|
41
|
+
workspaceId: u,
|
|
42
|
+
name: "Sample Folder",
|
|
43
|
+
slug: "sample-folder",
|
|
44
|
+
parentId: "",
|
|
45
|
+
restricted: !1,
|
|
46
|
+
...n
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function b(n = {}) {
|
|
50
|
+
return {
|
|
51
|
+
id: "collection_1",
|
|
52
|
+
workspaceId: u,
|
|
53
|
+
name: "Sample Collection",
|
|
54
|
+
slug: "sample-collection",
|
|
55
|
+
description: "",
|
|
56
|
+
type: "static",
|
|
57
|
+
rules: "",
|
|
58
|
+
restricted: !1,
|
|
59
|
+
...n
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function h(n = {}) {
|
|
63
|
+
return {
|
|
64
|
+
id: "tag_1",
|
|
65
|
+
workspaceId: u,
|
|
66
|
+
name: "Sample Tag",
|
|
67
|
+
slug: "sample-tag",
|
|
68
|
+
...n
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function m(n = {}) {
|
|
72
|
+
return {
|
|
73
|
+
id: "type_1",
|
|
74
|
+
workspaceId: u,
|
|
75
|
+
name: "Product Image",
|
|
76
|
+
slug: "product-image",
|
|
77
|
+
description: "",
|
|
78
|
+
allowedMimeTypes: ["image/png", "image/jpeg"],
|
|
79
|
+
metadataSchema: "{}",
|
|
80
|
+
active: !0,
|
|
81
|
+
...n
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function S(n = {}) {
|
|
85
|
+
return {
|
|
86
|
+
id: y,
|
|
87
|
+
displayName: "Stub User",
|
|
88
|
+
...n
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function $(n = {}) {
|
|
92
|
+
return {
|
|
93
|
+
ownerUserId: y,
|
|
94
|
+
grants: [],
|
|
95
|
+
...n
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function D(n = {}) {
|
|
99
|
+
return {
|
|
100
|
+
totalAssets: 1,
|
|
101
|
+
totalStorageBytes: 12345,
|
|
102
|
+
statusCounts: [],
|
|
103
|
+
recentUploads: [],
|
|
104
|
+
...n
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function I(n = {}) {
|
|
108
|
+
return {
|
|
109
|
+
id: "aiconn_1",
|
|
110
|
+
workspaceId: u,
|
|
111
|
+
name: "Sample Connection",
|
|
112
|
+
provider: "azure-openai",
|
|
113
|
+
endpoint: "",
|
|
114
|
+
deployment: "",
|
|
115
|
+
apiVersion: "",
|
|
116
|
+
baseUrl: "",
|
|
117
|
+
model: "",
|
|
118
|
+
description: "",
|
|
119
|
+
active: !0,
|
|
120
|
+
hasApiKey: !1,
|
|
121
|
+
...n
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function w(n = {}) {
|
|
125
|
+
return {
|
|
126
|
+
id: "aiproc_1",
|
|
127
|
+
workspaceId: u,
|
|
128
|
+
assetTypeId: "type_1",
|
|
129
|
+
connectionId: "aiconn_1",
|
|
130
|
+
name: "Sample Process",
|
|
131
|
+
prompt: "",
|
|
132
|
+
outputs: [],
|
|
133
|
+
position: 0,
|
|
134
|
+
active: !0,
|
|
135
|
+
...n
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function F(n = {}) {
|
|
139
|
+
return {
|
|
140
|
+
id: "airun_1",
|
|
141
|
+
aiProcessId: "aiproc_1",
|
|
142
|
+
processName: "Sample Process",
|
|
143
|
+
status: "succeeded",
|
|
144
|
+
error: "",
|
|
145
|
+
startedAt: f,
|
|
146
|
+
finishedAt: f,
|
|
147
|
+
...n
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function l(n, i) {
|
|
151
|
+
return new Error(`${n} ${i} not found`);
|
|
152
|
+
}
|
|
153
|
+
function N(n) {
|
|
154
|
+
return {
|
|
155
|
+
items: n,
|
|
156
|
+
total: n.length,
|
|
157
|
+
page: 1,
|
|
158
|
+
pageSize: n.length || 1,
|
|
159
|
+
totalPages: 1
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function E(n = {}) {
|
|
163
|
+
let i = [g()], c = [_()], r = [b()], d = [h()];
|
|
164
|
+
const p = (e) => {
|
|
165
|
+
const t = i.find((s) => s.id === e);
|
|
166
|
+
if (!t) throw l("asset", e);
|
|
167
|
+
return t;
|
|
168
|
+
}, A = {
|
|
169
|
+
list: async () => N(i.map((e) => ({ ...e }))),
|
|
170
|
+
get: async (e) => ({ ...p(e) }),
|
|
171
|
+
create: async (e, t) => {
|
|
172
|
+
const s = {
|
|
173
|
+
...g(),
|
|
174
|
+
id: `asset_${i.length + 1}`,
|
|
175
|
+
workspaceId: e,
|
|
176
|
+
name: t.name,
|
|
177
|
+
description: t.description ?? "",
|
|
178
|
+
assetTypeId: t.assetTypeId,
|
|
179
|
+
folderId: t.folderId ?? "",
|
|
180
|
+
metadata: t.metadata ?? {},
|
|
181
|
+
analyzeWithAi: t.analyzeWithAi ?? !1,
|
|
182
|
+
versions: []
|
|
183
|
+
};
|
|
184
|
+
return i = [...i, s], s;
|
|
185
|
+
},
|
|
186
|
+
update: async (e, t) => {
|
|
187
|
+
const s = {
|
|
188
|
+
...p(e),
|
|
189
|
+
...t.name !== void 0 ? { name: t.name } : {},
|
|
190
|
+
...t.description !== void 0 ? { description: t.description } : {},
|
|
191
|
+
...t.metadata !== void 0 ? { metadata: t.metadata } : {}
|
|
192
|
+
};
|
|
193
|
+
return i = i.map((o) => o.id === e ? s : o), s;
|
|
194
|
+
},
|
|
195
|
+
delete: async (e) => {
|
|
196
|
+
i = i.filter((t) => t.id !== e);
|
|
197
|
+
},
|
|
198
|
+
getUploadUrl: async () => ({
|
|
199
|
+
uploadUrl: "blob:stub-upload",
|
|
200
|
+
versionId: "ver_new"
|
|
201
|
+
}),
|
|
202
|
+
finalizeUpload: async (e) => ({
|
|
203
|
+
...g(),
|
|
204
|
+
versions: [{ ...g().versions[0], id: e }]
|
|
205
|
+
}),
|
|
206
|
+
getDownloadUrl: async () => "blob:stub-download",
|
|
207
|
+
move: async (e, t) => {
|
|
208
|
+
const s = { ...p(e), folderId: t };
|
|
209
|
+
return i = i.map((o) => o.id === e ? s : o), s;
|
|
210
|
+
},
|
|
211
|
+
transitionStatus: async (e, t, s) => {
|
|
212
|
+
const o = { ...p(e), statusSlug: s };
|
|
213
|
+
return i = i.map((a) => a.id === e ? o : a), o;
|
|
214
|
+
},
|
|
215
|
+
enhanceMetadata: async (e) => ({ ...p(e) }),
|
|
216
|
+
listProcessRuns: async () => [F()]
|
|
217
|
+
}, C = {
|
|
218
|
+
list: async () => c.map((e) => ({ ...e })),
|
|
219
|
+
get: async (e) => {
|
|
220
|
+
const t = c.find((s) => s.id === e);
|
|
221
|
+
if (!t) throw l("folder", e);
|
|
222
|
+
return { ...t };
|
|
223
|
+
},
|
|
224
|
+
create: async (e) => {
|
|
225
|
+
const t = {
|
|
226
|
+
..._(),
|
|
227
|
+
id: `folder_${c.length + 1}`,
|
|
228
|
+
workspaceId: e.workspaceId,
|
|
229
|
+
name: e.name,
|
|
230
|
+
slug: e.slug,
|
|
231
|
+
parentId: e.parentId,
|
|
232
|
+
restricted: e.restricted ?? !1
|
|
233
|
+
};
|
|
234
|
+
return c = [...c, t], t;
|
|
235
|
+
},
|
|
236
|
+
update: async (e, t) => {
|
|
237
|
+
const s = c.find((a) => a.id === e);
|
|
238
|
+
if (!s) throw l("folder", e);
|
|
239
|
+
const o = { ...s, name: t };
|
|
240
|
+
return c = c.map((a) => a.id === e ? o : a), o;
|
|
241
|
+
},
|
|
242
|
+
delete: async (e) => {
|
|
243
|
+
c = c.filter((t) => t.id !== e);
|
|
244
|
+
},
|
|
245
|
+
move: async (e, t) => {
|
|
246
|
+
const s = c.find((a) => a.id === e);
|
|
247
|
+
if (!s) throw l("folder", e);
|
|
248
|
+
const o = { ...s, parentId: t };
|
|
249
|
+
return c = c.map((a) => a.id === e ? o : a), o;
|
|
250
|
+
},
|
|
251
|
+
setRestricted: async (e, t) => {
|
|
252
|
+
const s = c.find((a) => a.id === e);
|
|
253
|
+
if (!s) throw l("folder", e);
|
|
254
|
+
const o = { ...s, restricted: t };
|
|
255
|
+
return c = c.map((a) => a.id === e ? o : a), o;
|
|
256
|
+
}
|
|
257
|
+
}, T = {
|
|
258
|
+
list: async () => r.map((e) => ({ ...e })),
|
|
259
|
+
get: async (e) => {
|
|
260
|
+
const t = r.find((s) => s.id === e);
|
|
261
|
+
if (!t) throw l("collection", e);
|
|
262
|
+
return { ...t };
|
|
263
|
+
},
|
|
264
|
+
create: async (e) => {
|
|
265
|
+
const t = {
|
|
266
|
+
...b(),
|
|
267
|
+
id: `collection_${r.length + 1}`,
|
|
268
|
+
workspaceId: e.workspaceId,
|
|
269
|
+
name: e.name,
|
|
270
|
+
slug: e.slug,
|
|
271
|
+
description: e.description,
|
|
272
|
+
type: e.type,
|
|
273
|
+
rules: e.rules,
|
|
274
|
+
restricted: e.restricted ?? !1
|
|
275
|
+
};
|
|
276
|
+
return r = [...r, t], t;
|
|
277
|
+
},
|
|
278
|
+
update: async (e, t) => {
|
|
279
|
+
const s = r.find((a) => a.id === e);
|
|
280
|
+
if (!s) throw l("collection", e);
|
|
281
|
+
const o = { ...s, ...t };
|
|
282
|
+
return r = r.map((a) => a.id === e ? o : a), o;
|
|
283
|
+
},
|
|
284
|
+
delete: async (e) => {
|
|
285
|
+
r = r.filter((t) => t.id !== e);
|
|
286
|
+
},
|
|
287
|
+
addAssets: async () => {
|
|
288
|
+
},
|
|
289
|
+
removeAssets: async () => {
|
|
290
|
+
},
|
|
291
|
+
setRestricted: async (e, t) => {
|
|
292
|
+
const s = r.find((a) => a.id === e);
|
|
293
|
+
if (!s) throw l("collection", e);
|
|
294
|
+
const o = { ...s, restricted: t };
|
|
295
|
+
return r = r.map((a) => a.id === e ? o : a), o;
|
|
296
|
+
}
|
|
297
|
+
}, k = {
|
|
298
|
+
list: async () => d.map((e) => ({ ...e })),
|
|
299
|
+
create: async (e) => {
|
|
300
|
+
const t = {
|
|
301
|
+
...h(),
|
|
302
|
+
id: `tag_${d.length + 1}`,
|
|
303
|
+
workspaceId: e.workspaceId,
|
|
304
|
+
name: e.name,
|
|
305
|
+
slug: e.slug
|
|
306
|
+
};
|
|
307
|
+
return d = [...d, t], t;
|
|
308
|
+
},
|
|
309
|
+
update: async (e, t) => {
|
|
310
|
+
const s = d.find((a) => a.id === e);
|
|
311
|
+
if (!s) throw l("tag", e);
|
|
312
|
+
const o = { ...s, name: t };
|
|
313
|
+
return d = d.map((a) => a.id === e ? o : a), o;
|
|
314
|
+
},
|
|
315
|
+
delete: async (e) => {
|
|
316
|
+
d = d.filter((t) => t.id !== e);
|
|
317
|
+
},
|
|
318
|
+
tagAssets: async () => {
|
|
319
|
+
},
|
|
320
|
+
untagAssets: async () => {
|
|
321
|
+
}
|
|
322
|
+
}, U = {
|
|
323
|
+
list: async () => [m()],
|
|
324
|
+
get: async (e) => ({ ...m(), id: e }),
|
|
325
|
+
create: async (e) => ({
|
|
326
|
+
...m(),
|
|
327
|
+
id: "type_new",
|
|
328
|
+
name: e.name,
|
|
329
|
+
slug: e.slug,
|
|
330
|
+
description: e.description,
|
|
331
|
+
allowedMimeTypes: e.allowedMimeTypes,
|
|
332
|
+
metadataSchema: e.metadataSchema
|
|
333
|
+
}),
|
|
334
|
+
update: async (e, t) => ({ ...m(), id: e, ...t }),
|
|
335
|
+
delete: async () => {
|
|
336
|
+
}
|
|
337
|
+
}, v = {
|
|
338
|
+
resolveUsers: async (e) => e.map((t) => S({ id: t })),
|
|
339
|
+
listWorkspaceMembers: async () => [S()]
|
|
340
|
+
}, P = {
|
|
341
|
+
list: async () => $(),
|
|
342
|
+
grant: async () => {
|
|
343
|
+
},
|
|
344
|
+
revoke: async () => {
|
|
345
|
+
}
|
|
346
|
+
}, z = {
|
|
347
|
+
getWorkspaceStats: async () => D(),
|
|
348
|
+
getDashboardLayout: async () => "{}",
|
|
349
|
+
saveDashboardLayout: async () => {
|
|
350
|
+
}
|
|
351
|
+
}, W = {
|
|
352
|
+
list: async () => [I()],
|
|
353
|
+
get: async (e) => ({ ...I(), id: e }),
|
|
354
|
+
create: async (e) => ({
|
|
355
|
+
...I(),
|
|
356
|
+
id: "aiconn_new",
|
|
357
|
+
...e
|
|
358
|
+
}),
|
|
359
|
+
update: async (e, t) => ({ ...I(), id: e, ...t }),
|
|
360
|
+
delete: async () => {
|
|
361
|
+
}
|
|
362
|
+
}, B = {
|
|
363
|
+
list: async () => [w()],
|
|
364
|
+
get: async (e) => ({ ...w(), id: e }),
|
|
365
|
+
create: async (e) => ({
|
|
366
|
+
...w(),
|
|
367
|
+
id: "aiproc_new",
|
|
368
|
+
assetTypeId: e.assetTypeId,
|
|
369
|
+
connectionId: e.connectionId,
|
|
370
|
+
name: e.name,
|
|
371
|
+
prompt: e.prompt,
|
|
372
|
+
outputs: e.outputs,
|
|
373
|
+
position: e.position
|
|
374
|
+
}),
|
|
375
|
+
update: async (e, t) => ({ ...w(), id: e, ...t }),
|
|
376
|
+
delete: async () => {
|
|
377
|
+
}
|
|
378
|
+
}, M = {
|
|
379
|
+
canManage: async () => !0
|
|
380
|
+
};
|
|
381
|
+
return {
|
|
382
|
+
assets: { ...A, ...n.assets },
|
|
383
|
+
folders: { ...C, ...n.folders },
|
|
384
|
+
collections: { ...T, ...n.collections },
|
|
385
|
+
tags: { ...k, ...n.tags },
|
|
386
|
+
assetTypes: { ...U, ...n.assetTypes },
|
|
387
|
+
directory: { ...v, ...n.directory },
|
|
388
|
+
grants: { ...P, ...n.grants },
|
|
389
|
+
dashboard: { ...z, ...n.dashboard },
|
|
390
|
+
aiConnection: { ...W, ...n.aiConnection },
|
|
391
|
+
aiProcess: { ...B, ...n.aiProcess },
|
|
392
|
+
authz: { ...M, ...n.authz }
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
export {
|
|
396
|
+
f as STUB_NOW,
|
|
397
|
+
y as STUB_USER_ID,
|
|
398
|
+
u as STUB_WORKSPACE_ID,
|
|
399
|
+
E as createStubMediahubClients,
|
|
400
|
+
I as stubAIConnection,
|
|
401
|
+
w as stubAIProcess,
|
|
402
|
+
F as stubAIProcessRun,
|
|
403
|
+
g as stubAsset,
|
|
404
|
+
m as stubAssetType,
|
|
405
|
+
R as stubAssetVersion,
|
|
406
|
+
b as stubCollection,
|
|
407
|
+
_ as stubFolder,
|
|
408
|
+
$ as stubGrantRoster,
|
|
409
|
+
h as stubTag,
|
|
410
|
+
S as stubUser,
|
|
411
|
+
D as stubWorkspaceStats
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sources":["../src/testing/fixtures.ts","../src/testing/stub-client.ts"],"sourcesContent":["// The stub workspace the `./testing` client answers from.\n//\n// One asset (with one version), one folder, one collection, one tag, one\n// asset type and one directory user — enough for every surface to render\n// something real, and named so a host's test can assert on it without\n// restating the rows.\nimport type {\n\tAIConnectionInfo,\n\tAIProcessInfo,\n\tAIProcessRunInfo,\n\tAssetInfo,\n\tAssetTypeInfo,\n\tAssetVersionInfo,\n\tCollectionInfo,\n\tFolderInfo,\n\tGrantRoster,\n\tTagInfo,\n\tUserInfo,\n\tWorkspaceStats,\n} from \"../types\";\n\nexport const STUB_WORKSPACE_ID = \"ws_1\";\nexport const STUB_USER_ID = \"user_1\";\nexport const STUB_NOW = new Date(\"2026-01-01T00:00:00Z\");\n\nexport function stubAssetVersion(\n\toverrides: Partial<AssetVersionInfo> = {},\n): AssetVersionInfo {\n\treturn {\n\t\tid: \"ver_1\",\n\t\tversionNumber: 1,\n\t\toriginalFilename: \"sample.png\",\n\t\tstorageKey: `${STUB_WORKSPACE_ID}/asset_1/1/sample.png`,\n\t\tfileSize: 12_345,\n\t\tmimeType: \"image/png\",\n\t\tcreatedBy: STUB_USER_ID,\n\t\tcomment: \"\",\n\t\tcreatedAt: STUB_NOW,\n\t\t...overrides,\n\t};\n}\n\nexport function stubAsset(overrides: Partial<AssetInfo> = {}): AssetInfo {\n\treturn {\n\t\tid: \"asset_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Sample Asset\",\n\t\tdescription: \"\",\n\t\tstatusSlug: \"\",\n\t\tcurrentVersion: 1,\n\t\tmetadata: {},\n\t\tassetTypeId: \"type_1\",\n\t\tfolderId: \"\",\n\t\tcreatedBy: STUB_USER_ID,\n\t\tupdatedBy: STUB_USER_ID,\n\t\tcreatedAt: STUB_NOW,\n\t\tupdatedAt: STUB_NOW,\n\t\tversions: [stubAssetVersion()],\n\t\ttagIds: [],\n\t\tcollectionIds: [],\n\t\tanalyzeWithAi: false,\n\t\t...overrides,\n\t};\n}\n\nexport function stubFolder(overrides: Partial<FolderInfo> = {}): FolderInfo {\n\treturn {\n\t\tid: \"folder_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Sample Folder\",\n\t\tslug: \"sample-folder\",\n\t\tparentId: \"\",\n\t\trestricted: false,\n\t\t...overrides,\n\t};\n}\n\nexport function stubCollection(\n\toverrides: Partial<CollectionInfo> = {},\n): CollectionInfo {\n\treturn {\n\t\tid: \"collection_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Sample Collection\",\n\t\tslug: \"sample-collection\",\n\t\tdescription: \"\",\n\t\ttype: \"static\",\n\t\trules: \"\",\n\t\trestricted: false,\n\t\t...overrides,\n\t};\n}\n\nexport function stubTag(overrides: Partial<TagInfo> = {}): TagInfo {\n\treturn {\n\t\tid: \"tag_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Sample Tag\",\n\t\tslug: \"sample-tag\",\n\t\t...overrides,\n\t};\n}\n\nexport function stubAssetType(\n\toverrides: Partial<AssetTypeInfo> = {},\n): AssetTypeInfo {\n\treturn {\n\t\tid: \"type_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Product Image\",\n\t\tslug: \"product-image\",\n\t\tdescription: \"\",\n\t\tallowedMimeTypes: [\"image/png\", \"image/jpeg\"],\n\t\tmetadataSchema: \"{}\",\n\t\tactive: true,\n\t\t...overrides,\n\t};\n}\n\nexport function stubUser(overrides: Partial<UserInfo> = {}): UserInfo {\n\treturn {\n\t\tid: STUB_USER_ID,\n\t\tdisplayName: \"Stub User\",\n\t\t...overrides,\n\t};\n}\n\nexport function stubGrantRoster(\n\toverrides: Partial<GrantRoster> = {},\n): GrantRoster {\n\treturn {\n\t\townerUserId: STUB_USER_ID,\n\t\tgrants: [],\n\t\t...overrides,\n\t};\n}\n\nexport function stubWorkspaceStats(\n\toverrides: Partial<WorkspaceStats> = {},\n): WorkspaceStats {\n\treturn {\n\t\ttotalAssets: 1,\n\t\ttotalStorageBytes: 12_345,\n\t\tstatusCounts: [],\n\t\trecentUploads: [],\n\t\t...overrides,\n\t};\n}\n\nexport function stubAIConnection(\n\toverrides: Partial<AIConnectionInfo> = {},\n): AIConnectionInfo {\n\treturn {\n\t\tid: \"aiconn_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tname: \"Sample Connection\",\n\t\tprovider: \"azure-openai\",\n\t\tendpoint: \"\",\n\t\tdeployment: \"\",\n\t\tapiVersion: \"\",\n\t\tbaseUrl: \"\",\n\t\tmodel: \"\",\n\t\tdescription: \"\",\n\t\tactive: true,\n\t\thasApiKey: false,\n\t\t...overrides,\n\t};\n}\n\nexport function stubAIProcess(\n\toverrides: Partial<AIProcessInfo> = {},\n): AIProcessInfo {\n\treturn {\n\t\tid: \"aiproc_1\",\n\t\tworkspaceId: STUB_WORKSPACE_ID,\n\t\tassetTypeId: \"type_1\",\n\t\tconnectionId: \"aiconn_1\",\n\t\tname: \"Sample Process\",\n\t\tprompt: \"\",\n\t\toutputs: [],\n\t\tposition: 0,\n\t\tactive: true,\n\t\t...overrides,\n\t};\n}\n\nexport function stubAIProcessRun(\n\toverrides: Partial<AIProcessRunInfo> = {},\n): AIProcessRunInfo {\n\treturn {\n\t\tid: \"airun_1\",\n\t\taiProcessId: \"aiproc_1\",\n\t\tprocessName: \"Sample Process\",\n\t\tstatus: \"succeeded\",\n\t\terror: \"\",\n\t\tstartedAt: STUB_NOW,\n\t\tfinishedAt: STUB_NOW,\n\t\t...overrides,\n\t};\n}\n","// `MediahubClients` that answer every method from the stub workspace.\n//\n// Typed as the whole interface, so a method added to a client without an\n// answer here fails THIS package's typecheck rather than a host's test at\n// runtime.\n//\n// Reads answer the fixtures, fresh objects every call. Writes resolve with\n// what a server would plausibly send back — the fixture the write was about,\n// with the fields the input set applied — and change nothing: the stub has\n// no state, so a test asserting a write asserts the CALL (replace a method\n// with a spy through `overrides`), never a read that follows it.\nimport type {\n\tAIConnectionClient,\n\tAIProcessClient,\n\tAssetClient,\n\tAssetTypeClient,\n\tAuthzClient,\n\tCollectionClient,\n\tDashboardClient,\n\tDirectoryClient,\n\tFolderClient,\n\tGrantClient,\n\tMediahubClients,\n\tTagClient,\n} from \"../clients\";\nimport type { AssetInfo, CollectionInfo, FolderInfo, TagInfo } from \"../types\";\nimport {\n\tstubAIConnection,\n\tstubAIProcess,\n\tstubAIProcessRun,\n\tstubAsset,\n\tstubAssetType,\n\tstubCollection,\n\tstubFolder,\n\tstubGrantRoster,\n\tstubTag,\n\tstubUser,\n\tstubWorkspaceStats,\n} from \"./fixtures\";\n\n/** Per-client replacements for any method — a rejection, a spy, a different payload. */\nexport interface StubMediahubOverrides {\n\tassets?: Partial<AssetClient>;\n\tfolders?: Partial<FolderClient>;\n\tcollections?: Partial<CollectionClient>;\n\ttags?: Partial<TagClient>;\n\tassetTypes?: Partial<AssetTypeClient>;\n\tdirectory?: Partial<DirectoryClient>;\n\tgrants?: Partial<GrantClient>;\n\tdashboard?: Partial<DashboardClient>;\n\taiConnection?: Partial<AIConnectionClient>;\n\taiProcess?: Partial<AIProcessClient>;\n\tauthz?: Partial<AuthzClient>;\n}\n\nfunction notFound(kind: string, id: string): Error {\n\treturn new Error(`${kind} ${id} not found`);\n}\n\nfunction wholePage<T>(items: T[]) {\n\treturn {\n\t\titems,\n\t\ttotal: items.length,\n\t\tpage: 1,\n\t\tpageSize: items.length || 1,\n\t\ttotalPages: 1,\n\t};\n}\n\n/**\n * The stub `MediahubClients`. Mount them in `MediahubProvider`:\n *\n * ```tsx\n * const clients = createStubMediahubClients();\n * render(\n * <MediahubProvider clients={clients} workspaceId={STUB_WORKSPACE_ID}>\n * <AssetLibrary />\n * </MediahubProvider>,\n * );\n * ```\n *\n * Pass `overrides` to replace any method of any sub-client for one test:\n *\n * ```ts\n * createStubMediahubClients({ assets: { delete: vi.fn(async () => {}) } });\n * ```\n */\nexport function createStubMediahubClients(\n\toverrides: StubMediahubOverrides = {},\n): MediahubClients {\n\tlet assets: AssetInfo[] = [stubAsset()];\n\tlet folders: FolderInfo[] = [stubFolder()];\n\tlet collections: CollectionInfo[] = [stubCollection()];\n\tlet tags: TagInfo[] = [stubTag()];\n\n\tconst findAsset = (id: string) => {\n\t\tconst found = assets.find((a) => a.id === id);\n\t\tif (!found) throw notFound(\"asset\", id);\n\t\treturn found;\n\t};\n\n\tconst assetClient: AssetClient = {\n\t\tlist: async () => wholePage(assets.map((a) => ({ ...a }))),\n\t\tget: async (id) => ({ ...findAsset(id) }),\n\t\tcreate: async (workspaceId, params) => {\n\t\t\tconst created: AssetInfo = {\n\t\t\t\t...stubAsset(),\n\t\t\t\tid: `asset_${assets.length + 1}`,\n\t\t\t\tworkspaceId,\n\t\t\t\tname: params.name,\n\t\t\t\tdescription: params.description ?? \"\",\n\t\t\t\tassetTypeId: params.assetTypeId,\n\t\t\t\tfolderId: params.folderId ?? \"\",\n\t\t\t\tmetadata: params.metadata ?? {},\n\t\t\t\tanalyzeWithAi: params.analyzeWithAi ?? false,\n\t\t\t\tversions: [],\n\t\t\t};\n\t\t\tassets = [...assets, created];\n\t\t\treturn created;\n\t\t},\n\t\tupdate: async (id, patch) => {\n\t\t\tconst updated = {\n\t\t\t\t...findAsset(id),\n\t\t\t\t...(patch.name !== undefined ? { name: patch.name } : {}),\n\t\t\t\t...(patch.description !== undefined\n\t\t\t\t\t? { description: patch.description }\n\t\t\t\t\t: {}),\n\t\t\t\t...(patch.metadata !== undefined ? { metadata: patch.metadata } : {}),\n\t\t\t};\n\t\t\tassets = assets.map((a) => (a.id === id ? updated : a));\n\t\t\treturn updated;\n\t\t},\n\t\tdelete: async (id) => {\n\t\t\tassets = assets.filter((a) => a.id !== id);\n\t\t},\n\t\tgetUploadUrl: async () => ({\n\t\t\tuploadUrl: \"blob:stub-upload\",\n\t\t\tversionId: \"ver_new\",\n\t\t}),\n\t\tfinalizeUpload: async (versionId) => ({\n\t\t\t...stubAsset(),\n\t\t\tversions: [{ ...stubAsset().versions[0], id: versionId }],\n\t\t}),\n\t\tgetDownloadUrl: async () => \"blob:stub-download\",\n\t\tmove: async (id, folderId) => {\n\t\t\tconst moved = { ...findAsset(id), folderId };\n\t\t\tassets = assets.map((a) => (a.id === id ? moved : a));\n\t\t\treturn moved;\n\t\t},\n\t\ttransitionStatus: async (id, _fromStatusSlug, toStatusSlug) => {\n\t\t\tconst moved = { ...findAsset(id), statusSlug: toStatusSlug };\n\t\t\tassets = assets.map((a) => (a.id === id ? moved : a));\n\t\t\treturn moved;\n\t\t},\n\t\tenhanceMetadata: async (id) => ({ ...findAsset(id) }),\n\t\tlistProcessRuns: async () => [stubAIProcessRun()],\n\t};\n\n\tconst folderClient: FolderClient = {\n\t\tlist: async () => folders.map((f) => ({ ...f })),\n\t\tget: async (id) => {\n\t\t\tconst found = folders.find((f) => f.id === id);\n\t\t\tif (!found) throw notFound(\"folder\", id);\n\t\t\treturn { ...found };\n\t\t},\n\t\tcreate: async (params) => {\n\t\t\tconst created: FolderInfo = {\n\t\t\t\t...stubFolder(),\n\t\t\t\tid: `folder_${folders.length + 1}`,\n\t\t\t\tworkspaceId: params.workspaceId,\n\t\t\t\tname: params.name,\n\t\t\t\tslug: params.slug,\n\t\t\t\tparentId: params.parentId,\n\t\t\t\trestricted: params.restricted ?? false,\n\t\t\t};\n\t\t\tfolders = [...folders, created];\n\t\t\treturn created;\n\t\t},\n\t\tupdate: async (id, name) => {\n\t\t\tconst found = folders.find((f) => f.id === id);\n\t\t\tif (!found) throw notFound(\"folder\", id);\n\t\t\tconst updated = { ...found, name };\n\t\t\tfolders = folders.map((f) => (f.id === id ? updated : f));\n\t\t\treturn updated;\n\t\t},\n\t\tdelete: async (id) => {\n\t\t\tfolders = folders.filter((f) => f.id !== id);\n\t\t},\n\t\tmove: async (id, parentId) => {\n\t\t\tconst found = folders.find((f) => f.id === id);\n\t\t\tif (!found) throw notFound(\"folder\", id);\n\t\t\tconst moved = { ...found, parentId };\n\t\t\tfolders = folders.map((f) => (f.id === id ? moved : f));\n\t\t\treturn moved;\n\t\t},\n\t\tsetRestricted: async (id, restricted) => {\n\t\t\tconst found = folders.find((f) => f.id === id);\n\t\t\tif (!found) throw notFound(\"folder\", id);\n\t\t\tconst updated = { ...found, restricted };\n\t\t\tfolders = folders.map((f) => (f.id === id ? updated : f));\n\t\t\treturn updated;\n\t\t},\n\t};\n\n\tconst collectionClient: CollectionClient = {\n\t\tlist: async () => collections.map((c) => ({ ...c })),\n\t\tget: async (id) => {\n\t\t\tconst found = collections.find((c) => c.id === id);\n\t\t\tif (!found) throw notFound(\"collection\", id);\n\t\t\treturn { ...found };\n\t\t},\n\t\tcreate: async (params) => {\n\t\t\tconst created: CollectionInfo = {\n\t\t\t\t...stubCollection(),\n\t\t\t\tid: `collection_${collections.length + 1}`,\n\t\t\t\tworkspaceId: params.workspaceId,\n\t\t\t\tname: params.name,\n\t\t\t\tslug: params.slug,\n\t\t\t\tdescription: params.description,\n\t\t\t\ttype: params.type,\n\t\t\t\trules: params.rules,\n\t\t\t\trestricted: params.restricted ?? false,\n\t\t\t};\n\t\t\tcollections = [...collections, created];\n\t\t\treturn created;\n\t\t},\n\t\tupdate: async (id, patch) => {\n\t\t\tconst found = collections.find((c) => c.id === id);\n\t\t\tif (!found) throw notFound(\"collection\", id);\n\t\t\tconst updated = { ...found, ...patch };\n\t\t\tcollections = collections.map((c) => (c.id === id ? updated : c));\n\t\t\treturn updated;\n\t\t},\n\t\tdelete: async (id) => {\n\t\t\tcollections = collections.filter((c) => c.id !== id);\n\t\t},\n\t\taddAssets: async () => {},\n\t\tremoveAssets: async () => {},\n\t\tsetRestricted: async (id, restricted) => {\n\t\t\tconst found = collections.find((c) => c.id === id);\n\t\t\tif (!found) throw notFound(\"collection\", id);\n\t\t\tconst updated = { ...found, restricted };\n\t\t\tcollections = collections.map((c) => (c.id === id ? updated : c));\n\t\t\treturn updated;\n\t\t},\n\t};\n\n\tconst tagClient: TagClient = {\n\t\tlist: async () => tags.map((t) => ({ ...t })),\n\t\tcreate: async (params) => {\n\t\t\tconst created: TagInfo = {\n\t\t\t\t...stubTag(),\n\t\t\t\tid: `tag_${tags.length + 1}`,\n\t\t\t\tworkspaceId: params.workspaceId,\n\t\t\t\tname: params.name,\n\t\t\t\tslug: params.slug,\n\t\t\t};\n\t\t\ttags = [...tags, created];\n\t\t\treturn created;\n\t\t},\n\t\tupdate: async (id, name) => {\n\t\t\tconst found = tags.find((t) => t.id === id);\n\t\t\tif (!found) throw notFound(\"tag\", id);\n\t\t\tconst updated = { ...found, name };\n\t\t\ttags = tags.map((t) => (t.id === id ? updated : t));\n\t\t\treturn updated;\n\t\t},\n\t\tdelete: async (id) => {\n\t\t\ttags = tags.filter((t) => t.id !== id);\n\t\t},\n\t\ttagAssets: async () => {},\n\t\tuntagAssets: async () => {},\n\t};\n\n\tconst assetTypeClient: AssetTypeClient = {\n\t\tlist: async () => [stubAssetType()],\n\t\tget: async (id) => ({ ...stubAssetType(), id }),\n\t\tcreate: async (params) => ({\n\t\t\t...stubAssetType(),\n\t\t\tid: \"type_new\",\n\t\t\tname: params.name,\n\t\t\tslug: params.slug,\n\t\t\tdescription: params.description,\n\t\t\tallowedMimeTypes: params.allowedMimeTypes,\n\t\t\tmetadataSchema: params.metadataSchema,\n\t\t}),\n\t\tupdate: async (id, patch) => ({ ...stubAssetType(), id, ...patch }),\n\t\tdelete: async () => {},\n\t};\n\n\tconst directoryClient: DirectoryClient = {\n\t\tresolveUsers: async (ids) => ids.map((id) => stubUser({ id })),\n\t\tlistWorkspaceMembers: async () => [stubUser()],\n\t};\n\n\tconst grantClient: GrantClient = {\n\t\tlist: async () => stubGrantRoster(),\n\t\tgrant: async () => {},\n\t\trevoke: async () => {},\n\t};\n\n\tconst dashboardClient: DashboardClient = {\n\t\tgetWorkspaceStats: async () => stubWorkspaceStats(),\n\t\tgetDashboardLayout: async () => \"{}\",\n\t\tsaveDashboardLayout: async () => {},\n\t};\n\n\tconst aiConnectionClient: AIConnectionClient = {\n\t\tlist: async () => [stubAIConnection()],\n\t\tget: async (id) => ({ ...stubAIConnection(), id }),\n\t\tcreate: async (params) => ({\n\t\t\t...stubAIConnection(),\n\t\t\tid: \"aiconn_new\",\n\t\t\t...params,\n\t\t}),\n\t\tupdate: async (id, patch) => ({ ...stubAIConnection(), id, ...patch }),\n\t\tdelete: async () => {},\n\t};\n\n\tconst aiProcessClient: AIProcessClient = {\n\t\tlist: async () => [stubAIProcess()],\n\t\tget: async (id) => ({ ...stubAIProcess(), id }),\n\t\tcreate: async (params) => ({\n\t\t\t...stubAIProcess(),\n\t\t\tid: \"aiproc_new\",\n\t\t\tassetTypeId: params.assetTypeId,\n\t\t\tconnectionId: params.connectionId,\n\t\t\tname: params.name,\n\t\t\tprompt: params.prompt,\n\t\t\toutputs: params.outputs,\n\t\t\tposition: params.position,\n\t\t}),\n\t\tupdate: async (id, patch) => ({ ...stubAIProcess(), id, ...patch }),\n\t\tdelete: async () => {},\n\t};\n\n\tconst authzClient: AuthzClient = {\n\t\tcanManage: async () => true,\n\t};\n\n\treturn {\n\t\tassets: { ...assetClient, ...overrides.assets },\n\t\tfolders: { ...folderClient, ...overrides.folders },\n\t\tcollections: { ...collectionClient, ...overrides.collections },\n\t\ttags: { ...tagClient, ...overrides.tags },\n\t\tassetTypes: { ...assetTypeClient, ...overrides.assetTypes },\n\t\tdirectory: { ...directoryClient, ...overrides.directory },\n\t\tgrants: { ...grantClient, ...overrides.grants },\n\t\tdashboard: { ...dashboardClient, ...overrides.dashboard },\n\t\taiConnection: { ...aiConnectionClient, ...overrides.aiConnection },\n\t\taiProcess: { ...aiProcessClient, ...overrides.aiProcess },\n\t\tauthz: { ...authzClient, ...overrides.authz },\n\t};\n}\n"],"names":["STUB_WORKSPACE_ID","STUB_USER_ID","STUB_NOW","stubAssetVersion","overrides","stubAsset","stubFolder","stubCollection","stubTag","stubAssetType","stubUser","stubGrantRoster","stubWorkspaceStats","stubAIConnection","stubAIProcess","stubAIProcessRun","notFound","kind","id","wholePage","items","createStubMediahubClients","assets","folders","collections","tags","findAsset","found","a","assetClient","workspaceId","params","created","patch","updated","versionId","folderId","moved","_fromStatusSlug","toStatusSlug","folderClient","f","name","parentId","restricted","collectionClient","c","tagClient","t","assetTypeClient","directoryClient","ids","grantClient","dashboardClient","aiConnectionClient","aiProcessClient","authzClient"],"mappings":"AAqBO,MAAMA,IAAoB,QACpBC,IAAe,UACfC,IAAW,oBAAI,KAAK,sBAAsB;AAEhD,SAASC,EACfC,IAAuC,IACpB;AACnB,SAAO;AAAA,IACN,IAAI;AAAA,IACJ,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,YAAY,GAAGJ,CAAiB;AAAA,IAChC,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAWC;AAAA,IACX,SAAS;AAAA,IACT,WAAWC;AAAA,IACX,GAAGE;AAAA,EAAA;AAEL;AAEO,SAASC,EAAUD,IAAgC,IAAe;AACxE,SAAO;AAAA,IACN,IAAI;AAAA,IACJ,aAAaJ;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,UAAU,CAAA;AAAA,IACV,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAWC;AAAA,IACX,WAAWA;AAAA,IACX,WAAWC;AAAA,IACX,WAAWA;AAAA,IACX,UAAU,CAACC,GAAkB;AAAA,IAC7B,QAAQ,CAAA;AAAA,IACR,eAA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,GAAGoD,GAAa,GAAGpD,EAAU,MAAA;AAAA,EAAM;AAE9C;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@knkcs/mediahub-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Reusable mediahub asset-management UI surfaces (AssetPicker, AssetLibrary) for host apps",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./testing": {
|
|
15
|
+
"types": "./dist/testing.d.ts",
|
|
16
|
+
"import": "./dist/testing.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/knkcs/mediahub.git",
|
|
25
|
+
"directory": "packages/mediahub-ui"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -b && vite build",
|
|
29
|
+
"dev": "vite build --watch",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"lint": "biome check src/",
|
|
32
|
+
"format": "biome format --write src/"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@bufbuild/protobuf": "^2.0.0",
|
|
36
|
+
"@hookform/resolvers": "^3.0.0",
|
|
37
|
+
"@knkcs/anker": "^5.2.0",
|
|
38
|
+
"@knkcs/fieldkit": "^0.16.0",
|
|
39
|
+
"@knkcs/statushub-ui": "^0.5.0",
|
|
40
|
+
"@tanstack/react-query": "^5.0.0",
|
|
41
|
+
"@tanstack/react-table": "^8.0.0",
|
|
42
|
+
"lucide-react": ">=0.400.0",
|
|
43
|
+
"react": "^19.0.0",
|
|
44
|
+
"react-dom": "^19.0.0",
|
|
45
|
+
"react-hook-form": "^7.0.0",
|
|
46
|
+
"react-i18next": "^17.0.0",
|
|
47
|
+
"zod": "^3.0.0",
|
|
48
|
+
"zustand": "^5.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@biomejs/biome": "^1.9.0",
|
|
52
|
+
"@hookform/resolvers": "^3.0.0",
|
|
53
|
+
"@knkcs/anker": "^5.2.0",
|
|
54
|
+
"@knkcs/fieldkit": "^0.16.0",
|
|
55
|
+
"@knkcs/statushub-ui": "^0.5.0",
|
|
56
|
+
"@testing-library/dom": "^10.4.1",
|
|
57
|
+
"@testing-library/react": "^16.3.2",
|
|
58
|
+
"@types/node": "^22.20.0",
|
|
59
|
+
"@types/react": "^19.0.0",
|
|
60
|
+
"@types/react-dom": "^19.0.0",
|
|
61
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
62
|
+
"lucide-react": "^0.400.0",
|
|
63
|
+
"react": "^19.0.0",
|
|
64
|
+
"react-dom": "^19.0.0",
|
|
65
|
+
"typescript": "~5.6.0",
|
|
66
|
+
"vite": "^6.0.0",
|
|
67
|
+
"vite-plugin-dts": "^4.0.0",
|
|
68
|
+
"vitest": "^4.0.0",
|
|
69
|
+
"zustand": "^5.0.14"
|
|
70
|
+
}
|
|
71
|
+
}
|