primitive-admin 1.1.0-alpha.47 → 1.1.0-alpha.49

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.
Files changed (74) hide show
  1. package/dist/bin/primitive.js +2 -0
  2. package/dist/bin/primitive.js.map +1 -1
  3. package/dist/src/commands/apps.js +54 -2
  4. package/dist/src/commands/apps.js.map +1 -1
  5. package/dist/src/commands/databases.js +31 -10
  6. package/dist/src/commands/databases.js.map +1 -1
  7. package/dist/src/commands/documents.js +77 -0
  8. package/dist/src/commands/documents.js.map +1 -1
  9. package/dist/src/commands/guides.d.ts +15 -12
  10. package/dist/src/commands/guides.js +22 -15
  11. package/dist/src/commands/guides.js.map +1 -1
  12. package/dist/src/commands/settings.d.ts +15 -0
  13. package/dist/src/commands/settings.js +102 -0
  14. package/dist/src/commands/settings.js.map +1 -0
  15. package/dist/src/commands/sync-app-settings.d.ts +105 -0
  16. package/dist/src/commands/sync-app-settings.js +339 -0
  17. package/dist/src/commands/sync-app-settings.js.map +1 -0
  18. package/dist/src/commands/sync.d.ts +34 -19
  19. package/dist/src/commands/sync.js +373 -200
  20. package/dist/src/commands/sync.js.map +1 -1
  21. package/dist/src/commands/workflows.js +32 -10
  22. package/dist/src/commands/workflows.js.map +1 -1
  23. package/dist/src/lib/api-client.d.ts +2 -0
  24. package/dist/src/lib/api-client.js +6 -0
  25. package/dist/src/lib/api-client.js.map +1 -1
  26. package/dist/src/lib/app-settings-descriptor.d.ts +108 -0
  27. package/dist/src/lib/app-settings-descriptor.js +250 -0
  28. package/dist/src/lib/app-settings-descriptor.js.map +1 -0
  29. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +15 -0
  30. package/dist/src/lib/codegen-shared/generatedFiles.js +27 -10
  31. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -1
  32. package/dist/src/lib/db-codegen/dbGenerator.d.ts +11 -83
  33. package/dist/src/lib/db-codegen/dbGenerator.js +93 -556
  34. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  35. package/dist/src/lib/db-codegen/dbNaming.d.ts +15 -7
  36. package/dist/src/lib/db-codegen/dbNaming.js +25 -13
  37. package/dist/src/lib/db-codegen/dbNaming.js.map +1 -1
  38. package/dist/src/lib/db-codegen/dbTemplates.d.ts +55 -4
  39. package/dist/src/lib/db-codegen/dbTemplates.js +169 -40
  40. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  41. package/dist/src/lib/db-codegen/dbTypeIR.d.ts +146 -0
  42. package/dist/src/lib/db-codegen/dbTypeIR.js +517 -0
  43. package/dist/src/lib/db-codegen/dbTypeIR.js.map +1 -0
  44. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.d.ts +101 -0
  45. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js +200 -0
  46. package/dist/src/lib/db-codegen/generated-operation-def-descriptor.js.map +1 -0
  47. package/dist/src/lib/swift-codegen/dbGenerator.d.ts +68 -0
  48. package/dist/src/lib/swift-codegen/dbGenerator.js +380 -0
  49. package/dist/src/lib/swift-codegen/dbGenerator.js.map +1 -0
  50. package/dist/src/lib/swift-codegen/dbSwiftTypes.d.ts +42 -0
  51. package/dist/src/lib/swift-codegen/dbSwiftTypes.js +100 -0
  52. package/dist/src/lib/swift-codegen/dbSwiftTypes.js.map +1 -0
  53. package/dist/src/lib/swift-codegen/generator.d.ts +84 -0
  54. package/dist/src/lib/swift-codegen/generator.js +178 -0
  55. package/dist/src/lib/swift-codegen/generator.js.map +1 -0
  56. package/dist/src/lib/swift-codegen/schemaToSwift.d.ts +72 -0
  57. package/dist/src/lib/swift-codegen/schemaToSwift.js +644 -0
  58. package/dist/src/lib/swift-codegen/schemaToSwift.js.map +1 -0
  59. package/dist/src/lib/swift-codegen/swiftNaming.d.ts +85 -0
  60. package/dist/src/lib/swift-codegen/swiftNaming.js +198 -0
  61. package/dist/src/lib/swift-codegen/swiftNaming.js.map +1 -0
  62. package/dist/src/lib/sync-resource-types.d.ts +225 -0
  63. package/dist/src/lib/sync-resource-types.js +394 -0
  64. package/dist/src/lib/sync-resource-types.js.map +1 -0
  65. package/dist/src/lib/template.d.ts +1 -1
  66. package/dist/src/lib/template.js +6 -3
  67. package/dist/src/lib/template.js.map +1 -1
  68. package/dist/src/lib/workflow-codegen/generator.d.ts +18 -5
  69. package/dist/src/lib/workflow-codegen/generator.js +116 -41
  70. package/dist/src/lib/workflow-codegen/generator.js.map +1 -1
  71. package/dist/src/lib/workflow-codegen/invokerIR.d.ts +85 -0
  72. package/dist/src/lib/workflow-codegen/invokerIR.js +71 -0
  73. package/dist/src/lib/workflow-codegen/invokerIR.js.map +1 -0
  74. package/package.json +4 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dbTypeIR.js","sourceRoot":"","sources":["../../../../src/lib/db-codegen/dbTypeIR.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAwGtD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAEjD,0EAA0E;IAC1E,yEAAyE;IACzE,uCAAuC;IACvC,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAQ,CAAC;IACrD,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,GAC7C,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAElC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM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EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT BY HAND.
