sandcms 0.5.2 → 0.6.0

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