@actuate-media/cms-core 0.13.0 → 0.14.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 (55) hide show
  1. package/LICENSE +21 -21
  2. package/dist/__tests__/api/api-key-auth.test.d.ts +2 -0
  3. package/dist/__tests__/api/api-key-auth.test.d.ts.map +1 -0
  4. package/dist/__tests__/api/api-key-auth.test.js +217 -0
  5. package/dist/__tests__/api/api-key-auth.test.js.map +1 -0
  6. package/dist/__tests__/security/api-key-enhanced.test.d.ts +2 -0
  7. package/dist/__tests__/security/api-key-enhanced.test.d.ts.map +1 -0
  8. package/dist/__tests__/security/api-key-enhanced.test.js +110 -0
  9. package/dist/__tests__/security/api-key-enhanced.test.js.map +1 -0
  10. package/dist/api/handler-factory.d.ts.map +1 -1
  11. package/dist/api/handler-factory.js +19 -2
  12. package/dist/api/handler-factory.js.map +1 -1
  13. package/dist/api/handlers.d.ts.map +1 -1
  14. package/dist/api/handlers.js +427 -30
  15. package/dist/api/handlers.js.map +1 -1
  16. package/dist/security/api-key-enhanced.d.ts +48 -5
  17. package/dist/security/api-key-enhanced.d.ts.map +1 -1
  18. package/dist/security/api-key-enhanced.js +60 -9
  19. package/dist/security/api-key-enhanced.js.map +1 -1
  20. package/generated/browser.ts +109 -0
  21. package/generated/client.ts +133 -0
  22. package/generated/commonInputTypes.ts +709 -0
  23. package/generated/enums.ts +125 -0
  24. package/generated/internal/class.ts +376 -0
  25. package/generated/internal/prismaNamespace.ts +2617 -0
  26. package/generated/internal/prismaNamespaceBrowser.ts +611 -0
  27. package/generated/models/ApiKey.ts +1550 -0
  28. package/generated/models/AuditLog.ts +1206 -0
  29. package/generated/models/BackupRecord.ts +1250 -0
  30. package/generated/models/ContentLock.ts +1472 -0
  31. package/generated/models/ContentTemplate.ts +1416 -0
  32. package/generated/models/Document.ts +3005 -0
  33. package/generated/models/Folder.ts +1904 -0
  34. package/generated/models/FormSubmission.ts +1200 -0
  35. package/generated/models/InAppNotification.ts +1457 -0
  36. package/generated/models/Media.ts +2340 -0
  37. package/generated/models/MediaUsage.ts +1472 -0
  38. package/generated/models/OAuthAccount.ts +1463 -0
  39. package/generated/models/Redirect.ts +1284 -0
  40. package/generated/models/Session.ts +1492 -0
  41. package/generated/models/Site.ts +1206 -0
  42. package/generated/models/User.ts +3513 -0
  43. package/generated/models/Version.ts +1511 -0
  44. package/generated/models/WorkflowState.ts +1514 -0
  45. package/generated/models.ts +29 -0
  46. package/package.json +1 -1
  47. package/prisma/cms-schema.prisma +306 -306
  48. package/prisma/migrations/0001_init/migration.sql +384 -384
  49. package/prisma/migrations/0002_folders/migration.sql +39 -39
  50. package/prisma/migrations/0003_search_and_webhooks/migration.sql +50 -50
  51. package/prisma/migrations/0004_script_tags/migration.sql +21 -21
  52. package/prisma/migrations/0005_password_reset_tokens/migration.sql +20 -20
  53. package/prisma/migrations/0006_page_builder/migration.sql +38 -38
  54. package/prisma/migrations/migration_lock.toml +3 -3
  55. package/prisma/schema.prisma +549 -549
