primitive-admin 1.1.0 → 1.2.0-alpha.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.
- package/README.md +11 -11
- package/assets/skill/skills/primitive-platform/SKILL.md +6 -0
- package/dist/src/commands/collections.js +20 -17
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/database-types.js +13 -313
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.js +0 -19
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/groups.js +16 -0
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/llm.js +9 -6
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/settings.d.ts +18 -0
- package/dist/src/commands/settings.js +54 -0
- package/dist/src/commands/settings.js.map +1 -0
- package/dist/src/commands/sync.d.ts +1 -4
- package/dist/src/commands/sync.js +42 -45
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/workflows.js +3 -3
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +3 -40
- package/dist/src/lib/api-client.js +20 -69
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-match-guard.d.ts +44 -0
- package/dist/src/lib/app-match-guard.js +72 -0
- package/dist/src/lib/app-match-guard.js.map +1 -0
- package/dist/src/lib/collection-export.d.ts +37 -9
- package/dist/src/lib/collection-export.js +48 -12
- package/dist/src/lib/collection-export.js.map +1 -1
- package/dist/src/lib/function-triggers.d.ts +66 -0
- package/dist/src/lib/function-triggers.js +285 -0
- package/dist/src/lib/function-triggers.js.map +1 -0
- package/dist/src/lib/generated-allowlist.js +0 -1
- package/dist/src/lib/generated-allowlist.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.js +56 -32
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/generated-workflow-model-fields.d.ts +20 -0
- package/dist/src/lib/generated-workflow-model-fields.js +53 -0
- package/dist/src/lib/generated-workflow-model-fields.js.map +1 -0
- package/dist/src/lib/google-client-secret-status.d.ts +35 -0
- package/dist/src/lib/google-client-secret-status.js +56 -0
- package/dist/src/lib/google-client-secret-status.js.map +1 -0
- package/dist/src/lib/log-inspection.d.ts +1 -6
- package/dist/src/lib/log-inspection.js +5 -7
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/migration-nag.d.ts +2 -2
- package/dist/src/lib/migration-nag.js +4 -3
- package/dist/src/lib/migration-nag.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +8 -24
- package/dist/src/lib/paginate.js +8 -21
- package/dist/src/lib/paginate.js.map +1 -1
- package/dist/src/lib/sync-dir-selector.d.ts +1 -1
- package/dist/src/lib/sync-dir-selector.js +1 -1
- package/dist/src/lib/toml-database-config.js +2 -2
- package/dist/src/lib/toml-database-config.js.map +1 -1
- package/dist/src/lib/workflow-field-descriptor.d.ts +91 -0
- package/dist/src/lib/workflow-field-descriptor.js +153 -0
- package/dist/src/lib/workflow-field-descriptor.js.map +1 -0
- package/package.json +2 -2
|
@@ -44,7 +44,6 @@ export interface ExportedCollection {
|
|
|
44
44
|
name: string;
|
|
45
45
|
description: string | null;
|
|
46
46
|
collectionType: string | null;
|
|
47
|
-
contextId: string | null;
|
|
48
47
|
createdAt: string | null;
|
|
49
48
|
owner: ExportedOwner | null;
|
|
50
49
|
documents: ExportedCollectionDocument[];
|
|
@@ -58,6 +57,16 @@ export interface CollectionExportFile {
|
|
|
58
57
|
collectionCount: number;
|
|
59
58
|
collections: ExportedCollection[];
|
|
60
59
|
}
|
|
60
|
+
/** A file as the import reads it: the file, plus what reading it counted. */
|
|
61
|
+
export interface ReadCollectionExportFile extends CollectionExportFile {
|
|
62
|
+
/**
|
|
63
|
+
* How many collections in the file carry a non-empty `contextId`. Files
|
|
64
|
+
* exported before the platform removed the field (#3926) still have one; it
|
|
65
|
+
* is read only to be counted, so the import can say once that it is not
|
|
66
|
+
* carried across. Never written.
|
|
67
|
+
*/
|
|
68
|
+
legacyContextIdCount: number;
|
|
69
|
+
}
|
|
61
70
|
/**
|
|
62
71
|
* Resolve the `<path>` an import was given to the file it must read.
|
|
63
72
|
*
|
|
@@ -71,7 +80,7 @@ export declare function resolveCollectionExportPath(inputPath: string): string;
|
|
|
71
80
|
* Every refusal here happens BEFORE any request: a file this CLI cannot read
|
|
72
81
|
* is not a reason to start writing collections into the target app.
|
|
73
82
|
*/
|
|
74
|
-
export declare function readCollectionExportFile(inputPath: string):
|
|
83
|
+
export declare function readCollectionExportFile(inputPath: string): ReadCollectionExportFile;
|
|
75
84
|
export type CollectionImportAction = "create" | "merge" | "skip" | "refused";
|
|
76
85
|
/** Which part of a collection a per-item problem is about. */
|
|
77
86
|
export type CollectionProblemKind = "owner" | "collection" | "document" | "member" | "group";
|
|
@@ -88,15 +97,20 @@ export interface ExistingTargetCollection {
|
|
|
88
97
|
collectionId: string;
|
|
89
98
|
createdBy: string;
|
|
90
99
|
collectionType: string | null;
|
|
91
|
-
contextId: string | null;
|
|
92
100
|
}
|
|
93
101
|
export interface CollectionResolution {
|
|
94
102
|
/** The userId the owner resolved to in the TARGET app, or null. */
|
|
95
103
|
ownerUserId: string | null;
|
|
96
104
|
/** Why the owner could not be resolved — becomes the refusal's reason. */
|
|
97
105
|
ownerReason?: string;
|
|
98
|
-
/** The target collection carrying this exact name, if any. */
|
|
106
|
+
/** The ONE target collection carrying this exact name, if any. */
|
|
99
107
|
existing?: ExistingTargetCollection | null;
|
|
108
|
+
/**
|
|
109
|
+
* Every target collection id carrying this exact name, when more than one
|
|
110
|
+
* does. A name is a label, not an identity (#3925), so matching by name
|
|
111
|
+
* cannot choose between them.
|
|
112
|
+
*/
|
|
113
|
+
ambiguousTargetIds?: string[] | null;
|
|
100
114
|
/** The source id of an earlier collection in the same file with this name. */
|
|
101
115
|
duplicateOfSourceId?: string | null;
|
|
102
116
|
}
|
|
@@ -114,14 +128,15 @@ export interface CollectionPlanRow {
|
|
|
114
128
|
problem?: Omit<CollectionImportProblem, "sourceCollectionId" | "name">;
|
|
115
129
|
}
|
|
116
130
|
/**
|
|
117
|
-
* Which of `createdBy
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
131
|
+
* Which of `createdBy` and `collectionType` a name match differs on — the
|
|
132
|
+
* fields the server will never let an update change (`collections-controller.ts`
|
|
133
|
+
* rejects a type change; `createdBy` is immutable), so a difference cannot be
|
|
134
|
+
* merged away (F2). A `contextId` an older file still carries is not compared:
|
|
135
|
+
* the platform removed the field (#3926), so it is no difference at all.
|
|
121
136
|
*
|
|
122
137
|
* Returns null when the match is compatible.
|
|
123
138
|
*/
|
|
124
|
-
export declare function incompatibleField(collection: Pick<ExportedCollection, "collectionType"
|
|
139
|
+
export declare function incompatibleField(collection: Pick<ExportedCollection, "collectionType">, existing: ExistingTargetCollection, ownerUserId: string): "owner" | "collectionType" | null;
|
|
125
140
|
/** What to do about one recorded group grant, given the target's grants. */
|
|
126
141
|
export type GrantDisposition = "grant" | "already-applied" | "update";
|
|
127
142
|
/**
|
|
@@ -164,6 +179,19 @@ export declare function planCollection(collection: ExportedCollection, resolutio
|
|
|
164
179
|
* maps to it here and is refused.
|
|
165
180
|
*/
|
|
166
181
|
export declare function duplicateNameSources(collections: ExportedCollection[]): Map<string, string>;
|
|
182
|
+
/**
|
|
183
|
+
* The target app's collections grouped by name, in listing order.
|
|
184
|
+
*
|
|
185
|
+
* A name is a label, not an identity (#3925), so one name may map to several
|
|
186
|
+
* collections; the resolve phase passes a lone match on as `existing` and more
|
|
187
|
+
* than one as `ambiguousTargetIds`.
|
|
188
|
+
*/
|
|
189
|
+
export declare function groupTargetsByName(rows: Array<{
|
|
190
|
+
collectionId: string;
|
|
191
|
+
name: string;
|
|
192
|
+
createdBy: string;
|
|
193
|
+
collectionType?: string | null;
|
|
194
|
+
}>): Map<string, ExistingTargetCollection[]>;
|
|
167
195
|
export interface CollectionImportSummary {
|
|
168
196
|
created: number;
|
|
169
197
|
merged: number;
|
|
@@ -58,19 +58,22 @@ export function readCollectionExportFile(inputPath) {
|
|
|
58
58
|
`this CLI reads version ${COLLECTION_EXPORT_VERSION} only.`);
|
|
59
59
|
}
|
|
60
60
|
const collections = Array.isArray(parsed.collections) ? parsed.collections : [];
|
|
61
|
+
const legacyContextIdCount = collections.filter((c) => typeof c?.contextId === "string" && c.contextId !== "").length;
|
|
61
62
|
return {
|
|
62
63
|
version: parsed.version,
|
|
63
64
|
exportedAt: String(parsed.exportedAt ?? ""),
|
|
64
65
|
sourceAppId: String(parsed.sourceAppId ?? ""),
|
|
65
66
|
collectionCount: Number(parsed.collectionCount ?? collections.length),
|
|
66
67
|
collections,
|
|
68
|
+
legacyContextIdCount,
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
|
-
* Which of `createdBy
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Which of `createdBy` and `collectionType` a name match differs on — the
|
|
73
|
+
* fields the server will never let an update change (`collections-controller.ts`
|
|
74
|
+
* rejects a type change; `createdBy` is immutable), so a difference cannot be
|
|
75
|
+
* merged away (F2). A `contextId` an older file still carries is not compared:
|
|
76
|
+
* the platform removed the field (#3926), so it is no difference at all.
|
|
74
77
|
*
|
|
75
78
|
* Returns null when the match is compatible.
|
|
76
79
|
*/
|
|
@@ -82,9 +85,6 @@ export function incompatibleField(collection, existing, ownerUserId) {
|
|
|
82
85
|
const wanted = collection.collectionType || "default";
|
|
83
86
|
if ((existing.collectionType || "default") !== wanted)
|
|
84
87
|
return "collectionType";
|
|
85
|
-
if ((existing.contextId ?? null) !== (collection.contextId ?? null)) {
|
|
86
|
-
return "contextId";
|
|
87
|
-
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -136,17 +136,17 @@ export function planCollection(collection, resolution, options) {
|
|
|
136
136
|
sourceCollectionId: collection.collectionId,
|
|
137
137
|
name: collection.name,
|
|
138
138
|
};
|
|
139
|
-
//
|
|
140
|
-
// could not
|
|
141
|
-
// naming both source ids.
|
|
139
|
+
// The import matches by name, so two collections in one file that share one
|
|
140
|
+
// could not be told apart on a re-run. The second is refused before
|
|
141
|
+
// anything is written, naming both source ids.
|
|
142
142
|
if (resolution.duplicateOfSourceId) {
|
|
143
143
|
return {
|
|
144
144
|
...base,
|
|
145
145
|
action: "refused",
|
|
146
146
|
reason: `the export lists two collections named "${collection.name}" ` +
|
|
147
147
|
`(${resolution.duplicateOfSourceId} and ${collection.collectionId}); ` +
|
|
148
|
-
`
|
|
149
|
-
`one in the export and re-run.`,
|
|
148
|
+
`the import matches by name, so the file can describe only one ` +
|
|
149
|
+
`collection per name. Rename one in the export and re-run.`,
|
|
150
150
|
problem: {
|
|
151
151
|
kind: "collection",
|
|
152
152
|
id: collection.collectionId,
|
|
@@ -154,6 +154,22 @@ export function planCollection(collection, resolution, options) {
|
|
|
154
154
|
},
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
+
// Two or more target collections carry the name (#3925): the file could mean
|
|
158
|
+
// any of them, so neither a skip nor a merge is safe. Refused whatever
|
|
159
|
+
// --overwrite says, and ahead of the owner — one problem per collection.
|
|
160
|
+
const ambiguous = resolution.ambiguousTargetIds ?? [];
|
|
161
|
+
if (ambiguous.length > 1) {
|
|
162
|
+
const reason = `${ambiguous.length} collections named "${collection.name}" exist in ` +
|
|
163
|
+
`the target (${ambiguous.join(", ")}), and the import matches by name, ` +
|
|
164
|
+
`so it cannot tell which one the file means`;
|
|
165
|
+
return {
|
|
166
|
+
...base,
|
|
167
|
+
action: "refused",
|
|
168
|
+
reason: `${reason}. Rename or delete all but one of them in the target, or ` +
|
|
169
|
+
`rename the collection in the export, and re-run.`,
|
|
170
|
+
problem: { kind: "collection", id: collection.name, reason },
|
|
171
|
+
};
|
|
172
|
+
}
|
|
157
173
|
if (!resolution.ownerUserId) {
|
|
158
174
|
const reason = resolution.ownerReason ??
|
|
159
175
|
`its owner could not be resolved in the target app`;
|
|
@@ -228,6 +244,26 @@ export function duplicateNameSources(collections) {
|
|
|
228
244
|
}
|
|
229
245
|
return duplicates;
|
|
230
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* The target app's collections grouped by name, in listing order.
|
|
249
|
+
*
|
|
250
|
+
* A name is a label, not an identity (#3925), so one name may map to several
|
|
251
|
+
* collections; the resolve phase passes a lone match on as `existing` and more
|
|
252
|
+
* than one as `ambiguousTargetIds`.
|
|
253
|
+
*/
|
|
254
|
+
export function groupTargetsByName(rows) {
|
|
255
|
+
const byName = new Map();
|
|
256
|
+
for (const row of rows) {
|
|
257
|
+
const matches = byName.get(row.name) ?? [];
|
|
258
|
+
matches.push({
|
|
259
|
+
collectionId: row.collectionId,
|
|
260
|
+
createdBy: row.createdBy,
|
|
261
|
+
collectionType: row.collectionType ?? null,
|
|
262
|
+
});
|
|
263
|
+
byName.set(row.name, matches);
|
|
264
|
+
}
|
|
265
|
+
return byName;
|
|
266
|
+
}
|
|
231
267
|
export function emptyImportSummary() {
|
|
232
268
|
return {
|
|
233
269
|
created: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-export.js","sourceRoot":"","sources":["../../../src/lib/collection-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,sDAAsD;AACtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,mEAAmE;AACnE,MAAM,CAAC,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-export.js","sourceRoot":"","sources":["../../../src/lib/collection-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `[function.triggers.*]`, read and checked locally (#3181).
|
|
3
|
+
*
|
|
4
|
+
* The SERVER is the authority: it derives the declaration from the TOML bytes
|
|
5
|
+
* inside the version envelope and validates it there, so a direct API push
|
|
6
|
+
* cannot ship a trigger the authored file does not declare (D3181-005). What
|
|
7
|
+
* this file buys is the other half of the `entry` dual-validation shape #3179
|
|
8
|
+
* established — an author who mistypes a key hears about it against their own
|
|
9
|
+
* file, by name, before a request is made.
|
|
10
|
+
*
|
|
11
|
+
* It is deliberately a VENDORED copy of the shape rules in
|
|
12
|
+
* `src/server-functions/trigger-declaration.ts` rather than an import: the CLI
|
|
13
|
+
* compiles with `rootDir: "."` and cannot reach the worker sources, which is
|
|
14
|
+
* the same constraint that made `generated-config-surfaces.ts` a vendored
|
|
15
|
+
* artifact. `cli/tests/unit/function-triggers-3181.test.ts` drives both copies
|
|
16
|
+
* from one fixture list so they cannot drift apart silently.
|
|
17
|
+
*
|
|
18
|
+
* Everything that needs the APP's state stays on the server: whether a
|
|
19
|
+
* referenced secret exists, whether the scheme-specific config is valid under
|
|
20
|
+
* this environment's JWKS policy, whether the app is at its webhook or cron
|
|
21
|
+
* cap, whether a standalone webhook holds the key. A local copy of those would
|
|
22
|
+
* be a preflight that can give a false all-clear.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The resolved mode the declaration is checked against (#3281): the caller
|
|
26
|
+
* resolves `mode`/`durable` once through the vendored `resolveDeclaredMode`
|
|
27
|
+
* and hands the answer here, so this copy never reads the alias itself.
|
|
28
|
+
*/
|
|
29
|
+
export interface TriggerModeOptions {
|
|
30
|
+
mode?: "request" | "task";
|
|
31
|
+
}
|
|
32
|
+
export interface WebhookTriggerDeclaration {
|
|
33
|
+
verificationScheme: string;
|
|
34
|
+
signingSecret?: string;
|
|
35
|
+
toleranceSeconds?: number;
|
|
36
|
+
deduplicationEnabled?: boolean;
|
|
37
|
+
deduplicationWindowMs?: number;
|
|
38
|
+
maxBodyBytes?: number;
|
|
39
|
+
secretGracePeriodMs?: number;
|
|
40
|
+
verification?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface CronTriggerDeclaration {
|
|
43
|
+
name: string;
|
|
44
|
+
cron: string;
|
|
45
|
+
timezone?: string;
|
|
46
|
+
overlapPolicy?: string;
|
|
47
|
+
rootInput?: unknown;
|
|
48
|
+
}
|
|
49
|
+
/** One `[[function.triggers.database]]` entry, normalized (#3184). */
|
|
50
|
+
export interface DatabaseTriggerDeclaration {
|
|
51
|
+
type: string;
|
|
52
|
+
}
|
|
53
|
+
export interface TriggerDeclaration {
|
|
54
|
+
webhook: WebhookTriggerDeclaration | null;
|
|
55
|
+
cron: CronTriggerDeclaration[];
|
|
56
|
+
databases: DatabaseTriggerDeclaration[];
|
|
57
|
+
}
|
|
58
|
+
export declare const MAX_CRON_TRIGGERS_PER_FUNCTION = 10;
|
|
59
|
+
export declare const MAX_DATABASE_TRIGGERS_PER_FUNCTION = 5;
|
|
60
|
+
export declare class TriggerDeclarationError extends Error {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Normalize (and check) the `triggers` table of a parsed `[function]` table.
|
|
64
|
+
* Returns null when nothing is declared, so a caller can skip the work.
|
|
65
|
+
*/
|
|
66
|
+
export declare function normalizeFunctionTriggers(functionTable: any, options?: TriggerModeOptions): TriggerDeclaration | null;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `[function.triggers.*]`, read and checked locally (#3181).
|
|
3
|
+
*
|
|
4
|
+
* The SERVER is the authority: it derives the declaration from the TOML bytes
|
|
5
|
+
* inside the version envelope and validates it there, so a direct API push
|
|
6
|
+
* cannot ship a trigger the authored file does not declare (D3181-005). What
|
|
7
|
+
* this file buys is the other half of the `entry` dual-validation shape #3179
|
|
8
|
+
* established — an author who mistypes a key hears about it against their own
|
|
9
|
+
* file, by name, before a request is made.
|
|
10
|
+
*
|
|
11
|
+
* It is deliberately a VENDORED copy of the shape rules in
|
|
12
|
+
* `src/server-functions/trigger-declaration.ts` rather than an import: the CLI
|
|
13
|
+
* compiles with `rootDir: "."` and cannot reach the worker sources, which is
|
|
14
|
+
* the same constraint that made `generated-config-surfaces.ts` a vendored
|
|
15
|
+
* artifact. `cli/tests/unit/function-triggers-3181.test.ts` drives both copies
|
|
16
|
+
* from one fixture list so they cannot drift apart silently.
|
|
17
|
+
*
|
|
18
|
+
* Everything that needs the APP's state stays on the server: whether a
|
|
19
|
+
* referenced secret exists, whether the scheme-specific config is valid under
|
|
20
|
+
* this environment's JWKS policy, whether the app is at its webhook or cron
|
|
21
|
+
* cap, whether a standalone webhook holds the key. A local copy of those would
|
|
22
|
+
* be a preflight that can give a false all-clear.
|
|
23
|
+
*/
|
|
24
|
+
export const MAX_CRON_TRIGGERS_PER_FUNCTION = 10;
|
|
25
|
+
export const MAX_DATABASE_TRIGGERS_PER_FUNCTION = 5;
|
|
26
|
+
const CRON_NAME_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;
|
|
27
|
+
/** The charset the grant grammar already uses for a database type key. */
|
|
28
|
+
const DATABASE_TYPE_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
29
|
+
const DATABASE_KEYS = ["type"];
|
|
30
|
+
const WEBHOOK_KEYS = [
|
|
31
|
+
"verificationScheme",
|
|
32
|
+
"signingSecret",
|
|
33
|
+
"toleranceSeconds",
|
|
34
|
+
"deduplicationEnabled",
|
|
35
|
+
"deduplicationWindowMs",
|
|
36
|
+
"maxBodyBytes",
|
|
37
|
+
"secretGracePeriodMs",
|
|
38
|
+
"verification",
|
|
39
|
+
];
|
|
40
|
+
const CRON_KEYS = ["name", "cron", "timezone", "overlapPolicy", "rootInput"];
|
|
41
|
+
const VALID_OVERLAP_POLICIES = ["skip", "allow"];
|
|
42
|
+
export class TriggerDeclarationError extends Error {
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Normalize (and check) the `triggers` table of a parsed `[function]` table.
|
|
46
|
+
* Returns null when nothing is declared, so a caller can skip the work.
|
|
47
|
+
*/
|
|
48
|
+
export function normalizeFunctionTriggers(functionTable, options = {}) {
|
|
49
|
+
const triggers = functionTable?.triggers;
|
|
50
|
+
if (triggers === undefined || triggers === null)
|
|
51
|
+
return null;
|
|
52
|
+
if (typeof triggers !== "object" || Array.isArray(triggers)) {
|
|
53
|
+
throw new TriggerDeclarationError("[function.triggers] must be a table declaring `webhook` and/or `cron`");
|
|
54
|
+
}
|
|
55
|
+
for (const key of Object.keys(triggers)) {
|
|
56
|
+
if (key !== "webhook" && key !== "cron" && key !== "database") {
|
|
57
|
+
throw new TriggerDeclarationError(`unknown trigger kind '${key}' under [function.triggers]: the kinds are ` +
|
|
58
|
+
"`webhook`, `cron` and `database`");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const webhook = normalizeWebhook(triggers.webhook, options);
|
|
62
|
+
const cron = normalizeCron(triggers.cron, options);
|
|
63
|
+
const databases = normalizeDatabases(triggers.database, options);
|
|
64
|
+
if (!webhook && cron.length === 0 && databases.length === 0)
|
|
65
|
+
return null;
|
|
66
|
+
return { webhook, cron, databases };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `[[function.triggers.database]]` — one accepted key, `type` (#3184).
|
|
70
|
+
*
|
|
71
|
+
* Sync mode only, permanently: a database-change fire runs inside the write
|
|
72
|
+
* request with no run row, and there is no durable shape for that.
|
|
73
|
+
*/
|
|
74
|
+
function normalizeDatabases(raw, options) {
|
|
75
|
+
if (raw === undefined || raw === null)
|
|
76
|
+
return [];
|
|
77
|
+
const entries = Array.isArray(raw) ? raw : [raw];
|
|
78
|
+
if (entries.length === 0)
|
|
79
|
+
return [];
|
|
80
|
+
if (options.mode === "task") {
|
|
81
|
+
throw new TriggerDeclarationError("database triggers require request mode: set `mode = \"request\"` (or " +
|
|
82
|
+
"remove `mode = \"task\"`), or remove the [[function.triggers.database]] " +
|
|
83
|
+
"entries");
|
|
84
|
+
}
|
|
85
|
+
if (entries.length > MAX_DATABASE_TRIGGERS_PER_FUNCTION) {
|
|
86
|
+
throw new TriggerDeclarationError(`a function may watch at most ${MAX_DATABASE_TRIGGERS_PER_FUNCTION} database ` +
|
|
87
|
+
`types, and this one declares ${entries.length}`);
|
|
88
|
+
}
|
|
89
|
+
const seen = new Set();
|
|
90
|
+
const normalized = [];
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
93
|
+
throw new TriggerDeclarationError("each [[function.triggers.database]] entry must be a table");
|
|
94
|
+
}
|
|
95
|
+
const table = entry;
|
|
96
|
+
for (const key of Object.keys(table)) {
|
|
97
|
+
if (!DATABASE_KEYS.includes(key)) {
|
|
98
|
+
throw new TriggerDeclarationError(`unknown key '${key}' in a [[function.triggers.database]] entry: the ` +
|
|
99
|
+
`only accepted key is ${DATABASE_KEYS.join(", ")}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const type = String(table.type ?? "").trim();
|
|
103
|
+
if (!type) {
|
|
104
|
+
throw new TriggerDeclarationError("each [[function.triggers.database]] entry needs a `type`: it names the " +
|
|
105
|
+
"database type whose writes fire the function");
|
|
106
|
+
}
|
|
107
|
+
if (!DATABASE_TYPE_PATTERN.test(type)) {
|
|
108
|
+
throw new TriggerDeclarationError(`database trigger type '${type}' must contain only letters, digits, ` +
|
|
109
|
+
"'-' or '_'");
|
|
110
|
+
}
|
|
111
|
+
if (seen.has(type)) {
|
|
112
|
+
throw new TriggerDeclarationError(`duplicate database trigger type '${type}': a function fires once per ` +
|
|
113
|
+
"write request, so each type is declared once");
|
|
114
|
+
}
|
|
115
|
+
seen.add(type);
|
|
116
|
+
normalized.push({ type });
|
|
117
|
+
}
|
|
118
|
+
// Sorted, matching the server, so `config diff` compares the same canonical
|
|
119
|
+
// shape whichever order the file lists its blocks in.
|
|
120
|
+
normalized.sort((a, b) => a.type.localeCompare(b.type));
|
|
121
|
+
return normalized;
|
|
122
|
+
}
|
|
123
|
+
function normalizeWebhook(raw, options) {
|
|
124
|
+
if (raw === undefined || raw === null)
|
|
125
|
+
return null;
|
|
126
|
+
if (Array.isArray(raw)) {
|
|
127
|
+
throw new TriggerDeclarationError("[function.triggers.webhook] is a single table: one webhook trigger per " +
|
|
128
|
+
'function (the intent, "Webhook trigger URL and scheme?")');
|
|
129
|
+
}
|
|
130
|
+
if (typeof raw !== "object") {
|
|
131
|
+
throw new TriggerDeclarationError("[function.triggers.webhook] must be a table");
|
|
132
|
+
}
|
|
133
|
+
const table = raw;
|
|
134
|
+
for (const key of Object.keys(table)) {
|
|
135
|
+
if (!WEBHOOK_KEYS.includes(key)) {
|
|
136
|
+
throw new TriggerDeclarationError(`unknown key '${key}' under [function.triggers.webhook]: accepted keys ` +
|
|
137
|
+
`are ${WEBHOOK_KEYS.join(", ")}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (options.mode === "task") {
|
|
141
|
+
throw new TriggerDeclarationError("webhook triggers require request mode: set `mode = \"request\"` (or " +
|
|
142
|
+
"remove `mode = \"task\"`), or remove [function.triggers.webhook]");
|
|
143
|
+
}
|
|
144
|
+
const scheme = String(table.verificationScheme ?? "").trim();
|
|
145
|
+
if (!scheme) {
|
|
146
|
+
throw new TriggerDeclarationError("[function.triggers.webhook] verificationScheme is required");
|
|
147
|
+
}
|
|
148
|
+
if (scheme === "none") {
|
|
149
|
+
throw new TriggerDeclarationError("verification scheme 'none' is not allowed for function triggers: an " +
|
|
150
|
+
"unauthenticated caller could run the function");
|
|
151
|
+
}
|
|
152
|
+
const declaration = { verificationScheme: scheme };
|
|
153
|
+
if (table.signingSecret !== undefined) {
|
|
154
|
+
declaration.signingSecret = String(table.signingSecret);
|
|
155
|
+
}
|
|
156
|
+
for (const key of [
|
|
157
|
+
"toleranceSeconds",
|
|
158
|
+
"deduplicationWindowMs",
|
|
159
|
+
"maxBodyBytes",
|
|
160
|
+
"secretGracePeriodMs",
|
|
161
|
+
]) {
|
|
162
|
+
if (table[key] === undefined)
|
|
163
|
+
continue;
|
|
164
|
+
const value = Number(table[key]);
|
|
165
|
+
if (!Number.isFinite(value)) {
|
|
166
|
+
throw new TriggerDeclarationError(`[function.triggers.webhook] ${key} must be a number`);
|
|
167
|
+
}
|
|
168
|
+
declaration[key] = value;
|
|
169
|
+
}
|
|
170
|
+
if (table.deduplicationEnabled !== undefined) {
|
|
171
|
+
if (typeof table.deduplicationEnabled !== "boolean") {
|
|
172
|
+
throw new TriggerDeclarationError("[function.triggers.webhook] deduplicationEnabled must be a boolean");
|
|
173
|
+
}
|
|
174
|
+
declaration.deduplicationEnabled = table.deduplicationEnabled;
|
|
175
|
+
}
|
|
176
|
+
if (table.verification !== undefined) {
|
|
177
|
+
const verification = table.verification;
|
|
178
|
+
if (verification === null ||
|
|
179
|
+
typeof verification !== "object" ||
|
|
180
|
+
Array.isArray(verification)) {
|
|
181
|
+
throw new TriggerDeclarationError("[function.triggers.webhook.verification] must be a table");
|
|
182
|
+
}
|
|
183
|
+
declaration.verification = jsonSafe(verification);
|
|
184
|
+
}
|
|
185
|
+
return declaration;
|
|
186
|
+
}
|
|
187
|
+
function normalizeCron(raw, options) {
|
|
188
|
+
if (raw === undefined || raw === null)
|
|
189
|
+
return [];
|
|
190
|
+
const entries = Array.isArray(raw) ? raw : [raw];
|
|
191
|
+
if (entries.length === 0)
|
|
192
|
+
return [];
|
|
193
|
+
if (options.mode === "task") {
|
|
194
|
+
throw new TriggerDeclarationError("cron triggers require request mode: set `mode = \"request\"` (or " +
|
|
195
|
+
"remove `mode = \"task\"`), or remove the [[function.triggers.cron]] " +
|
|
196
|
+
"entries — a cron trigger on a task function is not available in this " +
|
|
197
|
+
"release");
|
|
198
|
+
}
|
|
199
|
+
if (entries.length > MAX_CRON_TRIGGERS_PER_FUNCTION) {
|
|
200
|
+
throw new TriggerDeclarationError(`a function may declare at most ${MAX_CRON_TRIGGERS_PER_FUNCTION} cron ` +
|
|
201
|
+
`trigger entries, and this one declares ${entries.length}`);
|
|
202
|
+
}
|
|
203
|
+
const seen = new Set();
|
|
204
|
+
const normalized = [];
|
|
205
|
+
for (const entry of entries) {
|
|
206
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
207
|
+
throw new TriggerDeclarationError("each [[function.triggers.cron]] entry must be a table");
|
|
208
|
+
}
|
|
209
|
+
const table = entry;
|
|
210
|
+
for (const key of Object.keys(table)) {
|
|
211
|
+
if (!CRON_KEYS.includes(key)) {
|
|
212
|
+
throw new TriggerDeclarationError(`unknown key '${key}' in a [[function.triggers.cron]] entry: accepted ` +
|
|
213
|
+
`keys are ${CRON_KEYS.join(", ")}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const name = String(table.name ?? "").trim();
|
|
217
|
+
if (!name) {
|
|
218
|
+
throw new TriggerDeclarationError("each [[function.triggers.cron]] entry needs a `name`: it is required " +
|
|
219
|
+
"because it is half of the trigger's key, `<functionKey>:<name>`");
|
|
220
|
+
}
|
|
221
|
+
if (!CRON_NAME_PATTERN.test(name)) {
|
|
222
|
+
throw new TriggerDeclarationError(`cron trigger name '${name}' must start with a letter or digit and ` +
|
|
223
|
+
"contain only letters, digits, '-' or '_'");
|
|
224
|
+
}
|
|
225
|
+
if (seen.has(name)) {
|
|
226
|
+
throw new TriggerDeclarationError(`duplicate cron trigger name '${name}': names are the trigger's key ` +
|
|
227
|
+
"within the function, so each must appear once");
|
|
228
|
+
}
|
|
229
|
+
seen.add(name);
|
|
230
|
+
const cron = String(table.cron ?? "").trim();
|
|
231
|
+
if (!cron) {
|
|
232
|
+
throw new TriggerDeclarationError(`cron trigger '${name}' needs a \`cron\` expression`);
|
|
233
|
+
}
|
|
234
|
+
// Shape only. The full grammar is the server's `parseCron` — the CLI
|
|
235
|
+
// refuses the mistake that is obvious from the text and leaves the
|
|
236
|
+
// authority where the DO's own parser is.
|
|
237
|
+
if (cron.trim().split(/\s+/).length !== 5) {
|
|
238
|
+
throw new TriggerDeclarationError(`cron trigger '${name}': a cron expression has exactly 5 fields, and ` +
|
|
239
|
+
`'${cron}' has ${cron.trim().split(/\s+/).length}`);
|
|
240
|
+
}
|
|
241
|
+
const declaration = { name, cron };
|
|
242
|
+
if (table.timezone !== undefined) {
|
|
243
|
+
declaration.timezone = String(table.timezone);
|
|
244
|
+
}
|
|
245
|
+
if (table.overlapPolicy !== undefined) {
|
|
246
|
+
const policy = String(table.overlapPolicy);
|
|
247
|
+
if (!VALID_OVERLAP_POLICIES.includes(policy)) {
|
|
248
|
+
throw new TriggerDeclarationError(`cron trigger '${name}': overlapPolicy must be one of ` +
|
|
249
|
+
VALID_OVERLAP_POLICIES.join(", "));
|
|
250
|
+
}
|
|
251
|
+
declaration.overlapPolicy = policy;
|
|
252
|
+
}
|
|
253
|
+
if (table.rootInput !== undefined) {
|
|
254
|
+
declaration.rootInput = jsonSafe(table.rootInput);
|
|
255
|
+
}
|
|
256
|
+
normalized.push(declaration);
|
|
257
|
+
}
|
|
258
|
+
// Sorted by name, matching the server, so `config diff` compares the same
|
|
259
|
+
// canonical shape whichever order the file lists its entries in.
|
|
260
|
+
normalized.sort((a, b) => a.name.localeCompare(b.name));
|
|
261
|
+
return normalized;
|
|
262
|
+
}
|
|
263
|
+
function jsonSafe(value) {
|
|
264
|
+
if (value === null || value === undefined)
|
|
265
|
+
return value;
|
|
266
|
+
if (typeof value === "bigint")
|
|
267
|
+
return Number(value);
|
|
268
|
+
if (value instanceof Date)
|
|
269
|
+
return value.toISOString();
|
|
270
|
+
if (Array.isArray(value))
|
|
271
|
+
return value.map(jsonSafe);
|
|
272
|
+
if (typeof value === "object") {
|
|
273
|
+
const anyValue = value;
|
|
274
|
+
if (typeof anyValue.toISOString === "function") {
|
|
275
|
+
return String(anyValue.toISOString());
|
|
276
|
+
}
|
|
277
|
+
const out = {};
|
|
278
|
+
for (const [key, child] of Object.entries(anyValue)) {
|
|
279
|
+
out[key] = jsonSafe(child);
|
|
280
|
+
}
|
|
281
|
+
return out;
|
|
282
|
+
}
|
|
283
|
+
return value;
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=function-triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-triggers.js","sourceRoot":"","sources":["../../../src/lib/function-triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAyCH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAEjD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AAEpD,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAExD,0EAA0E;AAC1E,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,CAAC;AAE/B,MAAM,YAAY,GAAG;IACnB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,sBAAsB;IACtB,uBAAuB;IACvB,cAAc;IACd,qBAAqB;IACrB,cAAc;CACf,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;AAE7E,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,OAAO,uBAAwB,SAAQ,KAAK;CAAG;AAErD;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,aAAkB,EAClB,UAA8B,EAAE;IAEhC,MAAM,QAAQ,GAAG,aAAa,EAAE,QAAQ,CAAC;IACzC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5D,MAAM,IA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AC,MAAM,4BAA4B,GAAsB;IAC7D,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,OAAO;IACP,IAAI;IACJ,UAAU;IACV,aAAa;IACb,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU;IACV,MAAM;IACN,UAAU;IACV,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,UAAU;IACV,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,UAAU;IACV,SAAS;IACT,eAAe;IACf,aAAa;IACb,SAAS;IACT,
|
|
1
|
+
{"version":3,"file":"generated-allowlist.js","sourceRoot":"","sources":["../../../src/lib/generated-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,OAAO;IACP,IAAI;IACJ,UAAU;IACV,aAAa;IACb,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU;IACV,MAAM;IACN,UAAU;IACV,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,UAAU;IACV,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,UAAU;IACV,SAAS;IACT,eAAe;IACf,aAAa;IACb,SAAS;IACT,iBAAiB;IACjB,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,MAAM;IACN,YAAY;IACZ,cAAc;IACd,UAAU;IACV,SAAS;IACT,aAAa;IACb,WAAW;IACX,eAAe;IACf,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,QAAQ;IACR,SAAS;IACT,SA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