primitive-admin 1.3.0-alpha.0 → 1.3.0-alpha.2
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 +45 -0
- package/dist/src/commands/admins.js +91 -0
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/auth-passkeys.d.ts +7 -0
- package/dist/src/commands/auth-passkeys.js +99 -0
- package/dist/src/commands/auth-passkeys.js.map +1 -0
- package/dist/src/commands/auth-sessions.js +7 -28
- package/dist/src/commands/auth-sessions.js.map +1 -1
- package/dist/src/commands/auth.js +32 -6
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/db3-types.d.ts +27 -0
- package/dist/src/commands/db3-types.js +288 -2
- package/dist/src/commands/db3-types.js.map +1 -1
- package/dist/src/commands/db3.d.ts +16 -2
- package/dist/src/commands/db3.js +614 -5
- package/dist/src/commands/db3.js.map +1 -1
- package/dist/src/commands/documents.js +7 -0
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/functions.js +8 -3
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/hosting.js +177 -14
- package/dist/src/commands/hosting.js.map +1 -1
- package/dist/src/commands/metadata.js +14 -6
- package/dist/src/commands/metadata.js.map +1 -1
- package/dist/src/commands/secrets.d.ts +38 -0
- package/dist/src/commands/secrets.js +102 -4
- package/dist/src/commands/secrets.js.map +1 -1
- package/dist/src/commands/spent-tokens.d.ts +19 -0
- package/dist/src/commands/spent-tokens.js +79 -0
- package/dist/src/commands/spent-tokens.js.map +1 -0
- package/dist/src/commands/sync-app-settings.d.ts +145 -0
- package/dist/src/commands/sync-app-settings.js +341 -8
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +62 -15
- package/dist/src/commands/sync.js +437 -48
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/usage.d.ts +24 -0
- package/dist/src/commands/usage.js +54 -0
- package/dist/src/commands/usage.js.map +1 -1
- package/dist/src/commands/users.js +41 -1
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/lib/admin-login-tables.d.ts +31 -0
- package/dist/src/lib/admin-login-tables.js +75 -0
- package/dist/src/lib/admin-login-tables.js.map +1 -0
- package/dist/src/lib/api-client.d.ts +241 -0
- package/dist/src/lib/api-client.js +203 -10
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +42 -3
- package/dist/src/lib/app-settings-descriptor.js +114 -1
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/auth-flow.d.ts +13 -0
- package/dist/src/lib/auth-flow.js +23 -2
- package/dist/src/lib/auth-flow.js.map +1 -1
- package/dist/src/lib/command-groups.js +2 -0
- package/dist/src/lib/command-groups.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.js +6 -1
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/credentials-store.d.ts +19 -0
- package/dist/src/lib/credentials-store.js +66 -2
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/db-codegen/dbTypeIR.d.ts +2 -0
- package/dist/src/lib/db-codegen/dbTypeIR.js +3 -1
- package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -1
- package/dist/src/lib/db-type-records.d.ts +20 -1
- package/dist/src/lib/db-type-records.js +17 -4
- package/dist/src/lib/db-type-records.js.map +1 -1
- package/dist/src/lib/db3-export.d.ts +43 -8
- package/dist/src/lib/db3-export.js +133 -13
- package/dist/src/lib/db3-export.js.map +1 -1
- package/dist/src/lib/db3-json-fields.d.ts +49 -0
- package/dist/src/lib/db3-json-fields.js +195 -0
- package/dist/src/lib/db3-json-fields.js.map +1 -0
- package/dist/src/lib/db3-type-archive.d.ts +59 -0
- package/dist/src/lib/db3-type-archive.js +95 -0
- package/dist/src/lib/db3-type-archive.js.map +1 -0
- package/dist/src/lib/db3-type-models.d.ts +15 -1
- package/dist/src/lib/db3-type-models.js +147 -16
- package/dist/src/lib/db3-type-models.js.map +1 -1
- package/dist/src/lib/document-export-record-log.d.ts +7 -0
- package/dist/src/lib/document-export-record-log.js +9 -0
- package/dist/src/lib/document-export-record-log.js.map +1 -1
- package/dist/src/lib/document-ingest-artifact.d.ts +6 -0
- package/dist/src/lib/document-ingest-artifact.js +20 -1
- package/dist/src/lib/document-ingest-artifact.js.map +1 -1
- package/dist/src/lib/function-authorize-check.js +5 -0
- package/dist/src/lib/function-authorize-check.js.map +1 -1
- package/dist/src/lib/function-authorize-view.d.ts +9 -0
- package/dist/src/lib/function-authorize-view.js +27 -4
- package/dist/src/lib/function-authorize-view.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +28 -0
- package/dist/src/lib/function-collect.js +129 -2
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-db-types.js +31 -2
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-grants-preflight.d.ts +99 -0
- package/dist/src/lib/function-grants-preflight.js +154 -2
- package/dist/src/lib/function-grants-preflight.js.map +1 -1
- package/dist/src/lib/function-lint.d.ts +29 -1
- package/dist/src/lib/function-lint.js +208 -0
- package/dist/src/lib/function-lint.js.map +1 -1
- package/dist/src/lib/function-sync.d.ts +73 -0
- package/dist/src/lib/function-sync.js +107 -2
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/generated-command-status.js +46 -8
- package/dist/src/lib/generated-command-status.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +351 -9
- package/dist/src/lib/generated-config-surfaces.js +1009 -24
- 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/hosting-trust-step.d.ts +67 -0
- package/dist/src/lib/hosting-trust-step.js +279 -0
- package/dist/src/lib/hosting-trust-step.js.map +1 -0
- package/dist/src/lib/hosting-trust.d.ts +77 -0
- package/dist/src/lib/hosting-trust.js +194 -0
- package/dist/src/lib/hosting-trust.js.map +1 -0
- package/dist/src/lib/primitive-declaration.js +89 -10
- package/dist/src/lib/primitive-declaration.js.map +1 -1
- package/dist/src/lib/refresh-admin-credentials.d.ts +34 -4
- package/dist/src/lib/refresh-admin-credentials.js +85 -29
- package/dist/src/lib/refresh-admin-credentials.js.map +1 -1
- package/dist/src/lib/refresh-stored-login.d.ts +85 -0
- package/dist/src/lib/refresh-stored-login.js +233 -0
- package/dist/src/lib/refresh-stored-login.js.map +1 -0
- package/dist/src/lib/row-field-rename.d.ts +18 -0
- package/dist/src/lib/row-field-rename.js +32 -0
- package/dist/src/lib/row-field-rename.js.map +1 -0
- package/dist/src/lib/schema-codegen/generated-field-grammar.d.ts +13 -2
- package/dist/src/lib/schema-codegen/generated-field-grammar.js +24 -1
- package/dist/src/lib/schema-codegen/generated-field-grammar.js.map +1 -1
- package/dist/src/lib/schema-defs-module.d.ts +29 -0
- package/dist/src/lib/schema-defs-module.js +103 -0
- package/dist/src/lib/schema-defs-module.js.map +1 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.d.ts +6 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js +74 -0
- package/dist/src/lib/swift-codegen/sharedGenerator.js.map +1 -1
- package/dist/src/lib/toml-list-edit.d.ts +33 -0
- package/dist/src/lib/toml-list-edit.js +481 -0
- package/dist/src/lib/toml-list-edit.js.map +1 -0
- package/dist/src/lib/toml-scalar-edit.d.ts +9 -0
- package/dist/src/lib/toml-scalar-edit.js +67 -1
- package/dist/src/lib/toml-scalar-edit.js.map +1 -1
- package/dist/src/lib/usage-meters.d.ts +16 -0
- package/dist/src/lib/usage-meters.js +52 -0
- package/dist/src/lib/usage-meters.js.map +1 -0
- package/dist/src/types/index.d.ts +9 -0
- package/package.json +2 -2
|
@@ -730,8 +730,8 @@ export declare function runConfigPushPreflight(input: {
|
|
|
730
730
|
* tree's, never this app's, so it is out of the validated body.
|
|
731
731
|
*/
|
|
732
732
|
localEnvironment?: boolean;
|
|
733
|
-
/** #5249
|
|
734
|
-
client: Pick<ApiClient, "listIntegrations" | "listFunctions" | "listPrompts" | "listPromptConfigs" | "getPrompt" | "listSchemaFiles" | "listDatabaseTypeConfigs">;
|
|
733
|
+
/** #5249 `getPrompt`: a prompt read. #6119 `getFunctionConfigEnvelope`: an active version read. */
|
|
734
|
+
client: Pick<ApiClient, "listIntegrations" | "listFunctions" | "listPrompts" | "listPromptConfigs" | "getPrompt" | "listSchemaFiles" | "listDatabaseTypeConfigs" | "getFunctionConfigEnvelope">;
|
|
735
735
|
/** #4485 — the environment's vars override file, layered over vars.toml. */
|
|
736
736
|
varsOverridePath?: string | null;
|
|
737
737
|
/**
|
|
@@ -1062,10 +1062,22 @@ export declare function serializeDb3Type(typeConfig: any, ruleSetIdToName: Map<s
|
|
|
1062
1062
|
/**
|
|
1063
1063
|
* #4802 — a `db3-types/<name>.toml` file as the payload `PUT db3-types/:name`
|
|
1064
1064
|
* takes: the database type file's, its type read from `[type] name`.
|
|
1065
|
+
* #6020 — `[type] archived = true` reads as `archived: true`; `false` and an
|
|
1066
|
+
* absent key both read as active (no key), the spelling a pull writes.
|
|
1065
1067
|
*/
|
|
1066
1068
|
export declare function parseDb3TypeToml(tomlData: any): {
|
|
1067
1069
|
typeConfig: any;
|
|
1068
1070
|
};
|
|
1071
|
+
/**
|
|
1072
|
+
* #5998 — the preflight refusal of a `db3-types/` file whose `[type] create`
|
|
1073
|
+
* is not `"admins"` or `"members"`, or `null` when it is one or absent.
|
|
1074
|
+
*/
|
|
1075
|
+
export declare function db3TypeCreateKeyError(filePath: string, tomlData: any): string | null;
|
|
1076
|
+
/**
|
|
1077
|
+
* #6020 — the preflight refusal of a `db3-types/` file whose `[type]
|
|
1078
|
+
* archived` is not a boolean, or `null` when it is one or absent.
|
|
1079
|
+
*/
|
|
1080
|
+
export declare function db3TypeArchivedKeyError(filePath: string, tomlData: any): string | null;
|
|
1069
1081
|
/**
|
|
1070
1082
|
* Flatten an email-template detail response onto its field surface.
|
|
1071
1083
|
*
|
|
@@ -1399,6 +1411,15 @@ export declare function appendOnlyReasonLines(type: string, reasons: Array<{
|
|
|
1399
1411
|
path: string;
|
|
1400
1412
|
reason: string;
|
|
1401
1413
|
}>): string[];
|
|
1414
|
+
/**
|
|
1415
|
+
* What a type write's answer says about the type's field lifecycle, as
|
|
1416
|
+
* `config push` prints it: `deprecatedFields` as a reminder, and
|
|
1417
|
+
* `unclearedFields` as a warning that the return is partial.
|
|
1418
|
+
*/
|
|
1419
|
+
export declare function fieldLifecycleLines(type: string, answer: any): {
|
|
1420
|
+
info: string[];
|
|
1421
|
+
warn: string[];
|
|
1422
|
+
};
|
|
1402
1423
|
/** The reasons of a `409 DB3_TYPE_NOT_APPEND_ONLY`, or `null` for any other error. */
|
|
1403
1424
|
export declare function appendOnlyReasonsOf(err: unknown): AppendOnlyRefusal["reasons"] | null;
|
|
1404
1425
|
/**
|
|
@@ -1471,6 +1492,45 @@ export declare function db3TypeConflictHint(name: string): string;
|
|
|
1471
1492
|
* the next such edit as both sides having changed.
|
|
1472
1493
|
*/
|
|
1473
1494
|
export declare function db3TypeWriteBaseline(answerType: any, name: string, maps: ConfigDiffMaps): string | undefined;
|
|
1495
|
+
/**
|
|
1496
|
+
* #6020 — the environment variable naming the file `config push`'s db3 type
|
|
1497
|
+
* step writes each type's outcome to. Set only by `db3-types archive` and
|
|
1498
|
+
* `unarchive`, which run `config push --only db3-type/<type>` and must tell a
|
|
1499
|
+
* refusal from a write whose answer was lost.
|
|
1500
|
+
*/
|
|
1501
|
+
export declare const DB3_TYPE_PUSH_REPORT_ENV = "PRIMITIVE_INTERNAL_DB3_TYPE_PUSH_REPORT";
|
|
1502
|
+
/** What `config push` did with one db3 type file (#6020), as the report file holds it. */
|
|
1503
|
+
export type Db3TypePushReport = {
|
|
1504
|
+
outcome: "applied";
|
|
1505
|
+
answer: any;
|
|
1506
|
+
} | {
|
|
1507
|
+
outcome: "skipped";
|
|
1508
|
+
} | {
|
|
1509
|
+
outcome: "declined";
|
|
1510
|
+
action: string;
|
|
1511
|
+
} | {
|
|
1512
|
+
outcome: "failed";
|
|
1513
|
+
failure: {
|
|
1514
|
+
name?: string;
|
|
1515
|
+
message: string;
|
|
1516
|
+
statusCode?: number;
|
|
1517
|
+
code?: string;
|
|
1518
|
+
};
|
|
1519
|
+
};
|
|
1520
|
+
/**
|
|
1521
|
+
* The sync baseline of one `db3-types/` file: the row's `modifiedAt`, the
|
|
1522
|
+
* file's bytes, the semantic hash of the row and whether it holds a schema.
|
|
1523
|
+
* The legacy twin's baseline moves with the row, so its prune and its next
|
|
1524
|
+
* push read no drift. Shared by `config push` and `db3-types archive` (#6020).
|
|
1525
|
+
*/
|
|
1526
|
+
export declare function recordDb3TypeBaseline(syncState: SyncState, name: string, filePath: string, modifiedAt: string, semanticHash?: string, hasSchema?: boolean): void;
|
|
1527
|
+
/**
|
|
1528
|
+
* #6020 — stamp the sync baseline of one `db3-types/` file from a type read
|
|
1529
|
+
* back from `GET db3-types/:name` (the db3 type answer), as a push's answer
|
|
1530
|
+
* stamps it: used when the push's own answer was lost and the read confirmed
|
|
1531
|
+
* the write. Writes nothing when this tree has no sync state for the app.
|
|
1532
|
+
*/
|
|
1533
|
+
export declare function stampDb3TypeBaselineFromRead(name: string, filePath: string, type: any): void;
|
|
1474
1534
|
/**
|
|
1475
1535
|
* #5025 — the hint a declined `db3-types/` push carries: the conflict hint
|
|
1476
1536
|
* when the row is live but this tree holds no baseline for it, none otherwise.
|
|
@@ -2141,19 +2201,6 @@ export declare function pulledSemanticHash(label: string, serverContent: string,
|
|
|
2141
2201
|
* behind it, so only comments, key order and spelling are free.
|
|
2142
2202
|
*/
|
|
2143
2203
|
export declare function sameTomlAs(serverContent: string): (localContent: string) => boolean;
|
|
2144
|
-
/**
|
|
2145
|
-
* The sync state `config push` writes into (#2731 B6, closing #2374).
|
|
2146
|
-
*
|
|
2147
|
-
* `loadSyncState` answers `null` for an absent sync-state baseline, and
|
|
2148
|
-
* every per-entity state write in the push loops is guarded by `if (syncState)`
|
|
2149
|
-
* — so a first push created every resource and recorded none of them. The next
|
|
2150
|
-
* push then re-entered the create path for everything and depended on 409
|
|
2151
|
-
* adoption to recover, which for database types hard-failed on operations.
|
|
2152
|
-
*
|
|
2153
|
-
* Building the state up front (the same shape the cross-app-push branch
|
|
2154
|
-
* already builds) makes those guards hold from the first run, so the
|
|
2155
|
-
* end-of-push and catch-path saves persist what the push actually did.
|
|
2156
|
-
*/
|
|
2157
2204
|
export declare function ensurePushSyncState(existing: SyncState | null, appId: string, serverUrl: string): SyncState;
|
|
2158
2205
|
/**
|
|
2159
2206
|
* `parseTomlFile`, or null for a file whose field table does not compile
|