@antelopejs/dms-media 0.6.1 → 0.7.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/README.md +18 -3
- package/dist/acl/entries.js +1 -2
- package/dist/acl/entries.js.map +1 -1
- package/dist/bindings.js +1 -3
- package/dist/bindings.js.map +1 -1
- package/dist/declared/folders.js +3 -2
- package/dist/declared/folders.js.map +1 -1
- package/dist/declared/records.d.ts +2 -2
- package/dist/declared/records.js +3 -2
- package/dist/declared/records.js.map +1 -1
- package/dist/derivatives.js +9 -6
- package/dist/derivatives.js.map +1 -1
- package/dist/guards.d.ts +4 -0
- package/dist/guards.js +19 -0
- package/dist/guards.js.map +1 -0
- package/dist/library/activity.js +7 -5
- package/dist/library/activity.js.map +1 -1
- package/dist/library/batches.js +6 -3
- package/dist/library/batches.js.map +1 -1
- package/dist/library/events.js +4 -4
- package/dist/library/events.js.map +1 -1
- package/dist/library/module-readout.js +5 -2
- package/dist/library/module-readout.js.map +1 -1
- package/dist/library/realtime.js.map +1 -1
- package/dist/pages/activity.js +1 -1
- package/dist/pages/activity.js.map +1 -1
- package/dist/routes/media/assets.d.ts +1 -1
- package/dist/routes/media/assets.js +5 -5
- package/dist/routes/media/assets.js.map +1 -1
- package/dist/routes/media/bulk.js +17 -13
- package/dist/routes/media/bulk.js.map +1 -1
- package/dist/routes/media/delivery-headers.js +9 -9
- package/dist/routes/media/delivery-headers.js.map +1 -1
- package/dist/routes/media/delivery-stream.js.map +1 -1
- package/dist/routes/media/delivery.js.map +1 -1
- package/dist/routes/media/manage.js.map +1 -1
- package/dist/routes/media/transform.js +13 -8
- package/dist/routes/media/transform.js.map +1 -1
- package/dist/test/antelope.test.js +13 -12
- package/dist/test/antelope.test.js.map +1 -1
- package/dist/test/helpers/folders.d.ts +27 -0
- package/dist/test/helpers/folders.js +15 -0
- package/dist/test/helpers/folders.js.map +1 -1
- package/dist/test/helpers/pages.js +10 -6
- package/dist/test/helpers/pages.js.map +1 -1
- package/dist/test/helpers/permissions-world.d.ts +98 -0
- package/dist/test/helpers/permissions-world.js +205 -0
- package/dist/test/helpers/permissions-world.js.map +1 -0
- package/dist/test/helpers/prototype.d.ts +1 -0
- package/dist/test/helpers/prototype.js +11 -0
- package/dist/test/helpers/prototype.js.map +1 -0
- package/dist/test/integration/derivative-sweep-query.test.js +13 -16
- package/dist/test/integration/derivative-sweep-query.test.js.map +1 -1
- package/dist/test/integration/folder-query.test.js +5 -9
- package/dist/test/integration/folder-query.test.js.map +1 -1
- package/dist/test/integration/media-bindings.test.js +2 -2
- package/dist/test/integration/media-bindings.test.js.map +1 -1
- package/dist/test/integration/media-cleanup.test.js +14 -17
- package/dist/test/integration/media-cleanup.test.js.map +1 -1
- package/dist/test/integration/media-declared-content.test.js +2 -1
- package/dist/test/integration/media-declared-content.test.js.map +1 -1
- package/dist/test/integration/media-delivery-editing.test.js +7 -5
- package/dist/test/integration/media-delivery-editing.test.js.map +1 -1
- package/dist/test/integration/media-delivery.test.js +19 -5
- package/dist/test/integration/media-delivery.test.js.map +1 -1
- package/dist/test/integration/media-explorer-writes.test.js +2 -2
- package/dist/test/integration/media-explorer-writes.test.js.map +1 -1
- package/dist/test/integration/media-guards.test.js +18 -7
- package/dist/test/integration/media-guards.test.js.map +1 -1
- package/dist/test/integration/media-library.test.js +1 -1
- package/dist/test/integration/media-library.test.js.map +1 -1
- package/dist/test/integration/media-linked-subfolders.test.js +5 -5
- package/dist/test/integration/media-linked-subfolders.test.js.map +1 -1
- package/dist/test/integration/media-member-access.test.js +2 -5
- package/dist/test/integration/media-member-access.test.js.map +1 -1
- package/dist/test/integration/media-permissions.test.js +142 -473
- package/dist/test/integration/media-permissions.test.js.map +1 -1
- package/dist/test/integration/media-project-field.test.js +3 -5
- package/dist/test/integration/media-project-field.test.js.map +1 -1
- package/dist/test/integration/media-search-query.test.js +11 -16
- package/dist/test/integration/media-search-query.test.js.map +1 -1
- package/dist/test/integration/media-storage-origin-unreachable.test.js +1 -0
- package/dist/test/integration/media-storage-origin-unreachable.test.js.map +1 -1
- package/dist/test/integration/media-upload-policy.test.js +2 -2
- package/dist/test/integration/media-upload-policy.test.js.map +1 -1
- package/dist/test/integration/permissions-management.d.ts +2 -0
- package/dist/test/integration/permissions-management.js +189 -0
- package/dist/test/integration/permissions-management.js.map +1 -0
- package/dist/test/unit/acl/entries.test.js +2 -1
- package/dist/test/unit/acl/entries.test.js.map +1 -1
- package/dist/test/unit/acl/resolver.test.js +10 -3
- package/dist/test/unit/acl/resolver.test.js.map +1 -1
- package/dist/test/unit/library/fixtures.d.ts +1 -1
- package/dist/test/unit/library/fixtures.js +6 -1
- package/dist/test/unit/library/fixtures.js.map +1 -1
- package/dist/test/unit/library/library.test.js +0 -1
- package/dist/test/unit/library/library.test.js.map +1 -1
- package/dist/test/unit/library/realtime.test.js.map +1 -1
- package/dist/test/unit/library/search-facets.test.js +2 -2
- package/dist/test/unit/library/search-facets.test.js.map +1 -1
- package/dist/test/unit/pages/toolbar.test.js +24 -7
- package/dist/test/unit/pages/toolbar.test.js.map +1 -1
- package/dist/test/unit/routes/dto.test.js +7 -6
- package/dist/test/unit/routes/dto.test.js.map +1 -1
- package/dist/test/unit/routes/file-page.test.js +5 -7
- package/dist/test/unit/routes/file-page.test.js.map +1 -1
- package/dist/test/unit/routes/preset-row.test.js +2 -1
- package/dist/test/unit/routes/preset-row.test.js.map +1 -1
- package/dist/transform.js +6 -6
- package/dist/transform.js.map +1 -1
- package/dist/upload-checks.d.ts +8 -2
- package/dist/upload-checks.js.map +1 -1
- package/dist/upload-policy.js +8 -8
- package/dist/upload-policy.js.map +1 -1
- package/dist/validation/declared.schema.js +14 -8
- package/dist/validation/declared.schema.js.map +1 -1
- package/dist/validation/media.schema.d.ts +1 -1
- package/dist/validation/media.schema.js +2 -2
- package/dist/validation/media.schema.js.map +1 -1
- package/frontend-vue/app/build/imageEditor/editorShapes.ts +118 -0
- package/frontend-vue/app/build/imageEditor/useEditorSaving.ts +87 -0
- package/frontend-vue/app/build/library/libraryActions.ts +444 -0
- package/frontend-vue/app/build/library/libraryCore.ts +137 -0
- package/frontend-vue/app/components/FirstRun.vue +2 -1
- package/frontend-vue/app/components/ImageEditor.vue +22 -179
- package/frontend-vue/app/components/dialogs/DestinationDialog.vue +3 -3
- package/frontend-vue/app/components/field/FieldAltPopover.vue +2 -1
- package/frontend-vue/app/composables/library/useMediaLibrary.ts +3 -575
- package/frontend-vue/app/composables/useAssetFieldUploads.ts +9 -1
- package/frontend-vue/app/composables/useAssetLink.ts +33 -13
- package/frontend-vue/app/composables/useFileDetails.ts +6 -5
- package/frontend-vue/app/composables/useMediaApi.ts +21 -5
- package/frontend-vue/app/composables/useUploadFailureText.ts +24 -5
- package/frontend-vue/app/composables/useUploadQueue.ts +178 -44
- package/frontend-vue/app/composables/useUploadToasts.ts +81 -19
- package/frontend-vue/build/backend-boundary.ts +122 -0
- package/frontend-vue/dms.frontend.build.ts +3 -0
- package/frontend-vue/eslint.config.mjs +13 -0
- package/frontend-vue/package.json +4 -2
- package/frontend-vue/pnpm-lock.yaml +217 -61
- package/frontend-vue/tests/api-error-presentation.test.ts +183 -0
- package/frontend-vue/tests/backend-boundary.test.ts +203 -0
- package/frontend-vue/tests/fixtures/serverRender.ts +1 -1
- package/frontend-vue/tests/mediaPreviews.test.ts +39 -0
- package/package.json +5 -11
- package/skills/dms-media/SKILL.md +3 -2
- package/skills/dms-media/cases.json +38 -0
- package/src/acl/entries.ts +6 -4
- package/src/bindings.ts +3 -3
- package/src/declared/folders.ts +3 -3
- package/src/declared/records.ts +9 -8
- package/src/derivatives.ts +10 -6
- package/src/guards.ts +19 -0
- package/src/library/activity.ts +17 -9
- package/src/library/batches.ts +12 -9
- package/src/library/events.ts +7 -4
- package/src/library/module-readout.ts +6 -2
- package/src/library/realtime.ts +5 -1
- package/src/library/zip.ts +1 -1
- package/src/pages/activity.ts +6 -2
- package/src/routes/media/assets.ts +4 -3
- package/src/routes/media/bulk.ts +16 -14
- package/src/routes/media/delivery-headers.ts +9 -12
- package/src/routes/media/delivery-stream.ts +3 -2
- package/src/routes/media/delivery.ts +4 -2
- package/src/routes/media/manage.ts +4 -6
- package/src/routes/media/transform.ts +27 -23
- package/src/test/antelope.test.ts +21 -17
- package/src/test/helpers/folders.ts +22 -0
- package/src/test/helpers/pages.ts +12 -5
- package/src/test/helpers/permissions-world.ts +326 -0
- package/src/test/helpers/prototype.ts +12 -0
- package/src/test/integration/derivative-sweep-query.test.ts +19 -21
- package/src/test/integration/folder-query.test.ts +11 -11
- package/src/test/integration/media-bindings.test.ts +7 -7
- package/src/test/integration/media-cleanup.test.ts +25 -37
- package/src/test/integration/media-declared-content.test.ts +18 -19
- package/src/test/integration/media-delivery-editing.test.ts +11 -7
- package/src/test/integration/media-delivery.test.ts +29 -8
- package/src/test/integration/media-explorer-writes.test.ts +2 -7
- package/src/test/integration/media-guards.test.ts +21 -7
- package/src/test/integration/media-library.test.ts +1 -1
- package/src/test/integration/media-linked-subfolders.test.ts +11 -20
- package/src/test/integration/media-member-access.test.ts +5 -9
- package/src/test/integration/media-permissions.test.ts +56 -570
- package/src/test/integration/media-project-field.test.ts +5 -7
- package/src/test/integration/media-search-query.test.ts +16 -20
- package/src/test/integration/media-storage-origin-unreachable.test.ts +3 -2
- package/src/test/integration/media-upload-policy.test.ts +2 -8
- package/src/test/integration/permissions-management.ts +292 -0
- package/src/test/unit/acl/entries.test.ts +2 -1
- package/src/test/unit/acl/resolver.test.ts +19 -7
- package/src/test/unit/library/fixtures.ts +9 -3
- package/src/test/unit/library/library.test.ts +1 -7
- package/src/test/unit/library/realtime.test.ts +1 -1
- package/src/test/unit/library/search-facets.test.ts +2 -2
- package/src/test/unit/pages/toolbar.test.ts +42 -17
- package/src/test/unit/routes/dto.test.ts +7 -6
- package/src/test/unit/routes/file-page.test.ts +10 -9
- package/src/test/unit/routes/preset-row.test.ts +2 -2
- package/src/transform.ts +6 -6
- package/src/upload-checks.ts +12 -3
- package/src/upload-policy.ts +8 -8
- package/src/validation/declared.schema.ts +17 -12
- package/src/validation/media.schema.ts +6 -6
- package/frontend-vue/tests/engines.test.ts +0 -20
- package/frontend-vue/tests/locales.test.ts +0 -61
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { afterEach, expect, it, vi } from 'vitest'
|
|
2
|
+
import * as vue from 'vue'
|
|
3
|
+
import { useApiErrorPresenter } from '#dms-core/app/composables/useApiErrorPresenter'
|
|
4
|
+
|
|
5
|
+
afterEach(() => {
|
|
6
|
+
vi.unstubAllGlobals()
|
|
7
|
+
vi.unstubAllEnvs()
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
it.each([
|
|
11
|
+
'names',
|
|
12
|
+
'presign',
|
|
13
|
+
'confirm',
|
|
14
|
+
'field',
|
|
15
|
+
'partial',
|
|
16
|
+
'success',
|
|
17
|
+
'local-field',
|
|
18
|
+
'local-batch',
|
|
19
|
+
])(
|
|
20
|
+
'presents the upload %s outcome without duplicate notices',
|
|
21
|
+
async (stage) => {
|
|
22
|
+
vi.resetModules()
|
|
23
|
+
vi.stubEnv('SSR', false)
|
|
24
|
+
for (const [name, value] of Object.entries(vue)) vi.stubGlobal(name, value)
|
|
25
|
+
const data = { message: 'error.read_only_demo', severity: 'warning' }
|
|
26
|
+
const error = Object.assign(new Error('Forbidden'), {
|
|
27
|
+
response: new Response(JSON.stringify(data), { status: 403 }),
|
|
28
|
+
data,
|
|
29
|
+
})
|
|
30
|
+
const notices = new Map<string | number, { title: string; color: string }>()
|
|
31
|
+
let sequence = 0
|
|
32
|
+
vi.stubGlobal('useToast', () => ({
|
|
33
|
+
add: (notice: { id?: string; title: string; color: string }) => {
|
|
34
|
+
const id = notice.id ?? ++sequence
|
|
35
|
+
notices.set(id, notice)
|
|
36
|
+
return { id }
|
|
37
|
+
},
|
|
38
|
+
update: (id: string | number, notice: { title: string; color: string }) =>
|
|
39
|
+
notices.set(id, notice),
|
|
40
|
+
remove: (id: string | number) => notices.delete(id),
|
|
41
|
+
}))
|
|
42
|
+
vi.stubGlobal('getPluginI18n', () => ({
|
|
43
|
+
i18n: {
|
|
44
|
+
tm: (key: string) =>
|
|
45
|
+
key === 'error.read_only_demo' ? 'This demo is read-only' : key,
|
|
46
|
+
rt: (message: string) => message,
|
|
47
|
+
},
|
|
48
|
+
}))
|
|
49
|
+
const state = vue.ref(new WeakMap())
|
|
50
|
+
vi.stubGlobal('useDmsState', () => state)
|
|
51
|
+
vi.stubGlobal('useApiErrorPresenter', useApiErrorPresenter)
|
|
52
|
+
vi.stubGlobal('useI18n', () => ({ t: (key: string) => key }))
|
|
53
|
+
vi.stubGlobal('useConfirm', () => ({ confirm: async () => false }))
|
|
54
|
+
vi.stubGlobal('onBeforeUnmount', () => undefined)
|
|
55
|
+
vi.stubGlobal('useUploadFailureText', () => () => 'Upload failed')
|
|
56
|
+
vi.stubGlobal('apiErrorStatus', () => 403)
|
|
57
|
+
vi.stubGlobal(
|
|
58
|
+
'uploadLimits',
|
|
59
|
+
vue.ref({ maxUploadBytes: 1000, allowedMimetypes: null }),
|
|
60
|
+
)
|
|
61
|
+
vi.stubGlobal('isActiveDocument', () => false)
|
|
62
|
+
vi.stubGlobal('newBatchId', () => 'batch-1')
|
|
63
|
+
vi.stubGlobal(
|
|
64
|
+
'XMLHttpRequest',
|
|
65
|
+
class {
|
|
66
|
+
upload = {}
|
|
67
|
+
status = 200
|
|
68
|
+
onload = () => undefined
|
|
69
|
+
open() {}
|
|
70
|
+
send() {
|
|
71
|
+
this.onload()
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
)
|
|
75
|
+
vi.stubGlobal('useUploadApi', () => ({
|
|
76
|
+
freeNames: async () => {
|
|
77
|
+
if (stage === 'names' || stage === 'field') throw error
|
|
78
|
+
return { names: [null, null] }
|
|
79
|
+
},
|
|
80
|
+
presign: async (_folderId: string, file: File) => {
|
|
81
|
+
if (
|
|
82
|
+
stage === 'presign' ||
|
|
83
|
+
(stage === 'partial' && file.name === 'world.txt')
|
|
84
|
+
)
|
|
85
|
+
throw error
|
|
86
|
+
return { resourceKey: 'key', uploadUrl: '/storage', headers: {} }
|
|
87
|
+
},
|
|
88
|
+
confirm: async () => {
|
|
89
|
+
if (stage === 'partial' || stage === 'success')
|
|
90
|
+
return { asset: { id: 'asset-1' } }
|
|
91
|
+
throw error
|
|
92
|
+
},
|
|
93
|
+
abort: async () => undefined,
|
|
94
|
+
reportBatch: async () => undefined,
|
|
95
|
+
}))
|
|
96
|
+
const { useUploadQueue } = await import('../app/composables/useUploadQueue')
|
|
97
|
+
vi.stubGlobal('useUploadQueue', useUploadQueue)
|
|
98
|
+
const { useUploadToasts } =
|
|
99
|
+
await import('../app/composables/useUploadToasts')
|
|
100
|
+
vi.stubGlobal('useUploadToasts', useUploadToasts)
|
|
101
|
+
const queue = useUploadQueue()
|
|
102
|
+
const toasts = useUploadToasts()
|
|
103
|
+
const settled = new Promise<void>((resolve) =>
|
|
104
|
+
queue.onBatchSettled(() => resolve()),
|
|
105
|
+
)
|
|
106
|
+
const files = stage.startsWith('local-')
|
|
107
|
+
? [new File([], 'empty.txt')]
|
|
108
|
+
: [new File(['hello'], 'hello.txt'), new File(['world'], 'world.txt')]
|
|
109
|
+
const destination = { folderId: 'folder-1', folderName: 'Docs' }
|
|
110
|
+
if (stage === 'field' || stage === 'local-field') {
|
|
111
|
+
const { useAssetFieldUploads } =
|
|
112
|
+
await import('../app/composables/useAssetFieldUploads')
|
|
113
|
+
await useAssetFieldUploads({
|
|
114
|
+
accept: () => undefined,
|
|
115
|
+
destination: () => destination,
|
|
116
|
+
room: () => undefined,
|
|
117
|
+
onUploaded: () => undefined,
|
|
118
|
+
}).upload(files)
|
|
119
|
+
} else {
|
|
120
|
+
const batchId = queue.enqueue(files, destination)
|
|
121
|
+
toasts.announce(batchId, files.length, 'Docs')
|
|
122
|
+
}
|
|
123
|
+
await settled
|
|
124
|
+
await vue.nextTick()
|
|
125
|
+
expect(
|
|
126
|
+
[...notices.values()].map(({ title, color }) => ({ title, color })),
|
|
127
|
+
).toEqual([
|
|
128
|
+
stage === 'success'
|
|
129
|
+
? { title: 'dms_media.toasts.upload_added', color: 'success' }
|
|
130
|
+
: stage === 'local-field'
|
|
131
|
+
? { title: 'dms_media.field_widget.upload.failed', color: 'warning' }
|
|
132
|
+
: stage === 'local-batch'
|
|
133
|
+
? { title: 'dms_media.toasts.upload_failed_one', color: 'warning' }
|
|
134
|
+
: { title: 'This demo is read-only', color: 'warning' },
|
|
135
|
+
])
|
|
136
|
+
},
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
it.each([true, false])(
|
|
140
|
+
'presents the clipboard outcome when copied is %s',
|
|
141
|
+
async (copied) => {
|
|
142
|
+
vi.resetModules()
|
|
143
|
+
const notices: { title: string; color: string; description?: string }[] = []
|
|
144
|
+
vi.stubGlobal('useMediaApi', () => ({}))
|
|
145
|
+
vi.stubGlobal('useAuthFetch', () => ({
|
|
146
|
+
$authFetch: async () => ({ origin: 'https://media.example.test/' }),
|
|
147
|
+
}))
|
|
148
|
+
vi.stubGlobal('useI18n', () => ({ t: (key: string) => key }))
|
|
149
|
+
vi.stubGlobal('useToast', () => ({
|
|
150
|
+
add: (notice: (typeof notices)[number]) => notices.push(notice),
|
|
151
|
+
}))
|
|
152
|
+
vi.stubGlobal('useConfirm', () => ({ confirm: async () => false }))
|
|
153
|
+
vi.stubGlobal('useApiErrorPresenter', useApiErrorPresenter)
|
|
154
|
+
vi.stubGlobal('getPluginI18n', () => ({ i18n: {} }))
|
|
155
|
+
vi.stubGlobal('useDmsState', () => vue.ref(new WeakMap()))
|
|
156
|
+
vi.stubGlobal('navigator', {
|
|
157
|
+
clipboard: {
|
|
158
|
+
writeText: async () => {
|
|
159
|
+
if (!copied) throw new Error('Clipboard denied')
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
const { useAssetLink } = await import('../app/composables/useAssetLink')
|
|
164
|
+
await useAssetLink().copyLink({
|
|
165
|
+
name: 'hello.txt',
|
|
166
|
+
url: '/media/hello.txt',
|
|
167
|
+
effectiveVisibility: 'public',
|
|
168
|
+
})
|
|
169
|
+
expect(notices).toHaveLength(1)
|
|
170
|
+
expect(notices[0]).toMatchObject(
|
|
171
|
+
copied
|
|
172
|
+
? {
|
|
173
|
+
title: 'dms_media.toasts.link_copied',
|
|
174
|
+
color: 'success',
|
|
175
|
+
}
|
|
176
|
+
: {
|
|
177
|
+
title: 'dms_media.asset_link.copy_failed',
|
|
178
|
+
description: 'https://media.example.test/media/hello.txt',
|
|
179
|
+
color: 'warning',
|
|
180
|
+
},
|
|
181
|
+
)
|
|
182
|
+
},
|
|
183
|
+
)
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mkdirSync,
|
|
3
|
+
mkdtempSync,
|
|
4
|
+
realpathSync,
|
|
5
|
+
rmSync,
|
|
6
|
+
symlinkSync,
|
|
7
|
+
writeFileSync,
|
|
8
|
+
} from 'node:fs'
|
|
9
|
+
import { tmpdir } from 'node:os'
|
|
10
|
+
import { dirname, join } from 'node:path'
|
|
11
|
+
import { build as viteBuild, type Plugin } from 'vite'
|
|
12
|
+
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
13
|
+
import { backendBoundary } from '../build/backend-boundary'
|
|
14
|
+
|
|
15
|
+
/** A scratch repository: the backend package, another package, and the frontend module inside the backend package. */
|
|
16
|
+
let repository: string
|
|
17
|
+
let frontend: string
|
|
18
|
+
|
|
19
|
+
function write(file: string, text: string): void {
|
|
20
|
+
mkdirSync(dirname(file), { recursive: true })
|
|
21
|
+
writeFileSync(file, text)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
beforeAll(() => {
|
|
25
|
+
repository = realpathSync(
|
|
26
|
+
mkdtempSync(join(tmpdir(), 'dms-media-boundary-')),
|
|
27
|
+
)
|
|
28
|
+
const backend = join(repository, 'packages/dms-media')
|
|
29
|
+
frontend = join(backend, 'frontend-vue')
|
|
30
|
+
write(
|
|
31
|
+
join(backend, 'package.json'),
|
|
32
|
+
JSON.stringify({ name: '@antelopejs/dms-media' }),
|
|
33
|
+
)
|
|
34
|
+
write(join(backend, 'src/backend.ts'), 'export const secret = 1\n')
|
|
35
|
+
write(join(backend, 'src/nested/deep.ts'), 'export const deep = 6\n')
|
|
36
|
+
write(join(backend, 'dist/built.js'), 'export const built = 2\n')
|
|
37
|
+
write(join(backend, 'dist/src/nested.js'), 'export const nested = 4\n')
|
|
38
|
+
write(join(backend, 'srcx/sibling.ts'), 'export const sibling = 5\n')
|
|
39
|
+
write(
|
|
40
|
+
join(repository, 'packages/other/package.json'),
|
|
41
|
+
JSON.stringify({ name: 'other' }),
|
|
42
|
+
)
|
|
43
|
+
write(
|
|
44
|
+
join(repository, 'packages/other/src/shared.ts'),
|
|
45
|
+
'export const shared = 3\n',
|
|
46
|
+
)
|
|
47
|
+
mkdirSync(frontend, { recursive: true })
|
|
48
|
+
symlinkSync(join(backend, 'src/backend.ts'), join(frontend, 'linked.ts'))
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
afterAll(() => {
|
|
52
|
+
rmSync(repository, { recursive: true, force: true })
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
interface BuildOptions {
|
|
56
|
+
extra?: Plugin[]
|
|
57
|
+
alias?: Record<string, string>
|
|
58
|
+
preserveSymlinks?: boolean
|
|
59
|
+
external?: string[]
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Builds a frontend entry made of `source` with the boundary plugin, and returns the bundled code. */
|
|
63
|
+
async function build(
|
|
64
|
+
source: string,
|
|
65
|
+
options: BuildOptions = {},
|
|
66
|
+
): Promise<string> {
|
|
67
|
+
write(join(frontend, 'entry.ts'), source)
|
|
68
|
+
const result = await viteBuild({
|
|
69
|
+
root: frontend,
|
|
70
|
+
configFile: false,
|
|
71
|
+
logLevel: 'silent',
|
|
72
|
+
plugins: [backendBoundary(), ...(options.extra ?? [])],
|
|
73
|
+
resolve: {
|
|
74
|
+
alias: options.alias ?? {},
|
|
75
|
+
preserveSymlinks: options.preserveSymlinks ?? false,
|
|
76
|
+
},
|
|
77
|
+
build: {
|
|
78
|
+
write: false,
|
|
79
|
+
rollupOptions: { external: options.external ?? [] },
|
|
80
|
+
lib: { entry: join(frontend, 'entry.ts'), formats: ['es'] },
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
return JSON.stringify(result)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** A plugin that answers the import `request` with the module id `id`. */
|
|
87
|
+
function resolver(request: string, id: string): Plugin {
|
|
88
|
+
return {
|
|
89
|
+
name: 'test-resolver',
|
|
90
|
+
resolveId: (source) => (source === request ? { id } : null),
|
|
91
|
+
load: (loaded) =>
|
|
92
|
+
loaded === id || loaded.startsWith('\0') ? 'export default 1\n' : null,
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const backendFile = () =>
|
|
97
|
+
join(repository, 'packages/dms-media/src/backend.ts')
|
|
98
|
+
|
|
99
|
+
describe('the backend boundary of the frontend build', () => {
|
|
100
|
+
it('fails on an import of the backend source, naming both files', async () => {
|
|
101
|
+
const failure = build(
|
|
102
|
+
'import { secret } from "../src/backend.ts"\nexport { secret }\n',
|
|
103
|
+
)
|
|
104
|
+
await expect(failure).rejects.toThrow(/Backend boundary/)
|
|
105
|
+
await expect(failure).rejects.toThrow(join(frontend, 'entry.ts'))
|
|
106
|
+
await expect(failure).rejects.toThrow(backendFile())
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('fails on a file deeper under the backend source', async () => {
|
|
110
|
+
await expect(
|
|
111
|
+
build('import { deep } from "../src/nested/deep.ts"\nexport { deep }\n'),
|
|
112
|
+
).rejects.toThrow(/Backend boundary/)
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it('fails on an alias that points into the backend source', async () => {
|
|
116
|
+
await expect(
|
|
117
|
+
build(
|
|
118
|
+
'import { secret } from "@backend/backend.ts"\nexport { secret }\n',
|
|
119
|
+
{
|
|
120
|
+
alias: { '@backend': join(repository, 'packages/dms-media/src') },
|
|
121
|
+
},
|
|
122
|
+
),
|
|
123
|
+
).rejects.toThrow(/Backend boundary/)
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
it('fails on a symlink to the backend source that the resolver returns', async () => {
|
|
127
|
+
await expect(
|
|
128
|
+
build('import { secret } from "./linked.ts"\nexport { secret }\n', {
|
|
129
|
+
extra: [resolver('./linked.ts', join(frontend, 'linked.ts'))],
|
|
130
|
+
preserveSymlinks: true,
|
|
131
|
+
}),
|
|
132
|
+
).rejects.toThrow(/Backend boundary/)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it('fails on an id that names the backend source with a query or a hash', async () => {
|
|
136
|
+
for (const suffix of ['?raw', '#fragment']) {
|
|
137
|
+
await expect(
|
|
138
|
+
build('import secret from "virtual-backend"\nexport { secret }\n', {
|
|
139
|
+
extra: [resolver('virtual-backend', `${backendFile()}${suffix}`)],
|
|
140
|
+
}),
|
|
141
|
+
).rejects.toThrow(/Backend boundary/)
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it('fails on a backend source import declared external', async () => {
|
|
146
|
+
await expect(
|
|
147
|
+
build('import { secret } from "../src/backend.ts"\nexport { secret }\n', {
|
|
148
|
+
external: [backendFile()],
|
|
149
|
+
}),
|
|
150
|
+
).rejects.toThrow(/Backend boundary/)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('fails on a worker entry under the backend source', async () => {
|
|
154
|
+
await expect(
|
|
155
|
+
build(
|
|
156
|
+
'export const worker = new Worker(new URL("../src/backend.ts", import.meta.url), { type: "module" })\n',
|
|
157
|
+
),
|
|
158
|
+
).rejects.toThrow(/Backend boundary/)
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it('fails on a worker of the frontend that imports the backend source', async () => {
|
|
162
|
+
write(
|
|
163
|
+
join(frontend, 'worker.ts'),
|
|
164
|
+
'import { secret } from "../src/backend.ts"\npostMessage(secret)\n',
|
|
165
|
+
)
|
|
166
|
+
await expect(
|
|
167
|
+
build(
|
|
168
|
+
'export const worker = new Worker(new URL("./worker.ts", import.meta.url), { type: "module" })\n',
|
|
169
|
+
),
|
|
170
|
+
).rejects.toThrow(/Backend boundary/)
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
it('passes the built output, a virtual module and the source of another package', async () => {
|
|
174
|
+
expect(
|
|
175
|
+
await build(
|
|
176
|
+
'import { built } from "../dist/built.js"\nexport { built }\n',
|
|
177
|
+
),
|
|
178
|
+
).toMatch(/built/)
|
|
179
|
+
expect(
|
|
180
|
+
await build('import value from "virtual:thing"\nexport { value }\n', {
|
|
181
|
+
extra: [resolver('virtual:thing', '\0virtual:thing')],
|
|
182
|
+
}),
|
|
183
|
+
).toMatch(/value/)
|
|
184
|
+
expect(
|
|
185
|
+
await build(
|
|
186
|
+
'import { shared } from "../../other/src/shared.ts"\nexport { shared }\n',
|
|
187
|
+
),
|
|
188
|
+
).toMatch(/shared/)
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it('passes a sibling folder named like src and a src folder inside dist', async () => {
|
|
192
|
+
expect(
|
|
193
|
+
await build(
|
|
194
|
+
'import { sibling } from "../srcx/sibling.ts"\nexport { sibling }\n',
|
|
195
|
+
),
|
|
196
|
+
).toMatch(/sibling/)
|
|
197
|
+
expect(
|
|
198
|
+
await build(
|
|
199
|
+
'import { nested } from "../dist/src/nested.js"\nexport { nested }\n',
|
|
200
|
+
),
|
|
201
|
+
).toMatch(/nested/)
|
|
202
|
+
})
|
|
203
|
+
})
|
|
@@ -62,7 +62,7 @@ provideGlobal('useToast', () => ({ add: noop }))
|
|
|
62
62
|
provideGlobal('useConfirm', () => ({ confirm: async () => false }))
|
|
63
63
|
provideGlobal('useOverlay', () => ({ create: () => ({ open: async () => undefined }) }))
|
|
64
64
|
provideGlobal('useDrawer', () => ({ open: noop }))
|
|
65
|
-
provideGlobal('
|
|
65
|
+
provideGlobal('useApiErrorPresenter', () => ({ presentError: noop, resolveError: () => null }))
|
|
66
66
|
provideGlobal('useUnsavedChanges', noop)
|
|
67
67
|
provideGlobal('usePageLiveRefresh', noop)
|
|
68
68
|
provideGlobal('defineShortcuts', noop)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { afterEach, expect, it, vi } from 'vitest'
|
|
2
|
+
import { useMediaApi } from '../app/composables/useMediaApi'
|
|
3
|
+
|
|
4
|
+
interface PreviewRequest {
|
|
5
|
+
method: string
|
|
6
|
+
query: { ids: string[] }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
afterEach(() => vi.unstubAllGlobals())
|
|
10
|
+
|
|
11
|
+
it('reads 150 previews in GET batches of 100 and 50 and merges both responses', async () => {
|
|
12
|
+
const ids = Array.from(
|
|
13
|
+
{ length: 150 },
|
|
14
|
+
(_, index) => `00000000-0000-4000-8000-${String(index).padStart(12, '0')}`,
|
|
15
|
+
)
|
|
16
|
+
const authFetch = vi.fn((_url: string, request: PreviewRequest) =>
|
|
17
|
+
Promise.resolve({
|
|
18
|
+
previews: Object.fromEntries(
|
|
19
|
+
request.query.ids.map((id) => [id, `https://media.test/${id}`]),
|
|
20
|
+
),
|
|
21
|
+
}),
|
|
22
|
+
)
|
|
23
|
+
vi.stubGlobal('useAuthFetch', () => ({ $authFetch: authFetch }))
|
|
24
|
+
|
|
25
|
+
const result = await useMediaApi().previews(ids)
|
|
26
|
+
|
|
27
|
+
expect(authFetch).toHaveBeenCalledTimes(2)
|
|
28
|
+
expect(authFetch).toHaveBeenNthCalledWith(1, '/api/media/previews', {
|
|
29
|
+
method: 'GET',
|
|
30
|
+
query: { ids: ids.slice(0, 100) },
|
|
31
|
+
})
|
|
32
|
+
expect(authFetch).toHaveBeenNthCalledWith(2, '/api/media/previews', {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
query: { ids: ids.slice(100) },
|
|
35
|
+
})
|
|
36
|
+
expect(result.previews).toEqual(
|
|
37
|
+
Object.fromEntries(ids.map((id) => [id, `https://media.test/${id}`])),
|
|
38
|
+
)
|
|
39
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms-media",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Media library for the AntelopeJS DMS: uploads, folders with per-folder permissions, image sizes and light editing, with a Finder-style explorer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -47,10 +47,7 @@
|
|
|
47
47
|
"dev:frontend": "pnpm frontend:dev",
|
|
48
48
|
"frontend:dev": "cd playground && pnpm frontend:dev",
|
|
49
49
|
"dev": "ajs project run -w -p playground",
|
|
50
|
-
"
|
|
51
|
-
"lint": "oxlint && oxfmt --check . && pnpm --dir frontend-vue lint && antelopejs-check-interface-ranges",
|
|
52
|
-
"typecheck": "tsc --noEmit",
|
|
53
|
-
"format": "oxfmt . && pnpm --dir frontend-vue format",
|
|
50
|
+
"typecheck": "pnpm --filter @antelopejs/interface-dms-media build && tsc --noEmit",
|
|
54
51
|
"test": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && ajs module test .",
|
|
55
52
|
"test:unit": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && DMS_MEDIA_TEST_DIR=dist/test/unit ajs module test .",
|
|
56
53
|
"test:integration": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && DMS_MEDIA_TEST_DIR=dist/test/integration ajs module test .",
|
|
@@ -77,9 +74,9 @@
|
|
|
77
74
|
},
|
|
78
75
|
"devDependencies": {
|
|
79
76
|
"@antelopejs/core": ">=1.17.1 <2",
|
|
80
|
-
"@antelopejs/dms": ">=0.
|
|
81
|
-
"@antelopejs/dms-frontend": "0.9.
|
|
82
|
-
"@antelopejs/tooling-configs": "
|
|
77
|
+
"@antelopejs/dms": ">=0.13.1 <1.0.0",
|
|
78
|
+
"@antelopejs/dms-frontend": "0.9.2",
|
|
79
|
+
"@antelopejs/tooling-configs": "^0.2.12",
|
|
83
80
|
"@types/chai": "^4.3.20",
|
|
84
81
|
"@types/mocha": "^10",
|
|
85
82
|
"@types/node": "^24.0.0",
|
|
@@ -88,9 +85,6 @@
|
|
|
88
85
|
"chai": "^4.5.0",
|
|
89
86
|
"knip": "^6.34.0",
|
|
90
87
|
"mongodb-memory-server-core": "^11.0.1",
|
|
91
|
-
"oxfmt": "^0.66.0",
|
|
92
|
-
"oxlint": "1.81.0",
|
|
93
|
-
"oxlint-tsgolint": "^7.0.2001",
|
|
94
88
|
"release-it": "^19.2.4",
|
|
95
89
|
"release-it-changelogen": "^0.1.0",
|
|
96
90
|
"rimraf": "^6.1.3",
|
|
@@ -19,8 +19,8 @@ Every data block carries `realtimeTopic: MEDIA_LIBRARY_TOPIC`; custom components
|
|
|
19
19
|
|
|
20
20
|
## Setup
|
|
21
21
|
|
|
22
|
-
- Media 0.
|
|
23
|
-
and `@antelopejs/interface-dms-media` >=0.3.0 <0.4.0. Media 0.
|
|
22
|
+
- Media 0.6.1 requires `@antelopejs/dms` >=0.11 (interface-dms >=0.9.0, renderer `@antelopejs/dms-frontend` 0.9)
|
|
23
|
+
and `@antelopejs/interface-dms-media` >=0.3.0 <0.4.0. Media 0.6.0 is the DMS 0.10 line; Media 0.4 uses media interface 0.2.
|
|
24
24
|
- `ajs project modules add @antelopejs/dms-media`, plus an `interface-file-storage` module (`file-storage-local`).
|
|
25
25
|
- Set the storage's `baseUrl` and the module's `publicBaseUrl` to `${@api.API_PUBLIC_BASE_URL}`, and list every
|
|
26
26
|
dashboard origin in the api module's `cors.allowedOrigins`: the browser `PUT`s files straight to the storage.
|
|
@@ -32,6 +32,7 @@ Every data block carries `realtimeTopic: MEDIA_LIBRARY_TOPIC`; custom components
|
|
|
32
32
|
Put the field in a DMS `Form` block of a backend-declared page; no custom Vue is needed.
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
+
import { Form } from "@antelopejs/interface-dms/base";
|
|
35
36
|
import { AssetType } from "@antelopejs/interface-dms-media"; // in the module's dependencies
|
|
36
37
|
|
|
37
38
|
static form = Form({
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"id": "media-image-field",
|
|
6
|
+
"area": "modules",
|
|
7
|
+
"style": "clean",
|
|
8
|
+
"prompt": "Add an image upload field for the product photos in the product form.",
|
|
9
|
+
"expect": {
|
|
10
|
+
"skills": ["dms-media"],
|
|
11
|
+
"acceptable": ["dms-pages", "dms", "dms-best-practices"],
|
|
12
|
+
"mustMention": ["AssetType"]
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"id": "media-upload-refused-casual",
|
|
17
|
+
"area": "modules",
|
|
18
|
+
"style": "casual",
|
|
19
|
+
"prompt": "uploads get refused on the media folder, cors maybe?",
|
|
20
|
+
"expect": {
|
|
21
|
+
"skills": ["dms-media"],
|
|
22
|
+
"acceptable": ["dms"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "dms-media-avoid-form-page",
|
|
27
|
+
"area": "modules",
|
|
28
|
+
"style": "clean",
|
|
29
|
+
"prompt": "Build an articles admin page with a Form block for the title and body and a TableView listing the articles.",
|
|
30
|
+
"expect": {
|
|
31
|
+
"skills": ["dms-pages"],
|
|
32
|
+
"acceptable": ["dms-best-practices", "dms"],
|
|
33
|
+
"mustMention": ["RegisterPage", "TableView"],
|
|
34
|
+
"avoid": ["dms-media"]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
package/src/acl/entries.ts
CHANGED
|
@@ -2,15 +2,17 @@ import { Logging } from "@antelopejs/interface-core/logging";
|
|
|
2
2
|
import type { MediaFolder } from "../db/tables";
|
|
3
3
|
import type { AclEntry } from "../types";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Fails closed: an unreadable stored ACL grants nothing instead of inheriting.
|
|
7
|
+
* A stored ACL that is not JSON is handled like one that is not an array:
|
|
8
|
+
* logged, then read as empty.
|
|
9
|
+
*/
|
|
6
10
|
export function parseFolderAcl(folder: MediaFolder): AclEntry[] | undefined {
|
|
7
11
|
if (!folder.json_acl) return undefined;
|
|
8
12
|
try {
|
|
9
13
|
const parsed = JSON.parse(folder.json_acl);
|
|
10
14
|
if (Array.isArray(parsed)) return parsed as AclEntry[];
|
|
11
|
-
} catch {
|
|
12
|
-
// Handled below with the non-array case.
|
|
13
|
-
}
|
|
15
|
+
} catch {}
|
|
14
16
|
Logging.Warn(
|
|
15
17
|
`Media folder '${folder._id}' has an unreadable ACL; treating it as empty.`,
|
|
16
18
|
);
|
package/src/bindings.ts
CHANGED
|
@@ -149,9 +149,9 @@ async function provisionTenant(
|
|
|
149
149
|
if (registeredBindings.size > 0) {
|
|
150
150
|
const folders = await folderModel.getAll();
|
|
151
151
|
const foldersByBinding = new Map(
|
|
152
|
-
folders
|
|
153
|
-
.
|
|
154
|
-
|
|
152
|
+
folders.flatMap((folder): [string, MediaFolder][] =>
|
|
153
|
+
folder.binding ? [[folder.binding, folder]] : [],
|
|
154
|
+
),
|
|
155
155
|
);
|
|
156
156
|
const contentRootId = await ensureContentRoot(
|
|
157
157
|
folderModel,
|
package/src/declared/folders.ts
CHANGED
|
@@ -21,12 +21,13 @@ import {
|
|
|
21
21
|
settlePendingDeclaration,
|
|
22
22
|
withDeclarationLock,
|
|
23
23
|
} from "./records";
|
|
24
|
+
import { isString } from "../guards";
|
|
24
25
|
|
|
25
26
|
type ParentTarget = NonNullable<DeclaredFolderInput["parent"]>;
|
|
26
27
|
|
|
27
28
|
/** The declared folder key a parent names, written as a string or as `{ key }`. */
|
|
28
29
|
function parentKeyOf(parent: ParentTarget | undefined): string | undefined {
|
|
29
|
-
if (
|
|
30
|
+
if (isString(parent)) return parent;
|
|
30
31
|
return parent && "key" in parent ? parent.key : undefined;
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -70,8 +71,7 @@ async function findParentFolder(
|
|
|
70
71
|
parent: ParentTarget,
|
|
71
72
|
fail: (reason: string) => never,
|
|
72
73
|
): Promise<MediaFolder> {
|
|
73
|
-
if (
|
|
74
|
-
return findDeclaredFolder(models, parent, fail);
|
|
74
|
+
if (isString(parent)) return findDeclaredFolder(models, parent, fail);
|
|
75
75
|
if ("key" in parent) return findDeclaredFolder(models, parent.key, fail);
|
|
76
76
|
const { binding } = parent;
|
|
77
77
|
const folder = await findBoundFolder(models, binding, fail);
|
package/src/declared/records.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetModel } from "@antelopejs/interface-database-decorators";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ZodType, ZodTypeDef } from "zod";
|
|
3
|
+
import { isObjectLike, isString } from "../guards";
|
|
3
4
|
import {
|
|
4
5
|
MediaAssetModel,
|
|
5
6
|
type MediaDeclarationKind,
|
|
@@ -45,18 +46,18 @@ export function declaredModels(tenantId: string): DeclaredModels {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
/** Validates a declaration, naming every refused field. */
|
|
48
|
-
export function parseDeclaration<
|
|
49
|
+
export function parseDeclaration<Output>(
|
|
49
50
|
kind: MediaDeclarationKind,
|
|
50
51
|
input: unknown,
|
|
51
|
-
schema:
|
|
52
|
-
):
|
|
52
|
+
schema: ZodType<Output, ZodTypeDef, unknown>,
|
|
53
|
+
): Output {
|
|
53
54
|
const parsed = schema.safeParse(input);
|
|
54
|
-
if (parsed.success) return parsed.data
|
|
55
|
-
const key = (input
|
|
55
|
+
if (parsed.success) return parsed.data;
|
|
56
|
+
const key = isObjectLike(input) && "key" in input ? input.key : undefined;
|
|
56
57
|
throw new MediaDeclarationError(
|
|
57
58
|
kind,
|
|
58
|
-
|
|
59
|
-
describeDeclarationIssues(parsed.error
|
|
59
|
+
isString(key) ? key : "?",
|
|
60
|
+
describeDeclarationIssues(parsed.error),
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
63
|
|