@stoker-platform/types 0.5.38 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/types",
3
- "version": "0.5.38",
3
+ "version": "0.5.40",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "src/main.ts",
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
  }
@@ -1,4 +1,4 @@
1
- import { FieldValue } from "firebase-admin/firestore"
1
+ import { Timestamp as AdminTimestamp, FieldValue } from "firebase-admin/firestore"
2
2
  import { Timestamp, WhereFilterOp, WriteBatch } from "firebase/firestore"
3
3
  import { NodeUtilities, WebUtilities } from "./app"
4
4
  import { CalendarOptions } from "@fullcalendar/core"
@@ -7,7 +7,8 @@ import { SearchResult } from "minisearch"
7
7
  export type StokerRole = string
8
8
  export type StokerCollection = string
9
9
 
10
- export type FirebaseTimestamp = Timestamp | FieldValue
10
+ export type FirestoreTimestamp = Timestamp | AdminTimestamp
11
+ export type InputTimestamp = Timestamp | FieldValue
11
12
 
12
13
  /* eslint-disable @typescript-eslint/no-explicit-any */
13
14
 
@@ -341,6 +342,10 @@ export type PostFileUpdateHookArgs = {
341
342
  }
342
343
  }
343
344
 
345
+ export type PostFileAddErrorHookArgs = PostFileAddHookArgs & {
346
+ error: unknown
347
+ }
348
+
344
349
  export type SetEmbeddingHookArgs = { record: StokerRecord }
345
350
 
346
351
  export type HookArgs =
@@ -356,6 +361,7 @@ export type HookArgs =
356
361
  | PreFileAddHookArgs
357
362
  | PreFileUpdateHookArgs
358
363
  | PostFileAddHookArgs
364
+ | PostFileAddErrorHookArgs
359
365
  | PostFileUpdateHookArgs
360
366
  | SetEmbeddingHookArgs
361
367
 
@@ -375,6 +381,7 @@ export type PreFileAddHook = (args: PreFileAddHookArgs) => boolean | void | Prom
375
381
  export type PreFileUpdateHook = (args: PreFileUpdateHookArgs) => boolean | void | Promise<boolean | void>
376
382
  export type PostFileAddHook = (args: PostFileAddHookArgs) => boolean | void | Promise<boolean | void>
377
383
  export type PostFileUpdateHook = (args: PostFileUpdateHookArgs) => boolean | void | Promise<boolean | void>
384
+ export type PostFileAddErrorHook = (args: PostFileAddErrorHookArgs) => void | Promise<void>
378
385
 
379
386
  export type SetEmbeddingHook = (args: SetEmbeddingHookArgs) => string | Promise<string>
380
387
 
@@ -391,6 +398,7 @@ export type Hook =
391
398
  | PreFileAddHook
392
399
  | PreFileUpdateHook
393
400
  | PostFileAddHook
401
+ | PostFileAddErrorHook
394
402
  | PostFileUpdateHook
395
403
  | SetEmbeddingHook
396
404
 
@@ -407,6 +415,7 @@ export type Hooks = {
407
415
  preFileAdd?: PreFileAddHook
408
416
  preFileUpdate?: PreFileUpdateHook
409
417
  postFileAdd?: PostFileAddHook
418
+ postFileAddError?: PostFileAddErrorHook
410
419
  postFileUpdate?: PostFileUpdateHook
411
420
  setEmbedding?: SetEmbeddingHook
412
421
  }
@@ -696,6 +705,10 @@ export interface CustomListAction {
696
705
  condition?: () => boolean
697
706
  }
698
707
 
708
+ export interface FileOptions {
709
+ maxImageWidth?: number
710
+ }
711
+
699
712
  export interface CollectionAdmin {
700
713
  hidden?: boolean | (() => boolean | Promise<boolean>)
701
714
  navbarPosition?: number | (() => number)
@@ -785,6 +798,7 @@ export interface CollectionAdmin {
785
798
  retriever?: () => any | Promise<any>
786
799
  assignable?: Assignable[] | (() => Assignable[] | Promise<Assignable[]>)
787
800
  customListActions?: CustomListAction[] | (() => CustomListAction[] | Promise<CustomListAction[]>)
801
+ fileOptions?: FileOptions | (() => FileOptions | Promise<FileOptions>)
788
802
  }
789
803
  export interface CollectionAdminCache {
790
804
  hidden?: boolean
@@ -833,6 +847,7 @@ export interface CollectionAdminCache {
833
847
  disableRangeSelector?: boolean
834
848
  assignable?: Assignable[]
835
849
  customListActions?: CustomListAction[]
850
+ fileOptions?: FileOptions
836
851
  }
837
852
 
838
853
  export interface FieldCustom extends Hooks {