3
+ *
4
+ * Vendored byte-for-byte from the canonical server module
5
+ * `src/app-api/controllers/operation-definition-descriptor.ts` — the SAME
6
+ * allow-lists the server validator (`validateDefinition` / `validateParams`)
7
+ * enforces. The client operation-definition types
8
+ * (`src/client/api/operationDefinition.ts`) hand-author the matching union;
9
+ * a key-parity test compares them against this committed copy.
10
+ *
11
+ * Regenerate with:
12
+ * node cli/scripts/gen-operation-def-descriptor.mjs (runs at CLI prebuild)
13
+ *
14
+ * A CI freshness guard
15
+ * (`cli/scripts/gen-operation-def-descriptor.mjs --check`, also asserted by
16
+ * `cli/tests/unit/operation-def-descriptor-drift-guard.test.ts`) fails if
17
+ * this committed copy does not match the source — see issue #1544 / #1442.
18
+ */
19
+ /**
20
+ * Canonical, dependency-free descriptor of the database operation-definition
21
+ * schema (issue #1544).
22
+ *
23
+ * The server validator (`validateDefinition` / `validateParams` in
24
+ * `database-type-operations-controller.ts`) and the CLIENT operation-definition
25
+ * types (`src/client/api/operationDefinition.ts`, consumed by
26
+ * `createOperation` / `updateOperation` / `DatabaseOperationInfo`) must agree on
27
+ * the set of operation types and the allowed keys for each definition shape —
28
+ * otherwise a hand-authored `OperationDefinition` member promises a key the
29
+ * runtime rejects (or omits one the runtime accepts).
30
+ *
31
+ * This module is the single source of that declarative contract: the op-type
32
+ * list, the per-type allowed definition-key sets, the per-type mutation/action
33
+ * op-name enums, and the param-schema key/type enums. The validator imports
34
+ * these constants directly (so a change here changes what the server enforces),
35
+ * and the CLI vendors a byte-for-byte copy as a committed artifact via
36
+ * `cli/scripts/gen-operation-def-descriptor.mjs` (the #1442 workflow
37
+ * schema-descriptor pattern). A drift-guard test runs that generator in
38
+ * `--check` mode, and a key-parity test asserts the hand-authored client type
39
+ * members' keys equal the corresponding allow-lists here — so the validator and
40
+ * the client types can never silently diverge. The CLI never imports server
41
+ * `src/` at runtime; only the build-time generator reads this file.
42
+ *
43
+ * The value-shape checks that are NOT purely declarative (requiredness, nested
44
+ * object structure, CEL parsing) stay imperative in the validator. This
45
+ * descriptor captures the declarative allow-lists — the part that is genuinely
46
+ * shared between the runtime boundary and the descriptive client types.
47
+ *
48
+ * Ordering is significant: the validator joins these arrays into its 400-level
49
+ * error messages (`Must be one of: ${X.join(", ")}`), so reordering an array
50
+ * changes an error string. Keep entries in their current order.
51
+ */
52
+ /** The operation `type` values accepted by `createOperation` / `updateOperation`. */
53
+ export declare const OPERATION_TYPES: readonly string[];
54
+ /** Allowed top-level keys in a `query` definition. `cache` (#1247) is query-only. */
55
+ export declare const QUERY_DEF_KEYS: readonly string[];
56
+ /** Allowed top-level keys in a `mutation` definition. */
57
+ export declare const MUTATION_DEF_KEYS: readonly string[];
58
+ /** Allowed top-level keys in a `count` definition. */
59
+ export declare const COUNT_DEF_KEYS: readonly string[];
60
+ /** Allowed top-level keys in an `aggregate` definition. */
61
+ export declare const AGGREGATE_DEF_KEYS: readonly string[];
62
+ /** Allowed top-level keys in a `pipeline` definition. */
63
+ export declare const PIPELINE_DEF_KEYS: readonly string[];
64
+ /** Allowed top-level keys in an `applyToQuery` definition. */
65
+ export declare const APPLY_TO_QUERY_DEF_KEYS: readonly string[];
66
+ /** Mutation op names allowed in a `mutation` definition's `operations[]`. */
67
+ export declare const MUTATION_OPS: readonly string[];
68
+ /**
69
+ * Aggregate op `type` names allowed in an `aggregate` definition's
70
+ * `operations[]`.
71
+ */
72
+ export declare const AGGREGATE_OP_TYPES: readonly string[];
73
+ /**
74
+ * `applyToQuery` action ops. Only mutation ops that operate on existing matched
75
+ * records — `save` is excluded because it makes no sense in a find-and-mutate
76
+ * flow.
77
+ */
78
+ export declare const APPLY_TO_QUERY_ACTIONS: readonly string[];
79
+ /** Allowed keys in an `applyToQuery` `source` block. */
80
+ export declare const APPLY_TO_QUERY_SOURCE_KEYS: readonly string[];
81
+ /** Allowed keys in an `applyToQuery` `action` block. */
82
+ export declare const APPLY_TO_QUERY_ACTION_KEYS: readonly string[];
83
+ /** Step `type` values allowed inside a `pipeline` definition's `steps[]`. */
84
+ export declare const PIPELINE_STEP_TYPES: readonly string[];
85
+ /** Allowed keys on a pipeline `query` step. */
86
+ export declare const PIPELINE_QUERY_STEP_KEYS: readonly string[];
87
+ /** Allowed keys on a pipeline `count` step. */
88
+ export declare const PIPELINE_COUNT_STEP_KEYS: readonly string[];
89
+ /** Allowed keys on a pipeline `aggregate` step. */
90
+ export declare const PIPELINE_AGGREGATE_STEP_KEYS: readonly string[];
91
+ /**
92
+ * Built-in param types. `integer` (#1488) is accepted here and by the runtime
93
+ * coercion path. `array` (#1488) declares a list param with a scalar `items`
94
+ * element type. Keep in step with the runtime coercion list
95
+ * (`MODEL_PARAM_SCALAR_TYPES` in `database-operations-controller.ts`).
96
+ */
97
+ export declare const PARAM_TYPES: readonly string[];
98
+ /** Scalar element types allowed for an `array` param's `items` (#1488). */
99
+ export declare const ARRAY_ELEMENT_TYPES: readonly string[];
100
+ /** Allowed keys in a single param definition. */
101
+ export declare const PARAM_DEF_KEYS: readonly string[];
@@ -0,0 +1,200 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT BY HAND.
3
+ *
4
+ * Vendored byte-for-byte from the canonical server module
5
+ * `src/app-api/controllers/operation-definition-descriptor.ts` — the SAME
6
+ * allow-lists the server validator (`validateDefinition` / `validateParams`)
7
+ * enforces. The client operation-definition types
8
+ * (`src/client/api/operationDefinition.ts`) hand-author the matching union;
9
+ * a key-parity test compares them against this committed copy.
10
+ *
11
+ * Regenerate with:
12
+ * node cli/scripts/gen-operation-def-descriptor.mjs (runs at CLI prebuild)
13
+ *
14
+ * A CI freshness guard
15
+ * (`cli/scripts/gen-operation-def-descriptor.mjs --check`, also asserted by
16
+ * `cli/tests/unit/operation-def-descriptor-drift-guard.test.ts`) fails if
17
+ * this committed copy does not match the source — see issue #1544 / #1442.
18
+ */
19
+ /**
20
+ * Canonical, dependency-free descriptor of the database operation-definition
21
+ * schema (issue #1544).
22
+ *
23
+ * The server validator (`validateDefinition` / `validateParams` in
24
+ * `database-type-operations-controller.ts`) and the CLIENT operation-definition
25
+ * types (`src/client/api/operationDefinition.ts`, consumed by
26
+ * `createOperation` / `updateOperation` / `DatabaseOperationInfo`) must agree on
27
+ * the set of operation types and the allowed keys for each definition shape —
28
+ * otherwise a hand-authored `OperationDefinition` member promises a key the
29
+ * runtime rejects (or omits one the runtime accepts).
30
+ *
31
+ * This module is the single source of that declarative contract: the op-type
32
+ * list, the per-type allowed definition-key sets, the per-type mutation/action
33
+ * op-name enums, and the param-schema key/type enums. The validator imports
34
+ * these constants directly (so a change here changes what the server enforces),
35
+ * and the CLI vendors a byte-for-byte copy as a committed artifact via
36
+ * `cli/scripts/gen-operation-def-descriptor.mjs` (the #1442 workflow
37
+ * schema-descriptor pattern). A drift-guard test runs that generator in
38
+ * `--check` mode, and a key-parity test asserts the hand-authored client type
39
+ * members' keys equal the corresponding allow-lists here — so the validator and
40
+ * the client types can never silently diverge. The CLI never imports server
41
+ * `src/` at runtime; only the build-time generator reads this file.
42
+ *
43
+ * The value-shape checks that are NOT purely declarative (requiredness, nested
44
+ * object structure, CEL parsing) stay imperative in the validator. This
45
+ * descriptor captures the declarative allow-lists — the part that is genuinely
46
+ * shared between the runtime boundary and the descriptive client types.
47
+ *
48
+ * Ordering is significant: the validator joins these arrays into its 400-level
49
+ * error messages (`Must be one of: ${X.join(", ")}`), so reordering an array
50
+ * changes an error string. Keep entries in their current order.
51
+ */
52
+ /** The operation `type` values accepted by `createOperation` / `updateOperation`. */
53
+ export const OPERATION_TYPES = [
54
+ "query",
55
+ "mutation",
56
+ "count",
57
+ "aggregate",
58
+ "pipeline",
59
+ "applyToQuery",
60
+ ];
61
+ // ── Per-type definition key allow-lists ──
62
+ /** Allowed top-level keys in a `query` definition. `cache` (#1247) is query-only. */
63
+ export const QUERY_DEF_KEYS = [
64
+ "filter",
65
+ "sort",
66
+ "limit",
67
+ "projection",
68
+ "include",
69
+ "cache",
70
+ ];
71
+ /** Allowed top-level keys in a `mutation` definition. */
72
+ export const MUTATION_DEF_KEYS = ["operations"];
73
+ /** Allowed top-level keys in a `count` definition. */
74
+ export const COUNT_DEF_KEYS = ["filter"];
75
+ /** Allowed top-level keys in an `aggregate` definition. */
76
+ export const AGGREGATE_DEF_KEYS = [
77
+ "groupBy",
78
+ "operations",
79
+ "filter",
80
+ "limit",
81
+ "sort",
82
+ ];
83
+ /** Allowed top-level keys in a `pipeline` definition. */
84
+ export const PIPELINE_DEF_KEYS = ["steps", "return"];
85
+ /** Allowed top-level keys in an `applyToQuery` definition. */
86
+ export const APPLY_TO_QUERY_DEF_KEYS = ["source", "action"];
87
+ // ── Op-name enums nested inside definitions ──
88
+ /** Mutation op names allowed in a `mutation` definition's `operations[]`. */
89
+ export const MUTATION_OPS = [
90
+ "save",
91
+ "patch",
92
+ "delete",
93
+ "increment",
94
+ "addToSet",
95
+ "removeFromSet",
96
+ ];
97
+ /**
98
+ * Aggregate op `type` names allowed in an `aggregate` definition's
99
+ * `operations[]`.
100
+ */
101
+ export const AGGREGATE_OP_TYPES = [
102
+ "count",
103
+ "sum",
104
+ "avg",
105
+ "min",
106
+ "max",
107
+ ];
108
+ /**
109
+ * `applyToQuery` action ops. Only mutation ops that operate on existing matched
110
+ * records — `save` is excluded because it makes no sense in a find-and-mutate
111
+ * flow.
112
+ */
113
+ export const APPLY_TO_QUERY_ACTIONS = [
114
+ "delete",
115
+ "patch",
116
+ "increment",
117
+ "addToSet",
118
+ "removeFromSet",
119
+ ];
120
+ /** Allowed keys in an `applyToQuery` `source` block. */
121
+ export const APPLY_TO_QUERY_SOURCE_KEYS = [
122
+ "filter",
123
+ "sort",
124
+ "limit",
125
+ ];
126
+ /** Allowed keys in an `applyToQuery` `action` block. */
127
+ export const APPLY_TO_QUERY_ACTION_KEYS = [
128
+ "op",
129
+ "data",
130
+ "fields",
131
+ "stringSets",
132
+ ];
133
+ // ── Pipeline step allow-lists ──
134
+ /** Step `type` values allowed inside a `pipeline` definition's `steps[]`. */
135
+ export const PIPELINE_STEP_TYPES = [
136
+ "query",
137
+ "count",
138
+ "aggregate",
139
+ ];
140
+ /** Allowed keys on a pipeline `query` step. */
141
+ export const PIPELINE_QUERY_STEP_KEYS = [
142
+ "name",
143
+ "type",
144
+ "modelName",
145
+ "filter",
146
+ "sort",
147
+ "limit",
148
+ "projection",
149
+ "include",
150
+ ];
151
+ /** Allowed keys on a pipeline `count` step. */
152
+ export const PIPELINE_COUNT_STEP_KEYS = [
153
+ "name",
154
+ "type",
155
+ "modelName",
156
+ "filter",
157
+ ];
158
+ /** Allowed keys on a pipeline `aggregate` step. */
159
+ export const PIPELINE_AGGREGATE_STEP_KEYS = [
160
+ "name",
161
+ "type",
162
+ "modelName",
163
+ "groupBy",
164
+ "operations",
165
+ "filter",
166
+ "limit",
167
+ "sort",
168
+ ];
169
+ // ── Param-schema enums ──
170
+ /**
171
+ * Built-in param types. `integer` (#1488) is accepted here and by the runtime
172
+ * coercion path. `array` (#1488) declares a list param with a scalar `items`
173
+ * element type. Keep in step with the runtime coercion list
174
+ * (`MODEL_PARAM_SCALAR_TYPES` in `database-operations-controller.ts`).
175
+ */
176
+ export const PARAM_TYPES = [
177
+ "string",
178
+ "number",
179
+ "boolean",
180
+ "integer",
181
+ "object",
182
+ "array",
183
+ ];
184
+ /** Scalar element types allowed for an `array` param's `items` (#1488). */
185
+ export const ARRAY_ELEMENT_TYPES = [
186
+ "string",
187
+ "number",
188
+ "boolean",
189
+ "integer",
190
+ ];
191
+ /** Allowed keys in a single param definition. */
192
+ export const PARAM_DEF_KEYS = [
193
+ "type",
194
+ "required",
195
+ "access",
196
+ "coerce",
197
+ "enum",
198
+ "items",
199
+ ];
200
+ //# sourceMappingURL=generated-operation-def-descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-operation-def-descriptor.js","sourceRoot":"","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ases codegen --lang swift` orchestrator (issue #1547, Phase 4).
3
+ *
4
+ * The Swift counterpart of `db-codegen/dbGenerator.ts`. Reads the SAME synced
5
+ * `database-types/*.toml` and emits ONE `<type>.generated.swift` per database
6
+ * type. Each file carries the type's record structs (read shape), per-op params
7
+ * structs (write shape), per-op result typealiases, and a typed `<Type>Ops`
8
+ * factory over the additive generic `executeOperation` overload on
9
+ * `DatabasesAPI` (the only published SDK surface for this generator).
10
+ *
11
+ * Design decisions realized (issue #1547):
12
+ * - Operation + record metadata (which ops exist, their params, their result
13
+ * descriptor, and per-model fields) is read from the SHARED `describeDbType`
14
+ * IR — the SAME source the TS renderer (`db-codegen/dbGenerator.ts`) reads.
15
+ * The Swift renderer reconstructs none of it (binding item 5), so the two
16
+ * clients can never disagree on a type's surface.
17
+ * - The generic result envelopes (`DBQueryResult<T>`, `DBMutationResult`, …)
18
+ * live in the JsBaoClient SDK, NOT emitted per file — a Swift package
19
+ * compiles all generated files into one module, so a per-file copy would
20
+ * collide. Generated files reference the SDK envelopes (mirrors how Phase 3
21
+ * put the workflow result envelopes in the SDK).
22
+ * - Swift has no analog of TS `Pick<M, …>` / `Partial<M>`, so a query op with
23
+ * a `pick`/`partial` projection types its rows as the open `JSONValue`
24
+ * rather than a narrowed record (the same Fork-4 "no clean analog →
25
+ * JSONValue" fallback the emitter uses for un-descended schema nodes). A
26
+ * `full` projection over a known record types as `DBQueryResult<Record>`.
27
+ * - Disk lifecycle (write / `--check` / orphan cleanup) delegates to the
28
+ * shared `writeOrCheckGeneratedFiles`, scoped by an ownership BANNER
29
+ * distinct from both the workflow Swift banner and the model codegen's, so
30
+ * a shared Swift output dir stays safe.
31
+ */
32
+ import { type WriteOrCheckResult } from "../codegen-shared/generatedFiles.js";
33
+ import { type DbCodegenInput } from "../db-codegen/dbTypeIR.js";
34
+ /**
35
+ * Banner prefix stamped on every CLI-emitted database `.generated.swift` file.
36
+ * Distinct from both the workflow Swift banner (`// AUTO-GENERATED FROM
37
+ * workflows/`) and the model codegen's (`// Generated by swift-bao-codegen`),
38
+ * so none of the three generators' stale-sweeps ever deletes another's files
39
+ * when they share an output dir.
40
+ */
41
+ export declare const DB_SWIFT_BANNER_PREFIX = "// AUTO-GENERATED FROM database-types/";
42
+ export interface GenerateDbSwiftTypesOptions {
43
+ inputs: DbCodegenInput[];
44
+ /** Directory where the `<type>.generated.swift` files are written. */
45
+ outputDir: string;
46
+ /** `--check`: compare against disk, do not write. */
47
+ check?: boolean;
48
+ /**
49
+ * Set when the run was filtered to a single database type. `inputs` is then a
50
+ * PARTIAL view, so orphan cleanup / stale detection is scoped to the filtered
51
+ * file. Mirrors the TS generator's `singleType`.
52
+ */
53
+ singleType?: boolean;
54
+ }
55
+ /** Swift record struct type name for a model (shared naming + Swift sanitize). */
56
+ export declare function dbRecordSwiftTypeName(modelName: string, className: string | undefined): string;
57
+ /**
58
+ * Render the full `<type>.generated.swift` content for one database-type TOML.
59
+ * Pure — exported so tests can assert on the string directly. Throws on a Swift
60
+ * record type-name collision between two models (mirrors the TS collision guard).
61
+ */
62
+ export declare function renderDbTypeSwiftFile(input: DbCodegenInput): string;
63
+ /**
64
+ * Run Swift database codegen end-to-end. One `<type>.generated.swift` per
65
+ * database type; delegates the disk lifecycle to the shared writer/checker with
66
+ * banner-scoped ownership so a shared Swift output dir stays safe.
67
+ */
68
+ export declare function generateDbSwiftTypes(options: GenerateDbSwiftTypesOptions): Promise<WriteOrCheckResult>;