@stoker-platform/types 0.5.39 → 0.5.40
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 +14 -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,10 @@ export interface CustomListAction {
|
|
|
697
705
|
condition?: () => boolean
|
|
698
706
|
}
|
|
699
707
|
|
|
708
|
+
export interface FileOptions {
|
|
709
|
+
maxImageWidth?: number
|
|
710
|
+
}
|
|
711
|
+
|
|
700
712
|
export interface CollectionAdmin {
|
|
701
713
|
hidden?: boolean | (() => boolean | Promise<boolean>)
|
|
702
714
|
navbarPosition?: number | (() => number)
|
|
@@ -786,6 +798,7 @@ export interface CollectionAdmin {
|
|
|
786
798
|
retriever?: () => any | Promise<any>
|
|
787
799
|
assignable?: Assignable[] | (() => Assignable[] | Promise<Assignable[]>)
|
|
788
800
|
customListActions?: CustomListAction[] | (() => CustomListAction[] | Promise<CustomListAction[]>)
|
|
801
|
+
fileOptions?: FileOptions | (() => FileOptions | Promise<FileOptions>)
|
|
789
802
|
}
|
|
790
803
|
export interface CollectionAdminCache {
|
|
791
804
|
hidden?: boolean
|
|
@@ -834,6 +847,7 @@ export interface CollectionAdminCache {
|
|
|
834
847
|
disableRangeSelector?: boolean
|
|
835
848
|
assignable?: Assignable[]
|
|
836
849
|
customListActions?: CustomListAction[]
|
|
850
|
+
fileOptions?: FileOptions
|
|
837
851
|
}
|
|
838
852
|
|
|
839
853
|
export interface FieldCustom extends Hooks {
|