@stoker-platform/types 0.5.39 → 0.5.41
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/package.json +1 -1
- package/src/types/app.ts +2 -0
- package/src/types/schema.ts +15 -0
package/package.json
CHANGED
package/src/types/app.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
CollectionCustomCache,
|
|
4
4
|
CollectionCustomization,
|
|
5
5
|
CollectionsSchema,
|
|
6
|
+
PostFileAddErrorHook,
|
|
6
7
|
PostFileAddHook,
|
|
7
8
|
PostFileUpdateHook,
|
|
8
9
|
PostOperationHook,
|
|
@@ -256,6 +257,7 @@ export type GlobalConfig = {
|
|
|
256
257
|
preFileAdd?: PreFileAddHook
|
|
257
258
|
preFileUpdate?: PreFileUpdateHook
|
|
258
259
|
postFileAdd?: PostFileAddHook
|
|
260
|
+
postFileAddError?: PostFileAddErrorHook
|
|
259
261
|
postFileUpdate?: PostFileUpdateHook
|
|
260
262
|
admin?: AdminConfig
|
|
261
263
|
}
|
package/src/types/schema.ts
CHANGED
|
@@ -342,6 +342,10 @@ export type PostFileUpdateHookArgs = {
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
export type PostFileAddErrorHookArgs = PostFileAddHookArgs & {
|
|
346
|
+
error: unknown
|
|
347
|
+
}
|
|
348
|
+
|
|
345
349
|
export type SetEmbeddingHookArgs = { record: StokerRecord }
|
|
346
350
|
|
|
347
351
|
export type HookArgs =
|
|
@@ -357,6 +361,7 @@ export type HookArgs =
|
|
|
357
361
|
| PreFileAddHookArgs
|
|
358
362
|
| PreFileUpdateHookArgs
|
|
359
363
|
| PostFileAddHookArgs
|
|
364
|
+
| PostFileAddErrorHookArgs
|
|
360
365
|
| PostFileUpdateHookArgs
|
|
361
366
|
| SetEmbeddingHookArgs
|
|
362
367
|
|
|
@@ -376,6 +381,7 @@ export type PreFileAddHook = (args: PreFileAddHookArgs) => boolean | void | Prom
|
|
|
376
381
|
export type PreFileUpdateHook = (args: PreFileUpdateHookArgs) => boolean | void | Promise<boolean | void>
|
|
377
382
|
export type PostFileAddHook = (args: PostFileAddHookArgs) => boolean | void | Promise<boolean | void>
|
|
378
383
|
export type PostFileUpdateHook = (args: PostFileUpdateHookArgs) => boolean | void | Promise<boolean | void>
|
|
384
|
+
export type PostFileAddErrorHook = (args: PostFileAddErrorHookArgs) => void | Promise<void>
|
|
379
385
|
|
|
380
386
|
export type SetEmbeddingHook = (args: SetEmbeddingHookArgs) => string | Promise<string>
|
|
381
387
|
|
|
@@ -392,6 +398,7 @@ export type Hook =
|
|
|
392
398
|
| PreFileAddHook
|
|
393
399
|
| PreFileUpdateHook
|
|
394
400
|
| PostFileAddHook
|
|
401
|
+
| PostFileAddErrorHook
|
|
395
402
|
| PostFileUpdateHook
|
|
396
403
|
| SetEmbeddingHook
|
|
397
404
|
|
|
@@ -408,6 +415,7 @@ export type Hooks = {
|
|
|
408
415
|
preFileAdd?: PreFileAddHook
|
|
409
416
|
preFileUpdate?: PreFileUpdateHook
|
|
410
417
|
postFileAdd?: PostFileAddHook
|
|
418
|
+
postFileAddError?: PostFileAddErrorHook
|
|
411
419
|
postFileUpdate?: PostFileUpdateHook
|
|
412
420
|
setEmbedding?: SetEmbeddingHook
|
|
413
421
|
}
|
|
@@ -697,6 +705,11 @@ export interface CustomListAction {
|
|
|
697
705
|
condition?: () => boolean
|
|
698
706
|
}
|
|
699
707
|
|
|
708
|
+
export interface FileOptions {
|
|
709
|
+
maxImageWidth?: number
|
|
710
|
+
thumbnails?: boolean
|
|
711
|
+
}
|
|
712
|
+
|
|
700
713
|
export interface CollectionAdmin {
|
|
701
714
|
hidden?: boolean | (() => boolean | Promise<boolean>)
|
|
702
715
|
navbarPosition?: number | (() => number)
|
|
@@ -786,6 +799,7 @@ export interface CollectionAdmin {
|
|
|
786
799
|
retriever?: () => any | Promise<any>
|
|
787
800
|
assignable?: Assignable[] | (() => Assignable[] | Promise<Assignable[]>)
|
|
788
801
|
customListActions?: CustomListAction[] | (() => CustomListAction[] | Promise<CustomListAction[]>)
|
|
802
|
+
fileOptions?: FileOptions | (() => FileOptions | Promise<FileOptions>)
|
|
789
803
|
}
|
|
790
804
|
export interface CollectionAdminCache {
|
|
791
805
|
hidden?: boolean
|
|
@@ -834,6 +848,7 @@ export interface CollectionAdminCache {
|
|
|
834
848
|
disableRangeSelector?: boolean
|
|
835
849
|
assignable?: Assignable[]
|
|
836
850
|
customListActions?: CustomListAction[]
|
|
851
|
+
fileOptions?: FileOptions
|
|
837
852
|
}
|
|
838
853
|
|
|
839
854
|
export interface FieldCustom extends Hooks {
|