primitive-admin 1.1.0-alpha.65 → 1.1.0-alpha.66
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 +4 -4
- package/assets/skill/skills/primitive-platform/SKILL.md +15 -7
- package/dist/bin/primitive.js +4 -3
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/apps.js +14 -5
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/env.d.ts +12 -1
- package/dist/src/commands/env.js +96 -21
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.js +78 -25
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/sync-app-settings.d.ts +83 -55
- package/dist/src/commands/sync-app-settings.js +131 -200
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +240 -28
- package/dist/src/commands/sync.js +2022 -309
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/workflows.js +14 -3
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +143 -15
- package/dist/src/lib/app-settings-descriptor.js +315 -28
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/config-payload.js +14 -3
- package/dist/src/lib/config-payload.js.map +1 -1
- package/dist/src/lib/config-surface.d.ts +37 -1
- package/dist/src/lib/config-surface.js +118 -0
- package/dist/src/lib/config-surface.js.map +1 -1
- package/dist/src/lib/env-resolver-core.d.ts +147 -0
- package/dist/src/lib/env-resolver-core.js +265 -0
- package/dist/src/lib/env-resolver-core.js.map +1 -0
- package/dist/src/lib/env-resolver.d.ts +28 -6
- package/dist/src/lib/env-resolver.js +44 -32
- package/dist/src/lib/env-resolver.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +33 -0
- package/dist/src/lib/generated-config-surfaces.js +151 -49
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/integration-request-config.d.ts +30 -0
- package/dist/src/lib/integration-request-config.js +145 -0
- package/dist/src/lib/integration-request-config.js.map +1 -0
- package/dist/src/lib/local-state.d.ts +55 -0
- package/dist/src/lib/local-state.js +167 -0
- package/dist/src/lib/local-state.js.map +1 -0
- package/dist/src/lib/server-text-normalization.d.ts +51 -0
- package/dist/src/lib/server-text-normalization.js +90 -0
- package/dist/src/lib/server-text-normalization.js.map +1 -0
- package/dist/src/lib/sync-resource-types.d.ts +8 -0
- package/dist/src/lib/sync-resource-types.js +8 -0
- package/dist/src/lib/sync-resource-types.js.map +1 -1
- package/dist/src/lib/template.d.ts +27 -0
- package/dist/src/lib/template.js +46 -20
- package/dist/src/lib/template.js.map +1 -1
- package/dist/src/types/index.d.ts +31 -7
- package/package.json +2 -2
|
@@ -13,22 +13,32 @@
|
|
|
13
13
|
* `RECOGNIZED_AUTH_KEYS` pattern to every section, and fully replaces it.
|
|
14
14
|
*
|
|
15
15
|
* Design decisions of record (issue #1033):
|
|
16
|
-
* -
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* - Google is a typed client MAP (#2891): `googleClients` renders as
|
|
17
|
+
* `[auth.google.clients.<type>]`, and each entry's `clientSecret` holds a
|
|
18
|
+
* whole `{{secrets.KEY}}` reference rather than the secret itself, so the
|
|
19
|
+
* map round-trips through `app.toml` like any other setting.
|
|
20
20
|
* - `[cors]` is always emitted (the `mode` key is `emit: "always"`), even in
|
|
21
21
|
* universal mode. A one-time diff on the next pull for existing apps is
|
|
22
22
|
* acceptable.
|
|
23
23
|
* - `[invitations]` is an additive table for the member-invitation fields.
|
|
24
|
-
* -
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
24
|
+
* - Nothing is writable-but-excluded any more (#2891). The legacy passkey
|
|
25
|
+
* pair and the three Google/redirect scalars are RETIRED: not writable, not
|
|
26
|
+
* synced, and refused by name with their own guidance when an old
|
|
27
|
+
* `app.toml` still carries them.
|
|
28
28
|
* - Push type mismatches are field-named validation errors — no silent
|
|
29
29
|
* coercion of a mistyped TOML value.
|
|
30
|
+
* - THE FILE IS THE WHOLE TRUTH (#2880, sponsor 2026-08-21). `app.toml` used
|
|
31
|
+
* to be the one surface where an omitted key preserved the server's value,
|
|
32
|
+
* while every other type follows "the local file is the source of truth"
|
|
33
|
+
* (#1567). That exception is gone: push emits a value for EVERY writable
|
|
34
|
+
* field, and a key the file does not carry clears the field or resets it to
|
|
35
|
+
* its declared default (`APP_SETTINGS_ABSENT_VALUES`). `[app].name` and
|
|
36
|
+
* `[app].mode` are the two exceptions — no default, identity-critical, and
|
|
37
|
+
* `mode: null` is a 400 — so their absence is a validation error instead.
|
|
30
38
|
*/
|
|
31
39
|
import { findUnknownDocumentKeys, requireConfigSurface, } from "./config-surface.js";
|
|
40
|
+
import { retiredConfigKey } from "./generated-config-surfaces.js";
|
|
41
|
+
import { canonicalizeSecretReference } from "./server-text-normalization.js";
|
|
32
42
|
/**
|
|
33
43
|
* The vendored `app-settings` definition (#2644) this module projects. Read
|
|
34
44
|
* once at load; a missing definition fails loudly rather than yielding an
|
|
@@ -69,19 +79,15 @@ export const APP_SETTINGS_SECTIONS = APP_SETTINGS_SURFACE.tables.map((table) =>
|
|
|
69
79
|
*/
|
|
70
80
|
export const IGNORED_GET_KEYS = new Set([
|
|
71
81
|
"appId",
|
|
72
|
-
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
// `
|
|
80
|
-
//
|
|
81
|
-
// syntax that resolves to nothing (#2332). Derived and read-only: it exists
|
|
82
|
-
// so an operator can be told to remediate a value the server refuses to send
|
|
83
|
-
// back.
|
|
84
|
-
"googleClientSecretStatus",
|
|
82
|
+
// `hasGoogleAuth`, `googleClientSecretSet` and `googleClientSecretStatus` are
|
|
83
|
+
// GONE (#2891), not ignored: the first could not describe a per-platform
|
|
84
|
+
// configuration, and the other two existed only to report a value the server
|
|
85
|
+
// refused to send back. The map states availability per entry and the stored
|
|
86
|
+
// reference is echoed, so a response still carrying any of them is a server
|
|
87
|
+
// this CLI does not understand — worth failing the drift guard over.
|
|
88
|
+
//
|
|
89
|
+
// `hasAppleAuth` / `hasPasskey` stay: the asymmetry is deliberate, since
|
|
90
|
+
// Apple and passkeys have no map to derive per-platform truth from.
|
|
85
91
|
"hasAppleAuth",
|
|
86
92
|
"hasPasskey",
|
|
87
93
|
"createdAt",
|
|
@@ -100,6 +106,200 @@ export const DEPRECATED_WRITABLE_EXCLUDED = new Set(
|
|
|
100
106
|
APP_SETTINGS_SURFACE.tables.flatMap((table) => Object.entries(table.notExposed)
|
|
101
107
|
.filter(([, classification]) => classification.kind === "deprecated")
|
|
102
108
|
.map(([field]) => field)));
|
|
109
|
+
export const APP_SETTINGS_ABSENT_VALUES = {
|
|
110
|
+
// [app]
|
|
111
|
+
name: { required: true },
|
|
112
|
+
mode: { required: true },
|
|
113
|
+
baseUrl: { value: null },
|
|
114
|
+
waitlistEnabled: { value: false },
|
|
115
|
+
waitlistNotifyAdmins: { value: true },
|
|
116
|
+
directLlmEnabled: { value: false },
|
|
117
|
+
allowedDomains: { value: null },
|
|
118
|
+
testAccountBaseEmails: { value: null },
|
|
119
|
+
// [auth]
|
|
120
|
+
googleOAuthEnabled: { value: null },
|
|
121
|
+
googleClients: { value: null },
|
|
122
|
+
passkeyEnabled: { value: false },
|
|
123
|
+
magicLinkEnabled: { value: true },
|
|
124
|
+
appleSignInEnabled: { value: null },
|
|
125
|
+
otpEnabled: { value: true },
|
|
126
|
+
appleAudiences: { value: null },
|
|
127
|
+
emailRedirectUris: { value: null },
|
|
128
|
+
passkeyRpConfig: { value: null },
|
|
129
|
+
// [cors]
|
|
130
|
+
corsMode: { value: "universal" },
|
|
131
|
+
corsAllowedOrigins: { value: null },
|
|
132
|
+
corsAllowCredentials: { value: false },
|
|
133
|
+
corsAllowedMethods: { value: null },
|
|
134
|
+
corsAllowedHeaders: { value: null },
|
|
135
|
+
corsExposedHeaders: { value: null },
|
|
136
|
+
corsMaxAge: { value: null },
|
|
137
|
+
// [invitations]
|
|
138
|
+
memberInvitationsEnabled: { value: false },
|
|
139
|
+
memberInvitationLimit: { value: 5 },
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* The absent-key rule for one field, or a loud failure.
|
|
143
|
+
*
|
|
144
|
+
* Deliberately a throw rather than a `?? null` fallback: under whole-truth push
|
|
145
|
+
* an unlisted field would be CLEARED on every push by a table nobody updated.
|
|
146
|
+
*/
|
|
147
|
+
export function appSettingAbsentValue(field) {
|
|
148
|
+
const entry = APP_SETTINGS_ABSENT_VALUES[field];
|
|
149
|
+
if (!entry) {
|
|
150
|
+
throw new Error(`app.toml: no absent-key rule declared for the setting \`${field}\`. ` +
|
|
151
|
+
`Add it to APP_SETTINGS_ABSENT_VALUES (cli/src/lib/app-settings-descriptor.ts) ` +
|
|
152
|
+
`— push sends a value for every writable field (#2880).`);
|
|
153
|
+
}
|
|
154
|
+
return entry;
|
|
155
|
+
}
|
|
156
|
+
/** Fields whose absence is a validation error rather than a clear (#2880). */
|
|
157
|
+
export const REQUIRED_APP_SETTING_FIELDS = APP_SETTINGS_DESCRIPTOR.filter((d) => APP_SETTINGS_ABSENT_VALUES[d.field]?.required === true).map((d) => d.field);
|
|
158
|
+
/**
|
|
159
|
+
* The value the SERVER would hold after accepting this one (#2880 DSO-003).
|
|
160
|
+
*
|
|
161
|
+
* The comparison runs on the local side only: push forwards what the file says
|
|
162
|
+
* and the server normalizes it, so without this an authored-but-noncanonical
|
|
163
|
+
* value (`baseUrl` with a trailing slash, a mixed-case test-account email)
|
|
164
|
+
* differs from the record the server returns FOREVER — and baseline restamping
|
|
165
|
+
* cannot save it, because after an apply the remote hash matches the new
|
|
166
|
+
* baseline while the local hash still does not, re-classifying `local-edited`
|
|
167
|
+
* on every run.
|
|
168
|
+
*
|
|
169
|
+
* Mirrors the rules in `settings-controller.ts` (`baseUrl` trim + trailing
|
|
170
|
+
* slash), `validateTestAccountBaseEmails` (trim, lower-case, dedupe) and
|
|
171
|
+
* `validateRedirectUris` (trim, dedupe). Only the NORMALIZATION is mirrored,
|
|
172
|
+
* never the rejection: an entry the server would refuse stays as authored so
|
|
173
|
+
* the server's own 400 is what the operator sees.
|
|
174
|
+
*/
|
|
175
|
+
export function canonicalizeAppSettingValue(field, value) {
|
|
176
|
+
if (value === null || value === undefined)
|
|
177
|
+
return value;
|
|
178
|
+
if (field === "baseUrl") {
|
|
179
|
+
if (typeof value !== "string")
|
|
180
|
+
return value;
|
|
181
|
+
const trimmed = value.trim().replace(/\/+$/, "");
|
|
182
|
+
return trimmed === "" ? null : trimmed;
|
|
183
|
+
}
|
|
184
|
+
if (field === "testAccountBaseEmails" || field === "emailRedirectUris") {
|
|
185
|
+
if (!Array.isArray(value))
|
|
186
|
+
return value;
|
|
187
|
+
const lower = field === "testAccountBaseEmails";
|
|
188
|
+
const seen = new Set();
|
|
189
|
+
const out = [];
|
|
190
|
+
for (const entry of value) {
|
|
191
|
+
if (typeof entry !== "string") {
|
|
192
|
+
out.push(entry);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const normalized = lower ? entry.trim().toLowerCase() : entry.trim();
|
|
196
|
+
if (seen.has(normalized))
|
|
197
|
+
continue;
|
|
198
|
+
seen.add(normalized);
|
|
199
|
+
out.push(normalized);
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
if (field === "appleAudiences") {
|
|
204
|
+
if (!Array.isArray(value))
|
|
205
|
+
return value;
|
|
206
|
+
// The controller filters non-empty strings and stores `null` for an empty
|
|
207
|
+
// result, so a list of blanks is the same state as no list at all.
|
|
208
|
+
return value.filter((v) => typeof v === "string" && v.length > 0);
|
|
209
|
+
}
|
|
210
|
+
if (field === "googleClients")
|
|
211
|
+
return canonicalizeGoogleClients(value);
|
|
212
|
+
return value;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The typed Google client map as the server STORES it (#2880 DSO-003).
|
|
216
|
+
*
|
|
217
|
+
* `validateGoogleClientsWrite` (`src/services/google-clients.ts`) rewrites each
|
|
218
|
+
* accepted entry: the `clientId` is trimmed, the `clientSecret` is stored as
|
|
219
|
+
* the canonical `{{secrets.KEY}}` reference, the redirect URIs are trimmed and
|
|
220
|
+
* de-duplicated (`validateRedirectUris`), and an entry that states none at all
|
|
221
|
+
* stores the empty list. Without mirroring that, an authored
|
|
222
|
+
* `clientId = " 123.apps... "` — or a `{{ secrets.KEY }}` written with the
|
|
223
|
+
* spacing TOML makes easy — is a `Modified` row on every run against a value
|
|
224
|
+
* push already applied.
|
|
225
|
+
*
|
|
226
|
+
* Normalization only, never rejection: an entry the server would refuse (a
|
|
227
|
+
* `clientSecret` that is not a reference, a URI it will not take) is left as
|
|
228
|
+
* authored so the `PUT`'s own 400 is what the operator sees.
|
|
229
|
+
*/
|
|
230
|
+
function canonicalizeGoogleClients(value) {
|
|
231
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
232
|
+
return value;
|
|
233
|
+
const clients = value.clients;
|
|
234
|
+
if (!clients || typeof clients !== "object" || Array.isArray(clients)) {
|
|
235
|
+
return value;
|
|
236
|
+
}
|
|
237
|
+
const out = {};
|
|
238
|
+
for (const [type, entry] of Object.entries(clients)) {
|
|
239
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
240
|
+
out[type] = entry;
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
const source = entry;
|
|
244
|
+
const canonical = { ...source };
|
|
245
|
+
if (typeof source.clientId === "string") {
|
|
246
|
+
canonical.clientId = source.clientId.trim();
|
|
247
|
+
}
|
|
248
|
+
if (source.clientSecret !== undefined) {
|
|
249
|
+
canonical.clientSecret = canonicalizeSecretReference(source.clientSecret);
|
|
250
|
+
}
|
|
251
|
+
// Trimmed and de-duplicated, and materialized when the entry states none —
|
|
252
|
+
// the server stores `[]` either way, so "no key" and "empty list" are one
|
|
253
|
+
// state rather than a difference no push can close.
|
|
254
|
+
canonical.redirectUris = Array.isArray(source.redirectUris)
|
|
255
|
+
? [
|
|
256
|
+
...new Set(source.redirectUris.map((uri) => typeof uri === "string" ? uri.trim() : uri)),
|
|
257
|
+
]
|
|
258
|
+
: [];
|
|
259
|
+
out[type] = canonical;
|
|
260
|
+
}
|
|
261
|
+
return { clients: out };
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* One field's comparable value — what `config diff` and the push gate both read.
|
|
265
|
+
*
|
|
266
|
+
* Canonicalized as above, then flattened to `null` when the value is "empty"
|
|
267
|
+
* under an `emit: "whenSet"` field's own rule. That second step is the
|
|
268
|
+
* app-settings copy of what `projectConfigForComparison` does for every other
|
|
269
|
+
* type (#2731): pull OMITS an empty `whenSet` value, so the file it round-trips
|
|
270
|
+
* to has no key, and comparing `[]` against "no key" would be a difference no
|
|
271
|
+
* push could ever converge.
|
|
272
|
+
*/
|
|
273
|
+
export function comparableAppSettingValue(descriptor, value) {
|
|
274
|
+
const canonical = canonicalizeAppSettingValue(descriptor.field, value);
|
|
275
|
+
if (canonical === undefined)
|
|
276
|
+
return null;
|
|
277
|
+
if (descriptor.emit === "whenSet" && isEmptyForEmit(canonical, descriptor.type)) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
return canonical ?? null;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Project a settings record (either side) onto the full writable field set.
|
|
284
|
+
*
|
|
285
|
+
* `excludeName` is the cross-app rule (#2880 DSO-001): while a cross-app push's
|
|
286
|
+
* name exclusion is active, BOTH sides and the stamped baseline are hashed
|
|
287
|
+
* without `name`, so `classifyPushChange`'s `remoteHash === baselineHash ⇒
|
|
288
|
+
* local-edited` arithmetic stays valid.
|
|
289
|
+
*/
|
|
290
|
+
export function projectAppSettingsForComparison(settings, options = {}) {
|
|
291
|
+
const projected = {};
|
|
292
|
+
for (const d of APP_SETTINGS_DESCRIPTOR) {
|
|
293
|
+
if (options.excludeName && d.field === "name")
|
|
294
|
+
continue;
|
|
295
|
+
const raw = settings?.[d.field];
|
|
296
|
+
const absent = APP_SETTINGS_ABSENT_VALUES[d.field];
|
|
297
|
+
projected[d.field] = comparableAppSettingValue(d, raw === undefined && absent && absent.required !== true
|
|
298
|
+
? absent.value
|
|
299
|
+
: raw);
|
|
300
|
+
}
|
|
301
|
+
return projected;
|
|
302
|
+
}
|
|
103
303
|
const DESCRIPTOR_BY_SECTION = (() => {
|
|
104
304
|
const m = new Map();
|
|
105
305
|
for (const d of APP_SETTINGS_DESCRIPTOR) {
|
|
@@ -198,17 +398,22 @@ export function serializeAppSettingsToToml(settings) {
|
|
|
198
398
|
return data;
|
|
199
399
|
}
|
|
200
400
|
/**
|
|
201
|
-
* Translate a parsed `app.toml` object into
|
|
202
|
-
*
|
|
203
|
-
*
|
|
401
|
+
* Translate a parsed `app.toml` object into the settings the FILE STATES —
|
|
402
|
+
* only the keys it carries. This is the parse half; `buildAppSettingsPayload`
|
|
403
|
+
* below turns it into the whole-truth `PUT /settings` body by filling in what
|
|
404
|
+
* the file omits. An unrecognized key or table and a type
|
|
204
405
|
* mismatch are both hard errors the caller must treat as abort-before-PUT
|
|
205
406
|
* (#2644 criterion 6: push rejects what it does not recognize, for every
|
|
206
407
|
* configuration surface, so a typo fails locally instead of being ignored).
|
|
207
408
|
*
|
|
208
|
-
* A `
|
|
209
|
-
* server's rejection to make (#2256): the push forwards
|
|
210
|
-
* 400 with `GOOGLE_CLIENT_SECRET_MUST_BE_SECRET_REF`. Duplicating
|
|
211
|
-
* here would put two definitions of "valid reference" in play.
|
|
409
|
+
* A per-entry `clientSecret` that is not a whole `{{secrets.KEY}}` reference is
|
|
410
|
+
* the server's rejection to make (#2256): the push forwards the map and the
|
|
411
|
+
* `PUT` answers 400 with `GOOGLE_CLIENT_SECRET_MUST_BE_SECRET_REF`. Duplicating
|
|
412
|
+
* the shape rule here would put two definitions of "valid reference" in play.
|
|
413
|
+
*
|
|
414
|
+
* A RETIRED key (#2891) is different: it is not a value the server can judge,
|
|
415
|
+
* it is a line that has to be deleted, so the parser refuses it locally with
|
|
416
|
+
* the guidance that names its replacement.
|
|
212
417
|
*
|
|
213
418
|
* `isCrossAppPush` strips `name` so a cross-app push never overwrites the
|
|
214
419
|
* target app's name.
|
|
@@ -238,6 +443,18 @@ export function parseTomlToAppSettings(tomlData, options = {}) {
|
|
|
238
443
|
for (const key of Object.keys(sectionData)) {
|
|
239
444
|
const d = byKey.get(key);
|
|
240
445
|
if (!d) {
|
|
446
|
+
// A RETIRED key is not an unknown key (#2803's rule, extended to
|
|
447
|
+
// app-settings by #2891/DSO-2891-005). "Check the spelling, or upgrade
|
|
448
|
+
// the CLI" is exactly backwards for a key the platform removed on
|
|
449
|
+
// purpose, and every pre-reshape `app.toml` still carries these lines —
|
|
450
|
+
// so the parser consults the shared retired set directly and says where
|
|
451
|
+
// the value moved to. Keyed under `app`, the app-settings surface's
|
|
452
|
+
// identifier, whichever section the key was authored in.
|
|
453
|
+
const retired = retiredConfigKey("app", key);
|
|
454
|
+
if (retired) {
|
|
455
|
+
errors.push(`app.toml: [${section}].${key} — ${retired.toml}`);
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
241
458
|
// #2644 criterion 6 — REJECTED, not warned-and-ignored. `app.toml` is a
|
|
242
459
|
// registered configuration surface like every other file, and an
|
|
243
460
|
// ignored key is a setting the author believes they changed.
|
|
@@ -259,4 +476,74 @@ export function parseTomlToAppSettings(tomlData, options = {}) {
|
|
|
259
476
|
}
|
|
260
477
|
return { settings, warnings, errors };
|
|
261
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
* `[app].name` / `[app].mode` absent — the two keys whole-truth push refuses to
|
|
481
|
+
* fill in for the author (#2880).
|
|
482
|
+
*
|
|
483
|
+
* Read from the DOCUMENT rather than the parse result, so a cross-app push
|
|
484
|
+
* (which strips `name` before validating) still requires the file to state one.
|
|
485
|
+
* `mode` has no default and `mode: null` is a 400; more to the point, a deleted
|
|
486
|
+
* `mode` line silently resetting an invite-only app to public is the wrong
|
|
487
|
+
* failure to choose.
|
|
488
|
+
*/
|
|
489
|
+
export function missingRequiredKeyErrors(tomlData) {
|
|
490
|
+
const errors = [];
|
|
491
|
+
for (const field of REQUIRED_APP_SETTING_FIELDS) {
|
|
492
|
+
const d = APP_SETTINGS_DESCRIPTOR.find((x) => x.field === field);
|
|
493
|
+
if (!d)
|
|
494
|
+
continue;
|
|
495
|
+
const section = tomlData?.[d.section];
|
|
496
|
+
const present = section !== null &&
|
|
497
|
+
typeof section === "object" &&
|
|
498
|
+
!Array.isArray(section) &&
|
|
499
|
+
section[d.key] !== undefined;
|
|
500
|
+
if (present)
|
|
501
|
+
continue;
|
|
502
|
+
errors.push(`app.toml: [${d.section}].${d.key} is required — \`config push\` applies ` +
|
|
503
|
+
`app.toml as the whole truth, and this field has no default to fall ` +
|
|
504
|
+
`back to. Add the line (\`config pull --only app\` writes it).`);
|
|
505
|
+
}
|
|
506
|
+
return errors;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* The whole-truth `PUT /settings` body (#2880 criterion 4).
|
|
510
|
+
*
|
|
511
|
+
* Every writable field gets a value: the authored one where the file carries
|
|
512
|
+
* the key, its `APP_SETTINGS_ABSENT_VALUES` entry where it does not. That is
|
|
513
|
+
* what makes `app.toml` mean what every other configuration file means — the
|
|
514
|
+
* local file is the state, not a patch over whatever the server happens to
|
|
515
|
+
* hold (#1567). The controller applies only the keys in the body (`if (field in
|
|
516
|
+
* updates)`), so the completeness has to come from here.
|
|
517
|
+
*
|
|
518
|
+
* Values are forwarded AS AUTHORED, never canonicalized: the server owns its
|
|
519
|
+
* own normalization, and a CLI that rewrote the value before sending it would
|
|
520
|
+
* be pushing something the operator did not write. The canonicalization in
|
|
521
|
+
* `canonicalizeAppSettingValue` is for the local COMPARISON only.
|
|
522
|
+
*
|
|
523
|
+
* `excludeName` (and `isCrossAppPush`, which implies it) leaves `name` out of
|
|
524
|
+
* the body entirely, so a cross-app push never renames the target app.
|
|
525
|
+
*/
|
|
526
|
+
export function buildAppSettingsPayload(tomlData, options = {}) {
|
|
527
|
+
const parsed = parseTomlToAppSettings(tomlData, options);
|
|
528
|
+
const errors = [...parsed.errors, ...missingRequiredKeyErrors(tomlData)];
|
|
529
|
+
if (errors.length > 0) {
|
|
530
|
+
return { settings: {}, warnings: parsed.warnings, errors };
|
|
531
|
+
}
|
|
532
|
+
const excludeName = !!(options.isCrossAppPush || options.excludeName);
|
|
533
|
+
const settings = {};
|
|
534
|
+
for (const d of APP_SETTINGS_DESCRIPTOR) {
|
|
535
|
+
if (excludeName && d.field === "name")
|
|
536
|
+
continue;
|
|
537
|
+
if (d.field in parsed.settings) {
|
|
538
|
+
settings[d.field] = parsed.settings[d.field];
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
const absent = appSettingAbsentValue(d.field);
|
|
542
|
+
// Required fields never reach here — their absence already errored above.
|
|
543
|
+
if (absent.required === true)
|
|
544
|
+
continue;
|
|
545
|
+
settings[d.field] = absent.value;
|
|
546
|
+
}
|
|
547
|
+
return { settings, warnings: parsed.warnings, errors: [] };
|
|
548
|
+
}
|
|
262
549
|
//# sourceMappingURL=app-settings-descriptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-settings-descriptor.js","sourceRoot":"","sources":["../../../src/lib/app-settings-descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,cAAc,CAAC,CAAC;AA8BlE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5C,KAAK,CAAC,MAAM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QAAQ,GAAwB,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,uBAAuB,EAAE,CAAC;QACxC,IAAI,WAAW,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;YAAE,SAAS;QAChD,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC/B,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7C,SAAS;QACX,CAAC;QACD,MAAM,MAAM,GAAG,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,0EAA0E;QAC1E,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,SAAS;QACvC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;IACnC,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -65,9 +65,20 @@ export function buildPayloadFromToml(table, tomlTable, { mode, values = {} }) {
|
|
|
65
65
|
if (!field.writableOn.includes(mode))
|
|
66
66
|
continue;
|
|
67
67
|
const produce = values[field.field];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
if (produce) {
|
|
69
|
+
payload[field.field] = produce(source[field.tomlKey], mode, source);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const value = source[field.tomlKey];
|
|
73
|
+
// #2880 DSO-002 — the file is the source of truth (#1567), so an absent key
|
|
74
|
+
// means the field's DECLARED default rather than "leave whatever the server
|
|
75
|
+
// has". Sending it is what makes the comparison's reading of that absence
|
|
76
|
+
// (the same default) something a push can converge on: dropping the key
|
|
77
|
+
// left an out-of-band change in place and re-reported it on every run.
|
|
78
|
+
payload[field.field] =
|
|
79
|
+
value === undefined && field.serverDefault !== undefined
|
|
80
|
+
? field.serverDefault
|
|
81
|
+
: value;
|
|
71
82
|
}
|
|
72
83
|
return payload;
|
|
73
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-payload.js","sourceRoot":"","sources":["../../../src/lib/config-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,GAGnB,MAAM,gCAAgC,CAAC;AAqBxC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAkB,EAClB,MAAW,EACX,SAAoC,EAAE;IAEtC,MAAM,GAAG,GAAwB,EAAE,CAAC;IACpC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;gBAAE,SAAS;QACtD,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACzE,SAAS;QACX,CAAC;QACD,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAkB,EAClB,SAAc,EACd,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAA0D;IAE7E,MAAM,MAA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GAAG,EAAE,EAA0D;IAE7E,MAAM,MAAM,GAAG,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,OAAO,GAAwB,EAAE,CAAC;IACxC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO;YAC5B,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC;YAC5C,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAc,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;AAE7D,+EAA+E;AAC/E,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* trip is therefore loud-and-lossy — push omits what it does not know, so
|
|
16
16
|
* the server keeps its stored values — never silently destructive.
|
|
17
17
|
*/
|
|
18
|
-
import { retiredConfigKey, type ConfigObjectSurface, type ConfigTable } from "./generated-config-surfaces.js";
|
|
18
|
+
import { retiredConfigKey, type ConfigObjectSurface, type ConfigField, type ConfigTable } from "./generated-config-surfaces.js";
|
|
19
19
|
export { retiredConfigKey };
|
|
20
20
|
/** A surface by label. Throws rather than silently skipping checks. */
|
|
21
21
|
export declare function requireConfigSurface(label: string): ConfigObjectSurface;
|
|
@@ -47,6 +47,42 @@ export declare const METADATA_CATEGORY_CONFIG_TABLE: ConfigTable;
|
|
|
47
47
|
export declare const TEST_CASE_TABLE: ConfigTable;
|
|
48
48
|
/** The `test-case` surface itself, for the sidecars' document-shape check. */
|
|
49
49
|
export declare const TEST_CASE_SURFACE: ConfigObjectSurface;
|
|
50
|
+
/**
|
|
51
|
+
* Does this field's declared type genuinely admit more than one spelling
|
|
52
|
+
* (#2880 criterion 5)?
|
|
53
|
+
*
|
|
54
|
+
* Two sources, both recorded rather than inferred: the definition's own
|
|
55
|
+
* `dualEncoded` marker (the #2869 server-`StringField` numbers), and the `json`
|
|
56
|
+
* type, which `config pull` itself writes either as a native TOML table or —
|
|
57
|
+
* for a value TOML cannot hold — as JSON text.
|
|
58
|
+
*/
|
|
59
|
+
export declare function fieldAdmitsMultipleEncodings(field: ConfigField): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Does this string spell a number the way the SERVER reads one back (#2880)?
|
|
62
|
+
*
|
|
63
|
+
* The grammar is `parseFloat`'s — sign, digits, one dot, an exponent, and
|
|
64
|
+
* nothing else — because that is what the server applies to the string it
|
|
65
|
+
* stored when it returns the value parsed. Published here so the declared-type
|
|
66
|
+
* validator and the comparator decide "is a number" the same way: a dual
|
|
67
|
+
* encoding the validator accepts must be one the comparison can equate, or
|
|
68
|
+
* `temperature = "warm"` passes preflight and then differs from the `null` the
|
|
69
|
+
* server reads it back as, on every run, with no push that can clear it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function spellsDecimalNumber(value: string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Every value in `tomlData` whose spelling does not match the type its field
|
|
74
|
+
* declares (#2880 criterion 5).
|
|
75
|
+
*
|
|
76
|
+
* Run by `config push`'s preflight — so a mistyped value fails before any
|
|
77
|
+
* request is issued — and by `config diff`, which renders the identical
|
|
78
|
+
* message instead of calling the file Synced. One validator, one message, two
|
|
79
|
+
* commands: the failure this replaces is a file diff reports as Synced and
|
|
80
|
+
* push then rejects (or, worse, coerces into a value the author did not write).
|
|
81
|
+
*
|
|
82
|
+
* A repeated table names the offending entry by index, so a typo in the third
|
|
83
|
+
* `[[configs]]` block is as findable as one in the first.
|
|
84
|
+
*/
|
|
85
|
+
export declare function configDeclaredTypeErrors(filePath: string, tomlData: unknown, table: ConfigTable): string[];
|
|
50
86
|
/**
|
|
51
87
|
* TOML keys in `table` that the definition does not recognize.
|
|
52
88
|
*
|