sandcms 0.5.3 → 0.6.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.
Files changed (147) hide show
  1. package/README.md +5 -3
  2. package/dist/admin/Account.svelte +4 -1
  3. package/dist/admin/ApiKeys.svelte +159 -0
  4. package/dist/admin/ApiKeys.svelte.d.ts +3 -0
  5. package/dist/admin/AssetAttachment.svelte +6 -4
  6. package/dist/admin/BlueprintFields.svelte +86 -0
  7. package/dist/admin/BlueprintFields.svelte.d.ts +15 -0
  8. package/dist/admin/Collection.svelte +40 -7
  9. package/dist/admin/Editor.svelte +57 -17
  10. package/dist/admin/Fields.svelte +217 -144
  11. package/dist/admin/Fields.svelte.d.ts +1 -0
  12. package/dist/admin/FocusPicker.svelte +136 -0
  13. package/dist/admin/FocusPicker.svelte.d.ts +11 -0
  14. package/dist/admin/Gallery.svelte +40 -34
  15. package/dist/admin/GlobalSearch.svelte +56 -0
  16. package/dist/admin/GlobalSearch.svelte.d.ts +3 -0
  17. package/dist/admin/Inbox.svelte +8 -5
  18. package/dist/admin/LinkField.svelte +116 -0
  19. package/dist/admin/LinkField.svelte.d.ts +17 -0
  20. package/dist/admin/MediaLibrary.svelte +41 -14
  21. package/dist/admin/MediaPicker.svelte +12 -2
  22. package/dist/admin/NotificationSettings.svelte +2 -2
  23. package/dist/admin/SearchList.svelte +55 -0
  24. package/dist/admin/SearchList.svelte.d.ts +42 -0
  25. package/dist/admin/SelectField.svelte +3 -1
  26. package/dist/admin/SelectField.svelte.d.ts +1 -0
  27. package/dist/admin/Shell.svelte +4 -2
  28. package/dist/admin/UnsavedChanges.svelte +1 -1
  29. package/dist/admin/Users.svelte +11 -5
  30. package/dist/admin/client.js +2 -1
  31. package/dist/admin/generated/admin.css +109 -0
  32. package/dist/admin/types.d.ts +5 -1
  33. package/dist/admin/uploads.js +27 -6
  34. package/dist/blueprints/conditions.d.ts +2 -0
  35. package/dist/blueprints/conditions.js +4 -0
  36. package/dist/blueprints/extends.d.ts +5 -0
  37. package/dist/blueprints/extends.js +76 -0
  38. package/dist/blueprints/files.d.ts +3 -1
  39. package/dist/blueprints/files.js +35 -2
  40. package/dist/blueprints/layout.d.ts +4 -0
  41. package/dist/blueprints/layout.js +12 -0
  42. package/dist/blueprints/load.d.ts +1 -1
  43. package/dist/blueprints/load.js +123 -12
  44. package/dist/blueprints/types.d.ts +35 -1
  45. package/dist/blueprints/validate.js +30 -6
  46. package/dist/cli/cloudflare.js +17 -5
  47. package/dist/cli/doctor.js +6 -3
  48. package/dist/cli/files.js +1 -1
  49. package/dist/cli/scaffold.js +8 -6
  50. package/dist/cli/setup.js +9 -2
  51. package/dist/cli/upgrade.js +2 -1
  52. package/dist/email-failure.d.ts +17 -0
  53. package/dist/email-failure.js +22 -0
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.js +1 -0
  56. package/dist/link.d.ts +17 -0
  57. package/dist/link.js +44 -0
  58. package/dist/notification-fields.js +1 -1
  59. package/dist/search.d.ts +8 -0
  60. package/dist/search.js +1 -0
  61. package/dist/server/access.d.ts +2 -0
  62. package/dist/server/access.js +59 -23
  63. package/dist/server/admin-load.d.ts +11 -2
  64. package/dist/server/admin-load.js +4 -2
  65. package/dist/server/api-access.d.ts +31 -0
  66. package/dist/server/api-access.js +52 -0
  67. package/dist/server/api-pagination.d.ts +34 -0
  68. package/dist/server/api-pagination.js +87 -0
  69. package/dist/server/api.js +224 -32
  70. package/dist/server/auth.d.ts +1150 -0
  71. package/dist/server/auth.js +11 -1
  72. package/dist/server/cms.d.ts +1210 -4
  73. package/dist/server/cms.js +12 -0
  74. package/dist/server/content.d.ts +17 -2
  75. package/dist/server/content.js +89 -14
  76. package/dist/server/db/auto-migrate.d.ts +12 -0
  77. package/dist/server/db/auto-migrate.js +23 -0
  78. package/dist/server/db/migration-data.js +24 -0
  79. package/dist/server/db/migrations/0001_independent_password_resets.sql +3 -0
  80. package/dist/server/db/migrations/0002_email_failure_reason.sql +1 -0
  81. package/dist/server/db/migrations/0003_direct_r2_uploads.sql +10 -0
  82. package/dist/server/db/migrations/0004_agent_api_keys.sql +38 -0
  83. package/dist/server/db/migrations/0005_api_retention_and_pagination.sql +3 -0
  84. package/dist/server/db/migrations/0006_durable_media_deletion.sql +7 -0
  85. package/dist/server/db/migrations/meta/0001_snapshot.json +1197 -0
  86. package/dist/server/db/migrations/meta/0002_snapshot.json +1204 -0
  87. package/dist/server/db/migrations/meta/0003_snapshot.json +1281 -0
  88. package/dist/server/db/migrations/meta/0004_snapshot.json +1546 -0
  89. package/dist/server/db/migrations/meta/0005_snapshot.json +1572 -0
  90. package/dist/server/db/migrations/meta/0006_snapshot.json +1627 -0
  91. package/dist/server/db/migrations/meta/_journal.json +42 -0
  92. package/dist/server/db/schema.d.ts +742 -2
  93. package/dist/server/db/schema.js +77 -5
  94. package/dist/server/db/store.js +24 -9
  95. package/dist/server/email/index.d.ts +11 -1
  96. package/dist/server/email/index.js +69 -6
  97. package/dist/server/forms.js +12 -2
  98. package/dist/server/hooks.d.ts +1 -1
  99. package/dist/server/hooks.js +37 -14
  100. package/dist/server/index.d.ts +2 -1
  101. package/dist/server/index.js +2 -1
  102. package/dist/server/links.d.ts +5 -0
  103. package/dist/server/links.js +44 -0
  104. package/dist/server/media/deletions.d.ts +2 -0
  105. package/dist/server/media/deletions.js +58 -0
  106. package/dist/server/media/presets.d.ts +10 -2
  107. package/dist/server/media/presets.js +14 -2
  108. package/dist/server/media/runner.d.ts +1 -1
  109. package/dist/server/media/runner.js +105 -8
  110. package/dist/server/media/service.d.ts +41 -3
  111. package/dist/server/media/service.js +146 -33
  112. package/dist/server/notifications.d.ts +1 -0
  113. package/dist/server/notifications.js +4 -2
  114. package/dist/server/request.d.ts +2 -0
  115. package/dist/server/request.js +5 -0
  116. package/dist/server/search.d.ts +13 -0
  117. package/dist/server/search.js +97 -0
  118. package/dist/worker/index.d.ts +4 -4
  119. package/dist/worker/index.js +208 -67
  120. package/dist/worker/local.d.ts +5 -0
  121. package/dist/worker/local.js +57 -0
  122. package/dist/worker/source.d.ts +1 -1
  123. package/dist/worker/source.js +2 -2
  124. package/dist/worker/uploads.d.ts +22 -0
  125. package/dist/worker/uploads.js +48 -0
  126. package/docs/api.md +73 -0
  127. package/docs/cloudflare.md +37 -10
  128. package/docs/content.md +162 -4
  129. package/docs/deployment.md +33 -4
  130. package/docs/email.md +11 -7
  131. package/docs/forms.md +3 -1
  132. package/docs/media.md +33 -4
  133. package/docs/package.md +6 -4
  134. package/docs/releases.md +54 -1
  135. package/docs/upgrades.md +91 -3
  136. package/package.json +19 -10
  137. package/templates/hooks.server.ts +2 -2
  138. package/templates/integration.ts +3 -2
  139. package/templates/routes/admin/+page.server.ts +1 -1
  140. package/templates/routes/api/+server.ts +1 -1
  141. package/templates/sandcms/blueprints/collections/projects.yaml +16 -8
  142. package/templates/sandcms/blueprints/fields/seo.yaml +5 -0
  143. package/templates/sandcms/blueprints/files/image.yaml +1 -0
  144. package/templates/sandcms/blueprints/pages/home.yaml +1 -0
  145. package/templates/sandcms/config.yaml +1 -0
  146. package/templates/sandcms/worker/local.ts +1 -0
  147. package/templates/sandcms/worker/wrangler.jsonc +1 -2
