@aventara/core 1.0.0-rc.0 → 1.0.0-rc.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.
Files changed (267) hide show
  1. package/CHANGELOG.md +1434 -0
  2. package/ERRORS.md +142 -0
  3. package/README.md +247 -57
  4. package/dist/adapters/adapter-discovery-diagnostic.d.ts +4 -4
  5. package/dist/adapters/adapter-discovery-diagnostic.guidance.d.ts +6 -0
  6. package/dist/adapters/adapter-discovery-diagnostic.guidance.js +7 -0
  7. package/dist/adapters/adapter-field.d.ts +25 -11
  8. package/dist/adapters/adapter-identifier.d.ts +6 -6
  9. package/dist/adapters/adapter-model.d.ts +18 -9
  10. package/dist/adapters/adapter-operation-executor.interface.d.ts +4 -4
  11. package/dist/adapters/adapter-operation.d.ts +3 -3
  12. package/dist/adapters/adapter-resource.d.ts +18 -9
  13. package/dist/adapters/adapter-sql-statement.d.ts +19 -0
  14. package/dist/adapters/adapter-transaction-executor.interface.d.ts +19 -0
  15. package/dist/adapters/adapter.interface.d.ts +59 -29
  16. package/dist/avz/avz-check.factory.d.ts +83 -0
  17. package/dist/avz/avz-check.factory.js +116 -0
  18. package/dist/avz/avz-check.registry.d.ts +35 -0
  19. package/dist/avz/avz-check.registry.js +9 -0
  20. package/dist/avz/avz.d.ts +203 -0
  21. package/dist/{json → avz}/avz.js +150 -8
  22. package/dist/{json → avz}/index.d.ts +2 -1
  23. package/dist/{json → avz}/json-shape.registry.d.ts +7 -7
  24. package/dist/{json → avz}/zod-issue.translator.d.ts +8 -2
  25. package/dist/{json → avz}/zod-issue.translator.js +7 -0
  26. package/dist/compiler/contract-compiler-diagnostic.d.ts +31 -5
  27. package/dist/compiler/contract-compiler-diagnostic.guidance.d.ts +6 -0
  28. package/dist/compiler/contract-compiler-diagnostic.guidance.js +97 -0
  29. package/dist/compiler/contract.compiler.d.ts +18 -18
  30. package/dist/compiler/contract.compiler.js +637 -442
  31. package/dist/compiler/create-requirements.projector.d.ts +49 -0
  32. package/dist/compiler/create-requirements.projector.js +423 -0
  33. package/dist/compiler/field-validator.compiler.d.ts +47 -0
  34. package/dist/compiler/field-validator.compiler.js +238 -0
  35. package/dist/config/any-framework-config.d.ts +19 -12
  36. package/dist/config/computed-fields.d.ts +62 -0
  37. package/dist/config/computed-fields.js +80 -0
  38. package/dist/config/config-diagnostic.d.ts +11 -4
  39. package/dist/config/config-diagnostic.guidance.d.ts +6 -0
  40. package/dist/config/config-diagnostic.guidance.js +32 -0
  41. package/dist/config/config-layer.d.ts +15 -6
  42. package/dist/config/config.resolver.d.ts +74 -31
  43. package/dist/config/config.resolver.js +108 -44
  44. package/dist/config/config.validator.d.ts +7 -7
  45. package/dist/config/config.validator.js +581 -72
  46. package/dist/config/define-resource.d.ts +57 -0
  47. package/dist/config/define-resource.js +14 -0
  48. package/dist/config/effective-fields.d.ts +19 -23
  49. package/dist/config/entrypoint.normalizer.d.ts +1 -1
  50. package/dist/config/exact-framework-config.d.ts +308 -0
  51. package/dist/config/field-compute.resolver.d.ts +21 -0
  52. package/dist/config/field-compute.resolver.js +123 -0
  53. package/dist/config/field-pipeline-config.d.ts +47 -0
  54. package/dist/config/forced-operation.validator.d.ts +10 -0
  55. package/dist/config/forced-operation.validator.js +66 -0
  56. package/dist/config/framework-config.d.ts +111 -39
  57. package/dist/config/framework-exemptions-config.d.ts +91 -0
  58. package/dist/config/framework-exemptions-config.js +1 -0
  59. package/dist/config/framework-field-definition.d.ts +78 -0
  60. package/dist/config/framework-field-definition.js +28 -0
  61. package/dist/config/framework-resources-config.d.ts +122 -0
  62. package/dist/config/framework-resources-config.js +1 -0
  63. package/dist/config/pipeline-config.d.ts +56 -20
  64. package/dist/config/pipeline-tree.resolver.d.ts +79 -0
  65. package/dist/config/pipeline-tree.resolver.js +220 -0
  66. package/dist/config/stage-type.eraser.d.ts +65 -0
  67. package/dist/config/stage-type.eraser.js +1 -0
  68. package/dist/contracts/capability.d.ts +21 -12
  69. package/dist/contracts/capability.js +2 -0
  70. package/dist/contracts/client-contract-structure.validator.d.ts +388 -63
  71. package/dist/contracts/client-contract-structure.validator.js +156 -10
  72. package/dist/contracts/contract-canonicalizer.d.ts +26 -3
  73. package/dist/contracts/contract-canonicalizer.js +156 -29
  74. package/dist/contracts/contract-hash.d.ts +12 -7
  75. package/dist/contracts/contract-hash.js +3 -2
  76. package/dist/contracts/contract-limits.d.ts +4 -1
  77. package/dist/contracts/contract-limits.js +1 -0
  78. package/dist/contracts/contract-lookup.d.ts +5 -5
  79. package/dist/contracts/contract-protocol.d.ts +4 -4
  80. package/dist/contracts/contract.d.ts +24 -16
  81. package/dist/contracts/create-requirements.d.ts +35 -0
  82. package/dist/contracts/create-requirements.js +1 -0
  83. package/dist/contracts/enum-definition.d.ts +1 -1
  84. package/dist/contracts/field-check.d.ts +101 -0
  85. package/dist/contracts/field-check.js +1 -0
  86. package/dist/contracts/field.d.ts +81 -42
  87. package/dist/contracts/identifier.d.ts +4 -4
  88. package/dist/contracts/json-shape.d.ts +12 -1
  89. package/dist/contracts/lifecycle-trait.d.ts +2 -2
  90. package/dist/contracts/resource-operations.d.ts +28 -28
  91. package/dist/contracts/resource.d.ts +15 -9
  92. package/dist/contracts/scalar-value-type.d.ts +15 -15
  93. package/dist/contracts/scalar.d.ts +3 -3
  94. package/dist/contracts/transaction-capability.d.ts +1 -1
  95. package/dist/contracts/wire-scalar-format.d.ts +4 -4
  96. package/dist/framework/contract-view.d.ts +213 -147
  97. package/dist/framework/framework-construction.error.d.ts +19 -10
  98. package/dist/framework/framework-construction.error.js +7 -3
  99. package/dist/framework/framework.d.ts +47 -23
  100. package/dist/framework/framework.factory.d.ts +8 -6
  101. package/dist/framework/framework.factory.js +49 -22
  102. package/dist/framework/operation-facade.d.ts +123 -52
  103. package/dist/framework/operation-facade.js +9 -1
  104. package/dist/index.d.ts +57 -50
  105. package/dist/index.js +7 -6
  106. package/dist/internal.d.ts +17 -10
  107. package/dist/internal.js +4 -1
  108. package/dist/operations/database-refusal.d.ts +51 -0
  109. package/dist/operations/database-refusal.js +45 -0
  110. package/dist/operations/operation-arguments.d.ts +343 -207
  111. package/dist/operations/operation-call.d.ts +27 -28
  112. package/dist/operations/operation-identity.d.ts +10 -10
  113. package/dist/operations/operation-result.d.ts +21 -21
  114. package/dist/operations/operation-validator-core.d.ts +6 -6
  115. package/dist/operations/operation-validator-core.js +99 -6
  116. package/dist/operations/operation-validator.d.ts +9 -9
  117. package/dist/operations/projection-scope.resolver.d.ts +6 -6
  118. package/dist/operations/structural-limits.walker.d.ts +6 -6
  119. package/dist/operations/structural-limits.walker.js +145 -0
  120. package/dist/operations/validation-code.d.ts +11 -6
  121. package/dist/operations/validation-code.guidance.d.ts +6 -0
  122. package/dist/operations/validation-code.guidance.js +90 -0
  123. package/dist/operations/validation-code.js +4 -0
  124. package/dist/operations/write-scope.resolver.d.ts +10 -6
  125. package/dist/operations/write-scope.resolver.js +2 -0
  126. package/dist/protocol/absent-route.responder.d.ts +13 -12
  127. package/dist/protocol/absent-route.responder.js +19 -19
  128. package/dist/protocol/contract-document.responder.d.ts +3 -3
  129. package/dist/protocol/contract-document.responder.js +2 -2
  130. package/dist/protocol/http-request.decoder.d.ts +17 -13
  131. package/dist/protocol/http-request.decoder.js +10 -10
  132. package/dist/protocol/http-request.reader.d.ts +3 -3
  133. package/dist/protocol/http-response.encoder.d.ts +4 -4
  134. package/dist/protocol/http-response.encoder.js +94 -55
  135. package/dist/protocol/http-status.table.d.ts +2 -2
  136. package/dist/protocol/operation-response.guard.d.ts +2 -2
  137. package/dist/protocol/protocol-surface.d.ts +4 -4
  138. package/dist/protocol/protocol.binder.d.ts +50 -27
  139. package/dist/protocol/protocol.binder.js +12 -9
  140. package/dist/protocol/protocol.handler.d.ts +22 -13
  141. package/dist/protocol/protocol.handler.js +91 -17
  142. package/dist/protocol/unmounted-route.error.d.ts +4 -4
  143. package/dist/protocol/unmounted-route.error.js +2 -2
  144. package/dist/runtime/caller-data.copier.d.ts +22 -5
  145. package/dist/runtime/caller-data.copier.js +31 -14
  146. package/dist/runtime/caller-data.door.d.ts +17 -11
  147. package/dist/runtime/caller-data.door.js +6 -4
  148. package/dist/runtime/computed-read-runtime.d.ts +7 -6
  149. package/dist/runtime/computed-read-runtime.js +76 -50
  150. package/dist/runtime/computed-value.error.d.ts +7 -6
  151. package/dist/runtime/computed-value.error.js +5 -4
  152. package/dist/runtime/context-executor.runtime.d.ts +59 -0
  153. package/dist/runtime/context-executor.runtime.js +275 -0
  154. package/dist/runtime/create-requirement.d.ts +44 -79
  155. package/dist/runtime/create-requirement.js +213 -73
  156. package/dist/runtime/decimal.d.ts +2 -2
  157. package/dist/runtime/decimal.js +1 -1
  158. package/dist/runtime/diagnostics-reporter.d.ts +54 -27
  159. package/dist/runtime/diagnostics-reporter.js +24 -0
  160. package/dist/runtime/error-boundary.d.ts +65 -8
  161. package/dist/runtime/error-boundary.js +49 -19
  162. package/dist/runtime/error-guidance.d.ts +12 -0
  163. package/dist/runtime/error-guidance.js +1 -0
  164. package/dist/runtime/error.catalog.d.ts +49 -0
  165. package/dist/runtime/error.catalog.js +49 -0
  166. package/dist/runtime/execution-options.d.ts +10 -2
  167. package/dist/runtime/field-check.evaluator.d.ts +29 -0
  168. package/dist/runtime/field-check.evaluator.js +521 -0
  169. package/dist/runtime/field-compute.d.ts +64 -0
  170. package/dist/runtime/field-compute.js +1 -0
  171. package/dist/runtime/field-stage.plan.d.ts +15 -0
  172. package/dist/runtime/field-stage.plan.js +27 -0
  173. package/dist/runtime/field-stage.runtime.d.ts +37 -0
  174. package/dist/runtime/field-stage.runtime.js +147 -0
  175. package/dist/runtime/field-validator.runtime.d.ts +19 -0
  176. package/dist/runtime/field-validator.runtime.js +92 -0
  177. package/dist/runtime/framework-error-class.table.d.ts +33 -0
  178. package/dist/runtime/framework-error-class.table.js +25 -0
  179. package/dist/runtime/framework-error.d.ts +68 -8
  180. package/dist/runtime/framework-error.factory.d.ts +4 -0
  181. package/dist/runtime/framework-error.factory.js +15 -0
  182. package/dist/runtime/framework-error.js +23 -2
  183. package/dist/runtime/interceptor-next.error.d.ts +5 -0
  184. package/dist/runtime/interceptor-next.error.js +6 -0
  185. package/dist/runtime/json-value.d.ts +11 -6
  186. package/dist/runtime/level-lifecycle.runtime.d.ts +25 -0
  187. package/dist/runtime/level-lifecycle.runtime.js +39 -0
  188. package/dist/runtime/misuse-reporter.d.ts +12 -12
  189. package/dist/runtime/mutation-planner.d.ts +19 -10
  190. package/dist/runtime/mutation-planner.js +48 -35
  191. package/dist/runtime/nested-write.walker.d.ts +32 -0
  192. package/dist/runtime/nested-write.walker.js +73 -0
  193. package/dist/runtime/operation-code.guidance.d.ts +6 -0
  194. package/dist/runtime/operation-code.guidance.js +167 -0
  195. package/dist/runtime/operation-request.d.ts +33 -6
  196. package/dist/runtime/operation-response.d.ts +17 -17
  197. package/dist/runtime/operation-runtime.d.ts +127 -25
  198. package/dist/runtime/operation-runtime.js +441 -78
  199. package/dist/runtime/outcome-mapper.d.ts +16 -5
  200. package/dist/runtime/outcome-mapper.js +23 -6
  201. package/dist/runtime/output-validator.d.ts +10 -10
  202. package/dist/runtime/output-validator.js +3 -3
  203. package/dist/runtime/owned-execution.registry.d.ts +16 -6
  204. package/dist/runtime/pipe-output.validator.d.ts +43 -18
  205. package/dist/runtime/pipe-output.validator.js +15 -13
  206. package/dist/runtime/pipeline.d.ts +223 -34
  207. package/dist/runtime/readonly-value.d.ts +43 -0
  208. package/dist/runtime/readonly-value.js +150 -0
  209. package/dist/runtime/request-envelope.validator.d.ts +3 -3
  210. package/dist/runtime/request-envelope.validator.js +12 -7
  211. package/dist/runtime/request-id.d.ts +1 -1
  212. package/dist/runtime/request-state.d.ts +14 -0
  213. package/dist/runtime/request-state.js +1 -0
  214. package/dist/runtime/request-state.resolver.d.ts +12 -0
  215. package/dist/runtime/request-state.resolver.js +20 -0
  216. package/dist/runtime/scalar-runtime.d.ts +35 -16
  217. package/dist/runtime/scalar-runtime.js +102 -34
  218. package/dist/runtime/unsent-value.normalizer.d.ts +15 -0
  219. package/dist/runtime/unsent-value.normalizer.js +128 -0
  220. package/dist/transactions/deferred-operation.d.ts +35 -20
  221. package/dist/transactions/operation-arguments-encoder.d.ts +3 -3
  222. package/dist/transactions/operation-arguments-encoder.js +2 -2
  223. package/dist/transactions/operation-fingerprint.js +2 -2
  224. package/dist/transactions/sql-statement.d.ts +85 -0
  225. package/dist/transactions/sql-statement.js +47 -0
  226. package/dist/transactions/sql-statement.validator.d.ts +44 -0
  227. package/dist/transactions/sql-statement.validator.js +167 -0
  228. package/dist/transactions/transaction-envelope.d.ts +4 -4
  229. package/dist/transactions/transaction-integrity-error.d.ts +6 -6
  230. package/dist/transactions/transaction-integrity-error.js +5 -2
  231. package/dist/transactions/transaction-plan-assembler.d.ts +21 -11
  232. package/dist/transactions/transaction-plan-assembler.js +169 -32
  233. package/dist/transactions/transaction-plan-validator.d.ts +45 -20
  234. package/dist/transactions/transaction-plan-validator.js +96 -38
  235. package/dist/transactions/transaction-reference-collector.d.ts +5 -5
  236. package/dist/transactions/transaction-reference-resolver.d.ts +19 -2
  237. package/dist/transactions/transaction-reference-resolver.js +26 -14
  238. package/dist/transactions/transaction-reference-validator.d.ts +76 -4
  239. package/dist/transactions/transaction-reference-validator.js +129 -71
  240. package/dist/transactions/transaction-reference.d.ts +13 -13
  241. package/dist/transactions/transaction-reference.js +5 -0
  242. package/dist/transactions/transaction-request.d.ts +18 -5
  243. package/dist/transactions/transaction-response.d.ts +6 -6
  244. package/dist/transactions/transaction-runtime.d.ts +8 -7
  245. package/dist/transactions/transaction-runtime.js +191 -50
  246. package/dist/transactions/transaction-settlement.runtime.d.ts +51 -0
  247. package/dist/transactions/transaction-settlement.runtime.js +120 -0
  248. package/dist/transactions/transaction-slot-path-error.d.ts +4 -4
  249. package/dist/transactions/transaction-slot-path-error.js +2 -2
  250. package/dist/transactions/transaction-slot-writer.js +2 -2
  251. package/dist/transactions/transaction-stage.runtime.d.ts +82 -0
  252. package/dist/transactions/transaction-stage.runtime.js +126 -0
  253. package/package.json +9 -7
  254. package/src/runtime/field-check.evaluator.ts +720 -0
  255. package/dist/config/define-fields.d.ts +0 -42
  256. package/dist/config/define-fields.js +0 -3
  257. package/dist/config/framework-behaviors-config.d.ts +0 -30
  258. package/dist/config/framework-fields-config.d.ts +0 -42
  259. package/dist/config/framework-restrictions-config.d.ts +0 -142
  260. package/dist/json/avz.d.ts +0 -96
  261. package/dist/runtime/field-behavior.d.ts +0 -48
  262. /package/dist/{config/framework-behaviors-config.js → adapters/adapter-sql-statement.js} +0 -0
  263. /package/dist/{config/framework-fields-config.js → adapters/adapter-transaction-executor.interface.js} +0 -0
  264. /package/dist/{json → avz}/index.js +0 -0
  265. /package/dist/{json → avz}/json-shape.registry.js +0 -0
  266. /package/dist/config/{framework-restrictions-config.js → exact-framework-config.js} +0 -0
  267. /package/dist/{runtime/field-behavior.js → config/field-pipeline-config.js} +0 -0
