@aphexcms/cms-core 0.1.1 → 0.1.4
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/dist/api/assets.d.ts +48 -0
- package/dist/api/assets.d.ts.map +1 -0
- package/dist/api/assets.js +52 -0
- package/dist/api/client.d.ts +37 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +125 -0
- package/dist/api/documents.d.ts +56 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +77 -0
- package/{src/api/index.ts → dist/api/index.d.ts} +1 -1
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +5 -0
- package/dist/api/organizations.d.ts +101 -0
- package/dist/api/organizations.d.ts.map +1 -0
- package/dist/api/organizations.js +92 -0
- package/dist/api/types.d.ts +23 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +1 -0
- package/dist/auth/auth-errors.d.ts +7 -0
- package/dist/auth/auth-errors.d.ts.map +1 -0
- package/dist/auth/auth-errors.js +13 -0
- package/dist/auth/auth-hooks.d.ts +6 -0
- package/dist/auth/auth-hooks.d.ts.map +1 -0
- package/dist/auth/auth-hooks.js +108 -0
- package/dist/auth/provider.d.ts +17 -0
- package/dist/auth/provider.d.ts.map +1 -0
- package/dist/auth/provider.js +1 -0
- package/dist/client/index.d.ts +24 -0
- package/dist/client/index.d.ts.map +1 -0
- package/{src/client/index.ts → dist/client/index.js} +0 -16
- package/{src → dist}/components/AdminApp.svelte +7 -8
- package/dist/components/AdminApp.svelte.d.ts +24 -0
- package/dist/components/AdminApp.svelte.d.ts.map +1 -0
- package/dist/components/admin/AdminLayout.svelte.d.ts +15 -0
- package/dist/components/admin/AdminLayout.svelte.d.ts.map +1 -0
- package/dist/components/admin/DocumentEditor.svelte.d.ts +18 -0
- package/dist/components/admin/DocumentEditor.svelte.d.ts.map +1 -0
- package/dist/components/admin/DocumentTypesList.svelte.d.ts +14 -0
- package/dist/components/admin/DocumentTypesList.svelte.d.ts.map +1 -0
- package/dist/components/admin/ObjectModal.svelte.d.ts +15 -0
- package/dist/components/admin/ObjectModal.svelte.d.ts.map +1 -0
- package/dist/components/admin/SchemaField.svelte.d.ts +19 -0
- package/dist/components/admin/SchemaField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/ArrayField.svelte.d.ts +12 -0
- package/dist/components/admin/fields/ArrayField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/BooleanField.svelte.d.ts +13 -0
- package/dist/components/admin/fields/BooleanField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/ImageField.svelte.d.ts +15 -0
- package/dist/components/admin/fields/ImageField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/NumberField.svelte.d.ts +14 -0
- package/dist/components/admin/fields/NumberField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/ReferenceField.svelte.d.ts +12 -0
- package/dist/components/admin/fields/ReferenceField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/SlugField.svelte.d.ts +15 -0
- package/dist/components/admin/fields/SlugField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/StringField.svelte.d.ts +14 -0
- package/dist/components/admin/fields/StringField.svelte.d.ts.map +1 -0
- package/dist/components/admin/fields/TextareaField.svelte.d.ts +14 -0
- package/dist/components/admin/fields/TextareaField.svelte.d.ts.map +1 -0
- package/dist/components/fields/index.d.ts +9 -0
- package/dist/components/fields/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/{src/components/index.ts → dist/components/index.js} +0 -4
- package/dist/components/layout/OrganizationSwitcher.svelte.d.ts +11 -0
- package/dist/components/layout/OrganizationSwitcher.svelte.d.ts.map +1 -0
- package/{src → dist}/components/layout/Sidebar.svelte +7 -7
- package/dist/components/layout/Sidebar.svelte.d.ts +14 -0
- package/dist/components/layout/Sidebar.svelte.d.ts.map +1 -0
- package/dist/components/layout/sidebar/AppSidebar.svelte.d.ts +11 -0
- package/dist/components/layout/sidebar/AppSidebar.svelte.d.ts.map +1 -0
- package/dist/components/layout/sidebar/NavMain.svelte.d.ts +19 -0
- package/dist/components/layout/sidebar/NavMain.svelte.d.ts.map +1 -0
- package/dist/components/layout/sidebar/NavSecondary.svelte.d.ts +9 -0
- package/dist/components/layout/sidebar/NavSecondary.svelte.d.ts.map +1 -0
- package/dist/components/layout/sidebar/NavUser.svelte.d.ts +9 -0
- package/dist/components/layout/sidebar/NavUser.svelte.d.ts.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +15 -0
- package/dist/db/adapters/index.d.ts +1 -0
- package/dist/db/adapters/index.d.ts.map +1 -0
- package/{src/db/adapters/index.ts → dist/db/adapters/index.js} +1 -0
- package/dist/db/index.d.ts +2 -0
- package/dist/db/index.d.ts.map +1 -0
- package/{src/db/index.ts → dist/db/index.js} +0 -1
- package/dist/db/interfaces/asset.d.ts +51 -0
- package/dist/db/interfaces/asset.d.ts.map +1 -0
- package/dist/db/interfaces/asset.js +1 -0
- package/dist/db/interfaces/document.d.ts +36 -0
- package/dist/db/interfaces/document.d.ts.map +1 -0
- package/dist/db/interfaces/document.js +1 -0
- package/dist/db/interfaces/index.d.ts +73 -0
- package/dist/db/interfaces/index.d.ts.map +1 -0
- package/dist/db/interfaces/index.js +1 -0
- package/dist/db/interfaces/organization.d.ts +27 -0
- package/dist/db/interfaces/organization.d.ts.map +1 -0
- package/dist/db/interfaces/organization.js +1 -0
- package/dist/db/interfaces/schema.d.ts +21 -0
- package/dist/db/interfaces/schema.d.ts.map +1 -0
- package/dist/db/interfaces/schema.js +1 -0
- package/dist/db/interfaces/user.d.ts +15 -0
- package/dist/db/interfaces/user.d.ts.map +1 -0
- package/dist/db/interfaces/user.js +1 -0
- package/dist/db/utils/reference-resolver.d.ts +18 -0
- package/dist/db/utils/reference-resolver.d.ts.map +1 -0
- package/dist/db/utils/reference-resolver.js +80 -0
- package/dist/define.d.ts +3 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +4 -0
- package/dist/email/index.d.ts +2 -0
- package/dist/email/index.d.ts.map +1 -0
- package/{src/email/index.ts → dist/email/index.js} +0 -1
- package/dist/email/interfaces/email.d.ts +42 -0
- package/dist/email/interfaces/email.d.ts.map +1 -0
- package/dist/email/interfaces/email.js +1 -0
- package/dist/engine.d.ts +26 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +66 -0
- package/dist/field-validation/rule.d.ts +51 -0
- package/dist/field-validation/rule.d.ts.map +1 -0
- package/dist/field-validation/rule.js +221 -0
- package/dist/field-validation/utils.d.ts +21 -0
- package/dist/field-validation/utils.d.ts.map +1 -0
- package/dist/field-validation/utils.js +66 -0
- package/dist/hooks.d.ts +23 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +96 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +0 -1
- package/dist/routes/assets-by-id.d.ts +5 -0
- package/dist/routes/assets-by-id.d.ts.map +1 -0
- package/dist/routes/assets-by-id.js +138 -0
- package/dist/routes/assets-cdn.d.ts +3 -0
- package/dist/routes/assets-cdn.d.ts.map +1 -0
- package/dist/routes/assets-cdn.js +155 -0
- package/dist/routes/assets.d.ts +4 -0
- package/dist/routes/assets.d.ts.map +1 -0
- package/dist/routes/assets.js +94 -0
- package/dist/routes/documents-by-id.d.ts +5 -0
- package/dist/routes/documents-by-id.d.ts.map +1 -0
- package/dist/routes/documents-by-id.js +142 -0
- package/dist/routes/documents-publish.d.ts +4 -0
- package/dist/routes/documents-publish.d.ts.map +1 -0
- package/dist/routes/documents-publish.js +151 -0
- package/dist/routes/documents.d.ts +4 -0
- package/dist/routes/documents.d.ts.map +1 -0
- package/dist/routes/documents.js +131 -0
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/{src/routes/index.ts → dist/routes/index.js} +0 -3
- package/dist/routes/organizations-by-id.d.ts +5 -0
- package/dist/routes/organizations-by-id.d.ts.map +1 -0
- package/dist/routes/organizations-by-id.js +187 -0
- package/dist/routes/organizations-invitations.d.ts +4 -0
- package/dist/routes/organizations-invitations.d.ts.map +1 -0
- package/dist/routes/organizations-invitations.js +125 -0
- package/dist/routes/organizations-members.d.ts +5 -0
- package/dist/routes/organizations-members.d.ts.map +1 -0
- package/dist/routes/organizations-members.js +206 -0
- package/dist/routes/organizations-switch.d.ts +3 -0
- package/dist/routes/organizations-switch.d.ts.map +1 -0
- package/dist/routes/organizations-switch.js +53 -0
- package/dist/routes/organizations.d.ts +4 -0
- package/dist/routes/organizations.d.ts.map +1 -0
- package/dist/routes/organizations.js +108 -0
- package/dist/routes/schemas-by-type.d.ts +3 -0
- package/dist/routes/schemas-by-type.d.ts.map +1 -0
- package/dist/routes/schemas-by-type.js +25 -0
- package/dist/routes/schemas.d.ts +3 -0
- package/dist/routes/schemas.d.ts.map +1 -0
- package/dist/routes/schemas.js +11 -0
- package/dist/routes-exports.d.ts +14 -0
- package/dist/routes-exports.d.ts.map +1 -0
- package/{src/routes-exports.ts → dist/routes-exports.js} +5 -28
- package/dist/schema-context.svelte.d.ts +10 -0
- package/dist/schema-context.svelte.d.ts.map +1 -0
- package/dist/schema-context.svelte.js +18 -0
- package/dist/schema-utils/cleanup.d.ts +21 -0
- package/dist/schema-utils/cleanup.d.ts.map +1 -0
- package/dist/schema-utils/cleanup.js +80 -0
- package/dist/schema-utils/index.d.ts +4 -0
- package/dist/schema-utils/index.d.ts.map +1 -0
- package/dist/schema-utils/utils.d.ts +30 -0
- package/dist/schema-utils/utils.d.ts.map +1 -0
- package/dist/schema-utils/utils.js +37 -0
- package/dist/schema-utils/validator.d.ts +6 -0
- package/dist/schema-utils/validator.d.ts.map +1 -0
- package/dist/schema-utils/validator.js +45 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.d.ts.map +1 -0
- package/{src/server/index.ts → dist/server/index.js} +2 -14
- package/dist/services/asset-service.d.ts +86 -0
- package/dist/services/asset-service.d.ts.map +1 -0
- package/dist/services/asset-service.js +187 -0
- package/{src/services/index.ts → dist/services/index.d.ts} +1 -4
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +4 -0
- package/dist/storage/adapters/index.d.ts +2 -0
- package/dist/storage/adapters/index.d.ts.map +1 -0
- package/dist/storage/adapters/local-storage-adapter.d.ts +54 -0
- package/dist/storage/adapters/local-storage-adapter.d.ts.map +1 -0
- package/dist/storage/adapters/local-storage-adapter.js +187 -0
- package/dist/storage/index.d.ts +3 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/{src/storage/index.ts → dist/storage/index.js} +0 -2
- package/dist/storage/interfaces/index.d.ts +2 -0
- package/dist/storage/interfaces/index.d.ts.map +1 -0
- package/dist/storage/interfaces/storage.d.ts +91 -0
- package/dist/storage/interfaces/storage.d.ts.map +1 -0
- package/dist/storage/interfaces/storage.js +1 -0
- package/dist/storage/providers/storage.d.ts +43 -0
- package/dist/storage/providers/storage.d.ts.map +1 -0
- package/dist/storage/providers/storage.js +64 -0
- package/dist/types/asset.d.ts +73 -0
- package/dist/types/asset.d.ts.map +1 -0
- package/dist/types/asset.js +2 -0
- package/dist/types/auth.d.ts +50 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +41 -0
- package/dist/types/config.d.ts +47 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +1 -0
- package/dist/types/document.d.ts +34 -0
- package/dist/types/document.d.ts.map +1 -0
- package/dist/types/document.js +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/organization.d.ts +105 -0
- package/dist/types/organization.d.ts.map +1 -0
- package/dist/types/organization.js +3 -0
- package/dist/types/schemas.d.ts +114 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/types/schemas.js +1 -0
- package/dist/types/sidebar.d.ts +33 -0
- package/dist/types/sidebar.d.ts.map +1 -0
- package/dist/types/sidebar.js +1 -0
- package/dist/types/user.d.ts +14 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/user.js +1 -0
- package/dist/utils/content-hash.d.ts +22 -0
- package/dist/utils/content-hash.d.ts.map +1 -0
- package/dist/utils/content-hash.js +67 -0
- package/dist/utils/image-url.d.ts +88 -0
- package/dist/utils/image-url.d.ts.map +1 -0
- package/dist/utils/image-url.js +165 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/{src/utils/index.ts → dist/utils/index.js} +0 -3
- package/dist/utils/slug.d.ts +13 -0
- package/dist/utils/slug.d.ts.map +1 -0
- package/dist/utils/slug.js +30 -0
- package/package.json +12 -25
- package/src/api/assets.ts +0 -75
- package/src/api/client.ts +0 -150
- package/src/api/documents.ts +0 -102
- package/src/api/organizations.ts +0 -154
- package/src/api/types.ts +0 -34
- package/src/auth/auth-errors.ts +0 -23
- package/src/auth/auth-hooks.ts +0 -132
- package/src/auth/provider.ts +0 -25
- package/src/config.ts +0 -18
- package/src/db/interfaces/asset.ts +0 -61
- package/src/db/interfaces/document.ts +0 -53
- package/src/db/interfaces/index.ts +0 -98
- package/src/db/interfaces/organization.ts +0 -51
- package/src/db/interfaces/schema.ts +0 -13
- package/src/db/interfaces/user.ts +0 -16
- package/src/db/utils/reference-resolver.ts +0 -119
- package/src/define.ts +0 -7
- package/src/email/interfaces/email.ts +0 -45
- package/src/engine.ts +0 -85
- package/src/field-validation/rule.ts +0 -287
- package/src/field-validation/utils.ts +0 -91
- package/src/hooks.ts +0 -142
- package/src/lib/is-mobile.svelte.ts +0 -9
- package/src/lib/utils.ts +0 -13
- package/src/routes/assets-by-id.ts +0 -161
- package/src/routes/assets-cdn.ts +0 -185
- package/src/routes/assets.ts +0 -116
- package/src/routes/documents-by-id.ts +0 -188
- package/src/routes/documents-publish.ts +0 -211
- package/src/routes/documents.ts +0 -172
- package/src/routes/organizations-by-id.ts +0 -258
- package/src/routes/organizations-invitations.ts +0 -183
- package/src/routes/organizations-members.ts +0 -301
- package/src/routes/organizations-switch.ts +0 -74
- package/src/routes/organizations.ts +0 -146
- package/src/routes/schemas-by-type.ts +0 -35
- package/src/routes/schemas.ts +0 -19
- package/src/schema-context.svelte.ts +0 -24
- package/src/schema-utils/cleanup.ts +0 -116
- package/src/schema-utils/utils.ts +0 -47
- package/src/schema-utils/validator.ts +0 -58
- package/src/services/asset-service.ts +0 -256
- package/src/storage/adapters/local-storage-adapter.ts +0 -215
- package/src/storage/interfaces/storage.ts +0 -114
- package/src/storage/providers/storage.ts +0 -83
- package/src/types/asset.ts +0 -81
- package/src/types/auth.ts +0 -80
- package/src/types/config.ts +0 -45
- package/src/types/document.ts +0 -38
- package/src/types/organization.ts +0 -119
- package/src/types/schemas.ts +0 -151
- package/src/types/sidebar.ts +0 -37
- package/src/types/user.ts +0 -17
- package/src/utils/content-hash.ts +0 -75
- package/src/utils/image-url.ts +0 -204
- package/src/utils/slug.ts +0 -33
- /package/{src → dist}/app.d.ts +0 -0
- /package/{src → dist}/auth/MULTI_TENANCY_PLAN.md +0 -0
- /package/{src → dist}/components/admin/AdminLayout.svelte +0 -0
- /package/{src → dist}/components/admin/DocumentEditor.svelte +0 -0
- /package/{src → dist}/components/admin/DocumentTypesList.svelte +0 -0
- /package/{src → dist}/components/admin/ObjectModal.svelte +0 -0
- /package/{src → dist}/components/admin/SchemaField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/ArrayField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/BooleanField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/ImageField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/NumberField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/ReferenceField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/SlugField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/StringField.svelte +0 -0
- /package/{src → dist}/components/admin/fields/TextareaField.svelte +0 -0
- /package/{src/components/fields/index.ts → dist/components/fields/index.js} +0 -0
- /package/{src → dist}/components/layout/OrganizationSwitcher.svelte +0 -0
- /package/{src → dist}/components/layout/sidebar/AppSidebar.svelte +0 -0
- /package/{src → dist}/components/layout/sidebar/NavMain.svelte +0 -0
- /package/{src → dist}/components/layout/sidebar/NavSecondary.svelte +0 -0
- /package/{src → dist}/components/layout/sidebar/NavUser.svelte +0 -0
- /package/{src → dist}/plugins/README.md +0 -0
- /package/{src/schema-utils/index.ts → dist/schema-utils/index.js} +0 -0
- /package/{src/storage/adapters/index.ts → dist/storage/adapters/index.js} +0 -0
- /package/{src/storage/interfaces/index.ts → dist/storage/interfaces/index.js} +0 -0
- /package/{src/types/index.ts → dist/types/index.js} +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Storage provider factory for creating different storage adapters
|
|
2
|
-
import type { StorageAdapter, StorageProvider, StorageConfig } from '../interfaces/storage.js';
|
|
3
|
-
import { LocalStorageAdapter } from '../adapters/local-storage-adapter.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Local file system provider
|
|
7
|
-
*/
|
|
8
|
-
export class LocalStorageProvider implements StorageProvider {
|
|
9
|
-
name = 'local';
|
|
10
|
-
|
|
11
|
-
createAdapter(config: StorageConfig): StorageAdapter {
|
|
12
|
-
return new LocalStorageAdapter(config);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Storage provider registry
|
|
18
|
-
*/
|
|
19
|
-
class StorageProviderRegistry {
|
|
20
|
-
private providers = new Map<string, StorageProvider>();
|
|
21
|
-
|
|
22
|
-
constructor() {
|
|
23
|
-
// Register built-in providers
|
|
24
|
-
this.register(new LocalStorageProvider());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
register(provider: StorageProvider): void {
|
|
28
|
-
this.providers.set(provider.name.toLowerCase(), provider);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
get(name: string): StorageProvider | undefined {
|
|
32
|
-
return this.providers.get(name.toLowerCase());
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
list(): string[] {
|
|
36
|
-
return Array.from(this.providers.keys());
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Global storage provider registry
|
|
42
|
-
*
|
|
43
|
-
* External packages can register custom storage providers:
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* import { storageProviders } from '@aphexcms/cms-core/server';
|
|
48
|
-
* import { R2StorageProvider } from '@aphexcms/storage-r2';
|
|
49
|
-
*
|
|
50
|
-
* // Register before creating config
|
|
51
|
-
* storageProviders.register(new R2StorageProvider());
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export const storageProviders = new StorageProviderRegistry();
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Factory function to create storage adapters
|
|
58
|
-
*/
|
|
59
|
-
export function createStorageAdapter(providerName: string, config: StorageConfig): StorageAdapter {
|
|
60
|
-
const provider = storageProviders.get(providerName);
|
|
61
|
-
|
|
62
|
-
if (!provider) {
|
|
63
|
-
const available = storageProviders.list();
|
|
64
|
-
throw new Error(
|
|
65
|
-
`Unknown storage provider: ${providerName}. Available providers: ${available.join(', ')}`
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return provider.createAdapter(config);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Convenience function for local storage
|
|
74
|
-
*/
|
|
75
|
-
export function createLocalStorageAdapter(
|
|
76
|
-
basePath: string,
|
|
77
|
-
options?: Partial<StorageConfig>
|
|
78
|
-
): StorageAdapter {
|
|
79
|
-
return createStorageAdapter('local', {
|
|
80
|
-
basePath,
|
|
81
|
-
...options
|
|
82
|
-
});
|
|
83
|
-
}
|
package/src/types/asset.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// types/asset.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Asset type - represents uploaded files
|
|
5
|
-
*/
|
|
6
|
-
export interface Asset {
|
|
7
|
-
id: string;
|
|
8
|
-
organizationId: string;
|
|
9
|
-
assetType: string;
|
|
10
|
-
filename: string;
|
|
11
|
-
originalFilename: string;
|
|
12
|
-
mimeType: string;
|
|
13
|
-
size: number;
|
|
14
|
-
url: string;
|
|
15
|
-
path: string;
|
|
16
|
-
storageAdapter: string;
|
|
17
|
-
width: number | null;
|
|
18
|
-
height: number | null;
|
|
19
|
-
metadata: any;
|
|
20
|
-
title: string | null;
|
|
21
|
-
description: string | null;
|
|
22
|
-
alt: string | null;
|
|
23
|
-
creditLine: string | null;
|
|
24
|
-
createdBy: string | null;
|
|
25
|
-
createdAt: Date | null;
|
|
26
|
-
updatedAt: Date | null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* New asset input type
|
|
31
|
-
*/
|
|
32
|
-
export interface NewAsset {
|
|
33
|
-
id?: string;
|
|
34
|
-
assetType: string;
|
|
35
|
-
filename: string;
|
|
36
|
-
originalFilename: string;
|
|
37
|
-
mimeType: string;
|
|
38
|
-
size: number;
|
|
39
|
-
url: string;
|
|
40
|
-
path: string;
|
|
41
|
-
storageAdapter: string;
|
|
42
|
-
width?: number | null;
|
|
43
|
-
height?: number | null;
|
|
44
|
-
metadata?: any;
|
|
45
|
-
title?: string | null;
|
|
46
|
-
description?: string | null;
|
|
47
|
-
alt?: string | null;
|
|
48
|
-
creditLine?: string | null;
|
|
49
|
-
createdBy?: string | null;
|
|
50
|
-
createdAt?: Date | null;
|
|
51
|
-
updatedAt?: Date | null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Sanity-style image data structure
|
|
55
|
-
export interface ImageAsset {
|
|
56
|
-
_type: 'reference';
|
|
57
|
-
_ref: string; // Asset ID
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ImageCrop {
|
|
61
|
-
top: number;
|
|
62
|
-
bottom: number;
|
|
63
|
-
left: number;
|
|
64
|
-
right: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface ImageHotspot {
|
|
68
|
-
x: number;
|
|
69
|
-
y: number;
|
|
70
|
-
height: number;
|
|
71
|
-
width: number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ImageValue {
|
|
75
|
-
_type: 'image';
|
|
76
|
-
asset: ImageAsset;
|
|
77
|
-
crop?: ImageCrop;
|
|
78
|
-
hotspot?: ImageHotspot;
|
|
79
|
-
// Additional custom fields can be added here
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
}
|
package/src/types/auth.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// types/auth.ts
|
|
2
|
-
import type { CMSUser } from './user.js';
|
|
3
|
-
import type { OrganizationRole } from './organization.js';
|
|
4
|
-
|
|
5
|
-
export interface SessionAuth {
|
|
6
|
-
type: 'session';
|
|
7
|
-
user: CMSUser;
|
|
8
|
-
session: {
|
|
9
|
-
id: string;
|
|
10
|
-
expiresAt: Date;
|
|
11
|
-
};
|
|
12
|
-
organizationId: string;
|
|
13
|
-
organizationRole: OrganizationRole;
|
|
14
|
-
organizations?: Array<{
|
|
15
|
-
id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
slug: string;
|
|
18
|
-
role: OrganizationRole;
|
|
19
|
-
isActive: boolean;
|
|
20
|
-
metadata?: any;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ApiKeyAuth {
|
|
25
|
-
type: 'api_key';
|
|
26
|
-
keyId: string;
|
|
27
|
-
name: string;
|
|
28
|
-
permissions: ('read' | 'write')[];
|
|
29
|
-
organizationId: string;
|
|
30
|
-
environment?: string;
|
|
31
|
-
lastUsedAt?: Date;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type Auth = SessionAuth | ApiKeyAuth;
|
|
35
|
-
|
|
36
|
-
// Access control utilities
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Check if a user has write permissions based on their organization role
|
|
40
|
-
* Viewers have read-only access
|
|
41
|
-
*/
|
|
42
|
-
export function canWrite(auth: Auth): boolean {
|
|
43
|
-
if (auth.type === 'api_key') {
|
|
44
|
-
return auth.permissions.includes('write');
|
|
45
|
-
}
|
|
46
|
-
// Viewers are read-only
|
|
47
|
-
return auth.organizationRole !== 'viewer';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Check if a user can manage organization members
|
|
52
|
-
* Only owners and admins can manage members
|
|
53
|
-
*/
|
|
54
|
-
export function canManageMembers(auth: Auth): boolean {
|
|
55
|
-
if (auth.type === 'api_key') {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return auth.organizationRole === 'owner' || auth.organizationRole === 'admin';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Check if a user can manage API keys
|
|
63
|
-
* Only owners and admins can manage API keys
|
|
64
|
-
*/
|
|
65
|
-
export function canManageApiKeys(auth: Auth): boolean {
|
|
66
|
-
if (auth.type === 'api_key') {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
return auth.organizationRole === 'owner' || auth.organizationRole === 'admin';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Check if a user is a viewer (read-only access)
|
|
74
|
-
*/
|
|
75
|
-
export function isViewer(auth: Auth): boolean {
|
|
76
|
-
if (auth.type === 'api_key') {
|
|
77
|
-
return !auth.permissions.includes('write');
|
|
78
|
-
}
|
|
79
|
-
return auth.organizationRole === 'viewer';
|
|
80
|
-
}
|
package/src/types/config.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// types/config.ts
|
|
2
|
-
import type { AuthProvider } from '../auth/provider.js';
|
|
3
|
-
import type { DatabaseAdapter } from '../db/index.js';
|
|
4
|
-
import type { StorageAdapter } from '../storage/interfaces/index.js';
|
|
5
|
-
import type { EmailAdapter } from '../email/index.js';
|
|
6
|
-
import { SchemaType } from './schemas.js';
|
|
7
|
-
|
|
8
|
-
export interface CMSPlugin {
|
|
9
|
-
name: string;
|
|
10
|
-
version: string;
|
|
11
|
-
routes?: { [path: string]: (event: any) => Promise<Response> | Response };
|
|
12
|
-
install: (cms: any) => Promise<void>;
|
|
13
|
-
config?: { [key: string]: any };
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface CMSConfig {
|
|
17
|
-
schemaTypes: SchemaType[];
|
|
18
|
-
database: DatabaseAdapter;
|
|
19
|
-
storage?: StorageAdapter | null;
|
|
20
|
-
email?: EmailAdapter | null;
|
|
21
|
-
customization?: {
|
|
22
|
-
branding?: {
|
|
23
|
-
title?: string;
|
|
24
|
-
logo?: string;
|
|
25
|
-
favicon?: string;
|
|
26
|
-
};
|
|
27
|
-
theme?: {
|
|
28
|
-
colors?: Record<string, string>;
|
|
29
|
-
fonts?: Record<string, string>;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
plugins?: CMSPlugin[];
|
|
33
|
-
auth?: {
|
|
34
|
-
provider: AuthProvider;
|
|
35
|
-
loginUrl?: string;
|
|
36
|
-
};
|
|
37
|
-
security?: {
|
|
38
|
-
/**
|
|
39
|
-
* Secret key for signing asset URLs (enables multi-tenant access without exposing API keys)
|
|
40
|
-
* Should be a long, random string (e.g., 32+ characters)
|
|
41
|
-
* Required for signed asset URLs to work
|
|
42
|
-
*/
|
|
43
|
-
assetSigningSecret?: string;
|
|
44
|
-
};
|
|
45
|
-
}
|
package/src/types/document.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// types/document.ts
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
import { AuthUser } from '../types/user';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Document type - represents a CMS document
|
|
8
|
-
*/
|
|
9
|
-
export interface Document {
|
|
10
|
-
id: string;
|
|
11
|
-
type: string;
|
|
12
|
-
status: 'draft' | 'published' | null;
|
|
13
|
-
draftData: any;
|
|
14
|
-
publishedData: any;
|
|
15
|
-
publishedHash: string | null;
|
|
16
|
-
createdBy: string | AuthUser | null;
|
|
17
|
-
updatedBy: string | null;
|
|
18
|
-
publishedAt: Date | null;
|
|
19
|
-
createdAt: Date | null;
|
|
20
|
-
updatedAt: Date | null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* New document input type
|
|
25
|
-
*/
|
|
26
|
-
export interface NewDocument {
|
|
27
|
-
id?: string;
|
|
28
|
-
type: string;
|
|
29
|
-
status?: 'draft' | 'published' | null;
|
|
30
|
-
draftData?: any;
|
|
31
|
-
publishedData?: any;
|
|
32
|
-
publishedHash?: string | null;
|
|
33
|
-
createdBy?: string | null;
|
|
34
|
-
updatedBy?: string | null;
|
|
35
|
-
publishedAt?: Date | null;
|
|
36
|
-
createdAt?: Date | null;
|
|
37
|
-
updatedAt?: Date | null;
|
|
38
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// Organization types for multi-tenancy
|
|
2
|
-
// These match the inferred types from Drizzle schema
|
|
3
|
-
|
|
4
|
-
export type OrganizationRole = 'owner' | 'admin' | 'editor' | 'viewer';
|
|
5
|
-
|
|
6
|
-
export interface Organization {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
slug: string;
|
|
10
|
-
parentOrganizationId: string | null;
|
|
11
|
-
metadata: {
|
|
12
|
-
logo?: string;
|
|
13
|
-
theme?: {
|
|
14
|
-
primaryColor: string;
|
|
15
|
-
fontFamily: string;
|
|
16
|
-
logoUrl: string;
|
|
17
|
-
};
|
|
18
|
-
website?: string;
|
|
19
|
-
settings?: Record<string, any>;
|
|
20
|
-
} | null;
|
|
21
|
-
createdBy: string;
|
|
22
|
-
createdAt: Date;
|
|
23
|
-
updatedAt: Date;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface NewOrganization {
|
|
27
|
-
name: string;
|
|
28
|
-
slug: string;
|
|
29
|
-
createdBy: string;
|
|
30
|
-
id?: string;
|
|
31
|
-
parentOrganizationId?: string | null;
|
|
32
|
-
metadata?: {
|
|
33
|
-
logo?: string;
|
|
34
|
-
theme?: {
|
|
35
|
-
primaryColor: string;
|
|
36
|
-
fontFamily: string;
|
|
37
|
-
logoUrl: string;
|
|
38
|
-
};
|
|
39
|
-
website?: string;
|
|
40
|
-
settings?: Record<string, any>;
|
|
41
|
-
} | null;
|
|
42
|
-
createdAt?: Date;
|
|
43
|
-
updatedAt?: Date;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface OrganizationMember {
|
|
47
|
-
id: string;
|
|
48
|
-
createdAt: Date;
|
|
49
|
-
updatedAt: Date;
|
|
50
|
-
organizationId: string;
|
|
51
|
-
userId: string;
|
|
52
|
-
role: OrganizationRole;
|
|
53
|
-
preferences: Record<string, any> | null;
|
|
54
|
-
invitationId: string | null; // Link to invitation (get invitedBy, invitedEmail from there)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface NewOrganizationMember {
|
|
58
|
-
organizationId: string;
|
|
59
|
-
userId: string;
|
|
60
|
-
role: OrganizationRole;
|
|
61
|
-
id?: string;
|
|
62
|
-
createdAt?: Date;
|
|
63
|
-
updatedAt?: Date;
|
|
64
|
-
preferences?: Record<string, any> | null;
|
|
65
|
-
invitationId?: string | null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface Invitation {
|
|
69
|
-
id: string;
|
|
70
|
-
createdAt: Date;
|
|
71
|
-
organizationId: string;
|
|
72
|
-
role: OrganizationRole;
|
|
73
|
-
invitedBy: string;
|
|
74
|
-
email: string;
|
|
75
|
-
token: string;
|
|
76
|
-
expiresAt: Date;
|
|
77
|
-
acceptedAt: Date | null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface NewInvitation {
|
|
81
|
-
organizationId: string;
|
|
82
|
-
role: OrganizationRole;
|
|
83
|
-
invitedBy: string;
|
|
84
|
-
email: string;
|
|
85
|
-
token: string;
|
|
86
|
-
expiresAt: Date;
|
|
87
|
-
id?: string;
|
|
88
|
-
createdAt?: Date;
|
|
89
|
-
acceptedAt?: Date | null;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface UserSession {
|
|
93
|
-
updatedAt: Date;
|
|
94
|
-
userId: string;
|
|
95
|
-
activeOrganizationId: string | null;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface NewUserSession {
|
|
99
|
-
userId: string;
|
|
100
|
-
updatedAt?: Date;
|
|
101
|
-
activeOrganizationId?: string | null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Helper type for organization with member info
|
|
105
|
-
export interface OrganizationMembership {
|
|
106
|
-
organization: Organization;
|
|
107
|
-
member: OrganizationMember;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Helper type for member with user info
|
|
111
|
-
export interface OrganizationMemberWithUser {
|
|
112
|
-
member: OrganizationMember;
|
|
113
|
-
user: {
|
|
114
|
-
id: string;
|
|
115
|
-
email: string;
|
|
116
|
-
name: string | null;
|
|
117
|
-
image: string | null;
|
|
118
|
-
};
|
|
119
|
-
}
|
package/src/types/schemas.ts
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
// types/schemas.ts
|
|
2
|
-
import type { Rule } from '../field-validation/rule.js';
|
|
3
|
-
|
|
4
|
-
// From root types.ts
|
|
5
|
-
export type FieldType =
|
|
6
|
-
| 'string'
|
|
7
|
-
| 'text'
|
|
8
|
-
| 'number'
|
|
9
|
-
| 'boolean'
|
|
10
|
-
| 'slug'
|
|
11
|
-
| 'image'
|
|
12
|
-
| 'array'
|
|
13
|
-
| 'object'
|
|
14
|
-
| 'reference';
|
|
15
|
-
|
|
16
|
-
export interface BaseField {
|
|
17
|
-
name: string;
|
|
18
|
-
type: FieldType;
|
|
19
|
-
title: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
validation?: ((rule: Rule) => Rule) | Array<(rule: Rule) => Rule>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface StringField extends BaseField {
|
|
25
|
-
type: 'string';
|
|
26
|
-
maxLength?: number;
|
|
27
|
-
placeholder?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface TextField extends BaseField {
|
|
31
|
-
type: 'text';
|
|
32
|
-
rows?: number;
|
|
33
|
-
maxLength?: number;
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface NumberField extends BaseField {
|
|
38
|
-
type: 'number';
|
|
39
|
-
min?: number;
|
|
40
|
-
max?: number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface BooleanField extends BaseField {
|
|
44
|
-
type: 'boolean';
|
|
45
|
-
initialValue?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface SlugField extends BaseField {
|
|
49
|
-
type: 'slug';
|
|
50
|
-
source?: string;
|
|
51
|
-
maxLength?: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface ImageField extends BaseField {
|
|
55
|
-
type: 'image';
|
|
56
|
-
accept?: string;
|
|
57
|
-
hotspot?: boolean; // Enable hotspot/crop UI
|
|
58
|
-
metadata?: string[]; // e.g., ['palette', 'exif', 'location']
|
|
59
|
-
fields?: Field[]; // Additional fields like caption, attribution
|
|
60
|
-
private?: boolean; // Default: false (public). Set true to require auth for access
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface TypeReference {
|
|
64
|
-
type: string; // References a SchemaType by name
|
|
65
|
-
title?: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface ArrayField extends BaseField {
|
|
69
|
-
type: 'array';
|
|
70
|
-
of: TypeReference[];
|
|
71
|
-
max?: number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ObjectField extends BaseField {
|
|
75
|
-
type: 'object';
|
|
76
|
-
fields: Field[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface ReferenceField extends BaseField {
|
|
80
|
-
type: 'reference';
|
|
81
|
-
to: Array<{ type: string }>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type Field =
|
|
85
|
-
| StringField
|
|
86
|
-
| TextField
|
|
87
|
-
| NumberField
|
|
88
|
-
| BooleanField
|
|
89
|
-
| SlugField
|
|
90
|
-
| ImageField
|
|
91
|
-
| ArrayField
|
|
92
|
-
| ObjectField
|
|
93
|
-
| ReferenceField;
|
|
94
|
-
|
|
95
|
-
export interface PreviewConfig {
|
|
96
|
-
select?: {
|
|
97
|
-
title?: string;
|
|
98
|
-
subtitle?: string;
|
|
99
|
-
media?: string;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface DocumentType {
|
|
104
|
-
id: string;
|
|
105
|
-
type: 'document';
|
|
106
|
-
name: string;
|
|
107
|
-
title: string;
|
|
108
|
-
description?: string;
|
|
109
|
-
fields: Field[];
|
|
110
|
-
preview?: PreviewConfig;
|
|
111
|
-
createdAt: Date | null;
|
|
112
|
-
updatedAt: Date | null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface ObjectType {
|
|
116
|
-
type: 'object';
|
|
117
|
-
name: string;
|
|
118
|
-
title: string;
|
|
119
|
-
description?: string;
|
|
120
|
-
fields: Field[];
|
|
121
|
-
preview?: PreviewConfig;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// From db/types.ts
|
|
125
|
-
/**
|
|
126
|
-
* Schema type - represents document and object type definitions stored in the DB
|
|
127
|
-
*/
|
|
128
|
-
// Schema type for all definitions
|
|
129
|
-
export interface SchemaType {
|
|
130
|
-
id?: string;
|
|
131
|
-
type: 'document' | 'object';
|
|
132
|
-
name: string;
|
|
133
|
-
title: string;
|
|
134
|
-
description?: string;
|
|
135
|
-
fields: Field[];
|
|
136
|
-
preview?: PreviewConfig;
|
|
137
|
-
createdAt?: Date | null;
|
|
138
|
-
updatedAt?: Date | null;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface NewSchemaType {
|
|
142
|
-
id?: string;
|
|
143
|
-
type: 'document' | 'object';
|
|
144
|
-
name: string;
|
|
145
|
-
title: string;
|
|
146
|
-
description?: string;
|
|
147
|
-
fields: Field[];
|
|
148
|
-
preview?: PreviewConfig;
|
|
149
|
-
createdAt?: Date | null;
|
|
150
|
-
updatedAt?: Date | null;
|
|
151
|
-
}
|
package/src/types/sidebar.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Sidebar data types - extensible interfaces for admin UI
|
|
2
|
-
export interface SidebarUser {
|
|
3
|
-
id: string;
|
|
4
|
-
email: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
image?: string;
|
|
7
|
-
role?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface SidebarNavItem {
|
|
11
|
-
href: string;
|
|
12
|
-
label: string;
|
|
13
|
-
icon?: string;
|
|
14
|
-
badge?: string | number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SidebarBranding {
|
|
18
|
-
title?: string;
|
|
19
|
-
logo?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface SidebarOrganization {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
slug: string;
|
|
26
|
-
role: 'owner' | 'admin' | 'editor' | 'viewer';
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
metadata?: any;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface SidebarData {
|
|
32
|
-
user: SidebarUser;
|
|
33
|
-
branding?: SidebarBranding;
|
|
34
|
-
navItems?: SidebarNavItem[]; // Optional custom nav items (defaults to Content)
|
|
35
|
-
organizations?: SidebarOrganization[]; // User's organizations for organization switcher
|
|
36
|
-
activeOrganization?: SidebarOrganization; // Currently active organization
|
|
37
|
-
}
|
package/src/types/user.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Represents the data stored in the cms_user_profiles table.
|
|
2
|
-
export interface UserProfile {
|
|
3
|
-
userId: string;
|
|
4
|
-
role: 'super_admin' | 'admin' | 'editor' | 'viewer';
|
|
5
|
-
preferences?: Record<string, any>;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// Represents the core user data from the auth provider.
|
|
9
|
-
export interface AuthUser {
|
|
10
|
-
id: string;
|
|
11
|
-
email: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
image?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// The final, combined object, composed from the two types above.
|
|
17
|
-
export interface CMSUser extends AuthUser, Omit<UserProfile, 'userId'> {}
|