@@ -1,18 +1,45 @@
1
+ /**
2
+ * API key generation and scope validation.
3
+ *
4
+ * Keys are formatted `act_sk_<64 hex chars>`. We store only a SHA-256 hash of
5
+ * the key in the database; the raw key is shown to the user exactly once at
6
+ * creation time. The first 15 chars (`act_sk_` + 8 hex) are stored as
7
+ * `keyPrefix` so the admin UI can display a human-recognizable token without
8
+ * leaking the secret half.
9
+ */
1
10
  export interface ApiKeyScope {
11
+ /**
12
+ * Collection slugs the key is allowed to act on. Use `'*'` for all
13
+ * collections. Omit/empty to deny collection access entirely.
14
+ */
2
15
  collections?: string[];
16
+ /**
17
+ * Actions allowed on the listed collections. Omit/empty to deny.
18
+ */
3
19
  actions?: ('read' | 'create' | 'update' | 'delete')[];
20
+ /**
21
+ * Global slugs the key is allowed to read or update. `'*'` for all.
22
+ */
4
23
  globals?: string[];
24
+ /** When true, the key can upload/manage media. */
5
25
  media?: boolean;
26
+ /**
27
+ * When true, the key can call AI page-builder endpoints (`/page-builder/*`).
28
+ * AI generation is expensive — issue this scope sparingly.
29
+ */
30
+ pageBuilder?: boolean;
31
+ /**
32
+ * When true, the key has full admin access (can manage users, settings,
33
+ * other API keys). Equivalent to a logged-in ADMIN session.
34
+ */
35
+ admin?: boolean;
6
36
  }
7
37
  export interface EnhancedApiKeyConfig {
38
+ /** Token prefix (always `act_sk` for live keys). */
8
39
  prefix: string;
9
40
  scopes: ApiKeyScope;
10
41
  ipRestrictions?: string[];
11
42
  expiresAt?: Date;
12
- rateLimit?: {
13
- maxRequests: number;
14
- windowMs: number;
15
- };
16
43
  }
17
44
  /** Generate a new API key with scoped permissions. */
18
45
  export declare function generateApiKey(config: EnhancedApiKeyConfig): Promise<{
@@ -20,6 +47,22 @@ export declare function generateApiKey(config: EnhancedApiKeyConfig): Promise<{
20
47
  keyHash: string;
21
48
  keyPrefix: string;
22
49
  }>;
23
- /** Validate an API key's scopes against a requested action. */
50
+ /** SHA-256 hash a raw API key for lookup. */
51
+ export declare function hashApiKey(rawKey: string): Promise<string>;
52
+ /** True when the request's bearer token looks like an API key (vs a session JWT). */
53
+ export declare function looksLikeApiKey(token: string): boolean;
54
+ /**
55
+ * Validate an API key's scopes against a collection action. Returns true when
56
+ * the key is permitted to perform `action` on `collection`. Admin keys always
57
+ * pass.
58
+ */
24
59
  export declare function validateApiKeyScope(scopes: ApiKeyScope, collection: string, action: 'read' | 'create' | 'update' | 'delete'): boolean;
60
+ /** Validate scope for a global action. */
61
+ export declare function validateApiKeyGlobalScope(scopes: ApiKeyScope, slug: string): boolean;
62
+ /** Validate scope for media uploads/management. */
63
+ export declare function validateApiKeyMediaScope(scopes: ApiKeyScope): boolean;
64
+ /** Validate scope for page-builder/AI endpoints. */
65
+ export declare function validateApiKeyPageBuilderScope(scopes: ApiKeyScope): boolean;
66
+ /** Validate IP restrictions against the request's client IP. */
67
+ export declare function validateApiKeyIp(restrictions: string[] | null | undefined, ip: string): boolean;
25
68
  //# sourceMappingURL=api-key-enhanced.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key-enhanced.d.ts","sourceRoot":"","sources":["../../src/security/api-key-enhanced.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAA;IACrD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,WAAW,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,SAAS,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CACtD;AAED,sDAAsD;AACtD,wBAAsB,cAAc,CAClC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAc9D;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAC9C,OAAO,CAQT"}
1
+ {"version":3,"file":"api-key-enhanced.d.ts","sourceRoot":"","sources":["../../src/security/api-key-enhanced.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,Q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;AAChE,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAI/F"}
@@ -1,3 +1,12 @@
1
+ /**
2
+ * API key generation and scope validation.
3
+ *
4
+ * Keys are formatted `act_sk_<64 hex chars>`. We store only a SHA-256 hash of
5
+ * the key in the database; the raw key is shown to the user exactly once at
6
+ * creation time. The first 15 chars (`act_sk_` + 8 hex) are stored as
7
+ * `keyPrefix` so the admin UI can display a human-recognizable token without
8
+ * leaking the secret half.
9
+ */
1
10
  /** Generate a new API key with scoped permissions. */
2
11
  export async function generateApiKey(config) {
3
12
  const rawBytes = crypto.getRandomValues(new Uint8Array(32));
@@ -5,21 +14,63 @@ export async function generateApiKey(config) {
5
14
  .map((b) => b.toString(16).padStart(2, '0'))
6
15
  .join('');
7
16
  const key = `${config.prefix}_${rawKey}`;
17
+ // First 8 hex chars after the underscore are safe to display (the remaining
18
+ // 56 hex chars provide >224 bits of entropy).
8
19
  const keyPrefix = key.slice(0, config.prefix.length + 9);
9
- const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key));
10
- const keyHash = Array.from(new Uint8Array(hashBuffer))
20
+ const keyHash = await hashApiKey(key);
21
+ return { key, keyHash, keyPrefix };
22
+ }
23
+ /** SHA-256 hash a raw API key for lookup. */
24
+ export async function hashApiKey(rawKey) {
25
+ const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(rawKey));
26
+ return Array.from(new Uint8Array(hashBuffer))
11
27
  .map((b) => b.toString(16).padStart(2, '0'))
12
28
  .join('');
13
- return { key, keyHash, keyPrefix };
14
29
  }