@@ -1,22 +1,22 @@
1
- import type { ContractLimits } from "./contract-limits.js";
2
- import type { ClientContractProtocol } from "./contract-protocol.js";
3
- import type { EnumDefinition } from "./enum-definition.js";
1
+ import type { AvContractLimits } from "./contract-limits.js";
2
+ import type { AvContractClientProtocol } from "./contract-protocol.js";
3
+ import type { AvEnumDefinition } from "./enum-definition.js";
4
4
  import type { ReferenceWriteLimit } from "./reference-write-limit.js";
5
- import type { Resource } from "./resource.js";
6
- import type { ScalarRegistry } from "./scalar.js";
7
- import type { TransactionCapability } from "./transaction-capability.js";
5
+ import type { AvResource } from "./resource.js";
6
+ import type { AvScalarRegistry } from "./scalar.js";
7
+ import type { AvTransactionCapability } from "./transaction-capability.js";
8
8
  /** What every Contract describes: scalars, enums, Resources, limits and transactions. */
9
- export interface Contract {
9
+ export interface AvContract {
10
10
  /** The scalar types available. */
11
- readonly scalars: ScalarRegistry;
11
+ readonly scalars: AvScalarRegistry;
12
12
  /** The enums, by name. */
13
- readonly enums: Readonly<Record<string, EnumDefinition>>;
13
+ readonly enums: Readonly<Record<string, AvEnumDefinition>>;
14
14
  /** The Resources, by name. */
15
- readonly resources: Readonly<Record<string, Resource<this>>>;
15
+ readonly resources: Readonly<Record<string, AvResource<this>>>;
16
16
  /** The request limits in force. */
17
- readonly limits: ContractLimits;
17
+ readonly limits: AvContractLimits;
18
18
  /** Whether interactive transactions are available. */
19
- readonly transactions: TransactionCapability;
19
+ readonly transactions: AvTransactionCapability;
20
20
  /**
21
21
  * `"uniform"` when one record must write the relations that hold a reference
22
22
  * either all as relations or all through their reference fields; a record
@@ -25,16 +25,24 @@ export interface Contract {
25
25
  readonly referenceWrites?: ReferenceWriteLimit;
26
26
  }
27
27
  /** The Contract compiled from the root configuration. */
28
- export interface CoreContract extends Contract {
28
+ export interface AvContractCore extends AvContract {
29
29
  }
30
30
  /** The Contract in-process calls run under (`framework.application`). */
31
- export interface ApplicationContract extends Contract {
31
+ export interface AvContractApplication extends AvContract {
32
32
  }
33
33
  /**
34
34
  * The Contract remote clients run under, published at `GET /_contract` and
35
35
  * identified by its hash.
36
36
  */
37
- export interface ClientContract extends Contract {
37
+ export interface AvContractClient extends AvContract {
38
38
  /** The protocol version and this Contract's hash. */
39
- readonly protocol: ClientContractProtocol;
39
+ readonly protocol: AvContractClientProtocol;
40
+ }
41
+ /**
42
+ * The Contract an AI agent's calls run under (the `agent` layer), identified by
43
+ * its hash. MCP tools are built from it.
44
+ */
45
+ export interface AvContractAgent extends AvContract {
46
+ /** The protocol version and this Contract's hash. */
47
+ readonly protocol: AvContractClientProtocol;
40
48
  }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A required to-one relation and the scalar fields that hold its reference,
3
+ * relation first: `["author", "authorId"]`. A create writes the relation, or
4
+ * every one of the fields together (`["author", "tenantId", "authorId"]` for a
5
+ * composite reference), never both.
6
+ */
7
+ export type AvCreateRequirementGroup = readonly [string, string, ...string[]];
8
+ /**
9
+ * What a create of one Resource cannot do without, as the Contract's layer
10
+ * exposes it. Only fields the layer lets a caller write at create appear: a
11
+ * group whose reference fields the layer hides is its relation alone, in
12
+ * `required`; one whose relation it hides is its reference fields, in
13
+ * `required`; a field a compute stage fills at create (`COMPUTED_ON_CREATE`) is
14
+ * not required.
15
+ */
16
+ export type AvCreateRequirements = {
17
+ /**
18
+ * The fields every create must write: scalars with no default, generated or
19
+ * computed value, and relations whose reference fields the layer hides.
20
+ */
21
+ readonly required?: readonly [string, ...string[]];
22
+ /** The required relations a create writes either way: see {@link AvCreateRequirementGroup}. */
23
+ readonly oneOf?: readonly [
24
+ AvCreateRequirementGroup,
25
+ ...AvCreateRequirementGroup[]
26
+ ];
27
+ /**
28
+ * By parent Resource, then by its relation: the fields above that a create
29
+ * nested through that relation gets from its parent, so it is not required
30
+ * there. `{ "User": { "posts": ["author", "authorId"] } }`: a post created in
31
+ * `User.posts` needs neither `author` nor `authorId`; a group any of whose
32
+ * fields is listed is satisfied whole.
33
+ */
34
+ readonly parentSupplies?: Readonly<Record<string, Readonly<Record<string, readonly [string, ...string[]]>>>>;
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  /** An enum: its allowed values. */
2
- export type EnumDefinition = {
2
+ export type AvEnumDefinition = {
3
3
  /** The allowed values, in declaration order. */
4
4
  readonly values: readonly string[];
5
5
  };
@@ -0,0 +1,101 @@
1
+ /** The named string formats: what `AvZ.email()`, `AvZ.uuid()` and the rest check. */
2
+ export type AvFieldCheckFormat = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "credit_card" | "iban" | "jwt";
3
+ /**
4
+ * A bound on a value (`AvZ.lt`, `AvZ.gte`, `AvZ.positive`, …). `value` is a number
5
+ * for an `int` or `float` field and a Json number; for a `bigint`, `decimal` or
6
+ * `datetime` field it is the bound's wire string.
7
+ */
8
+ export type AvFieldRangeCheck = {
9
+ readonly check: "less_than" | "greater_than";
10
+ readonly value: number | string;
11
+ readonly inclusive: boolean;
12
+ };
13
+ /** `AvZ.multipleOf`: `value` is written as {@link AvFieldRangeCheck}'s is. */
14
+ export type AvFieldMultipleCheck = {
15
+ readonly check: "multiple_of";
16
+ readonly value: number | string;
17
+ };
18
+ /** A length bound: a string's, or with `list: true` a list's. */
19
+ export type AvFieldLengthCheck = {
20
+ readonly check: "max_length";
21
+ readonly maximum: number;
22
+ readonly list?: true;
23
+ } | {
24
+ readonly check: "min_length";
25
+ readonly minimum: number;
26
+ readonly list?: true;
27
+ } | {
28
+ readonly check: "length_equals";
29
+ readonly length: number;
30
+ };
31
+ /** A pattern or a named format a string must match. */
32
+ export type AvFieldFormatCheck = {
33
+ readonly check: "string_format";
34
+ readonly format: "regex";
35
+ /** A JavaScript regular expression: its `source` and its `flags`. */
36
+ readonly pattern: {
37
+ readonly source: string;
38
+ readonly flags: string;
39
+ };
40
+ } | {
41
+ readonly check: "string_format";
42
+ readonly format: "includes";
43
+ readonly includes: string;
44
+ } | {
45
+ readonly check: "string_format";
46
+ readonly format: "starts_with";
47
+ readonly prefix: string;
48
+ } | {
49
+ readonly check: "string_format";
50
+ readonly format: "ends_with";
51
+ readonly suffix: string;
52
+ } | {
53
+ readonly check: "string_format";
54
+ readonly format: "lowercase" | "uppercase" | AvFieldCheckFormat;
55
+ };
56
+ /** A `bytes` value's byte length. */
57
+ export type AvFieldSizeCheck = {
58
+ readonly check: "max_size";
59
+ readonly maximum: number;
60
+ } | {
61
+ readonly check: "min_size";
62
+ readonly minimum: number;
63
+ } | {
64
+ readonly check: "size_equals";
65
+ readonly size: number;
66
+ };
67
+ /**
68
+ * One field validator as the Contract stores it: its check's name (`check`) and
69
+ * the check's parameters.
70
+ */
71
+ export type AvFieldCheck = AvFieldRangeCheck | AvFieldMultipleCheck | AvFieldLengthCheck | AvFieldFormatCheck | AvFieldSizeCheck;
72
+ /** The checks a Json Shape's string node may carry: its length, a pattern or a format. */
73
+ export type AvJsonStringCheck = {
74
+ readonly check: "max_length";
75
+ readonly maximum: number;
76
+ } | {
77
+ readonly check: "min_length";
78
+ readonly minimum: number;
79
+ } | {
80
+ readonly check: "length_equals";
81
+ readonly length: number;
82
+ } | AvFieldFormatCheck;
83
+ /** The checks a Json Shape's number or integer node may carry: bounds are numbers. */
84
+ export type AvJsonNumberCheck = {
85
+ readonly check: "less_than" | "greater_than";
86
+ readonly value: number;
87
+ readonly inclusive: boolean;
88
+ } | {
89
+ readonly check: "multiple_of";
90
+ readonly value: number;
91
+ };
92
+ /** The checks a Json Shape's array node may carry: its length. */
93
+ export type AvJsonListCheck = {
94
+ readonly check: "max_length";
95
+ readonly maximum: number;
96
+ readonly list: true;
97
+ } | {
98
+ readonly check: "min_length";
99
+ readonly minimum: number;
100
+ readonly list: true;
101
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,72 +1,89 @@
1
- import type { PaginationCapability, ProjectionScope, RelationFilterCapability, RelationMutationDirective, RelationReducer, ScalarFilterOperator, ScalarMutationDirective, WriteScope } from "./capability.js";
2
- import type { Contract } from "./contract.js";
1
+ import type { AvPaginationCapability, AvProjectionScope, AvRelationFilterCapability, AvRelationMutationDirective, AvRelationReducer, AvScalarFilterOperator, AvScalarMutationDirective, AvWriteScope, ScalarFilterMode } from "./capability.js";
2
+ import type { AvContract } from "./contract.js";
3
+ import type { AvFieldCheck } from "./field-check.js";
3
4
  import type { JsonSchema } from "./json-shape.js";
4
- import type { LifecycleTrait } from "./lifecycle-trait.js";
5
+ import type { AvLifecycleTrait } from "./lifecycle-trait.js";
5
6
  /** A format name that refines a scalar type, carried in the Contract as data. */
6
- export type ScalarFormat = string;
7
+ export type AvScalarFormat = string;
7
8
  /** The projection positions a field can be selected in (at least one). */
8
- export type ProjectionScopes = readonly [ProjectionScope, ...ProjectionScope[]];
9
+ export type AvProjectionScopes = readonly [
10
+ AvProjectionScope,
11
+ ...AvProjectionScope[]
12
+ ];
9
13
  /**
10
14
  * The write positions a field can be written in (at least one). A scope list
11
- * applies to the top level of a write argument only; see {@link WriteScope}.
15
+ * applies to the top level of a write argument only; see {@link AvWriteScope}.
12
16
  */
13
- export type WriteScopes = readonly [WriteScope, ...WriteScope[]];
17
+ export type AvWriteScopes = readonly [AvWriteScope, ...AvWriteScope[]];
14
18
  /**
15
19
  * Whether a relation can be selected or included: `true`, or the projection
16
20
  * positions it can be used in.
17
21
  */
18
- export type RelationProjectionCapability = boolean | ProjectionScopes;
22
+ export type AvRelationProjectionCapability = boolean | AvProjectionScopes;
19
23
  /**
20
24
  * The reducers a relation admits, qualified by the projection positions they are
21
25
  * admitted in. The reducer list and the scope list are separate facts: `$count` is
22
26
  * one of a closed set of reducers, and the scopes say where the reducer may be
23
27
  * asked for.
24
28
  */
25
- export type ScopedRelationReducers = {
26
- readonly reducers: readonly RelationReducer[];
27
- readonly scopes: ProjectionScopes;
29
+ export type AvScopedRelationReducers = {
30
+ readonly reducers: readonly AvRelationReducer[];
31
+ readonly scopes: AvProjectionScopes;
28
32
  };
29
33
  /**
30
34
  * A relation's reducers: a reducer list, or an object with the reducers and
31
35
  * the projection positions they apply in.
32
36
  */
33
- export type RelationReducerCapability = readonly RelationReducer[] | ScopedRelationReducers;
37
+ export type AvRelationReducerCapability = readonly AvRelationReducer[] | AvScopedRelationReducers;
34
38
  /**
35
39
  * The mutation directives a relation admits at one write stage, and the write
36
40
  * positions they are admitted in. `directives: []` means writable with no
37
41
  * directive.
38
42
  */
39
- export type ScopedRelationMutations = {
40
- readonly directives: readonly RelationMutationDirective[];
41
- readonly scopes: WriteScopes;
43
+ export type AvScopedRelationMutations = {
44
+ readonly directives: readonly AvRelationMutationDirective[];
45
+ readonly scopes: AvWriteScopes;
42
46
  };
43
47
  /**
44
48
  * A relation's write capability for `create` or `update`: a directive list, or
45
49
  * an object with the directives and the write positions they apply in.
46
50
  */
47
- export type RelationMutationCapability = readonly RelationMutationDirective[] | ScopedRelationMutations;
51
+ export type AvRelationMutationCapability = readonly AvRelationMutationDirective[] | AvScopedRelationMutations;
48
52
  /** What can be done with a scalar field. Scalar capabilities apply in every position. */
49
- export type ScalarFieldCapabilities = {
53
+ export type AvScalarFieldCapabilities = {
50
54
  readonly select?: boolean;
51
- readonly filter?: readonly ScalarFilterOperator[];
55
+ readonly filter?: readonly AvScalarFilterOperator[];
56
+ /**
57
+ * The modes the `mode` operator takes on this field: `"default"` (the
58
+ * database's own comparison) always, and `"sensitive"` or `"insensitive"`
59
+ * where the adapter honours them. Present exactly when `filter` offers `mode`.
60
+ */
61
+ readonly filterModes?: readonly ScalarFilterMode[];
62
+ /**
63
+ * A `json` field's modes when the filter names a `path`: the text compared is
64
+ * the value at that path rather than the whole document, and the database may
65
+ * honour more modes there. Present exactly when `filter` offers `mode` and
66
+ * `path`; without a `path`, `filterModes` applies.
67
+ */
68
+ readonly pathFilterModes?: readonly ScalarFilterMode[];
52
69
  readonly order?: boolean;
53
70
  readonly orderNulls?: boolean;
54
- readonly create?: readonly ScalarMutationDirective[];
55
- readonly update?: readonly ScalarMutationDirective[];
71
+ readonly create?: readonly AvScalarMutationDirective[];
72
+ readonly update?: readonly AvScalarMutationDirective[];
56
73
  };
57
74
  /** What can be done with a relation field. */
58
- export type RelationFieldCapabilities = {
59
- readonly select?: RelationProjectionCapability;
60
- readonly include?: RelationProjectionCapability;
61
- readonly filter?: readonly RelationFilterCapability[];
75
+ export type AvRelationFieldCapabilities = {
76
+ readonly select?: AvRelationProjectionCapability;
77
+ readonly include?: AvRelationProjectionCapability;
78
+ readonly filter?: readonly AvRelationFilterCapability[];
62
79
  readonly order?: boolean;
63
- readonly pagination?: readonly PaginationCapability[];
64
- readonly reducers?: RelationReducerCapability;
65
- readonly create?: RelationMutationCapability;
66
- readonly update?: RelationMutationCapability;
80
+ readonly pagination?: readonly AvPaginationCapability[];
81
+ readonly reducers?: AvRelationReducerCapability;
82
+ readonly create?: AvRelationMutationCapability;
83
+ readonly update?: AvRelationMutationCapability;
67
84
  /**
68
85
  * What the `where` of a nested `$update` or `$delete` through this relation may
69
- * filter: `"scalar"` — the target's scalar fields only, combined with
86
+ * filter: `"scalar"` means the target's scalar fields only, combined with
70
87
  * `AND`/`OR`/`NOT`, and no relation filter at any depth. Absent: any filter the
71
88
  * target takes.
72
89
  */
@@ -76,53 +93,75 @@ export type RelationFieldCapabilities = {
76
93
  * The reducers a relation advertises, in any projection position. Use
77
94
  * {@link advertisedReducersAt} for one position.
78
95
  */
79
- export declare function advertisedReducers(capability: RelationReducerCapability | undefined): readonly RelationReducer[] | undefined;
96
+ export declare function advertisedReducers(capability: AvRelationReducerCapability | undefined): readonly AvRelationReducer[] | undefined;
80
97
  /** Whether a projection capability holds at one projection position. */
81
- export declare function holdsAt(capability: RelationProjectionCapability | undefined, scope: ProjectionScope): boolean;
98
+ export declare function holdsAt(capability: AvRelationProjectionCapability | undefined, scope: AvProjectionScope): boolean;
82
99
  /**
83
100
  * Whether a projection capability holds in **any** projection position. Use
84
101
  * {@link holdsAt} when the position is known.
85
102
  */
86
- export declare function holdsInAnyScope(capability: RelationProjectionCapability | undefined): boolean;
103
+ export declare function holdsInAnyScope(capability: AvRelationProjectionCapability | undefined): boolean;
87
104
  /**
88
105
  * The reducers a relation advertises at one projection position, or
89
106
  * `undefined` where it has none there.
90
107
  */
91
- export declare function advertisedReducersAt(capability: RelationReducerCapability | undefined, scope: ProjectionScope): readonly RelationReducer[] | undefined;
108
+ export declare function advertisedReducersAt(capability: AvRelationReducerCapability | undefined, scope: AvProjectionScope): readonly AvRelationReducer[] | undefined;
92
109
  /**
93
110
  * The mutation directives a relation advertises at one write stage, in any
94
111
  * write position. `undefined` means the stage is unavailable; `[]` means
95
112
  * available with no directive.
96
113
  */
97
- export declare function advertisedDirectives(capability: RelationMutationCapability | undefined): readonly RelationMutationDirective[] | undefined;
114
+ export declare function advertisedDirectives(capability: AvRelationMutationCapability | undefined): readonly AvRelationMutationDirective[] | undefined;
98
115
  /**
99
116
  * The mutation directives a relation advertises at one write position, or
100
117
  * `undefined` where it is not writable there.
101
118
  */
102
- export declare function advertisedDirectivesAt(capability: RelationMutationCapability | undefined, scope: WriteScope): readonly RelationMutationDirective[] | undefined;
119
+ export declare function advertisedDirectivesAt(capability: AvRelationMutationCapability | undefined, scope: AvWriteScope): readonly AvRelationMutationDirective[] | undefined;
103
120
  /** A scalar field, including an enum-backed one. */
104
- export type ScalarField<C extends Contract> = {
121
+ export type AvScalarField<C extends AvContract> = {
105
122
  readonly kind: "scalar";
106
123
  readonly type: {
107
124
  readonly scalar: Extract<keyof C["scalars"], string>;
108
125
  } | {
109
126
  readonly enum: Extract<keyof C["enums"], string>;
110
127
  };
111
- readonly format?: ScalarFormat;
128
+ readonly format?: AvScalarFormat;
112
129
  readonly nullable: boolean;
113
130
  readonly list: boolean;
114
- readonly lifecycle: readonly LifecycleTrait[];
115
- readonly capabilities: ScalarFieldCapabilities;
131
+ readonly lifecycle: readonly AvLifecycleTrait[];
132
+ readonly capabilities: AvScalarFieldCapabilities;
116
133
  /** A `json` field's shape, as JSON Schema: what every value written to it is. */
117
134
  readonly json?: JsonSchema;
135
+ /**
136
+ * The field's validators: the root's checks, then the overlay's, in
137
+ * registration order. On a list field a check applies to each entry, except a
138
+ * `list: true` length check, which applies to the list.
139
+ */
140
+ readonly validators?: readonly AvFieldCheck[];
118
141
  };
119
142
  /** A relation field; the `target` Resource describes the related row. */
120
- export type RelationField<C extends Contract> = {
143
+ export type AvRelationField<C extends AvContract> = {
121
144
  readonly kind: "relation";
122
145
  readonly target: Extract<keyof C["resources"], string>;
123
146
  readonly cardinality: "one" | "many";
124
147
  readonly nullable: boolean;
125
- readonly capabilities: RelationFieldCapabilities;
148
+ readonly capabilities: AvRelationFieldCapabilities;
149
+ /**
150
+ * The target's relation field that is this relation's other end
151
+ * (`User.posts` ↔ `Post.author`): a record written through this relation sits
152
+ * at that field's `"loopback"` write position. Absent when the adapter states
153
+ * no pairing or the layer hides the other end.
154
+ */
155
+ readonly inverse?: string;
156
+ /**
157
+ * The scalar fields of this Resource that hold the relation's reference, in the
158
+ * order the data source pairs them with the target's key (`Post.category` has
159
+ * `["categoryId"]`). Writing the relation and one of them in one record names
160
+ * the reference twice; inside a record written through the relation's other
161
+ * end they sit at the `"loopback"` position with it. Absent on the end that
162
+ * holds no reference, and where the layer shows none of them.
163
+ */
164
+ readonly referenceFields?: readonly [string, ...string[]];
126
165
  };
127
166
  /** One field of a Resource: a scalar or a relation. */
128
- export type Field<C extends Contract> = ScalarField<C> | RelationField<C>;
167
+ export type AvField<C extends AvContract> = AvScalarField<C> | AvRelationField<C>;
@@ -1,7 +1,7 @@
1
- import type { Contract } from "./contract.js";
2
- import type { Field } from "./field.js";
1
+ import type { AvContract } from "./contract.js";
2
+ import type { AvField } from "./field.js";
3
3
  /** Keys of `TFields` whose field can be scalar-shaped. */
4
- export type ScalarFieldKey<TFields extends Readonly<Record<string, Field<Contract>>>> = Extract<{
4
+ export type AvScalarFieldKey<TFields extends Readonly<Record<string, AvField<AvContract>>>> = Extract<{
5
5
  [K in keyof TFields]: [
6
6
  Extract<TFields[K], {
7
7
  readonly kind: "scalar";
@@ -9,4 +9,4 @@ export type ScalarFieldKey<TFields extends Readonly<Record<string, Field<Contrac
9
9
  ] extends [never] ? never : K;
10
10
  }[keyof TFields], string>;
11
11
  /** Non-empty tuple of scalar field keys that identifies at most one Resource. */
12
- export type Identifier<TFields extends Readonly<Record<string, Field<Contract>>>> = readonly [ScalarFieldKey<TFields>, ...ScalarFieldKey<TFields>[]];
12
+ export type AvIdentifier<TFields extends Readonly<Record<string, AvField<AvContract>>>> = readonly [AvScalarFieldKey<TFields>, ...AvScalarFieldKey<TFields>[]];
@@ -1,3 +1,4 @@
1
+ import type { AvJsonListCheck, AvJsonNumberCheck, AvJsonStringCheck } from "./field-check.js";
1
2
  /**
2
3
  * The phantom key a Json Shape's TypeScript type travels under. Type-level only:
3
4
  * no value ever holds it.
@@ -20,7 +21,15 @@ export type JsonSchemaPrimitive = string | number | boolean | null;
20
21
  * the forms Aventara emits.
21
22
  */
22
23
  export type JsonSchema = {
23
- readonly type: "string" | "number" | "integer" | "boolean" | "null";
24
+ readonly type: "boolean" | "null";
25
+ } | {
26
+ readonly type: "string";
27
+ /** The node's checks, in the order they were added. */
28
+ readonly checks?: readonly AvJsonStringCheck[];
29
+ } | {
30
+ readonly type: "number" | "integer";
31
+ /** The node's checks, in the order they were added. */
32
+ readonly checks?: readonly AvJsonNumberCheck[];
24
33
  } | {
25
34
  readonly const: JsonSchemaPrimitive;
26
35
  } | {
@@ -39,6 +48,8 @@ export type JsonSchema = {
39
48
  } | {
40
49
  readonly type: "array";
41
50
  readonly items: JsonSchema;
51
+ /** The list's length checks, in the order they were added. */
52
+ readonly checks?: readonly AvJsonListCheck[];
42
53
  } | {
43
54
  readonly type: "array";
44
55
  readonly prefixItems: readonly [JsonSchema, ...JsonSchema[]];
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Where a field's value comes from, without saying whether it is writable:
3
3
  * `DEFAULTED` and `GENERATED_ON_*` by the data source, `COMPUTED_ON_*` by a
4
- * framework behavior; `VIRTUAL` marks a field that is not stored.
4
+ * compute stage; `VIRTUAL` marks a field that is not stored.
5
5
  */
6
6
  export declare const LIFECYCLE_TRAITS: readonly ["DEFAULTED", "GENERATED_ON_CREATE", "GENERATED_ON_UPDATE", "COMPUTED_ON_CREATE", "COMPUTED_ON_UPDATE", "COMPUTED_ON_READ", "VIRTUAL"];
7
7
  /** One of {@link LIFECYCLE_TRAITS}. */
8
- export type LifecycleTrait = (typeof LIFECYCLE_TRAITS)[number];
8
+ export type AvLifecycleTrait = (typeof LIFECYCLE_TRAITS)[number];
@@ -1,62 +1,62 @@
1
- import type { ProjectionScope, WriteScope } from "./capability.js";
1
+ import type { AvProjectionScope, AvWriteScope } from "./capability.js";
2
2
  /**
3
3
  * The argument scopes one advertised operation variant qualifies its arguments
4
4
  * with: which projection position its projection arguments sit in, and which write
5
5
  * position its data argument sits in.
6
6
  */
7
- export type OperationVariantScopes = {
8
- readonly projection: ProjectionScope;
9
- readonly write?: WriteScope;
7
+ export type AvOperationVariantScopes = {
8
+ readonly projection: AvProjectionScope;
9
+ readonly write?: AvWriteScope;
10
10
  } | {
11
- readonly projection?: ProjectionScope;
12
- readonly write: WriteScope;
11
+ readonly projection?: AvProjectionScope;
12
+ readonly write: AvWriteScope;
13
13
  };
14
14
  /**
15
15
  * Availability of one standard operation variant: `true` for "available, with no
16
16
  * scope qualification stated", or the scopes the variant qualifies its arguments
17
17
  * with.
18
18
  */
19
- export type OperationAvailability = true | OperationVariantScopes;
19
+ export type AvOperationAvailability = true | AvOperationVariantScopes;
20
20
  /** Availability of protocol-defined standard operations for one Resource. */
21
- export type ResourceOperations = {
21
+ export type AvResourceOperations = {
22
22
  readonly find?: {
23
- readonly first?: OperationAvailability;
24
- readonly unique?: OperationAvailability;
25
- readonly many?: OperationAvailability;
26
- readonly count?: OperationAvailability;
23
+ readonly first?: AvOperationAvailability;
24
+ readonly unique?: AvOperationAvailability;
25
+ readonly many?: AvOperationAvailability;
26
+ readonly count?: AvOperationAvailability;
27
27
  };
28
28
  readonly create?: {
29
- readonly one?: OperationAvailability;
30
- readonly many?: OperationAvailability;
31
- readonly count?: OperationAvailability;
29
+ readonly one?: AvOperationAvailability;
30
+ readonly many?: AvOperationAvailability;
31
+ readonly count?: AvOperationAvailability;
32
32
  };
33
33
  readonly update?: {
34
- readonly first?: OperationAvailability;
35
- readonly unique?: OperationAvailability;
36
- readonly many?: OperationAvailability;
37
- readonly count?: OperationAvailability;
34
+ readonly first?: AvOperationAvailability;
35
+ readonly unique?: AvOperationAvailability;
36
+ readonly many?: AvOperationAvailability;
37
+ readonly count?: AvOperationAvailability;
38
38
  };
39
39
  readonly delete?: {
40
- readonly first?: OperationAvailability;
41
- readonly unique?: OperationAvailability;
42
- readonly many?: OperationAvailability;
43
- readonly count?: OperationAvailability;
40
+ readonly first?: AvOperationAvailability;
41
+ readonly unique?: AvOperationAvailability;
42
+ readonly many?: AvOperationAvailability;
43
+ readonly count?: AvOperationAvailability;
44
44
  };
45
45
  readonly upsert?: {
46
- readonly unique?: OperationAvailability;
46
+ readonly unique?: AvOperationAvailability;
47
47
  };
48
48
  };
49
49
  /**
50
- * Whether one `ResourceOperations` entry marks its variant available: it is
50
+ * Whether one `AvResourceOperations` entry marks its variant available: it is
51
51
  * `true` or an argument-position descriptor.
52
52
  */
53
- export declare function isOperationVariantAvailable(availability: unknown): availability is OperationAvailability;
53
+ export declare function isOperationVariantAvailable(availability: unknown): availability is AvOperationAvailability;
54
54
  /**
55
55
  * The projection position one advertised variant's projection arguments sit in.
56
56
  */
57
- export declare function projectionScopeOf(availability: unknown): ProjectionScope;
57
+ export declare function projectionScopeOf(availability: unknown): AvProjectionScope;
58
58
  /**
59
59
  * The write position one advertised variant's data argument sits in, and the write
60
60
  * mirror of {@link projectionScopeOf}.
61
61
  */
62
- export declare function writeScopeOf(availability: unknown): WriteScope;
62
+ export declare function writeScopeOf(availability: unknown): AvWriteScope;
@@ -1,12 +1,18 @@
1
- import type { Contract } from "./contract.js";
2
- import type { Field } from "./field.js";
3
- import type { Identifier } from "./identifier.js";
4
- import type { ResourceOperations } from "./resource-operations.js";
1
+ import type { AvContract } from "./contract.js";
2
+ import type { AvCreateRequirements } from "./create-requirements.js";
3
+ import type { AvField } from "./field.js";
4
+ import type { AvIdentifier } from "./identifier.js";
5
+ import type { AvResourceOperations } from "./resource-operations.js";
5
6
  /** A Resource's fields, by name. */
6
- export type ResourceFieldMap<C extends Contract> = Readonly<Record<string, Field<C>>>;
7
- /** One Resource: its fields, identifiers and available operations. */
8
- export type Resource<C extends Contract, TFields extends ResourceFieldMap<C> = ResourceFieldMap<C>> = {
7
+ export type AvResourceFieldMap<C extends AvContract> = Readonly<Record<string, AvField<C>>>;
8
+ /**
9
+ * One Resource: its fields, identifiers and available operations, and what a
10
+ * create of it cannot do without.
11
+ */
12
+ export type AvResource<C extends AvContract, TFields extends AvResourceFieldMap<C> = AvResourceFieldMap<C>> = {
9
13
  readonly fields: TFields;
10
- readonly identifiers: readonly Identifier<TFields>[];
11
- readonly operations: ResourceOperations;
14
+ readonly identifiers: readonly AvIdentifier<TFields>[];
15
+ readonly operations: AvResourceOperations;
16
+ /** What a create must write; absent when it requires nothing. */
17
+ readonly createRequirements?: AvCreateRequirements;
12
18
  };