@@ -12,6 +12,8 @@ export interface CmsOptions {
12
12
  workerUrl?: string;
13
13
  trustedProxyHeader?: string;
14
14
  migrate?: boolean;
15
+ /** Back up an existing database, then apply pending migrations on startup. */
16
+ autoMigrate?: boolean;
15
17
  email?: EmailOptions;
16
18
  seo?: SeoOptions;
17
19
  }
@@ -737,6 +739,1156 @@ export declare function createCMS(options: CmsOptions): {
737
739
  ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
738
740
  INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
739
741
  };
742
+ }, {
743
+ id: "api-key";
744
+ version: string;
745
+ $ERROR_CODES: {
746
+ INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
747
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
748
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
749
+ USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
750
+ UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
751
+ KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
752
+ KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
753
+ KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
754
+ USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
755
+ KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
756
+ EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
757
+ EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
758
+ INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
759
+ INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
760
+ INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
761
+ METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
762
+ RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
763
+ NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
764
+ KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
765
+ INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
766
+ INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
767
+ INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
768
+ INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
769
+ SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
770
+ FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
771
+ NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
772
+ ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
773
+ USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
774
+ INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
775
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
776
+ ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
777
+ };
778
+ hooks: {
779
+ before: {
780
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
781
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
782
+ user: {
783
+ id: string;
784
+ createdAt: Date;
785
+ updatedAt: Date;
786
+ email: string;
787
+ emailVerified: boolean;
788
+ name: string;
789
+ image?: string | null | undefined;
790
+ };
791
+ session: {
792
+ id: string;
793
+ token: string;
794
+ userId: string;
795
+ userAgent: string | null;
796
+ ipAddress: string | null;
797
+ createdAt: Date;
798
+ updatedAt: Date;
799
+ expiresAt: Date;
800
+ };
801
+ } | {
802
+ context: import("better-auth").MiddlewareContext<import("better-auth").MiddlewareOptions, import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
803
+ options: import("better-auth").BetterAuthOptions;
804
+ trustedOrigins: string[];
805
+ trustedProviders: string[];
806
+ isTrustedOrigin: (url: string, settings?: {
807
+ allowRelativePaths: boolean;
808
+ }) => boolean;
809
+ oauthConfig: {
810
+ skipStateCookieCheck?: boolean | undefined;
811
+ storeStateStrategy: "database" | "cookie";
812
+ };
813
+ newSession: {
814
+ session: {
815
+ id: string;
816
+ createdAt: Date;
817
+ updatedAt: Date;
818
+ userId: string;
819
+ expiresAt: Date;
820
+ token: string;
821
+ ipAddress?: string | null | undefined;
822
+ userAgent?: string | null | undefined;
823
+ } & Record<string, any>;
824
+ user: {
825
+ id: string;
826
+ createdAt: Date;
827
+ updatedAt: Date;
828
+ email: string;
829
+ emailVerified: boolean;
830
+ name: string;
831
+ image?: string | null | undefined;
832
+ } & Record<string, any>;
833
+ } | null;
834
+ session: {
835
+ session: {
836
+ id: string;
837
+ createdAt: Date;
838
+ updatedAt: Date;
839
+ userId: string;
840
+ expiresAt: Date;
841
+ token: string;
842
+ ipAddress?: string | null | undefined;
843
+ userAgent?: string | null | undefined;
844
+ } & Record<string, any>;
845
+ user: {
846
+ id: string;
847
+ createdAt: Date;
848
+ updatedAt: Date;
849
+ email: string;
850
+ emailVerified: boolean;
851
+ name: string;
852
+ image?: string | null | undefined;
853
+ } & Record<string, any>;
854
+ } | null;
855
+ setNewSession: (session: {
856
+ session: {
857
+ id: string;
858
+ createdAt: Date;
859
+ updatedAt: Date;
860
+ userId: string;
861
+ expiresAt: Date;
862
+ token: string;
863
+ ipAddress?: string | null | undefined;
864
+ userAgent?: string | null | undefined;
865
+ } & Record<string, any>;
866
+ user: {
867
+ id: string;
868
+ createdAt: Date;
869
+ updatedAt: Date;
870
+ email: string;
871
+ emailVerified: boolean;
872
+ name: string;
873
+ image?: string | null | undefined;
874
+ } & Record<string, any>;
875
+ } | null) => void;
876
+ socialProviders: import("better-auth").OAuthProvider[];
877
+ authCookies: import("better-auth").BetterAuthCookies;
878
+ logger: ReturnType<(options?: import("better-auth").Logger | undefined) => import("better-auth").InternalLogger>;
879
+ rateLimit: {
880
+ enabled: boolean;
881
+ window: number;
882
+ max: number;
883
+ storage: "memory" | "database" | "secondary-storage";
884
+ } & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
885
+ adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
886
+ checkSchema?: import("@better-auth/core/db/internal").SchemaCheck | undefined;
887
+ explicitSchemaCheck?: import("@better-auth/core/db/internal").SchemaCheck | undefined;
888
+ internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
889
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-auth").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
890
+ secret: string;
891
+ secretConfig: string | import("better-auth").SecretConfig;
892
+ sessionConfig: {
893
+ updateAge: number;
894
+ expiresIn: number;
895
+ freshAge: number;
896
+ cookieCacheSigner?: import("better-auth").CookieCacheSigner | undefined;
897
+ cookieRefreshCache: false | {
898
+ enabled: true;
899
+ updateAge: number;
900
+ };
901
+ };
902
+ generateId: (options: {
903
+ model: import("better-auth").ModelNames;
904
+ size?: number | undefined;
905
+ }) => string | false;
906
+ secondaryStorage: import("better-auth").SecondaryStorage | undefined;
907
+ password: {
908
+ hash: (password: string) => Promise<string>;
909
+ verify: (data: {
910
+ password: string;
911
+ hash: string;
912
+ }) => Promise<boolean>;
913
+ config: {
914
+ minPasswordLength: number;
915
+ maxPasswordLength: number;
916
+ };
917
+ checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
918
+ };
919
+ tables: import("better-auth").BetterAuthDBSchema;
920
+ runMigrations: () => Promise<void>;
921
+ publishTelemetry: (event: {
922
+ type: string;
923
+ anonymousId?: string | undefined;
924
+ payload: Record<string, any>;
925
+ }) => Promise<void>;
926
+ skipOriginCheck: boolean | string[];
927
+ skipCSRFCheck: boolean;
928
+ runInBackground: (promise: Promise<unknown>) => void;
929
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
930
+ } & {
931
+ returned?: unknown | undefined;
932
+ responseHeaders?: Headers | undefined;
933
+ }>;
934
+ }>>;
935
+ }[];
936
+ };
937
+ endpoints: {
938
+ createApiKey: import("better-auth").StrictEndpoint<"/api-key/create", {
939
+ method: "POST";
940
+ body: import("zod").ZodObject<{
941
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
942
+ name: import("zod").ZodOptional<import("zod").ZodString>;
943
+ expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
944
+ prefix: import("zod").ZodOptional<import("zod").ZodString>;
945
+ remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
946
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
947
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
948
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
949
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
950
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
951
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
952
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
953
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
954
+ organizationId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
955
+ }, import("zod/v4/core").$strip>;
956
+ metadata: {
957
+ openapi: {
958
+ description: string;
959
+ responses: {
960
+ "200": {
961
+ description: string;
962
+ content: {
963
+ "application/json": {
964
+ schema: {
965
+ type: "object";
966
+ properties: {
967
+ id: {
968
+ type: string;
969
+ description: string;
970
+ };
971
+ createdAt: {
972
+ type: string;
973
+ format: string;
974
+ description: string;
975
+ };
976
+ updatedAt: {
977
+ type: string;
978
+ format: string;
979
+ description: string;
980
+ };
981
+ name: {
982
+ type: string;
983
+ nullable: boolean;
984
+ description: string;
985
+ };
986
+ prefix: {
987
+ type: string;
988
+ nullable: boolean;
989
+ description: string;
990
+ };
991
+ start: {
992
+ type: string;
993
+ nullable: boolean;
994
+ description: string;
995
+ };
996
+ key: {
997
+ type: string;
998
+ description: string;
999
+ };
1000
+ enabled: {
1001
+ type: string;
1002
+ description: string;
1003
+ };
1004
+ expiresAt: {
1005
+ type: string;
1006
+ format: string;
1007
+ nullable: boolean;
1008
+ description: string;
1009
+ };
1010
+ referenceId: {
1011
+ type: string;
1012
+ description: string;
1013
+ };
1014
+ lastRefillAt: {
1015
+ type: string;
1016
+ format: string;
1017
+ nullable: boolean;
1018
+ description: string;
1019
+ };
1020
+ lastRequest: {
1021
+ type: string;
1022
+ format: string;
1023
+ nullable: boolean;
1024
+ description: string;
1025
+ };
1026
+ metadata: {
1027
+ type: string;
1028
+ nullable: boolean;
1029
+ additionalProperties: boolean;
1030
+ description: string;
1031
+ };
1032
+ rateLimitMax: {
1033
+ type: string;
1034
+ nullable: boolean;
1035
+ description: string;
1036
+ };
1037
+ rateLimitTimeWindow: {
1038
+ type: string;
1039
+ nullable: boolean;
1040
+ description: string;
1041
+ };
1042
+ remaining: {
1043
+ type: string;
1044
+ nullable: boolean;
1045
+ description: string;
1046
+ };
1047
+ refillAmount: {
1048
+ type: string;
1049
+ nullable: boolean;
1050
+ description: string;
1051
+ };
1052
+ refillInterval: {
1053
+ type: string;
1054
+ nullable: boolean;
1055
+ description: string;
1056
+ };
1057
+ rateLimitEnabled: {
1058
+ type: string;
1059
+ description: string;
1060
+ };
1061
+ requestCount: {
1062
+ type: string;
1063
+ description: string;
1064
+ };
1065
+ permissions: {
1066
+ type: string;
1067
+ nullable: boolean;
1068
+ additionalProperties: {
1069
+ type: string;
1070
+ items: {
1071
+ type: string;
1072
+ };
1073
+ };
1074
+ description: string;
1075
+ };
1076
+ };
1077
+ required: string[];
1078
+ };
1079
+ };
1080
+ };
1081
+ };
1082
+ };
1083
+ };
1084
+ };
1085
+ }, {
1086
+ key: string;
1087
+ metadata: any;
1088
+ permissions: any;
1089
+ id: string;
1090
+ configId: string;
1091
+ name: string | null;
1092
+ start: string | null;
1093
+ prefix: string | null;
1094
+ referenceId: string;
1095
+ refillInterval: number | null;
1096
+ refillAmount: number | null;
1097
+ lastRefillAt: Date | null;
1098
+ enabled: boolean;
1099
+ rateLimitEnabled: boolean;
1100
+ rateLimitTimeWindow: number | null;
1101
+ rateLimitMax: number | null;
1102
+ requestCount: number;
1103
+ remaining: number | null;
1104
+ lastRequest: Date | null;
1105
+ expiresAt: Date | null;
1106
+ createdAt: Date;
1107
+ updatedAt: Date;
1108
+ }>;
1109
+ verifyApiKey: import("better-auth").StrictEndpoint<string, {
1110
+ method: "POST";
1111
+ body: import("zod").ZodObject<{
1112
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
1113
+ key: import("zod").ZodString;
1114
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
1115
+ }, import("zod/v4/core").$strip>;
1116
+ }, {
1117
+ valid: boolean;
1118
+ error: {
1119
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
1120
+ code: "KEY_NOT_FOUND";
1121
+ };
1122
+ key: null;
1123
+ } | {
1124
+ valid: boolean;
1125
+ error: {
1126
+ message: string | undefined;
1127
+ code: string;
1128
+ cause?: unknown;
1129
+ };
1130
+ key: null;
1131
+ } | {
1132
+ valid: boolean;
1133
+ error: {
1134
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
1135
+ code: "INVALID_API_KEY";
1136
+ };
1137
+ key: null;
1138
+ } | {
1139
+ valid: boolean;
1140
+ error: null;
1141
+ key: Omit<import("@better-auth/api-key").ApiKey, "key"> | null;
1142
+ }>;
1143
+ getApiKey: import("better-auth").StrictEndpoint<"/api-key/get", {
1144
+ method: "GET";
1145
+ query: import("zod").ZodObject<{
1146
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
1147
+ id: import("zod").ZodString;
1148
+ }, import("zod/v4/core").$strip>;
1149
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1150
+ session: {
1151
+ session: Record<string, any> & {
1152
+ id: string;
1153
+ createdAt: Date;
1154
+ updatedAt: Date;
1155
+ userId: string;
1156
+ expiresAt: Date;
1157
+ token: string;
1158
+ ipAddress?: string | null | undefined;
1159
+ userAgent?: string | null | undefined;
1160
+ };
1161
+ user: Record<string, any> & {
1162
+ id: string;
1163
+ createdAt: Date;
1164
+ updatedAt: Date;
1165
+ email: string;
1166
+ emailVerified: boolean;
1167
+ name: string;
1168
+ image?: string | null | undefined;
1169
+ };
1170
+ };
1171
+ }>>[];
1172
+ metadata: {
1173
+ openapi: {
1174
+ description: string;
1175
+ responses: {
1176
+ "200": {
1177
+ description: string;
1178
+ content: {
1179
+ "application/json": {
1180
+ schema: {
1181
+ type: "object";
1182
+ properties: {
1183
+ id: {
1184
+ type: string;
1185
+ description: string;
1186
+ };
1187
+ name: {
1188
+ type: string;
1189
+ nullable: boolean;
1190
+ description: string;
1191
+ };
1192
+ start: {
1193
+ type: string;
1194
+ nullable: boolean;
1195
+ description: string;
1196
+ };
1197
+ prefix: {
1198
+ type: string;
1199
+ nullable: boolean;
1200
+ description: string;
1201
+ };
1202
+ userId: {
1203
+ type: string;
1204
+ description: string;
1205
+ };
1206
+ refillInterval: {
1207
+ type: string;
1208
+ nullable: boolean;
1209
+ description: string;
1210
+ };
1211
+ refillAmount: {
1212
+ type: string;
1213
+ nullable: boolean;
1214
+ description: string;
1215
+ };
1216
+ lastRefillAt: {
1217
+ type: string;
1218
+ format: string;
1219
+ nullable: boolean;
1220
+ description: string;
1221
+ };
1222
+ enabled: {
1223
+ type: string;
1224
+ description: string;
1225
+ default: boolean;
1226
+ };
1227
+ rateLimitEnabled: {
1228
+ type: string;
1229
+ description: string;
1230
+ };
1231
+ rateLimitTimeWindow: {
1232
+ type: string;
1233
+ nullable: boolean;
1234
+ description: string;
1235
+ };
1236
+ rateLimitMax: {
1237
+ type: string;
1238
+ nullable: boolean;
1239
+ description: string;
1240
+ };
1241
+ requestCount: {
1242
+ type: string;
1243
+ description: string;
1244
+ };
1245
+ remaining: {
1246
+ type: string;
1247
+ nullable: boolean;
1248
+ description: string;
1249
+ };
1250
+ lastRequest: {
1251
+ type: string;
1252
+ format: string;
1253
+ nullable: boolean;
1254
+ description: string;
1255
+ };
1256
+ expiresAt: {
1257
+ type: string;
1258
+ format: string;
1259
+ nullable: boolean;
1260
+ description: string;
1261
+ };
1262
+ createdAt: {
1263
+ type: string;
1264
+ format: string;
1265
+ description: string;
1266
+ };
1267
+ updatedAt: {
1268
+ type: string;
1269
+ format: string;
1270
+ description: string;
1271
+ };
1272
+ metadata: {
1273
+ type: string;
1274
+ nullable: boolean;
1275
+ additionalProperties: boolean;
1276
+ description: string;
1277
+ };
1278
+ permissions: {
1279
+ type: string;
1280
+ nullable: boolean;
1281
+ description: string;
1282
+ };
1283
+ };
1284
+ required: string[];
1285
+ };
1286
+ };
1287
+ };
1288
+ };
1289
+ };
1290
+ };
1291
+ };
1292
+ }, {
1293
+ metadata: Record<string, any> | null;
1294
+ permissions: {
1295
+ [key: string]: string[];
1296
+ } | null;
1297
+ id: string;
1298
+ configId: string;
1299
+ name: string | null;
1300
+ start: string | null;
1301
+ prefix: string | null;
1302
+ referenceId: string;
1303
+ refillInterval: number | null;
1304
+ refillAmount: number | null;
1305
+ lastRefillAt: Date | null;
1306
+ enabled: boolean;
1307
+ rateLimitEnabled: boolean;
1308
+ rateLimitTimeWindow: number | null;
1309
+ rateLimitMax: number | null;
1310
+ requestCount: number;
1311
+ remaining: number | null;
1312
+ lastRequest: Date | null;
1313
+ expiresAt: Date | null;
1314
+ createdAt: Date;
1315
+ updatedAt: Date;
1316
+ }>;
1317
+ updateApiKey: import("better-auth").StrictEndpoint<"/api-key/update", {
1318
+ method: "POST";
1319
+ body: import("zod").ZodObject<{
1320
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
1321
+ keyId: import("zod").ZodString;
1322
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
1323
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1324
+ enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
1325
+ remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
1326
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
1327
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
1328
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
1329
+ expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
1330
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
1331
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
1332
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
1333
+ permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
1334
+ }, import("zod/v4/core").$strip>;
1335
+ metadata: {
1336
+ openapi: {
1337
+ description: string;
1338
+ responses: {
1339
+ "200": {
1340
+ description: string;
1341
+ content: {
1342
+ "application/json": {
1343
+ schema: {
1344
+ type: "object";
1345
+ properties: {
1346
+ id: {
1347
+ type: string;
1348
+ description: string;
1349
+ };
1350
+ name: {
1351
+ type: string;
1352
+ nullable: boolean;
1353
+ description: string;
1354
+ };
1355
+ start: {
1356
+ type: string;
1357
+ nullable: boolean;
1358
+ description: string;
1359
+ };
1360
+ prefix: {
1361
+ type: string;
1362
+ nullable: boolean;
1363
+ description: string;
1364
+ };
1365
+ userId: {
1366
+ type: string;
1367
+ description: string;
1368
+ };
1369
+ refillInterval: {
1370
+ type: string;
1371
+ nullable: boolean;
1372
+ description: string;
1373
+ };
1374
+ refillAmount: {
1375
+ type: string;
1376
+ nullable: boolean;
1377
+ description: string;
1378
+ };
1379
+ lastRefillAt: {
1380
+ type: string;
1381
+ format: string;
1382
+ nullable: boolean;
1383
+ description: string;
1384
+ };
1385
+ enabled: {
1386
+ type: string;
1387
+ description: string;
1388
+ default: boolean;
1389
+ };
1390
+ rateLimitEnabled: {
1391
+ type: string;
1392
+ description: string;
1393
+ };
1394
+ rateLimitTimeWindow: {
1395
+ type: string;
1396
+ nullable: boolean;
1397
+ description: string;
1398
+ };
1399
+ rateLimitMax: {
1400
+ type: string;
1401
+ nullable: boolean;
1402
+ description: string;
1403
+ };
1404
+ requestCount: {
1405
+ type: string;
1406
+ description: string;
1407
+ };
1408
+ remaining: {
1409
+ type: string;
1410
+ nullable: boolean;
1411
+ description: string;
1412
+ };
1413
+ lastRequest: {
1414
+ type: string;
1415
+ format: string;
1416
+ nullable: boolean;
1417
+ description: string;
1418
+ };
1419
+ expiresAt: {
1420
+ type: string;
1421
+ format: string;
1422
+ nullable: boolean;
1423
+ description: string;
1424
+ };
1425
+ createdAt: {
1426
+ type: string;
1427
+ format: string;
1428
+ description: string;
1429
+ };
1430
+ updatedAt: {
1431
+ type: string;
1432
+ format: string;
1433
+ description: string;
1434
+ };
1435
+ metadata: {
1436
+ type: string;
1437
+ nullable: boolean;
1438
+ additionalProperties: boolean;
1439
+ description: string;
1440
+ };
1441
+ permissions: {
1442
+ type: string;
1443
+ nullable: boolean;
1444
+ description: string;
1445
+ };
1446
+ };
1447
+ required: string[];
1448
+ };
1449
+ };
1450
+ };
1451
+ };
1452
+ };
1453
+ };
1454
+ };
1455
+ }, {
1456
+ metadata: Record<string, any> | null;
1457
+ permissions: {
1458
+ [key: string]: string[];
1459
+ } | null;
1460
+ id: string;
1461
+ configId: string;
1462
+ name: string | null;
1463
+ start: string | null;
1464
+ prefix: string | null;
1465
+ referenceId: string;
1466
+ refillInterval: number | null;
1467
+ refillAmount: number | null;
1468
+ lastRefillAt: Date | null;
1469
+ enabled: boolean;
1470
+ rateLimitEnabled: boolean;
1471
+ rateLimitTimeWindow: number | null;
1472
+ rateLimitMax: number | null;
1473
+ requestCount: number;
1474
+ remaining: number | null;
1475
+ lastRequest: Date | null;
1476
+ expiresAt: Date | null;
1477
+ createdAt: Date;
1478
+ updatedAt: Date;
1479
+ }>;
1480
+ deleteApiKey: import("better-auth").StrictEndpoint<"/api-key/delete", {
1481
+ method: "POST";
1482
+ body: import("zod").ZodObject<{
1483
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
1484
+ keyId: import("zod").ZodString;
1485
+ }, import("zod/v4/core").$strip>;
1486
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1487
+ session: {
1488
+ session: Record<string, any> & {
1489
+ id: string;
1490
+ createdAt: Date;
1491
+ updatedAt: Date;
1492
+ userId: string;
1493
+ expiresAt: Date;
1494
+ token: string;
1495
+ ipAddress?: string | null | undefined;
1496
+ userAgent?: string | null | undefined;
1497
+ };
1498
+ user: Record<string, any> & {
1499
+ id: string;
1500
+ createdAt: Date;
1501
+ updatedAt: Date;
1502
+ email: string;
1503
+ emailVerified: boolean;
1504
+ name: string;
1505
+ image?: string | null | undefined;
1506
+ };
1507
+ };
1508
+ }>>[];
1509
+ metadata: {
1510
+ openapi: {
1511
+ description: string;
1512
+ requestBody: {
1513
+ content: {
1514
+ "application/json": {
1515
+ schema: {
1516
+ type: "object";
1517
+ properties: {
1518
+ keyId: {
1519
+ type: string;
1520
+ description: string;
1521
+ };
1522
+ };
1523
+ required: string[];
1524
+ };
1525
+ };
1526
+ };
1527
+ };
1528
+ responses: {
1529
+ "200": {
1530
+ description: string;
1531
+ content: {
1532
+ "application/json": {
1533
+ schema: {
1534
+ type: "object";
1535
+ properties: {
1536
+ success: {
1537
+ type: string;
1538
+ description: string;
1539
+ };
1540
+ };
1541
+ required: string[];
1542
+ };
1543
+ };
1544
+ };
1545
+ };
1546
+ };
1547
+ };
1548
+ };
1549
+ }, {
1550
+ success: boolean;
1551
+ }>;
1552
+ listApiKeys: import("better-auth").StrictEndpoint<"/api-key/list", {
1553
+ method: "GET";
1554
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1555
+ session: {
1556
+ session: Record<string, any> & {
1557
+ id: string;
1558
+ createdAt: Date;
1559
+ updatedAt: Date;
1560
+ userId: string;
1561
+ expiresAt: Date;
1562
+ token: string;
1563
+ ipAddress?: string | null | undefined;
1564
+ userAgent?: string | null | undefined;
1565
+ };
1566
+ user: Record<string, any> & {
1567
+ id: string;
1568
+ createdAt: Date;
1569
+ updatedAt: Date;
1570
+ email: string;
1571
+ emailVerified: boolean;
1572
+ name: string;
1573
+ image?: string | null | undefined;
1574
+ };
1575
+ };
1576
+ }>>[];
1577
+ query: import("zod").ZodOptional<import("zod").ZodObject<{
1578
+ configId: import("zod").ZodOptional<import("zod").ZodString>;
1579
+ organizationId: import("zod").ZodOptional<import("zod").ZodString>;
1580
+ limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
1581
+ offset: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
1582
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
1583
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
1584
+ asc: "asc";
1585
+ desc: "desc";
1586
+ }>>;
1587
+ }, import("zod/v4/core").$strip>>;
1588
+ metadata: {
1589
+ openapi: {
1590
+ description: string;
1591
+ responses: {
1592
+ "200": {
1593
+ description: string;
1594
+ content: {
1595
+ "application/json": {
1596
+ schema: {
1597
+ type: "object";
1598
+ properties: {
1599
+ apiKeys: {
1600
+ type: string;
1601
+ items: {
1602
+ type: string;
1603
+ properties: {
1604
+ id: {
1605
+ type: string;
1606
+ description: string;
1607
+ };
1608
+ name: {
1609
+ type: string;
1610
+ nullable: boolean;
1611
+ description: string;
1612
+ };
1613
+ start: {
1614
+ type: string;
1615
+ nullable: boolean;
1616
+ description: string;
1617
+ };
1618
+ prefix: {
1619
+ type: string;
1620
+ nullable: boolean;
1621
+ description: string;
1622
+ };
1623
+ userId: {
1624
+ type: string;
1625
+ description: string;
1626
+ };
1627
+ refillInterval: {
1628
+ type: string;
1629
+ nullable: boolean;
1630
+ description: string;
1631
+ };
1632
+ refillAmount: {
1633
+ type: string;
1634
+ nullable: boolean;
1635
+ description: string;
1636
+ };
1637
+ lastRefillAt: {
1638
+ type: string;
1639
+ format: string;
1640
+ nullable: boolean;
1641
+ description: string;
1642
+ };
1643
+ enabled: {
1644
+ type: string;
1645
+ description: string;
1646
+ default: boolean;
1647
+ };
1648
+ rateLimitEnabled: {
1649
+ type: string;
1650
+ description: string;
1651
+ };
1652
+ rateLimitTimeWindow: {
1653
+ type: string;
1654
+ nullable: boolean;
1655
+ description: string;
1656
+ };
1657
+ rateLimitMax: {
1658
+ type: string;
1659
+ nullable: boolean;
1660
+ description: string;
1661
+ };
1662
+ requestCount: {
1663
+ type: string;
1664
+ description: string;
1665
+ };
1666
+ remaining: {
1667
+ type: string;
1668
+ nullable: boolean;
1669
+ description: string;
1670
+ };
1671
+ lastRequest: {
1672
+ type: string;
1673
+ format: string;
1674
+ nullable: boolean;
1675
+ description: string;
1676
+ };
1677
+ expiresAt: {
1678
+ type: string;
1679
+ format: string;
1680
+ nullable: boolean;
1681
+ description: string;
1682
+ };
1683
+ createdAt: {
1684
+ type: string;
1685
+ format: string;
1686
+ description: string;
1687
+ };
1688
+ updatedAt: {
1689
+ type: string;
1690
+ format: string;
1691
+ description: string;
1692
+ };
1693
+ metadata: {
1694
+ type: string;
1695
+ nullable: boolean;
1696
+ additionalProperties: boolean;
1697
+ description: string;
1698
+ };
1699
+ permissions: {
1700
+ type: string;
1701
+ nullable: boolean;
1702
+ description: string;
1703
+ };
1704
+ };
1705
+ required: string[];
1706
+ };
1707
+ };
1708
+ total: {
1709
+ type: string;
1710
+ description: string;
1711
+ };
1712
+ limit: {
1713
+ type: string;
1714
+ nullable: boolean;
1715
+ description: string;
1716
+ };
1717
+ offset: {
1718
+ type: string;
1719
+ nullable: boolean;
1720
+ description: string;
1721
+ };
1722
+ };
1723
+ required: string[];
1724
+ };
1725
+ };
1726
+ };
1727
+ };
1728
+ };
1729
+ };
1730
+ };
1731
+ }, {
1732
+ apiKeys: {
1733
+ metadata: Record<string, any> | null;
1734
+ permissions: {
1735
+ [key: string]: string[];
1736
+ } | null;
1737
+ id: string;
1738
+ configId: string;
1739
+ name: string | null;
1740
+ start: string | null;
1741
+ prefix: string | null;
1742
+ referenceId: string;
1743
+ refillInterval: number | null;
1744
+ refillAmount: number | null;
1745
+ lastRefillAt: Date | null;
1746
+ enabled: boolean;
1747
+ rateLimitEnabled: boolean;
1748
+ rateLimitTimeWindow: number | null;
1749
+ rateLimitMax: number | null;
1750
+ requestCount: number;
1751
+ remaining: number | null;
1752
+ lastRequest: Date | null;
1753
+ expiresAt: Date | null;
1754
+ createdAt: Date;
1755
+ updatedAt: Date;
1756
+ }[];
1757
+ total: number;
1758
+ limit: number | undefined;
1759
+ offset: number | undefined;
1760
+ }>;
1761
+ deleteAllExpiredApiKeys: import("better-auth").StrictEndpoint<string, {
1762
+ method: "POST";
1763
+ }, {
1764
+ success: boolean;
1765
+ error: unknown;
1766
+ }>;
1767
+ };
1768
+ schema: {
1769
+ apikey: {
1770
+ fields: {
1771
+ configId: {
1772
+ type: "string";
1773
+ required: true;
1774
+ defaultValue: string;
1775
+ input: false;
1776
+ index: true;
1777
+ };
1778
+ name: {
1779
+ type: "string";
1780
+ required: false;
1781
+ input: false;
1782
+ };
1783
+ start: {
1784
+ type: "string";
1785
+ required: false;
1786
+ input: false;
1787
+ };
1788
+ referenceId: {
1789
+ type: "string";
1790
+ required: true;
1791
+ input: false;
1792
+ index: true;
1793
+ };
1794
+ prefix: {
1795
+ type: "string";
1796
+ required: false;
1797
+ input: false;
1798
+ };
1799
+ key: {
1800
+ type: "string";
1801
+ required: true;
1802
+ input: false;
1803
+ index: true;
1804
+ };
1805
+ refillInterval: {
1806
+ type: "number";
1807
+ required: false;
1808
+ input: false;
1809
+ };
1810
+ refillAmount: {
1811
+ type: "number";
1812
+ required: false;
1813
+ input: false;
1814
+ };
1815
+ lastRefillAt: {
1816
+ type: "date";
1817
+ required: false;
1818
+ input: false;
1819
+ };
1820
+ enabled: {
1821
+ type: "boolean";
1822
+ required: false;
1823
+ input: false;
1824
+ defaultValue: true;
1825
+ };
1826
+ rateLimitEnabled: {
1827
+ type: "boolean";
1828
+ required: false;
1829
+ input: false;
1830
+ defaultValue: true;
1831
+ };
1832
+ rateLimitTimeWindow: {
1833
+ type: "number";
1834
+ required: false;
1835
+ input: false;
1836
+ defaultValue: number;
1837
+ };
1838
+ rateLimitMax: {
1839
+ type: "number";
1840
+ required: false;
1841
+ input: false;
1842
+ defaultValue: number;
1843
+ };
1844
+ requestCount: {
1845
+ type: "number";
1846
+ required: false;
1847
+ input: false;
1848
+ defaultValue: number;
1849
+ };
1850
+ remaining: {
1851
+ type: "number";
1852
+ required: false;
1853
+ input: false;
1854
+ };
1855
+ lastRequest: {
1856
+ type: "date";
1857
+ required: false;
1858
+ input: false;
1859
+ };
1860
+ expiresAt: {
1861
+ type: "date";
1862
+ required: false;
1863
+ input: false;
1864
+ };
1865
+ createdAt: {
1866
+ type: "date";
1867
+ required: true;
1868
+ input: false;
1869
+ };
1870
+ updatedAt: {
1871
+ type: "date";
1872
+ required: true;
1873
+ input: false;
1874
+ };
1875
+ permissions: {
1876
+ type: "string";
1877
+ required: false;
1878
+ input: false;
1879
+ };
1880
+ metadata: {
1881
+ type: "string";
1882
+ required: false;
1883
+ input: true;
1884
+ transform: {
1885
+ input(value: import("better-auth").DBPrimitive): string;
1886
+ output(value: import("better-auth").DBPrimitive): any;
1887
+ };
1888
+ };
1889
+ };
1890
+ };
1891
+ };
740
1892
  }];