15
- /** Validate an API key's scopes against a requested action. */
30
+ /** True when the request's bearer token looks like an API key (vs a session JWT). */
31
+ export function looksLikeApiKey(token) {
32
+ return /^act_sk_[a-f0-9]{32,}$/i.test(token);
33
+ }
34
+ /**
35
+ * Validate an API key's scopes against a collection action. Returns true when
36
+ * the key is permitted to perform `action` on `collection`. Admin keys always
37
+ * pass.
38
+ */
16
39
  export function validateApiKeyScope(scopes, collection, action) {
17
- if (scopes.collections && !scopes.collections.includes(collection)) {
40
+ if (scopes.admin)
41
+ return true;
42
+ if (!scopes.collections || scopes.collections.length === 0)
43
+ return false;
44
+ if (!scopes.actions || !scopes.actions.includes(action))
18
45
  return false;
19
- }
20
- if (scopes.actions && !scopes.actions.includes(action)) {
46
+ if (scopes.collections.includes('*'))
47
+ return true;
48
+ return scopes.collections.includes(collection);
49
+ }
50
+ /** Validate scope for a global action. */
51
+ export function validateApiKeyGlobalScope(scopes, slug) {
52
+ if (scopes.admin)
53
+ return true;
54
+ if (!scopes.globals || scopes.globals.length === 0)
55
+ return false;
56
+ if (scopes.globals.includes('*'))
57
+ return true;
58
+ return scopes.globals.includes(slug);
59
+ }
60
+ /** Validate scope for media uploads/management. */
61
+ export function validateApiKeyMediaScope(scopes) {
62
+ return scopes.admin === true || scopes.media === true;
63
+ }
64
+ /** Validate scope for page-builder/AI endpoints. */
65
+ export function validateApiKeyPageBuilderScope(scopes) {
66
+ return scopes.admin === true || scopes.pageBuilder === true;
67
+ }
68
+ /** Validate IP restrictions against the request's client IP. */
69
+ export function validateApiKeyIp(restrictions, ip) {
70
+ if (!restrictions || restrictions.length === 0)
71
+ return true;
72
+ if (!ip || ip === 'unknown')
21
73
  return false;
22
- }
23
- return true;
74
+ return restrictions.includes(ip);
24
75
  }
