primitive-admin 1.0.49 → 1.0.50
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 +102 -2
- package/assets/skill/skills/primitive-platform/SKILL.md +85 -30
- package/dist/bin/primitive.d.ts +2 -0
- package/dist/bin/primitive.js +66 -1
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/admins.d.ts +2 -0
- package/dist/src/commands/analytics.d.ts +2 -0
- package/dist/src/commands/apps.d.ts +2 -0
- package/dist/src/commands/apps.js +20 -0
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth.d.ts +2 -0
- package/dist/src/commands/blob-buckets.d.ts +2 -0
- package/dist/src/commands/catalog.d.ts +2 -0
- package/dist/src/commands/collection-type-configs.d.ts +2 -0
- package/dist/src/commands/collections.d.ts +2 -0
- package/dist/src/commands/comparisons.d.ts +2 -0
- package/dist/src/commands/cron-triggers.d.ts +2 -0
- package/dist/src/commands/cron-triggers.js +8 -15
- package/dist/src/commands/cron-triggers.js.map +1 -1
- package/dist/src/commands/database-types.d.ts +2 -0
- package/dist/src/commands/databases.d.ts +2 -0
- package/dist/src/commands/databases.js +31 -0
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.d.ts +2 -0
- package/dist/src/commands/email-templates.d.ts +2 -0
- package/dist/src/commands/env.d.ts +12 -0
- package/dist/src/commands/group-type-configs.d.ts +2 -0
- package/dist/src/commands/groups.d.ts +2 -0
- package/dist/src/commands/guides.d.ts +84 -0
- package/dist/src/commands/guides.js +201 -24
- package/dist/src/commands/guides.js.map +1 -1
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.js +63 -25
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +2 -0
- package/dist/src/commands/integrations.js +22 -5
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.d.ts +2 -0
- package/dist/src/commands/prompts.d.ts +2 -0
- package/dist/src/commands/rule-sets.d.ts +2 -0
- package/dist/src/commands/secrets.d.ts +2 -0
- package/dist/src/commands/skill.d.ts +2 -0
- package/dist/src/commands/sync.d.ts +113 -0
- package/dist/src/commands/sync.js +366 -12
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.d.ts +2 -0
- package/dist/src/commands/tokens.js +104 -1
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.d.ts +2 -0
- package/dist/src/commands/waitlist.d.ts +2 -0
- package/dist/src/commands/waitlist.js +1 -1
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.d.ts +2 -0
- package/dist/src/commands/workflows.d.ts +49 -0
- package/dist/src/commands/workflows.js +74 -21
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +1244 -0
- package/dist/src/lib/api-client.js +30 -0
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/auth-flow.d.ts +8 -0
- package/dist/src/lib/cli-manifest.d.ts +60 -0
- package/dist/src/lib/cli-manifest.js +70 -0
- package/dist/src/lib/cli-manifest.js.map +1 -0
- package/dist/src/lib/config.d.ts +37 -0
- package/dist/src/lib/confirm-prompt.d.ts +66 -0
- package/dist/src/lib/confirm-prompt.js +85 -0
- package/dist/src/lib/confirm-prompt.js.map +1 -0
- package/dist/src/lib/constants.d.ts +2 -0
- package/dist/src/lib/crash-handlers.d.ts +20 -0
- package/dist/src/lib/crash-handlers.js +49 -0
- package/dist/src/lib/crash-handlers.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +79 -0
- package/dist/src/lib/csv.d.ts +48 -0
- package/dist/src/lib/db-codegen/dbFingerprint.d.ts +10 -0
- package/dist/src/lib/db-codegen/dbGenerator.d.ts +111 -0
- package/dist/src/lib/db-codegen/dbNaming.d.ts +45 -0
- package/dist/src/lib/db-codegen/dbTemplates.d.ts +97 -0
- package/dist/src/lib/db-codegen/dbTemplates.js +31 -10
- package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTsTypes.d.ts +78 -0
- package/dist/src/lib/db-codegen/dbTsTypes.js +2 -2
- package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
- package/dist/src/lib/env-resolver.d.ts +62 -0
- package/dist/src/lib/fetch.d.ts +5 -0
- package/dist/src/lib/init-config.d.ts +46 -0
- package/dist/src/lib/init-config.js +7 -0
- package/dist/src/lib/init-config.js.map +1 -1
- package/dist/src/lib/migration-nag.d.ts +49 -0
- package/dist/src/lib/output.d.ts +49 -0
- package/dist/src/lib/output.js +25 -1
- package/dist/src/lib/output.js.map +1 -1
- package/dist/src/lib/paginate.d.ts +33 -0
- package/dist/src/lib/project-config.d.ts +97 -0
- package/dist/src/lib/refresh-admin-credentials.d.ts +65 -0
- package/dist/src/lib/resolve-platform.d.ts +45 -0
- package/dist/src/lib/resolve-platform.js +43 -0
- package/dist/src/lib/resolve-platform.js.map +1 -0
- package/dist/src/lib/skill-installer.d.ts +23 -0
- package/dist/src/lib/snapshots.d.ts +99 -0
- package/dist/src/lib/snapshots.js +357 -0
- package/dist/src/lib/snapshots.js.map +1 -0
- package/dist/src/lib/sync-paths.d.ts +72 -0
- package/dist/src/lib/sync-paths.js +29 -1
- package/dist/src/lib/sync-paths.js.map +1 -1
- package/dist/src/lib/template.d.ts +93 -0
- package/dist/src/lib/token-inject.d.ts +56 -0
- package/dist/src/lib/token-inject.js +204 -0
- package/dist/src/lib/token-inject.js.map +1 -0
- package/dist/src/lib/toml-database-config.d.ts +132 -0
- package/dist/src/lib/toml-params-validator.d.ts +95 -0
- package/dist/src/lib/version-check.d.ts +10 -0
- package/dist/src/lib/workflow-fragments.d.ts +41 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +86 -0
- package/dist/src/lib/workflow-toml-validator.js +31 -1
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/dist/src/types/index.d.ts +513 -0
- package/dist/src/validators.d.ts +64 -0
- package/dist/src/validators.js +63 -0
- package/dist/src/validators.js.map +1 -0
- package/package.json +7 -1
|
@@ -74,9 +74,11 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
74
74
|
"context",
|
|
75
75
|
"cursor",
|
|
76
76
|
"cursorField",
|
|
77
|
+
"data", // document.save/patch: record fields to write (#948 / #985)
|
|
77
78
|
"databaseId",
|
|
78
79
|
"default", // switch: { output } fallback branch (#802)
|
|
79
80
|
"direction",
|
|
81
|
+
"documentId", // document.*: target document id (#948 / #985)
|
|
80
82
|
"dryRun",
|
|
81
83
|
"durationMs",
|
|
82
84
|
"email",
|
|
@@ -84,6 +86,7 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
84
86
|
"expiresInSeconds",
|
|
85
87
|
"feature",
|
|
86
88
|
"filename",
|
|
89
|
+
"filter", // document.query/queryOne/count: record filter (#948 / #985)
|
|
87
90
|
"filters",
|
|
88
91
|
"groupBy",
|
|
89
92
|
"groupId",
|
|
@@ -92,6 +95,7 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
92
95
|
"includeUserDetails",
|
|
93
96
|
"input",
|
|
94
97
|
"integrationKey",
|
|
98
|
+
"iterationName", // iterate-users: required iteration name (#971)
|
|
95
99
|
"itemsField",
|
|
96
100
|
"limit",
|
|
97
101
|
"limits", // script: per-step runtime caps (lower-only-clamp; #783)
|
|
@@ -100,25 +104,32 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
100
104
|
"messages",
|
|
101
105
|
"metrics",
|
|
102
106
|
"model",
|
|
107
|
+
"modelName", // document.*: document model name to operate on (#948 / #985)
|
|
103
108
|
"modelOverride",
|
|
104
109
|
"ms",
|
|
105
110
|
"multipartFields",
|
|
111
|
+
"onConflict", // iterate-users: "skip" | "refuse" on singleton lock conflict (#971)
|
|
106
112
|
"onPartialFailure",
|
|
107
113
|
"operationName",
|
|
114
|
+
"options", // document.query/queryOne: query options (limit/sort/etc.) (#948 / #985)
|
|
108
115
|
"output",
|
|
109
116
|
"page",
|
|
117
|
+
"pageSize", // iterate-users: user-page size (#971)
|
|
110
118
|
"params",
|
|
111
119
|
"payload",
|
|
120
|
+
"perUser", // iterate-users: per-user child workflow descriptor (#971)
|
|
112
121
|
"plugins",
|
|
113
122
|
"prompt",
|
|
114
123
|
"promptKey",
|
|
115
124
|
"query",
|
|
116
125
|
"queryType",
|
|
126
|
+
"recordId", // document.save/patch/delete: target record id (#948 / #985)
|
|
117
127
|
"ref", // script: named reference to a Script (resolved at publish time; #783)
|
|
118
128
|
"request",
|
|
119
129
|
"route",
|
|
120
130
|
"runs",
|
|
121
131
|
"sort",
|
|
132
|
+
"source", // iterate-users: user-source descriptor ({ mode }) (#971)
|
|
122
133
|
"step", // collect: nested inner step definition
|
|
123
134
|
"subject",
|
|
124
135
|
"tags",
|
|
@@ -140,6 +151,16 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
140
151
|
"with", // script: input context for the script (whole `with:` block; #783)
|
|
141
152
|
"workflowKey",
|
|
142
153
|
]);
|
|
154
|
+
/**
|
|
155
|
+
* Read-only view of `ALLOWLISTED_FIELDS` for the drift-guard test (#985).
|
|
156
|
+
*
|
|
157
|
+
* Exported so `cli/tests/unit/workflow-toml-validator-drift-guard.test.ts` can
|
|
158
|
+
* assert this set stays a superset of every top-level field the step runners
|
|
159
|
+
* in `src/workflows/steps/*.ts` actually read — checking the *live* set the
|
|
160
|
+
* validator enforces rather than a copy that could itself drift. Not part of
|
|
161
|
+
* the public validator API; consumed only by the guard.
|
|
162
|
+
*/
|
|
163
|
+
export const ALLOWLISTED_FIELDS_FOR_DRIFT_GUARD = ALLOWLISTED_FIELDS;
|
|
143
164
|
/**
|
|
144
165
|
* Walk a parsed workflow TOML document and return all unknown-field errors.
|
|
145
166
|
*
|
|
@@ -328,7 +349,16 @@ export function formatWorkflowTomlErrors(filePath, errors) {
|
|
|
328
349
|
// the offending field is on the inner step, not the outer collect.
|
|
329
350
|
// The outer step's id (if any) is also included in the prefix so the
|
|
330
351
|
// diagnostic can be cross-referenced against the parent's TOML header.
|
|
331
|
-
|
|
352
|
+
//
|
|
353
|
+
// #971: top-level errors carry `parentStepId: null` (set explicitly at the
|
|
354
|
+
// top-level `validateStepObject` call); only genuine collect-inner errors
|
|
355
|
+
// carry a real id (or `undefined` if a future caller omits it). Use a
|
|
356
|
+
// non-null check so BOTH `null` and `undefined` top-level errors render as
|
|
357
|
+
// a bare `steps[N]` without the `(inside collect step)` suffix. The prior
|
|
358
|
+
// `!== undefined` check treated `null` as inner (`null !== undefined` is
|
|
359
|
+
// `true`), mislabeling every top-level error as inside a collect step (a
|
|
360
|
+
// regression from PR #762).
|
|
361
|
+
const isInnerStep = err.parentStepId != null;
|
|
332
362
|
const slot = isInnerStep
|
|
333
363
|
? `steps[${err.stepIndex}].step`
|
|
334
364
|
: `steps[${err.stepIndex}]`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-toml-validator.js","sourceRoot":"","sources":["../../../src/lib/workflow-toml-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS;IACzC,2CAA2C;IAC3C,IAAI;IACJ,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,IAAI;IACJ,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,aAAa;IACb,SAAS;IACT,kCAAkC;IAClC,YAAY,EAAE,mCAAmC;IACjD,QAAQ;IACR,OAAO;IACP,UAAU;IACV,aAAa;IACb,QAAQ;IACR,UAAU;IACV,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,OAAO,EAAE,2CAA2C;IACpD,UAAU;IACV,SAAS;IACT,eAAe;IACf,aAAa;IACb,SAAS;IACT,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS,EAAE,4CAA4C;IACvD,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,UAAU;IACV,oBAAoB;IACpB,OAAO;IACP,gBAAgB;IAChB,YAAY;IACZ,OAAO;IACP,QAAQ,EAAE,yDAAyD;IACnE,UAAU;IACV,SAAS;IACT,UAAU;IACV,SAAS;IACT,OAAO;IACP,eAAe;IACf,IAAI;IACJ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;IACT,SAAS;IACT,QAAQ;IACR,WAAW;IACX,OAAO;IACP,WAAW;IACX,KAAK,EAAE,uEAAuE;IAC9E,SAAS;IACT,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM,EAAE,wCAAwC;IAChD,SAAS;IACT,MAAM;IACN,aAAa;IACb,cAAc;IACd,UAAU;IACV,eAAe;IACf,IAAI;IACJ,OAAO;IACP,aAAa;IACb,OAAO;IACP,UAAU;IACV,MAAM;IACN,MAAM;IACN,QAAQ;IACR,UAAU;IACV,WAAW;IACX,YAAY;IACZ,MAAM,EAAE,mEAAmE;IAC3E,aAAa;CACd,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-toml-validator.js","sourceRoot":"","sources":["../../../src/lib/workflow-toml-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS;IACzC,2CAA2C;IAC3C,IAAI;IACJ,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,SAAS;IACT,IAAI;IACJ,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,aAAa;IACb,SAAS;IACT,kCAAkC;IAClC,YAAY,EAAE,mCAAmC;IACjD,QAAQ;I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mBAAmB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,SAAS;QACX,CAAC;QAED,wEAAwE;QACxE,uEAAuE;QACvE,mEAAmE;QACnE,qEAAqE;QACrE,uEAAuE;QACvE,EAAE;QACF,2EAA2E;QAC3E,0EAA0E;QAC1E,sEAAsE;QACtE,2EAA2E;QAC3E,0EAA0E;QAC1E,yEAAyE;QACzE,yEAAyE;QACzE,4BAA4B;QAC5B,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC;QAC7C,MAAM,IAAI,GAAG,WAAW;YACtB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,QAAQ;YAChC,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,GAAG,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,MAAM,UAAU,GACd,WAAW,IAAI,GAAG,CAAC,YAAY;YAC7B,CAAC,CAAC,6BAA6B,GAAG,CAAC,YAAY,IAAI;YACnD,CAAC,CAAC,WAAW;gBACb,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CACR,KAAK,IAAI,GAAG,MAAM,GAAG,UAAU,uBAAuB,GAAG,CAAC,KAAK,IAAI,CACpE,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
export interface Credentials {
|
|
2
|
+
serverUrl: string;
|
|
3
|
+
accessToken: string;
|
|
4
|
+
refreshToken: string;
|
|
5
|
+
expiresAt: string;
|
|
6
|
+
adminId: string;
|
|
7
|
+
email: string;
|
|
8
|
+
role: "admin" | "super-admin";
|
|
9
|
+
name?: string;
|
|
10
|
+
currentAppId?: string;
|
|
11
|
+
currentAppName?: string;
|
|
12
|
+
globalAdminAppId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AppSummary {
|
|
15
|
+
appId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
mode?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AppSettings {
|
|
20
|
+
name: string;
|
|
21
|
+
baseUrl?: string | null;
|
|
22
|
+
mode: "public" | "invite-only" | "domain";
|
|
23
|
+
waitlistEnabled?: boolean;
|
|
24
|
+
allowedDomains?: string[] | null;
|
|
25
|
+
redirectUris?: string[] | null;
|
|
26
|
+
googleOAuthEnabled?: boolean;
|
|
27
|
+
googleClientId?: string;
|
|
28
|
+
googleClientSecret?: string;
|
|
29
|
+
corsMode?: "universal" | "custom";
|
|
30
|
+
corsAllowedOrigins?: string[] | null;
|
|
31
|
+
corsAllowCredentials?: boolean;
|
|
32
|
+
corsAllowedMethods?: string[] | null;
|
|
33
|
+
corsAllowedHeaders?: string[] | null;
|
|
34
|
+
corsExposedHeaders?: string[] | null;
|
|
35
|
+
corsMaxAge?: number | null;
|
|
36
|
+
passkeyEnabled?: boolean;
|
|
37
|
+
passkeyRpId?: string;
|
|
38
|
+
passkeyRpName?: string;
|
|
39
|
+
passkeyRpConfig?: Record<string, {
|
|
40
|
+
name: string;
|
|
41
|
+
}> | null;
|
|
42
|
+
hasPasskey?: boolean;
|
|
43
|
+
magicLinkEnabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface User {
|
|
46
|
+
userId: string;
|
|
47
|
+
email: string;
|
|
48
|
+
name: string;
|
|
49
|
+
role: "owner" | "admin" | "member";
|
|
50
|
+
addedAt: string;
|
|
51
|
+
}
|
|
52
|
+
export interface Invitation {
|
|
53
|
+
invitationId: string;
|
|
54
|
+
email: string;
|
|
55
|
+
role: "admin" | "member";
|
|
56
|
+
createdAt: string;
|
|
57
|
+
expiresAt: string;
|
|
58
|
+
invitedBy: string;
|
|
59
|
+
accepted?: boolean;
|
|
60
|
+
acceptedAt?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface WaitlistEntry {
|
|
63
|
+
waitlistId: string;
|
|
64
|
+
email: string;
|
|
65
|
+
displayName?: string | null;
|
|
66
|
+
provider?: string | null;
|
|
67
|
+
providerId?: string | null;
|
|
68
|
+
source?: string | null;
|
|
69
|
+
note?: string | null;
|
|
70
|
+
requestedAt?: string | null;
|
|
71
|
+
updatedAt?: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface MultipartFieldDefinition {
|
|
74
|
+
fieldName: string;
|
|
75
|
+
type: "attachment" | "value";
|
|
76
|
+
attachmentIndex?: number;
|
|
77
|
+
attachmentName?: string;
|
|
78
|
+
value?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IntegrationRequestConfig {
|
|
81
|
+
baseUrl: string;
|
|
82
|
+
allowedMethods?: string[];
|
|
83
|
+
allowedPaths?: string[];
|
|
84
|
+
defaultMethod?: string;
|
|
85
|
+
defaultHeaders?: Record<string, string>;
|
|
86
|
+
staticQuery?: Record<string, any>;
|
|
87
|
+
forwardHeaders?: string[];
|
|
88
|
+
forwardQueryParams?: string[];
|
|
89
|
+
responsePassthrough?: boolean;
|
|
90
|
+
exampleQuery?: Record<string, any>;
|
|
91
|
+
exampleBody?: any;
|
|
92
|
+
bodyMode?: "json" | "raw" | "multipart";
|
|
93
|
+
multipartFieldMapping?: MultipartFieldDefinition[];
|
|
94
|
+
}
|
|
95
|
+
export interface IntegrationSummary {
|
|
96
|
+
integrationId: string;
|
|
97
|
+
integrationKey: string;
|
|
98
|
+
displayName: string;
|
|
99
|
+
status: string;
|
|
100
|
+
lastTestedAt?: string | null;
|
|
101
|
+
createdAt?: string;
|
|
102
|
+
modifiedAt?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface IntegrationDetail extends IntegrationSummary {
|
|
105
|
+
appId: string;
|
|
106
|
+
description?: string | null;
|
|
107
|
+
requestConfig: IntegrationRequestConfig;
|
|
108
|
+
timeoutMs?: number;
|
|
109
|
+
maxRequestBodyBytes?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface IntegrationSecret {
|
|
112
|
+
secretId: string;
|
|
113
|
+
version: string;
|
|
114
|
+
secretSummary?: string | null;
|
|
115
|
+
status?: string;
|
|
116
|
+
createdBy?: string;
|
|
117
|
+
createdAt?: string;
|
|
118
|
+
supersededAt?: string | null;
|
|
119
|
+
preview?: {
|
|
120
|
+
headers: string[];
|
|
121
|
+
query: string[];
|
|
122
|
+
body: string[];
|
|
123
|
+
} | null;
|
|
124
|
+
}
|
|
125
|
+
export interface IntegrationTestPayload {
|
|
126
|
+
method?: string;
|
|
127
|
+
path?: string;
|
|
128
|
+
query?: Record<string, any>;
|
|
129
|
+
headers?: Record<string, string>;
|
|
130
|
+
body?: any;
|
|
131
|
+
}
|
|
132
|
+
export interface IntegrationTestResult {
|
|
133
|
+
success: boolean;
|
|
134
|
+
upstreamResponse?: {
|
|
135
|
+
status: number;
|
|
136
|
+
headers: Record<string, string>;
|
|
137
|
+
body: any;
|
|
138
|
+
traceId?: string;
|
|
139
|
+
durationMs?: number;
|
|
140
|
+
};
|
|
141
|
+
errorCode?: string;
|
|
142
|
+
message?: string;
|
|
143
|
+
traceId?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface IntegrationLogEntry {
|
|
146
|
+
timestamp: string;
|
|
147
|
+
method: string;
|
|
148
|
+
path: string;
|
|
149
|
+
status: number;
|
|
150
|
+
durationMs: number;
|
|
151
|
+
traceId: string;
|
|
152
|
+
errorCode?: string;
|
|
153
|
+
actorType?: string;
|
|
154
|
+
actorId?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface Webhook {
|
|
157
|
+
webhookId: string;
|
|
158
|
+
webhookKey: string;
|
|
159
|
+
displayName: string;
|
|
160
|
+
description?: string;
|
|
161
|
+
status: string;
|
|
162
|
+
workflowKey: string;
|
|
163
|
+
verificationScheme: string;
|
|
164
|
+
signingSecretMasked?: string;
|
|
165
|
+
toleranceSeconds: number;
|
|
166
|
+
deduplicationEnabled: boolean;
|
|
167
|
+
deduplicationWindowMs: number;
|
|
168
|
+
secretGracePeriodMs: number;
|
|
169
|
+
inputMapping?: string;
|
|
170
|
+
allowedIpCidrs?: string;
|
|
171
|
+
metadata?: string;
|
|
172
|
+
lastTriggeredAt?: string;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
modifiedAt: string;
|
|
175
|
+
}
|
|
176
|
+
export interface WebhookEvent {
|
|
177
|
+
eventId: string;
|
|
178
|
+
externalEventId?: string;
|
|
179
|
+
status: string;
|
|
180
|
+
httpStatus: number;
|
|
181
|
+
sourceIp?: string;
|
|
182
|
+
payloadSummary?: string;
|
|
183
|
+
rejectionReason?: string;
|
|
184
|
+
workflowRunKey?: string;
|
|
185
|
+
processingDurationMs?: number;
|
|
186
|
+
createdAt: string;
|
|
187
|
+
}
|
|
188
|
+
export interface Workflow {
|
|
189
|
+
workflowId: string;
|
|
190
|
+
workflowKey: string;
|
|
191
|
+
name: string;
|
|
192
|
+
description: string | null;
|
|
193
|
+
status: "draft" | "active" | "archived";
|
|
194
|
+
activeConfigId: string | null;
|
|
195
|
+
latestRevision: string | null;
|
|
196
|
+
inputSchema: object | null;
|
|
197
|
+
outputSchema: object | null;
|
|
198
|
+
perUserMaxRunning: number;
|
|
199
|
+
perUserMaxQueued: number;
|
|
200
|
+
perAppMaxRunning: number;
|
|
201
|
+
perAppMaxQueued: number;
|
|
202
|
+
queueTtlSeconds: number;
|
|
203
|
+
dequeueOrder: "fifo" | "lifo";
|
|
204
|
+
createdBy: string;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
modifiedAt: string;
|
|
207
|
+
}
|
|
208
|
+
export interface WorkflowDraft {
|
|
209
|
+
steps: any[];
|
|
210
|
+
inputSchema: object | null;
|
|
211
|
+
outputSchema: object | null;
|
|
212
|
+
}
|
|
213
|
+
export interface WorkflowRevision {
|
|
214
|
+
revisionId: string;
|
|
215
|
+
workflowId: string;
|
|
216
|
+
stepsR2Key: string;
|
|
217
|
+
inputSchema: object | null;
|
|
218
|
+
outputSchema: object | null;
|
|
219
|
+
publishedAt: string | null;
|
|
220
|
+
createdBy: string;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
}
|
|
223
|
+
export interface WorkflowRun {
|
|
224
|
+
runId: string;
|
|
225
|
+
runKey: string;
|
|
226
|
+
instanceId: string;
|
|
227
|
+
workflowId: string;
|
|
228
|
+
workflowKey: string;
|
|
229
|
+
revisionId: string;
|
|
230
|
+
contextDocId: string;
|
|
231
|
+
status: string;
|
|
232
|
+
startedAt: string | null;
|
|
233
|
+
endedAt: string | null;
|
|
234
|
+
startedByUserId?: string;
|
|
235
|
+
input: any | null;
|
|
236
|
+
meta: object | null;
|
|
237
|
+
isPreview?: boolean;
|
|
238
|
+
}
|
|
239
|
+
export interface WorkflowInstanceStatus {
|
|
240
|
+
status: string;
|
|
241
|
+
output?: any;
|
|
242
|
+
stepResults?: Array<{
|
|
243
|
+
id: string;
|
|
244
|
+
kind: string;
|
|
245
|
+
output: any;
|
|
246
|
+
startedAt: string;
|
|
247
|
+
endedAt: string;
|
|
248
|
+
durationMs: number;
|
|
249
|
+
skipped?: boolean;
|
|
250
|
+
}>;
|
|
251
|
+
error?: any;
|
|
252
|
+
}
|
|
253
|
+
export interface AppPromptSummary {
|
|
254
|
+
promptId: string;
|
|
255
|
+
promptKey: string;
|
|
256
|
+
displayName: string;
|
|
257
|
+
description?: string | null;
|
|
258
|
+
activeConfigId?: string | null;
|
|
259
|
+
defaultEvaluatorPromptId?: string | null;
|
|
260
|
+
status: "draft" | "active" | "archived";
|
|
261
|
+
createdAt?: string;
|
|
262
|
+
modifiedAt?: string;
|
|
263
|
+
}
|
|
264
|
+
export interface AppPromptDetail extends AppPromptSummary {
|
|
265
|
+
appId: string;
|
|
266
|
+
copiedFromCatalogId?: string | null;
|
|
267
|
+
inputSchema?: string | null;
|
|
268
|
+
createdBy?: string;
|
|
269
|
+
configs: AppPromptConfig[];
|
|
270
|
+
}
|
|
271
|
+
export interface AppPromptConfig {
|
|
272
|
+
configId: string;
|
|
273
|
+
promptId: string;
|
|
274
|
+
appId: string;
|
|
275
|
+
configName: string;
|
|
276
|
+
description?: string | null;
|
|
277
|
+
provider: "openrouter" | "gemini";
|
|
278
|
+
model: string;
|
|
279
|
+
systemPrompt?: string | null;
|
|
280
|
+
userPromptTemplate: string;
|
|
281
|
+
temperature?: number | null;
|
|
282
|
+
topP?: number | null;
|
|
283
|
+
maxTokens?: number | null;
|
|
284
|
+
outputSchema?: object | null;
|
|
285
|
+
providerConfig?: object | null;
|
|
286
|
+
status: "active" | "archived";
|
|
287
|
+
createdBy?: string;
|
|
288
|
+
createdAt?: string;
|
|
289
|
+
modifiedAt?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface PromptExecuteResult {
|
|
292
|
+
success: boolean;
|
|
293
|
+
output: string;
|
|
294
|
+
rawResponse: any;
|
|
295
|
+
error?: string;
|
|
296
|
+
configId?: string;
|
|
297
|
+
metrics: {
|
|
298
|
+
durationMs: number;
|
|
299
|
+
inputTokens?: number;
|
|
300
|
+
outputTokens?: number;
|
|
301
|
+
totalTokens?: number;
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
export interface PromptPreviewResult {
|
|
305
|
+
systemPrompt?: string;
|
|
306
|
+
userPrompt: string;
|
|
307
|
+
model?: string;
|
|
308
|
+
provider?: string;
|
|
309
|
+
configId?: string;
|
|
310
|
+
}
|
|
311
|
+
export interface AnalyticsOverviewResponse {
|
|
312
|
+
windowDays: number;
|
|
313
|
+
bucketDays: number;
|
|
314
|
+
totals: {
|
|
315
|
+
dau: number;
|
|
316
|
+
wau: number;
|
|
317
|
+
mau: number;
|
|
318
|
+
totalEvents: number;
|
|
319
|
+
};
|
|
320
|
+
series: Array<{
|
|
321
|
+
bucketStart: string;
|
|
322
|
+
activeUsers: number;
|
|
323
|
+
totalEvents: number;
|
|
324
|
+
}>;
|
|
325
|
+
}
|
|
326
|
+
export interface AnalyticsTopUsersResponse {
|
|
327
|
+
windowDays: number;
|
|
328
|
+
limit: number;
|
|
329
|
+
results: Array<{
|
|
330
|
+
userUlid: string;
|
|
331
|
+
firstSeen: string;
|
|
332
|
+
lastSeen: string;
|
|
333
|
+
eventCount: number;
|
|
334
|
+
}>;
|
|
335
|
+
}
|
|
336
|
+
export interface AnalyticsUserTimelineResponse {
|
|
337
|
+
windowDays: number;
|
|
338
|
+
bucketSeconds: number;
|
|
339
|
+
timeline: Array<{
|
|
340
|
+
bucketStart: string;
|
|
341
|
+
events: number;
|
|
342
|
+
}>;
|
|
343
|
+
breakdown: Array<{
|
|
344
|
+
action: string;
|
|
345
|
+
feature: string;
|
|
346
|
+
route: string;
|
|
347
|
+
events: number;
|
|
348
|
+
}>;
|
|
349
|
+
}
|
|
350
|
+
export interface AnalyticsIntegrationMetricsResponse {
|
|
351
|
+
windowDays: number;
|
|
352
|
+
integrations: Array<{
|
|
353
|
+
integrationKey: string;
|
|
354
|
+
invocations: number;
|
|
355
|
+
errorRate: number;
|
|
356
|
+
avgDurationMs: number;
|
|
357
|
+
p95DurationMs: number;
|
|
358
|
+
}>;
|
|
359
|
+
}
|
|
360
|
+
export interface AdminSummary {
|
|
361
|
+
adminId: string;
|
|
362
|
+
email: string;
|
|
363
|
+
name: string;
|
|
364
|
+
role: string;
|
|
365
|
+
appCreationLimit: number;
|
|
366
|
+
disabledAt?: string | null;
|
|
367
|
+
assignedAppsCount: number;
|
|
368
|
+
createdAppsCount: number;
|
|
369
|
+
}
|
|
370
|
+
export interface AdminInvitation {
|
|
371
|
+
invitationId: string;
|
|
372
|
+
email: string;
|
|
373
|
+
invitedAt?: string;
|
|
374
|
+
expiresAt?: string;
|
|
375
|
+
invitedBy?: string | null;
|
|
376
|
+
type: "global" | "app";
|
|
377
|
+
appId?: string;
|
|
378
|
+
appName?: string;
|
|
379
|
+
appCreationLimit?: number;
|
|
380
|
+
}
|
|
381
|
+
export interface PromptCatalogItem {
|
|
382
|
+
catalogId: string;
|
|
383
|
+
catalogKey: string;
|
|
384
|
+
displayName: string;
|
|
385
|
+
description?: string | null;
|
|
386
|
+
category?: string | null;
|
|
387
|
+
provider: "openrouter" | "gemini";
|
|
388
|
+
model: string;
|
|
389
|
+
systemPrompt?: string | null;
|
|
390
|
+
userPromptTemplate: string;
|
|
391
|
+
inputSchema?: string | null;
|
|
392
|
+
outputSchema?: string | null;
|
|
393
|
+
temperature?: string | null;
|
|
394
|
+
topP?: string | null;
|
|
395
|
+
maxTokens?: number | null;
|
|
396
|
+
status: "draft" | "active" | "deprecated";
|
|
397
|
+
createdBy?: string;
|
|
398
|
+
createdAt?: string;
|
|
399
|
+
modifiedAt?: string;
|
|
400
|
+
}
|
|
401
|
+
export interface IntegrationCatalogItem {
|
|
402
|
+
catalogId: string;
|
|
403
|
+
catalogKey: string;
|
|
404
|
+
displayName: string;
|
|
405
|
+
description?: string | null;
|
|
406
|
+
category?: string | null;
|
|
407
|
+
requestConfig: string;
|
|
408
|
+
docUrl?: string | null;
|
|
409
|
+
logoUrl?: string | null;
|
|
410
|
+
status: "draft" | "active" | "deprecated";
|
|
411
|
+
createdBy?: string;
|
|
412
|
+
createdAt?: string;
|
|
413
|
+
modifiedAt?: string;
|
|
414
|
+
}
|
|
415
|
+
export interface WorkflowConfiguration {
|
|
416
|
+
configId: string;
|
|
417
|
+
workflowId: string;
|
|
418
|
+
appId: string;
|
|
419
|
+
configName: string;
|
|
420
|
+
description?: string | null;
|
|
421
|
+
stepsR2Key: string;
|
|
422
|
+
status: "active" | "archived";
|
|
423
|
+
steps?: any[];
|
|
424
|
+
createdBy?: string;
|
|
425
|
+
createdAt?: string;
|
|
426
|
+
modifiedAt?: string;
|
|
427
|
+
}
|
|
428
|
+
export interface SyncState {
|
|
429
|
+
appId: string;
|
|
430
|
+
serverUrl: string;
|
|
431
|
+
lastSyncedAt: string;
|
|
432
|
+
entities: {
|
|
433
|
+
app?: {
|
|
434
|
+
modifiedAt: string;
|
|
435
|
+
contentHash?: string;
|
|
436
|
+
};
|
|
437
|
+
integrations?: Record<string, {
|
|
438
|
+
id: string;
|
|
439
|
+
modifiedAt: string;
|
|
440
|
+
contentHash?: string;
|
|
441
|
+
}>;
|
|
442
|
+
prompts?: Record<string, {
|
|
443
|
+
id: string;
|
|
444
|
+
modifiedAt: string;
|
|
445
|
+
contentHash?: string;
|
|
446
|
+
}>;
|
|
447
|
+
workflows?: Record<string, {
|
|
448
|
+
id: string;
|
|
449
|
+
modifiedAt: string;
|
|
450
|
+
activeConfigId?: string;
|
|
451
|
+
contentHash?: string;
|
|
452
|
+
}>;
|
|
453
|
+
emailTemplates?: Record<string, {
|
|
454
|
+
id: string;
|
|
455
|
+
modifiedAt: string;
|
|
456
|
+
}>;
|
|
457
|
+
testCases?: Record<string, {
|
|
458
|
+
id: string;
|
|
459
|
+
blockType: string;
|
|
460
|
+
blockId: string;
|
|
461
|
+
blockKey: string;
|
|
462
|
+
slug: string;
|
|
463
|
+
modifiedAt: string;
|
|
464
|
+
attachmentFilenames?: string[];
|
|
465
|
+
contentHash?: string;
|
|
466
|
+
}>;
|
|
467
|
+
databaseTypes?: Record<string, {
|
|
468
|
+
databaseType: string;
|
|
469
|
+
modifiedAt: string;
|
|
470
|
+
operations?: Record<string, {
|
|
471
|
+
modifiedAt: string;
|
|
472
|
+
}>;
|
|
473
|
+
subscriptions?: Record<string, {
|
|
474
|
+
modifiedAt: string;
|
|
475
|
+
}>;
|
|
476
|
+
contentHash?: string;
|
|
477
|
+
hasSchema?: boolean;
|
|
478
|
+
}>;
|
|
479
|
+
ruleSets?: Record<string, {
|
|
480
|
+
id: string;
|
|
481
|
+
modifiedAt: string;
|
|
482
|
+
contentHash?: string;
|
|
483
|
+
}>;
|
|
484
|
+
groupTypeConfigs?: Record<string, {
|
|
485
|
+
modifiedAt: string;
|
|
486
|
+
contentHash?: string;
|
|
487
|
+
}>;
|
|
488
|
+
collectionTypeConfigs?: Record<string, {
|
|
489
|
+
modifiedAt: string;
|
|
490
|
+
contentHash?: string;
|
|
491
|
+
}>;
|
|
492
|
+
webhooks?: Record<string, {
|
|
493
|
+
id: string;
|
|
494
|
+
modifiedAt: string;
|
|
495
|
+
contentHash?: string;
|
|
496
|
+
}>;
|
|
497
|
+
blobBuckets?: Record<string, {
|
|
498
|
+
id: string;
|
|
499
|
+
modifiedAt: string;
|
|
500
|
+
contentHash?: string;
|
|
501
|
+
}>;
|
|
502
|
+
cronTriggers?: Record<string, {
|
|
503
|
+
id: string;
|
|
504
|
+
modifiedAt: string;
|
|
505
|
+
contentHash?: string;
|
|
506
|
+
}>;
|
|
507
|
+
scripts?: Record<string, {
|
|
508
|
+
id: string;
|
|
509
|
+
modifiedAt: string;
|
|
510
|
+
contentHash?: string;
|
|
511
|
+
}>;
|
|
512
|
+
};
|
|
513
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public subpath export: `primitive-admin/validators` (issue #983).
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the TOML validators that `sync push` runs as its load-bearing
|
|
5
|
+
* gate, so external tooling (e.g. `primitive-docs`) can validate the exact
|
|
6
|
+
* same way the published CLI does — instead of re-implementing the parse /
|
|
7
|
+
* expand / validate flow against submodule source and silently drifting.
|
|
8
|
+
*
|
|
9
|
+
* Two kinds of entry points are exported:
|
|
10
|
+
*
|
|
11
|
+
* 1. `validateWorkflowTomlSource(raw, filePath)` — the **source-level**
|
|
12
|
+
* wrapper. Runs the identical parse → fragment-expand → validate → format
|
|
13
|
+
* path that `sync push` runs for workflow TOML (`cli/src/commands/sync.ts`:
|
|
14
|
+
* `parseTomlFile()` → `validateWorkflowToml()` → `formatWorkflowTomlErrors()`).
|
|
15
|
+
* Use this when you have the raw TOML string and want zero divergence from
|
|
16
|
+
* `sync push`, including `include` fragment expansion.
|
|
17
|
+
*
|
|
18
|
+
* 2. The raw validators (`validateWorkflowToml`, `validateOperations`) and
|
|
19
|
+
* their formatters (`formatWorkflowTomlErrors`, `formatIssue`). These are
|
|
20
|
+
* **pure functions over already-parsed TOML** — they do not read files or
|
|
21
|
+
* parse TOML themselves. The consumer is responsible for parsing (e.g. with
|
|
22
|
+
* `@iarna/toml`) and, for workflows, for any `include` expansion. There is
|
|
23
|
+
* no coupling on a specific TOML parser version; pass whatever parsed
|
|
24
|
+
* object/operations[] you already have.
|
|
25
|
+
*
|
|
26
|
+
* Internal helpers (`collectParamRefs`, `declaredParamNames`,
|
|
27
|
+
* `locateOperationLine`) are intentionally NOT exported — they are
|
|
28
|
+
* implementation details of `validateOperations`.
|
|
29
|
+
*/
|
|
30
|
+
import { type WorkflowTomlError } from "./lib/workflow-toml-validator.js";
|
|
31
|
+
export { validateWorkflowToml, formatWorkflowTomlErrors, type WorkflowTomlError, } from "./lib/workflow-toml-validator.js";
|
|
32
|
+
export { validateOperations, formatIssue, type ValidationIssue, type ValidationResult, type ValidateOptions, } from "./lib/toml-params-validator.js";
|
|
33
|
+
/**
|
|
34
|
+
* Result of {@link validateWorkflowTomlSource}.
|
|
35
|
+
*/
|
|
36
|
+
export interface WorkflowTomlSourceResult {
|
|
37
|
+
/** The structured errors (empty when the source is valid). */
|
|
38
|
+
errors: WorkflowTomlError[];
|
|
39
|
+
/**
|
|
40
|
+
* A human-readable, multi-line error string (the same text `sync push`
|
|
41
|
+
* prints), or `null` when there are no errors.
|
|
42
|
+
*/
|
|
43
|
+
formatted: string | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validate a workflow TOML **source string** the exact way `sync push` does.
|
|
47
|
+
*
|
|
48
|
+
* Runs the identical pipeline `sync push` runs on every workflow file:
|
|
49
|
+
* `TOML.parse(raw)` → `expandWorkflowTomlData(parsed, filePath)`
|
|
50
|
+
* → `validateWorkflowToml(expanded)` → `formatWorkflowTomlErrors(...)`.
|
|
51
|
+
*
|
|
52
|
+
* The `include` fragment expansion resolves fragments relative to
|
|
53
|
+
* `<filePath>/../../workflow-fragments/` — pass the real (or intended) on-disk
|
|
54
|
+
* path of the workflow so fragment resolution matches `sync push`. If the
|
|
55
|
+
* source uses no `include` key the expander is a no-op and `filePath` is only
|
|
56
|
+
* used for error attribution.
|
|
57
|
+
*
|
|
58
|
+
* @param raw The raw workflow TOML source string.
|
|
59
|
+
* @param filePath The workflow's file path (used for fragment resolution and
|
|
60
|
+
* error attribution).
|
|
61
|
+
* @returns `{ errors, formatted }` — `errors` is empty and `formatted` is
|
|
62
|
+
* `null` when the source is valid.
|
|
63
|
+
*/
|
|
64
|
+
export declare function validateWorkflowTomlSource(raw: string, filePath: string): WorkflowTomlSourceResult;
|