741
1893
  }>;
742
1894
  content: {
@@ -793,6 +1945,19 @@ export declare function createCMS(options: CmsOptions): {
793
1945
  updatedAt: number;
794
1946
  createdAt: number;
795
1947
  };
1948
+ duplicate: (id: string, version: number) => {
1949
+ id: string;
1950
+ blueprint: string;
1951
+ singleton: string | null;
1952
+ draft: import("../blueprints/types.js").Payload;
1953
+ published: import("../blueprints/types.js").Payload | null;
1954
+ draftSlug: string | null;
1955
+ publishedSlug: string | null;
1956
+ version: number;
1957
+ publishedAt: number | null;
1958
+ updatedAt: number;
1959
+ createdAt: number;
1960
+ };
796
1961
  publish: (id: string, version: number) => {
797
1962
  id: string;
798
1963
  blueprint: string;
@@ -818,7 +1983,8 @@ export declare function createCMS(options: CmsOptions): {
818
1983
  id: string;
819
1984
  data: import("../blueprints/types.js").Payload;
820
1985
  } | null;
821
- unpublish: (id: string) => {
1986
+ validateLinkTarget: (field: import("../blueprints/types.js").Field, link: import("../link.ts").LinkValue, publish?: boolean) => void;
1987
+ unpublish: (id: string, version: number) => {
822
1988
  id: string;
823
1989
  blueprint: string;
824
1990
  singleton: string | null;
@@ -884,6 +2050,7 @@ export declare function createCMS(options: CmsOptions): {
884
2050
  role: "admin" | "editor";
885
2051
  expiresAt: number;
886
2052
  status: "failed" | "sending" | "accepted";
2053
+ failureReason: "timeout" | "dns" | "connection" | "authentication" | "tls" | "recipient_rejected" | "message_rejected" | "not_configured" | "configuration" | "invalid_message" | "unknown" | null;
887
2054
  }[];
888
2055
  invite: (recipient: string, role: "admin" | "editor", actor: string) => Promise<void>;
889
2056
  resend: (id: string, actor: string) => Promise<void>;
@@ -903,7 +2070,7 @@ export declare function createCMS(options: CmsOptions): {
903
2070
  filename: string;
904
2071
  mime: string;
905
2072
  bytes: number;
906
- status: "processing" | "ready" | "failed";
2073
+ status: "processing" | "ready" | "failed" | "deleting";
907
2074
  activeVersion: string | null;
908
2075
  targetVersion: string;
909
2076
  variants: import("./db/schema.ts").Variant[];
@@ -917,16 +2084,54 @@ export declare function createCMS(options: CmsOptions): {
917
2084
  filename: string;
918
2085
  mime: string;
919
2086
  bytes: number;
920
- status: "processing" | "ready" | "failed";
2087
+ status: "processing" | "ready" | "failed" | "deleting";
921
2088
  activeVersion: string | null;
922
2089
  targetVersion: string;
923
2090
  variants: import("./db/schema.ts").Variant[];
924
2091
  error: string | null;
925
2092
  createdAt: number;
926
2093
  }>;
2094
+ initiateUpload: (input: {
2095
+ name: string;
2096
+ type: string;
2097
+ size: number;
2098
+ }, blueprintId?: string) => Promise<{
2099
+ url: string;
2100
+ headers: Record<string, string>;
2101
+ expiresAt: number;
2102
+ id: `${string}-${string}-${string}-${string}-${string}`;
2103
+ }>;
2104
+ completeUpload: (id: string) => {
2105
+ blueprint: string;
2106
+ metadata: import("../blueprints/types.js").Payload;
2107
+ id: string;
2108
+ filename: string;
2109
+ mime: string;
2110
+ bytes: number;
2111
+ status: "processing" | "ready" | "failed" | "deleting";
2112
+ activeVersion: string | null;
2113
+ targetVersion: string;
2114
+ variants: import("./db/schema.ts").Variant[];
2115
+ error: string | null;
2116
+ createdAt: number;
2117
+ };
927
2118
  tick: () => Promise<boolean>;
928
2119
  retry: (id: string) => void;
929
2120
  version: string;
2121
+ versionForAsset: (asset: NonNullable<ReturnType<(id: string) => {
2122
+ blueprint: string;
2123
+ metadata: import("../blueprints/types.js").Payload;
2124
+ id: string;
2125
+ filename: string;
2126
+ mime: string;
2127
+ bytes: number;
2128
+ status: "processing" | "ready" | "failed" | "deleting";
2129
+ activeVersion: string | null;
2130
+ targetVersion: string;
2131
+ variants: import("./db/schema.ts").Variant[];
2132
+ error: string | null;
2133
+ createdAt: number;
2134
+ } | undefined>>) => string;
930
2135
  workerUrl: string;
931
2136
  list: () => {
932
2137
  blueprint: string;
@@ -935,7 +2140,7 @@ export declare function createCMS(options: CmsOptions): {
935
2140
  filename: string;
936
2141
  mime: string;
937
2142
  bytes: number;
938
- status: "processing" | "ready" | "failed";
2143
+ status: "processing" | "ready" | "failed" | "deleting";
939
2144
  activeVersion: string | null;
940
2145
  targetVersion: string;
941
2146
  variants: import("./db/schema.ts").Variant[];
@@ -1035,6 +2240,7 @@ export declare function createCMS(options: CmsOptions): {
1035
2240
  }[];
1036
2241
  start: () => () => void;
1037
2242
  };
2243
+ resolveLink: (value: unknown) => import("../link.ts").ResolvedLink | null;
1038
2244
  options: CmsOptions;
1039
2245
  seo: {
1040
2246
  robots(): string;