primitive-admin 1.3.0-alpha.2 → 1.3.0-alpha.3
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 +46 -22
- package/dist/bin/primitive.js +11 -4
- package/dist/bin/primitive.js.map +1 -1
- package/dist/src/commands/apps.d.ts +3 -6
- package/dist/src/commands/apps.js +7 -22
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/auth-passkeys.js +1 -1
- package/dist/src/commands/auth-passkeys.js.map +1 -1
- package/dist/src/commands/auth.js +1 -1
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/blob-buckets.d.ts +8 -0
- package/dist/src/commands/blob-buckets.js +23 -8
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/db3.js +6 -0
- package/dist/src/commands/db3.js.map +1 -1
- package/dist/src/commands/documents.js +3 -0
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/functions.js +13 -4
- package/dist/src/commands/functions.js.map +1 -1
- package/dist/src/commands/init.js +11 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/rule-sets.d.ts +1 -1
- package/dist/src/commands/rule-sets.js +0 -1
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/sync.d.ts +27 -13
- package/dist/src/commands/sync.js +105 -112
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/usage.d.ts +12 -2
- package/dist/src/commands/usage.js +115 -5
- package/dist/src/commands/usage.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +80 -5
- package/dist/src/lib/api-client.js +21 -9
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/cli-manifest.d.ts +9 -0
- package/dist/src/lib/cli-manifest.js +19 -3
- package/dist/src/lib/cli-manifest.js.map +1 -1
- package/dist/src/lib/config-object-descriptor.js +3 -5
- package/dist/src/lib/config-object-descriptor.js.map +1 -1
- package/dist/src/lib/db3-export.js +1 -0
- package/dist/src/lib/db3-export.js.map +1 -1
- package/dist/src/lib/document-ingest.d.ts +7 -1
- package/dist/src/lib/document-ingest.js +27 -2
- package/dist/src/lib/document-ingest.js.map +1 -1
- package/dist/src/lib/function-bundle.d.ts +6 -0
- package/dist/src/lib/function-bundle.js +14 -0
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-db-types.d.ts +8 -0
- package/dist/src/lib/function-db-types.js +15 -0
- package/dist/src/lib/function-db-types.js.map +1 -1
- package/dist/src/lib/function-log-lines.js +6 -1
- package/dist/src/lib/function-log-lines.js.map +1 -1
- package/dist/src/lib/function-log-row.d.ts +8 -0
- package/dist/src/lib/function-log-row.js +59 -0
- package/dist/src/lib/function-log-row.js.map +1 -1
- package/dist/src/lib/generated-command-status.js +6 -5
- package/dist/src/lib/generated-command-status.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +29 -4
- package/dist/src/lib/generated-config-surfaces.js +160 -49
- 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/log-inspection.d.ts +37 -2
- package/dist/src/lib/log-inspection.js +15 -3
- package/dist/src/lib/log-inspection.js.map +1 -1
- package/dist/src/lib/outside-project.d.ts +49 -0
- package/dist/src/lib/outside-project.js +133 -0
- package/dist/src/lib/outside-project.js.map +1 -0
- package/dist/src/lib/primitive-declaration.d.ts +8 -1
- package/dist/src/lib/primitive-declaration.js +40 -8
- package/dist/src/lib/primitive-declaration.js.map +1 -1
- package/dist/src/lib/schema-codegen/compiledSpace.d.ts +16 -0
- package/dist/src/lib/schema-codegen/compiledSpace.js +23 -11
- package/dist/src/lib/schema-codegen/compiledSpace.js.map +1 -1
- package/dist/src/lib/schema-codegen/generated-field-table.js +38 -3
- package/dist/src/lib/schema-codegen/generated-field-table.js.map +1 -1
- package/dist/src/lib/schema-codegen/generated-schema-refs.js +172 -19
- package/dist/src/lib/schema-codegen/generated-schema-refs.js.map +1 -1
- package/dist/src/lib/schema-codegen/namedRefs.js +8 -2
- package/dist/src/lib/schema-codegen/namedRefs.js.map +1 -1
- package/dist/src/lib/schema-codegen/schemaDocs.js +10 -4
- package/dist/src/lib/schema-codegen/schemaDocs.js.map +1 -1
- package/dist/src/lib/schema-codegen/schemaIR.d.ts +12 -2
- package/dist/src/lib/schema-codegen/schemaIR.js +26 -2
- package/dist/src/lib/schema-codegen/schemaIR.js.map +1 -1
- package/dist/src/lib/schema-codegen/schemaToTs.d.ts +2 -1
- package/dist/src/lib/schema-codegen/schemaToTs.js +8 -5
- package/dist/src/lib/schema-codegen/schemaToTs.js.map +1 -1
- package/dist/src/lib/usage-meters.js +1 -0
- package/dist/src/lib/usage-meters.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-sets.js","sourceRoot":"","sources":["../../../src/commands/rule-sets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAEL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,IAAI,WAAW,EACrB,WAAW,EACX,QAAQ,EACR,UAAU,EACV,IAAI,GACL,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,4EAA4E;AAC5E,qDAAqD;AACrD,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF;AACnF,4EAA4E;AAC5E,gFAAgF;AAChF,kEAAkE;AAClE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,UAAU;IACV,KAAK;IACL,OAAO;I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GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACvD,CAAC;YAED,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACxB,OAAO,CAAC,GAAG,CACT,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE;oBACxB,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE;oBACvC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;iBAC3E,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AAEP,CAAC"}
|
|
@@ -391,15 +391,19 @@ export declare function serializeIntegration(integration: any, logger?: (message
|
|
|
391
391
|
export declare function buildIntegrationPushPayload(key: string, tomlData: any, { mode }?: {
|
|
392
392
|
mode?: PushMode;
|
|
393
393
|
}): Record<string, any>;
|
|
394
|
-
|
|
394
|
+
/**
|
|
395
|
+
* The `blob-buckets/<key>.toml` text for a bucket the server answered. A
|
|
396
|
+
* bucket stored with a rule set (#6243) is written as `preset = "admin-only"`,
|
|
397
|
+
* the access it is served with, and `logger` is told once.
|
|
398
|
+
*/
|
|
399
|
+
export declare function serializeBlobBucket(bucket: any, logger?: (message: string) => void): string;
|
|
395
400
|
/**
|
|
396
401
|
* The entity a `blob-buckets/<key>.toml` describes (#4116) — the parse
|
|
397
402
|
* `config push` builds its bodies from and `config diff` compares.
|
|
398
403
|
*
|
|
399
|
-
* Read in CREATE mode, so the immutable `ttlTier` stays nameable.
|
|
400
|
-
* is
|
|
401
|
-
*
|
|
402
|
-
* it, and this parse never reads it.
|
|
404
|
+
* Read in CREATE mode, so the immutable `ttlTier` stays nameable. A bucket's
|
|
405
|
+
* access is its `preset`; `ruleSetName` and `ruleSetId` are retired keys
|
|
406
|
+
* (#6243) the preflight refuses, and this parse never reads them.
|
|
403
407
|
*
|
|
404
408
|
* An omitted `name` stays omitted: the update leaves the server's name alone,
|
|
405
409
|
* and only the create body falls back to the key.
|
|
@@ -410,10 +414,8 @@ export declare function parseBlobBucketToml(doc: any): any;
|
|
|
410
414
|
*
|
|
411
415
|
* EXACT extraction of the inline builder shared by the existing-update and
|
|
412
416
|
* 409-adopt branches — do NOT "clean up" the truthiness checks on the access
|
|
413
|
-
* model. The server
|
|
414
|
-
*
|
|
415
|
-
* refuses to leave a bucket with no access model or a blank name — so those
|
|
416
|
-
* fields are not clearable. `bucketKey` and `ttlTier` are immutable and never
|
|
417
|
+
* model. The server refuses to leave a bucket with no preset or a blank name,
|
|
418
|
+
* so those fields are not clearable. `bucketKey` and `ttlTier` are immutable and never
|
|
417
419
|
* sent. Both call sites must go through this helper so their field sets never
|
|
418
420
|
* drift.
|
|
419
421
|
*/
|
|
@@ -461,7 +463,7 @@ export declare function promptConfigPayload(tomlConfig: any, options?: {
|
|
|
461
463
|
}): Record<string, any>;
|
|
462
464
|
/**
|
|
463
465
|
* Build the POST body for a blob-bucket create from the parsed entity
|
|
464
|
-
* (`parseBlobBucketToml
|
|
466
|
+
* (`parseBlobBucketToml`).
|
|
465
467
|
*
|
|
466
468
|
* `ttlTier` is here and absent from the update body because the definition says
|
|
467
469
|
* so (`writableOn: ["create"]`) — the retention tier is fixed at creation.
|
|
@@ -685,9 +687,21 @@ export declare function retiredConfigDirectoriesIn(configDir: string): string[];
|
|
|
685
687
|
*/
|
|
686
688
|
export declare function retiredTypeConfigFilesIn(configDir: string): string[];
|
|
687
689
|
/**
|
|
688
|
-
*
|
|
689
|
-
* `lock`), as
|
|
690
|
-
*
|
|
690
|
+
* The refusal for one rule-set file whose `[ruleSet] resourceType` is retired
|
|
691
|
+
* (#4959: `lock`; #6243: `blob_bucket`), as
|
|
692
|
+
* `<file>: ruleSet.resourceType = "<type>" — <sentence>`, or null.
|
|
693
|
+
*/
|
|
694
|
+
export declare function retiredRuleSetFileError(file: string, tomlData: any): string | null;
|
|
695
|
+
/**
|
|
696
|
+
* The refusal for a bucket file whose `preset` is `custom` (#6243), or null:
|
|
697
|
+
* a bucket's access is one of the four presets. Any other value is the
|
|
698
|
+
* server's to judge.
|
|
699
|
+
*/
|
|
700
|
+
export declare function blobBucketPresetError(filePath: string, tomlData: any): string | null;
|
|
701
|
+
/**
|
|
702
|
+
* Every `rule-sets/*.toml` whose `[ruleSet] resourceType` is retired, as
|
|
703
|
+
* `retiredRuleSetFileError` words it. A file that does not parse is left to
|
|
704
|
+
* the rule-set validators.
|
|
691
705
|
*/
|
|
692
706
|
export declare function retiredRuleSetFilesIn(configDir: string): string[];
|
|
693
707
|
/**
|
|
@@ -35,7 +35,7 @@ import { buildPayloadFromToml, projectEntityToPayload, projectRecordToToml, toml
|
|
|
35
35
|
import { CONFIG_SURFACES, isEmptyForEmit, tomlGroupsOf, RETIRED_CONFIG_DIRECTORIES, RETIRED_TYPE_CONFIG_DIRECTORIES, } from "../lib/generated-config-surfaces.js";
|
|
36
36
|
// #4959 — the retired rule-set resource types, vendored with the one sentence
|
|
37
37
|
// the rule-set routes answer, so the preflight refuses exactly what they do.
|
|
38
|
-
import { retiredRuleSetResourceType } from "../lib/generated-config-surfaces.js";
|
|
38
|
+
import { BLOB_BUCKET_RULE_SET_RETIRED_MESSAGE, retiredRuleSetResourceType, } from "../lib/generated-config-surfaces.js";
|
|
39
39
|
// #3626 — the prompt KIND rule, vendored with the definitions so the CLI's
|
|
40
40
|
// preflight refuses exactly what the admin routes refuse.
|
|
41
41
|
import { promptKindOf, resolvePromptKind, } from "../lib/generated-config-surfaces.js";
|
|
@@ -897,32 +897,36 @@ export function buildIntegrationPushPayload(key, tomlData, { mode = "update" } =
|
|
|
897
897
|
requestConfig: tomlData?.requestConfig || {},
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
|
-
|
|
900
|
+
/**
|
|
901
|
+
* Whether a bucket the server answered is one rule sets left behind (#6243):
|
|
902
|
+
* it carries `convertedFromRuleSet`, or — from a server that predates it —
|
|
903
|
+
* preset `custom` or a `ruleSetId`. Such a bucket is served as `admin-only`.
|
|
904
|
+
*/
|
|
905
|
+
function isConvertedBlobBucket(bucket) {
|
|
906
|
+
return (bucket?.convertedFromRuleSet === true ||
|
|
907
|
+
bucket?.preset === "custom" ||
|
|
908
|
+
Boolean(bucket?.ruleSetId));
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* The `blob-buckets/<key>.toml` text for a bucket the server answered. A
|
|
912
|
+
* bucket stored with a rule set (#6243) is written as `preset = "admin-only"`,
|
|
913
|
+
* the access it is served with, and `logger` is told once.
|
|
914
|
+
*/
|
|
915
|
+
export function serializeBlobBucket(bucket, logger) {
|
|
901
916
|
const file = `blob-buckets/${bucket?.bucketKey}.toml`;
|
|
902
917
|
// #2644 — the `[bucket]` key set comes from the vendored definition.
|
|
903
918
|
warnUnrecognizedServerKeys(bucket, BLOB_BUCKET_TABLE, file, logger);
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
: undefined;
|
|
910
|
-
if (bucket?.ruleSetId && !ruleSetName) {
|
|
911
|
-
logger?.(`${file}: rule set ${bucket.ruleSetId} is not in this app's rule-set listing; ` +
|
|
912
|
-
"no ruleSetName written (an orphaned or unlisted rule set denies access closed)");
|
|
919
|
+
const converted = isConvertedBlobBucket(bucket);
|
|
920
|
+
if (converted) {
|
|
921
|
+
logger?.(`${file}: bucket "${bucket?.bucketKey}" had a rule set and is served as ` +
|
|
922
|
+
'admin-only (#6243); written as preset = "admin-only". Choose another ' +
|
|
923
|
+
"preset, or gate access in a server function.");
|
|
913
924
|
}
|
|
914
925
|
const data = {
|
|
915
926
|
bucket: {
|
|
916
927
|
key: bucket.bucketKey,
|
|
917
928
|
...projectRecordToToml(BLOB_BUCKET_TABLE, bucket, {
|
|
918
|
-
|
|
919
|
-
// set instead. Omit preset for custom buckets (preset === "custom").
|
|
920
|
-
preset: (record) => record.preset && record.preset !== "custom"
|
|
921
|
-
? record.preset
|
|
922
|
-
: record.ruleSetId
|
|
923
|
-
? undefined
|
|
924
|
-
: record.preset,
|
|
925
|
-
ruleSetId: () => ruleSetName,
|
|
929
|
+
preset: (record) => (converted ? "admin-only" : record.preset),
|
|
926
930
|
}),
|
|
927
931
|
},
|
|
928
932
|
};
|
|
@@ -937,10 +941,9 @@ export function serializeBlobBucket(bucket, ruleSetIdToName = new Map(), logger)
|
|
|
937
941
|
* The entity a `blob-buckets/<key>.toml` describes (#4116) — the parse
|
|
938
942
|
* `config push` builds its bodies from and `config diff` compares.
|
|
939
943
|
*
|
|
940
|
-
* Read in CREATE mode, so the immutable `ttlTier` stays nameable.
|
|
941
|
-
* is
|
|
942
|
-
*
|
|
943
|
-
* it, and this parse never reads it.
|
|
944
|
+
* Read in CREATE mode, so the immutable `ttlTier` stays nameable. A bucket's
|
|
945
|
+
* access is its `preset`; `ruleSetName` and `ruleSetId` are retired keys
|
|
946
|
+
* (#6243) the preflight refuses, and this parse never reads them.
|
|
944
947
|
*
|
|
945
948
|
* An omitted `name` stays omitted: the update leaves the server's name alone,
|
|
946
949
|
* and only the create body falls back to the key.
|
|
@@ -957,12 +960,6 @@ export function parseBlobBucketToml(doc) {
|
|
|
957
960
|
},
|
|
958
961
|
}),
|
|
959
962
|
});
|
|
960
|
-
// The builder read the `ruleSetName` value onto the `ruleSetId` field.
|
|
961
|
-
delete entity.ruleSetId;
|
|
962
|
-
if (typeof section.ruleSetName === "string" && section.ruleSetName.trim() !== "") {
|
|
963
|
-
// Trimmed, as `applyRuleSetReference` does for the type configs.
|
|
964
|
-
entity._ruleSetName = section.ruleSetName.trim();
|
|
965
|
-
}
|
|
966
963
|
return entity;
|
|
967
964
|
}
|
|
968
965
|
/**
|
|
@@ -970,26 +967,22 @@ export function parseBlobBucketToml(doc) {
|
|
|
970
967
|
*
|
|
971
968
|
* EXACT extraction of the inline builder shared by the existing-update and
|
|
972
969
|
* 409-adopt branches — do NOT "clean up" the truthiness checks on the access
|
|
973
|
-
* model. The server
|
|
974
|
-
*
|
|
975
|
-
* refuses to leave a bucket with no access model or a blank name — so those
|
|
976
|
-
* fields are not clearable. `bucketKey` and `ttlTier` are immutable and never
|
|
970
|
+
* model. The server refuses to leave a bucket with no preset or a blank name,
|
|
971
|
+
* so those fields are not clearable. `bucketKey` and `ttlTier` are immutable and never
|
|
977
972
|
* sent. Both call sites must go through this helper so their field sets never
|
|
978
973
|
* drift.
|
|
979
974
|
*/
|
|
980
975
|
export function buildBlobBucketUpdatePayload(bucket) {
|
|
981
976
|
// The access model's truthiness checks are the SERVER's rule and stay
|
|
982
977
|
// verbatim; the definition contributes the field list, not the semantics.
|
|
983
|
-
// #4116 — reads the parsed ENTITY (`parseBlobBucketToml
|
|
984
|
-
//
|
|
978
|
+
// #4116 — reads the parsed ENTITY (`parseBlobBucketToml`), whose field
|
|
979
|
+
// names are the wire keys.
|
|
985
980
|
const updatePayload = projectEntityToPayload(BLOB_BUCKET_TABLE, bucket, {
|
|
986
981
|
mode: "update",
|
|
987
982
|
values: {
|
|
988
|
-
// A
|
|
989
|
-
//
|
|
990
|
-
// neither is clearable and an absent key is omitted, not nulled.
|
|
983
|
+
// A bucket may not be left with no preset or a blank name — so neither
|
|
984
|
+
// is clearable and an absent key is omitted, not nulled.
|
|
991
985
|
preset: (value) => (value ? value : undefined),
|
|
992
|
-
ruleSetId: (value) => (value ? value : undefined),
|
|
993
986
|
name: (value) => (value ? value : undefined),
|
|
994
987
|
// Issue #1567: `description` is TOML-owned — always send it as
|
|
995
988
|
// value-or-`null` so removing the line from the TOML clears it
|
|
@@ -1081,7 +1074,7 @@ export function promptConfigPayload(tomlConfig, options = {}) {
|
|
|
1081
1074
|
}
|
|
1082
1075
|
/**
|
|
1083
1076
|
* Build the POST body for a blob-bucket create from the parsed entity
|
|
1084
|
-
* (`parseBlobBucketToml
|
|
1077
|
+
* (`parseBlobBucketToml`).
|
|
1085
1078
|
*
|
|
1086
1079
|
* `ttlTier` is here and absent from the update body because the definition says
|
|
1087
1080
|
* so (`writableOn: ["create"]`) — the retention tier is fixed at creation.
|
|
@@ -1094,7 +1087,6 @@ export function buildBlobBucketCreatePayload(key, bucket) {
|
|
|
1094
1087
|
values: {
|
|
1095
1088
|
name: (value) => value || key,
|
|
1096
1089
|
preset: (value) => (value ? value : undefined),
|
|
1097
|
-
ruleSetId: (value) => (value ? value : undefined),
|
|
1098
1090
|
description: (value) => (value ? value : undefined),
|
|
1099
1091
|
},
|
|
1100
1092
|
}),
|
|
@@ -1899,9 +1891,31 @@ export function retiredTypeConfigFilesIn(configDir) {
|
|
|
1899
1891
|
return refusals;
|
|
1900
1892
|
}
|
|
1901
1893
|
/**
|
|
1902
|
-
*
|
|
1903
|
-
* `lock`), as
|
|
1904
|
-
*
|
|
1894
|
+
* The refusal for one rule-set file whose `[ruleSet] resourceType` is retired
|
|
1895
|
+
* (#4959: `lock`; #6243: `blob_bucket`), as
|
|
1896
|
+
* `<file>: ruleSet.resourceType = "<type>" — <sentence>`, or null.
|
|
1897
|
+
*/
|
|
1898
|
+
export function retiredRuleSetFileError(file, tomlData) {
|
|
1899
|
+
const resourceType = tomlData?.ruleSet?.resourceType;
|
|
1900
|
+
const retired = retiredRuleSetResourceType(resourceType);
|
|
1901
|
+
if (!retired)
|
|
1902
|
+
return null;
|
|
1903
|
+
return `${file}: ruleSet.resourceType = ${JSON.stringify(resourceType)} — ${retired.message}`;
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* The refusal for a bucket file whose `preset` is `custom` (#6243), or null:
|
|
1907
|
+
* a bucket's access is one of the four presets. Any other value is the
|
|
1908
|
+
* server's to judge.
|
|
1909
|
+
*/
|
|
1910
|
+
export function blobBucketPresetError(filePath, tomlData) {
|
|
1911
|
+
if (tomlData?.bucket?.preset !== "custom")
|
|
1912
|
+
return null;
|
|
1913
|
+
return `${filePath}: bucket.preset = "custom" — ${BLOB_BUCKET_RULE_SET_RETIRED_MESSAGE}`;
|
|
1914
|
+
}
|
|
1915
|
+
/**
|
|
1916
|
+
* Every `rule-sets/*.toml` whose `[ruleSet] resourceType` is retired, as
|
|
1917
|
+
* `retiredRuleSetFileError` words it. A file that does not parse is left to
|
|
1918
|
+
* the rule-set validators.
|
|
1905
1919
|
*/
|
|
1906
1920
|
export function retiredRuleSetFilesIn(configDir) {
|
|
1907
1921
|
const dir = join(configDir, "rule-sets");
|
|
@@ -1909,17 +1923,16 @@ export function retiredRuleSetFilesIn(configDir) {
|
|
|
1909
1923
|
return [];
|
|
1910
1924
|
const refusals = [];
|
|
1911
1925
|
for (const file of readdirSync(dir).filter((f) => f.endsWith(".toml")).sort()) {
|
|
1912
|
-
let
|
|
1926
|
+
let tomlData;
|
|
1913
1927
|
try {
|
|
1914
|
-
|
|
1928
|
+
tomlData = parseTomlFile(join(dir, file));
|
|
1915
1929
|
}
|
|
1916
1930
|
catch {
|
|
1917
1931
|
continue;
|
|
1918
1932
|
}
|
|
1919
|
-
const
|
|
1920
|
-
if (
|
|
1921
|
-
|
|
1922
|
-
refusals.push(`${file}: ruleSet.resourceType = ${JSON.stringify(resourceType)} — ${retired.message}`);
|
|
1933
|
+
const refusal = retiredRuleSetFileError(file, tomlData);
|
|
1934
|
+
if (refusal)
|
|
1935
|
+
refusals.push(refusal);
|
|
1923
1936
|
}
|
|
1924
1937
|
return refusals;
|
|
1925
1938
|
}
|
|
@@ -2048,13 +2061,11 @@ export async function runConfigPushPreflight(input) {
|
|
|
2048
2061
|
})) {
|
|
2049
2062
|
preflightValidationErrors.push(` ${message}`);
|
|
2050
2063
|
}
|
|
2051
|
-
// #4959 — a rule set of a retired resource type (`lock
|
|
2064
|
+
// #4959, #6243 — a rule set of a retired resource type (`lock`,
|
|
2065
|
+
// `blob_bucket`) is refused by `collectConfigFileValidationErrors` below,
|
|
2052
2066
|
// with the sentence the rule-set routes give, before the rule-set loop could
|
|
2053
|
-
// skip it as unchanged
|
|
2054
|
-
// the stored row.
|
|
2055
|
-
for (const refusal of retiredRuleSetFilesIn(configDir)) {
|
|
2056
|
-
preflightValidationErrors.push(` ${refusal}`);
|
|
2057
|
-
}
|
|
2067
|
+
// skip it as unchanged; `config diff` runs the same collector. Deleting the
|
|
2068
|
+
// file and pushing with `--prune` removes the stored row.
|
|
2058
2069
|
// Validate all database-type TOMLs: the parse itself refuses an invalid
|
|
2059
2070
|
// declared-access manifest. (#3189 — the `[[operations]]` `$params` and
|
|
2060
2071
|
// `[[subscriptions]]` checks retired with the two tables, which the
|
|
@@ -3364,6 +3375,21 @@ export function configFileValidationMessages(filePath, tomlData, surface, tables
|
|
|
3364
3375
|
if (surface.label === "prompt") {
|
|
3365
3376
|
messages.push(...promptKindFileErrors(filePath, tomlData));
|
|
3366
3377
|
}
|
|
3378
|
+
// #6243 — a bucket's access is one of the four presets; `custom` was the
|
|
3379
|
+
// rule-set value, refused with the sentence the server gives.
|
|
3380
|
+
if (surface.label === "blob-bucket") {
|
|
3381
|
+
const presetError = blobBucketPresetError(filePath, tomlData);
|
|
3382
|
+
if (presetError)
|
|
3383
|
+
messages.push(presetError);
|
|
3384
|
+
}
|
|
3385
|
+
// #4959, #6243 — a rule set of a retired resource type (`lock`,
|
|
3386
|
+
// `blob_bucket`), with the sentence the rule-set routes give, in the
|
|
3387
|
+
// collector `config diff` runs too.
|
|
3388
|
+
if (surface.label === "rule-set") {
|
|
3389
|
+
const retiredError = retiredRuleSetFileError(basename(filePath), tomlData);
|
|
3390
|
+
if (retiredError)
|
|
3391
|
+
messages.push(retiredError);
|
|
3392
|
+
}
|
|
3367
3393
|
// #6020 — `archived` is a key, not a field, so the declared-type check above does not see it.
|
|
3368
3394
|
if (surface.label === "db3-type") {
|
|
3369
3395
|
const archivedError = db3TypeArchivedKeyError(filePath, tomlData);
|
|
@@ -4661,22 +4687,20 @@ const CONFIG_DIFF_SPECS = {
|
|
|
4661
4687
|
label: "blob-bucket",
|
|
4662
4688
|
table: BLOB_BUCKET_TABLE,
|
|
4663
4689
|
parse: (doc) => parseBlobBucketToml(doc),
|
|
4664
|
-
// #
|
|
4665
|
-
//
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
}),
|
|
4670
|
-
ruleSetRef: true,
|
|
4690
|
+
// #6243 — a bucket takes no rule set: a bucket stored with one renders as
|
|
4691
|
+
// the `admin-only` it is served with, so a pulled file compares in sync
|
|
4692
|
+
// and the comparison needs no rule-set listing.
|
|
4693
|
+
serialize: (record) => serializeBlobBucket(record),
|
|
4694
|
+
ruleSetRef: false,
|
|
4671
4695
|
// `name` is trimmed on the way in and a blank description is stored as
|
|
4672
4696
|
// none (DSO-003).
|
|
4673
4697
|
canonicalize: (entity) => canonicalizeServerTextFields(entity, {
|
|
4674
4698
|
trimmed: ["name"],
|
|
4675
4699
|
optional: ["description"],
|
|
4676
4700
|
}),
|
|
4677
|
-
// The
|
|
4701
|
+
// The two fields a bucket file leaves alone by omitting them, matching
|
|
4678
4702
|
// what `buildBlobBucketUpdatePayload` sends (#2880 criterion 3). The server
|
|
4679
|
-
// refuses to leave a bucket nameless or without
|
|
4703
|
+
// refuses to leave a bucket nameless or without a preset, so neither of
|
|
4680
4704
|
// them is clearable and the update omits an absent key rather than nulling
|
|
4681
4705
|
// it. Compared anyway, a bucket whose live name differs from its key — or
|
|
4682
4706
|
// one whose access model the file does not state — is a `Modified` row and
|
|
@@ -4691,12 +4715,6 @@ const CONFIG_DIFF_SPECS = {
|
|
|
4691
4715
|
keys.push("name");
|
|
4692
4716
|
if (!bucket.preset)
|
|
4693
4717
|
keys.push("preset");
|
|
4694
|
-
// A name manages the rule set (#4116) — read as the parse reads it, so a
|
|
4695
|
-
// blank name is no reference rather than a difference the update cannot
|
|
4696
|
-
// carry. The retired id spelling (#4283) manages nothing.
|
|
4697
|
-
const named = typeof bucket.ruleSetName === "string" && bucket.ruleSetName.trim() !== "";
|
|
4698
|
-
if (!named)
|
|
4699
|
-
keys.push("ruleSetId");
|
|
4700
4718
|
return keys;
|
|
4701
4719
|
},
|
|
4702
4720
|
describe: (entity) => `blob bucket "${entity?.bucketKey}"`,
|
|
@@ -9031,19 +9049,13 @@ export function registerConfigSyncCommands(sync, options = {}) {
|
|
|
9031
9049
|
const blobBucketsDir = join(configDir, "blob-buckets");
|
|
9032
9050
|
mkdirSync(blobBucketsDir, { recursive: true });
|
|
9033
9051
|
const blobBucketEntities = {};
|
|
9034
|
-
// #
|
|
9035
|
-
// rule-set listing
|
|
9036
|
-
//
|
|
9037
|
-
// without the name.
|
|
9038
|
-
const unwrittenBlobBucketKeys = [];
|
|
9052
|
+
// #6243 — a bucket takes no rule set, so its file needs nothing from
|
|
9053
|
+
// the rule-set listing. A bucket stored with one is written as
|
|
9054
|
+
// `admin-only`, and the serializer says so once.
|
|
9039
9055
|
for (const bucket of blobBucketItems) {
|
|
9040
|
-
if (!ruleSetsOutcome.ok && bucket.ruleSetId) {
|
|
9041
|
-
unwrittenBlobBucketKeys.push(bucket.bucketKey);
|
|
9042
|
-
continue;
|
|
9043
|
-
}
|
|
9044
9056
|
const filename = `${bucket.bucketKey}.toml`;
|
|
9045
9057
|
const filePath = join(blobBucketsDir, filename);
|
|
9046
|
-
const content = serializeBlobBucket(bucket,
|
|
9058
|
+
const content = serializeBlobBucket(bucket, (msg) => info(` ${msg}`));
|
|
9047
9059
|
writePulledFile(filePath, content, pullWrites, sameConfigAs("blob-bucket", content, filePath, pullDiffMaps));
|
|
9048
9060
|
blobBucketEntities[bucket.bucketKey] = {
|
|
9049
9061
|
id: bucket.bucketId,
|
|
@@ -9053,12 +9065,7 @@ export function registerConfigSyncCommands(sync, options = {}) {
|
|
|
9053
9065
|
semanticHash: pulledSemanticHash("blob-bucket", content, pullDiffMaps),
|
|
9054
9066
|
};
|
|
9055
9067
|
}
|
|
9056
|
-
info(` Pulled ${blobBucketItems.length
|
|
9057
|
-
if (unwrittenBlobBucketKeys.length > 0) {
|
|
9058
|
-
warn(`${unwrittenBlobBucketKeys.length} blob bucket(s) not written — the rule-set ` +
|
|
9059
|
-
`listing failed, so their ruleSetName is unknown; existing files kept ` +
|
|
9060
|
-
`(${unwrittenBlobBucketKeys.join(", ")})`);
|
|
9061
|
-
}
|
|
9068
|
+
info(` Pulled ${blobBucketItems.length} blob bucket(s)`);
|
|
9062
9069
|
// Write prompts
|
|
9063
9070
|
const promptEntities = {};
|
|
9064
9071
|
// #5249 — an evaluator link is written by the evaluator's KEY, read
|
|
@@ -9475,7 +9482,6 @@ export function registerConfigSyncCommands(sync, options = {}) {
|
|
|
9475
9482
|
preserveUnwrittenEntries(emailTemplateEntities, priorEntities.emailTemplates, emailTemplatesOutcome.ok
|
|
9476
9483
|
? emailTemplateOverrides.map((t) => t.emailType)
|
|
9477
9484
|
: []);
|
|
9478
|
-
preserveUnwrittenEntries(blobBucketEntities, priorEntities.blobBuckets, unwrittenBlobBucketKeys);
|
|
9479
9485
|
const finalBlobBucketEntities = keepPrior(blobBucketsOutcome.ok, blobBucketEntities, "blobBuckets");
|
|
9480
9486
|
const finalFunctionEntities = keepPrior(functionListOk, functionEntities, "functions");
|
|
9481
9487
|
const finalEmailTemplateEntities = keepPrior(emailTemplatesOutcome.ok, emailTemplateEntities, "emailTemplates");
|
|
@@ -11423,26 +11429,19 @@ What a push guarantees (two stages):
|
|
|
11423
11429
|
const liveBuckets = new Map();
|
|
11424
11430
|
let bucketsLiveOk = true;
|
|
11425
11431
|
if (files.length > 0) {
|
|
11426
|
-
// #
|
|
11427
|
-
//
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
else {
|
|
11434
|
-
try {
|
|
11435
|
-
const listed = await client.listBlobBuckets(resolvedAppId);
|
|
11436
|
-
for (const b of (listed?.items ?? [])) {
|
|
11437
|
-
if (b?.bucketKey)
|
|
11438
|
-
liveBuckets.set(b.bucketKey, b);
|
|
11439
|
-
}
|
|
11440
|
-
}
|
|
11441
|
-
catch (err) {
|
|
11442
|
-
bucketsLiveOk = false;
|
|
11443
|
-
warnLiveUnavailable("blob-buckets", err);
|
|
11432
|
+
// #6243 — a bucket takes no rule set, so the comparison needs no
|
|
11433
|
+
// rule-set listing.
|
|
11434
|
+
try {
|
|
11435
|
+
const listed = await client.listBlobBuckets(resolvedAppId);
|
|
11436
|
+
for (const b of (listed?.items ?? [])) {
|
|
11437
|
+
if (b?.bucketKey)
|
|
11438
|
+
liveBuckets.set(b.bucketKey, b);
|
|
11444
11439
|
}
|
|
11445
11440
|
}
|
|
11441
|
+
catch (err) {
|
|
11442
|
+
bucketsLiveOk = false;
|
|
11443
|
+
warnLiveUnavailable("blob-buckets", err);
|
|
11444
|
+
}
|
|
11446
11445
|
}
|
|
11447
11446
|
const refetchLiveBucket = async (bucketId) => {
|
|
11448
11447
|
const full = await client.getBlobBucket(resolvedAppId, bucketId);
|
|
@@ -11453,13 +11452,7 @@ What a push guarantees (two stages):
|
|
|
11453
11452
|
const tomlData = parseTomlFile(filePath);
|
|
11454
11453
|
const key = tomlData.bucket?.key || basename(file, ".toml");
|
|
11455
11454
|
withDerivedIdentity(tomlData, "bucket", { key });
|
|
11456
|
-
// #4116 — `ruleSetName` resolves to THIS app's rule set before any
|
|
11457
|
-
// request; a name that resolves nowhere fails here, so a bucket is
|
|
11458
|
-
// never created or updated without its rule set.
|
|
11459
11455
|
const bucket = parseBlobBucketToml(tomlData);
|
|
11460
|
-
resolveRuleSetReference(bucket, ruleSetNameToId, `blob bucket "${key}"`, {
|
|
11461
|
-
hint: ruleSetSelectionHint,
|
|
11462
|
-
});
|
|
11463
11456
|
const existingEntry = syncState?.entities?.blobBuckets?.[key];
|
|
11464
11457
|
const liveBucket = liveBuckets.get(key);
|
|
11465
11458
|
let gate;
|