@imgly/plugin-remote-asset-source-web 0.1.1

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.
@@ -0,0 +1,269 @@
1
+ import { z } from 'zod';
2
+ export declare const assetSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ groups: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5
+ meta: z.ZodOptional<z.ZodObject<{
6
+ mimeType: z.ZodOptional<z.ZodString>;
7
+ blockType: z.ZodOptional<z.ZodString>;
8
+ uri: z.ZodOptional<z.ZodString>;
9
+ thumbUri: z.ZodOptional<z.ZodString>;
10
+ previewUri: z.ZodOptional<z.ZodString>;
11
+ filename: z.ZodOptional<z.ZodString>;
12
+ vectorPath: z.ZodOptional<z.ZodString>;
13
+ width: z.ZodOptional<z.ZodNumber>;
14
+ height: z.ZodOptional<z.ZodNumber>;
15
+ duration: z.ZodOptional<z.ZodString>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ mimeType?: string | undefined;
18
+ blockType?: string | undefined;
19
+ uri?: string | undefined;
20
+ thumbUri?: string | undefined;
21
+ previewUri?: string | undefined;
22
+ filename?: string | undefined;
23
+ vectorPath?: string | undefined;
24
+ width?: number | undefined;
25
+ height?: number | undefined;
26
+ duration?: string | undefined;
27
+ }, {
28
+ mimeType?: string | undefined;
29
+ blockType?: string | undefined;
30
+ uri?: string | undefined;
31
+ thumbUri?: string | undefined;
32
+ previewUri?: string | undefined;
33
+ filename?: string | undefined;
34
+ vectorPath?: string | undefined;
35
+ width?: number | undefined;
36
+ height?: number | undefined;
37
+ duration?: string | undefined;
38
+ }>>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ id: string;
41
+ groups?: string[] | undefined;
42
+ meta?: {
43
+ mimeType?: string | undefined;
44
+ blockType?: string | undefined;
45
+ uri?: string | undefined;
46
+ thumbUri?: string | undefined;
47
+ previewUri?: string | undefined;
48
+ filename?: string | undefined;
49
+ vectorPath?: string | undefined;
50
+ width?: number | undefined;
51
+ height?: number | undefined;
52
+ duration?: string | undefined;
53
+ } | undefined;
54
+ }, {
55
+ id: string;
56
+ groups?: string[] | undefined;
57
+ meta?: {
58
+ mimeType?: string | undefined;
59
+ blockType?: string | undefined;
60
+ uri?: string | undefined;
61
+ thumbUri?: string | undefined;
62
+ previewUri?: string | undefined;
63
+ filename?: string | undefined;
64
+ vectorPath?: string | undefined;
65
+ width?: number | undefined;
66
+ height?: number | undefined;
67
+ duration?: string | undefined;
68
+ } | undefined;
69
+ }>;
70
+ export type Asset = z.infer<typeof assetSchema>;
71
+ export declare const assetDefinitionSchema: z.ZodObject<{
72
+ id: z.ZodString;
73
+ groups: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
+ meta: z.ZodOptional<z.ZodObject<{
75
+ mimeType: z.ZodOptional<z.ZodString>;
76
+ blockType: z.ZodOptional<z.ZodString>;
77
+ uri: z.ZodOptional<z.ZodString>;
78
+ thumbUri: z.ZodOptional<z.ZodString>;
79
+ previewUri: z.ZodOptional<z.ZodString>;
80
+ filename: z.ZodOptional<z.ZodString>;
81
+ vectorPath: z.ZodOptional<z.ZodString>;
82
+ width: z.ZodOptional<z.ZodNumber>;
83
+ height: z.ZodOptional<z.ZodNumber>;
84
+ duration: z.ZodOptional<z.ZodString>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ mimeType?: string | undefined;
87
+ blockType?: string | undefined;
88
+ uri?: string | undefined;
89
+ thumbUri?: string | undefined;
90
+ previewUri?: string | undefined;
91
+ filename?: string | undefined;
92
+ vectorPath?: string | undefined;
93
+ width?: number | undefined;
94
+ height?: number | undefined;
95
+ duration?: string | undefined;
96
+ }, {
97
+ mimeType?: string | undefined;
98
+ blockType?: string | undefined;
99
+ uri?: string | undefined;
100
+ thumbUri?: string | undefined;
101
+ previewUri?: string | undefined;
102
+ filename?: string | undefined;
103
+ vectorPath?: string | undefined;
104
+ width?: number | undefined;
105
+ height?: number | undefined;
106
+ duration?: string | undefined;
107
+ }>>;
108
+ label: z.ZodOptional<z.ZodString>;
109
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ id: string;
112
+ groups?: string[] | undefined;
113
+ meta?: {
114
+ mimeType?: string | undefined;
115
+ blockType?: string | undefined;
116
+ uri?: string | undefined;
117
+ thumbUri?: string | undefined;
118
+ previewUri?: string | undefined;
119
+ filename?: string | undefined;
120
+ vectorPath?: string | undefined;
121
+ width?: number | undefined;
122
+ height?: number | undefined;
123
+ duration?: string | undefined;
124
+ } | undefined;
125
+ label?: string | undefined;
126
+ tags?: string[] | undefined;
127
+ }, {
128
+ id: string;
129
+ groups?: string[] | undefined;
130
+ meta?: {
131
+ mimeType?: string | undefined;
132
+ blockType?: string | undefined;
133
+ uri?: string | undefined;
134
+ thumbUri?: string | undefined;
135
+ previewUri?: string | undefined;
136
+ filename?: string | undefined;
137
+ vectorPath?: string | undefined;
138
+ width?: number | undefined;
139
+ height?: number | undefined;
140
+ duration?: string | undefined;
141
+ } | undefined;
142
+ label?: string | undefined;
143
+ tags?: string[] | undefined;
144
+ }>;
145
+ export declare const assetsQueryResultSchema: z.ZodObject<{
146
+ assets: z.ZodArray<z.ZodObject<{
147
+ id: z.ZodString;
148
+ groups: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
149
+ meta: z.ZodOptional<z.ZodObject<{
150
+ mimeType: z.ZodOptional<z.ZodString>;
151
+ blockType: z.ZodOptional<z.ZodString>;
152
+ uri: z.ZodOptional<z.ZodString>;
153
+ thumbUri: z.ZodOptional<z.ZodString>;
154
+ previewUri: z.ZodOptional<z.ZodString>;
155
+ filename: z.ZodOptional<z.ZodString>;
156
+ vectorPath: z.ZodOptional<z.ZodString>;
157
+ width: z.ZodOptional<z.ZodNumber>;
158
+ height: z.ZodOptional<z.ZodNumber>;
159
+ duration: z.ZodOptional<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ mimeType?: string | undefined;
162
+ blockType?: string | undefined;
163
+ uri?: string | undefined;
164
+ thumbUri?: string | undefined;
165
+ previewUri?: string | undefined;
166
+ filename?: string | undefined;
167
+ vectorPath?: string | undefined;
168
+ width?: number | undefined;
169
+ height?: number | undefined;
170
+ duration?: string | undefined;
171
+ }, {
172
+ mimeType?: string | undefined;
173
+ blockType?: string | undefined;
174
+ uri?: string | undefined;
175
+ thumbUri?: string | undefined;
176
+ previewUri?: string | undefined;
177
+ filename?: string | undefined;
178
+ vectorPath?: string | undefined;
179
+ width?: number | undefined;
180
+ height?: number | undefined;
181
+ duration?: string | undefined;
182
+ }>>;
183
+ label: z.ZodOptional<z.ZodString>;
184
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ id: string;
187
+ groups?: string[] | undefined;
188
+ meta?: {
189
+ mimeType?: string | undefined;
190
+ blockType?: string | undefined;
191
+ uri?: string | undefined;
192
+ thumbUri?: string | undefined;
193
+ previewUri?: string | undefined;
194
+ filename?: string | undefined;
195
+ vectorPath?: string | undefined;
196
+ width?: number | undefined;
197
+ height?: number | undefined;
198
+ duration?: string | undefined;
199
+ } | undefined;
200
+ label?: string | undefined;
201
+ tags?: string[] | undefined;
202
+ }, {
203
+ id: string;
204
+ groups?: string[] | undefined;
205
+ meta?: {
206
+ mimeType?: string | undefined;
207
+ blockType?: string | undefined;
208
+ uri?: string | undefined;
209
+ thumbUri?: string | undefined;
210
+ previewUri?: string | undefined;
211
+ filename?: string | undefined;
212
+ vectorPath?: string | undefined;
213
+ width?: number | undefined;
214
+ height?: number | undefined;
215
+ duration?: string | undefined;
216
+ } | undefined;
217
+ label?: string | undefined;
218
+ tags?: string[] | undefined;
219
+ }>, "many">;
220
+ currentPage: z.ZodNumber;
221
+ nextPage: z.ZodOptional<z.ZodNumber>;
222
+ total: z.ZodNumber;
223
+ }, "strip", z.ZodTypeAny, {
224
+ assets: {
225
+ id: string;
226
+ groups?: string[] | undefined;
227
+ meta?: {
228
+ mimeType?: string | undefined;
229
+ blockType?: string | undefined;
230
+ uri?: string | undefined;
231
+ thumbUri?: string | undefined;
232
+ previewUri?: string | undefined;
233
+ filename?: string | undefined;
234
+ vectorPath?: string | undefined;
235
+ width?: number | undefined;
236
+ height?: number | undefined;
237
+ duration?: string | undefined;
238
+ } | undefined;
239
+ label?: string | undefined;
240
+ tags?: string[] | undefined;
241
+ }[];
242
+ currentPage: number;
243
+ total: number;
244
+ nextPage?: number | undefined;
245
+ }, {
246
+ assets: {
247
+ id: string;
248
+ groups?: string[] | undefined;
249
+ meta?: {
250
+ mimeType?: string | undefined;
251
+ blockType?: string | undefined;
252
+ uri?: string | undefined;
253
+ thumbUri?: string | undefined;
254
+ previewUri?: string | undefined;
255
+ filename?: string | undefined;
256
+ vectorPath?: string | undefined;
257
+ width?: number | undefined;
258
+ height?: number | undefined;
259
+ duration?: string | undefined;
260
+ } | undefined;
261
+ label?: string | undefined;
262
+ tags?: string[] | undefined;
263
+ }[];
264
+ currentPage: number;
265
+ total: number;
266
+ nextPage?: number | undefined;
267
+ }>;
268
+ export declare const assetIdSchema: z.ZodString;
269
+ export type AssetId = z.infer<typeof assetIdSchema>;
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ export declare const assetSourceManifestSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodObject<{
5
+ en: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ en: string;
8
+ }, {
9
+ en: string;
10
+ }>;
11
+ canGetGroups: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
12
+ credits: z.ZodOptional<z.ZodObject<{
13
+ name: z.ZodString;
14
+ url: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ name: string;
17
+ url?: string | undefined;
18
+ }, {
19
+ name: string;
20
+ url?: string | undefined;
21
+ }>>;
22
+ license: z.ZodOptional<z.ZodObject<{
23
+ name: z.ZodString;
24
+ url: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ name: string;
27
+ url?: string | undefined;
28
+ }, {
29
+ name: string;
30
+ url?: string | undefined;
31
+ }>>;
32
+ canAddAsset: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
33
+ canRemoveAsset: z.ZodDefault<z.ZodBoolean>;
34
+ supportedMimeTypes: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodUndefined]>>>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ id: string;
37
+ name: {
38
+ en: string;
39
+ };
40
+ canGetGroups: boolean;
41
+ canAddAsset: boolean;
42
+ canRemoveAsset: boolean;
43
+ supportedMimeTypes: string[];
44
+ credits?: {
45
+ name: string;
46
+ url?: string | undefined;
47
+ } | undefined;
48
+ license?: {
49
+ name: string;
50
+ url?: string | undefined;
51
+ } | undefined;
52
+ }, {
53
+ id: string;
54
+ name: {
55
+ en: string;
56
+ };
57
+ canGetGroups?: boolean | undefined;
58
+ credits?: {
59
+ name: string;
60
+ url?: string | undefined;
61
+ } | undefined;
62
+ license?: {
63
+ name: string;
64
+ url?: string | undefined;
65
+ } | undefined;
66
+ canAddAsset?: boolean | undefined;
67
+ canRemoveAsset?: boolean | undefined;
68
+ supportedMimeTypes?: string[] | undefined;
69
+ }>;
70
+ export type AssetSourceManifest = z.input<typeof assetSourceManifestSchema>;
package/dist/util.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { AssetResult, CompleteAssetResult, CreativeEngine } from '@cesdk/cesdk-js';
2
+ export declare function ensureMetadataKeys(engine: CreativeEngine, block: number, asset: AssetResult, sourceId: string): void;
3
+ export declare const isBlockFromSource: (block: number, sourceId: string, engine: CreativeEngine) => boolean;
4
+ export declare const getSourceIdFromBlock: (block: number, engine: CreativeEngine) => string | null;
5
+ export declare const getExternalIdFromBlock: (block: number, engine: CreativeEngine) => string | null;
6
+ export declare function ensureAssetDuration(engine: CreativeEngine, asset: CompleteAssetResult, block: number): Promise<void>;
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@imgly/plugin-remote-asset-source-web",
3
+ "version": "0.1.1",
4
+ "description": "Remote asset source plugin for the CE.SDK editor",
5
+ "keywords": [
6
+ "CE.SDK",
7
+ "plugin",
8
+ "assets",
9
+ "client-side",
10
+ "asset-source"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/imgly/plugins.git"
15
+ },
16
+ "license": "SEE LICENSE IN LICENSE.md",
17
+ "author": {
18
+ "name": "IMG.LY GmbH",
19
+ "email": "support@img.ly",
20
+ "url": "https://img.ly"
21
+ },
22
+ "bugs": {
23
+ "email": "support@img.ly"
24
+ },
25
+ "source": "./src/index.ts",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.mjs",
31
+ "types": "./dist/index.d.ts"
32
+ }
33
+ },
34
+ "homepage": "https://img.ly/products/creative-sdk",
35
+ "files": [
36
+ "LICENSE.md",
37
+ "README.md",
38
+ "CHANGELOG.md",
39
+ "dist/",
40
+ "bin/"
41
+ ],
42
+ "scripts": {
43
+ "start": "npm run watch",
44
+ "clean": "npx rimraf dist",
45
+ "build": "npm run clean && node scripts/build.mjs && yarn run types:create",
46
+ "dev": "npm run clean && node scripts/watch.mjs",
47
+ "dev:types": "tsc --emitDeclarationOnly --watch --preserveWatchOutput",
48
+ "publish:latest": "npm run build && npm publish --tag latest --access public",
49
+ "publish:next": "npm run build && npm publish --tag next --access public",
50
+ "check:all": "concurrently -n lint,type,pretty \"yarn check:lint\" \"yarn check:type\" \"yarn check:pretty\"",
51
+ "check:lint": "eslint --max-warnings 0 './src/**/*.{ts,tsx}'",
52
+ "check:pretty": "prettier --list-different './src/**/*.{ts,tsx}'",
53
+ "check:type": "tsc --noEmit",
54
+ "types:create": "tsc --emitDeclarationOnly"
55
+ },
56
+ "devDependencies": {
57
+ "@cesdk/cesdk-js": "~1.21.0",
58
+ "@types/ndarray": "^1.0.14",
59
+ "chalk": "^5.3.0",
60
+ "concurrently": "^8.2.2",
61
+ "esbuild": "^0.19.11",
62
+ "eslint": "^8.51.0",
63
+ "typescript": "^5.3.3"
64
+ },
65
+ "peerDependencies": {
66
+ "@cesdk/cesdk-js": "~1.21.0"
67
+ },
68
+ "dependencies": {
69
+ "lodash": "^4.17.21"
70
+ }
71
+ }