25
76
  //# sourceMappingURL=api-key-enhanced.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key-enhanced.js","sourceRoot":"","sources":["../../src/security/api-key-enhanced.ts"],"names":[],"mappings":"AAeA,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA4B;IAE5B,MAAM,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,QAA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,KAAK,IAAI,CAAA;AACvD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,8BAA8B,CAAC,MAAmB;IAChE,OAAO,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,CAAA;AAC7D,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,gBAAgB,CAAC,YAAyC,EAAE,EAAU;IACpF,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3D,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,KAAK,CAAA;IACzC,OAAO,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAClC,CAAC"}
@@ -0,0 +1,109 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ // @ts-nocheck
6
+ /*
7
+ * This file should be your main import to use Prisma-related types and utilities in a browser.
8
+ * Use it to get access to models, enums, and input types.
9
+ *
10
+ * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
11
+ * See `client.ts` for the standard, server-side entry point.
12
+ *
13
+ * 🟢 You can import this file directly.
14
+ */
15
+
16
+ import * as Prisma from './internal/prismaNamespaceBrowser'
17
+ export { Prisma }
18
+ export * as $Enums from './enums'
19
+ export * from './enums';
20
+ /**
21
+ * Model User
22
+ *
23
+ */
24
+ export type User = Prisma.UserModel
25
+ /**
26
+ * Model OAuthAccount
27
+ *
28
+ */
29
+ export type OAuthAccount = Prisma.OAuthAccountModel
30
+ /**
31
+ * Model Session
32
+ *
33
+ */
34
+ export type Session = Prisma.SessionModel
35
+ /**
36
+ * Model ApiKey
37
+ *
38
+ */
39
+ export type ApiKey = Prisma.ApiKeyModel
40
+ /**
41
+ * Model AuditLog
42
+ *
43
+ */
44
+ export type AuditLog = Prisma.AuditLogModel
45
+ /**
46
+ * Model Folder
47
+ *
48
+ */
49
+ export type Folder = Prisma.FolderModel
50
+ /**
51
+ * Model Document
52
+ *
53
+ */
54
+ export type Document = Prisma.DocumentModel
55
+ /**
56
+ * Model Version
57
+ *
58
+ */
59
+ export type Version = Prisma.VersionModel
60
+ /**
61
+ * Model Media
62
+ *
63
+ */
64
+ export type Media = Prisma.MediaModel
65
+ /**
66
+ * Model MediaUsage
67
+ *
68
+ */
69
+ export type MediaUsage = Prisma.MediaUsageModel
70
+ /**
71
+ * Model ContentLock
72
+ *
73
+ */
74
+ export type ContentLock = Prisma.ContentLockModel
75
+ /**
76
+ * Model InAppNotification
77
+ *
78
+ */
79
+ export type InAppNotification = Prisma.InAppNotificationModel
80
+ /**
81
+ * Model ContentTemplate
82
+ *
83
+ */
84
+ export type ContentTemplate = Prisma.ContentTemplateModel
85
+ /**
86
+ * Model Site
87
+ *
88
+ */
89
+ export type Site = Prisma.SiteModel
90
+ /**
91
+ * Model WorkflowState
92
+ *
93
+ */
94
+ export type WorkflowState = Prisma.WorkflowStateModel
95
+ /**
96
+ * Model Redirect
97
+ *
98
+ */
99
+ export type Redirect = Prisma.RedirectModel
100
+ /**
101
+ * Model FormSubmission
102
+ *
103
+ */
104
+ export type FormSubmission = Prisma.FormSubmissionModel
105
+ /**
106
+ * Model BackupRecord
107
+ *
108
+ */
109
+ export type BackupRecord = Prisma.BackupRecordModel
@@ -0,0 +1,133 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ // @ts-nocheck
6
+ /*
7
+ * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
8
+ * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
9
+ *
10
+ * 🟢 You can import this file directly.
11
+ */
12
+
13
+ import * as process from 'node:process'
14
+ import * as path from 'node:path'
15
+ import { fileURLToPath } from 'node:url'
16
+ globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
17
+
18
+ import * as runtime from "@prisma/client/runtime/client"
19
+ import * as $Enums from "./enums"
20
+ import * as $Class from "./internal/class"
21
+ import * as Prisma from "./internal/prismaNamespace"
22
+
23
+ export * as $Enums from './enums'
24
+ export * from "./enums"
25
+ /**
26
+ * ## Prisma Client
27
+ *
28
+ * Type-safe database client for TypeScript
29
+ * @example
30
+ * ```
31
+ * const prisma = new PrismaClient({
32
+ * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
33
+ * })
34
+ * // Fetch zero or more Users
35
+ * const users = await prisma.user.findMany()
36
+ * ```
37
+ *
38
+ * Read more in our [docs](https://pris.ly/d/client).
39
+ */
40
+ export const PrismaClient = $Class.getPrismaClientClass()
41
+ export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
42
+ export { Prisma }
43
+
44
+ /**
45
+ * Model User
46
+ *
47
+ */
48
+ export type User = Prisma.UserModel
49
+ /**
50
+ * Model OAuthAccount
51
+ *
52
+ */
53
+ export type OAuthAccount = Prisma.OAuthAccountModel
54
+ /**
55
+ * Model Session
56
+ *
57
+ */
58
+ export type Session = Prisma.SessionModel
59
+ /**
60
+ * Model ApiKey
61
+ *
62
+ */
63
+ export type ApiKey = Prisma.ApiKeyModel
64
+ /**
65
+ * Model AuditLog
66
+ *
67
+ */
68
+ export type AuditLog = Prisma.AuditLogModel
69
+ /**
70
+ * Model Folder
71
+ *
72
+ */
73
+ export type Folder = Prisma.FolderModel
74
+ /**
75
+ * Model Document
76
+ *
77
+ */
78
+ export type Document = Prisma.DocumentModel
79
+ /**
80
+ * Model Version
81
+ *
82
+ */
83
+ export type Version = Prisma.VersionModel
84
+ /**
85
+ * Model Media
86
+ *
87
+ */
88
+ export type Media = Prisma.MediaModel
89
+ /**
90
+ * Model MediaUsage
91
+ *
92
+ */
93
+ export type MediaUsage = Prisma.MediaUsageModel
94
+ /**
95
+ * Model ContentLock
96
+ *
97
+ */
98
+ export type ContentLock = Prisma.ContentLockModel
99
+ /**
100
+ * Model InAppNotification
101
+ *
102
+ */
103
+ export type InAppNotification = Prisma.InAppNotificationModel
104
+ /**
105
+ * Model ContentTemplate
106
+ *
107
+ */
108
+ export type ContentTemplate = Prisma.ContentTemplateModel
109
+ /**
110
+ * Model Site
111
+ *
112
+ */
113
+ export type Site = Prisma.SiteModel
114
+ /**
115
+ * Model WorkflowState
116
+ *
117
+ */
118
+ export type WorkflowState = Prisma.WorkflowStateModel
119
+ /**
120
+ * Model Redirect
121
+ *
122
+ */
123
+ export type Redirect = Prisma.RedirectModel
124
+ /**
125
+ * Model FormSubmission
126
+ *
127
+ */
128
+ export type FormSubmission = Prisma.FormSubmissionModel
129
+ /**
130
+ * Model BackupRecord
131
+ *
132
+ */
133
+ export type BackupRecord = Prisma.BackupRecordModel