@aventara/client 0.0.0-stage → 0.1.0-pilot.1
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/LICENSE +91 -0
- package/LICENSE-ADDITIONAL-PERMISSION.md +9 -0
- package/README.md +234 -2
- package/dist/avclient.bin.d.ts +2 -0
- package/dist/avclient.bin.js +15 -0
- package/dist/cli/command.parser.d.ts +37 -0
- package/dist/cli/command.parser.js +177 -0
- package/dist/cli/generate.command.d.ts +24 -0
- package/dist/cli/generate.command.js +41 -0
- package/dist/cli/generation-failure.renderer.d.ts +6 -0
- package/dist/cli/generation-failure.renderer.js +52 -0
- package/dist/cli/generation-success.renderer.d.ts +32 -0
- package/dist/cli/generation-success.renderer.js +47 -0
- package/dist/cli/terminal.prompter.d.ts +13 -0
- package/dist/cli/terminal.prompter.js +53 -0
- package/dist/cli/warning.renderer.d.ts +10 -0
- package/dist/cli/warning.renderer.js +14 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.js +75 -0
- package/dist/config/client-config.interface.d.ts +62 -0
- package/dist/config/client-config.interface.js +14 -0
- package/dist/config/config.loader.d.ts +41 -0
- package/dist/config/config.loader.js +95 -0
- package/dist/config/config.resolver.d.ts +50 -0
- package/dist/config/config.resolver.js +126 -0
- package/dist/config/env.cascade.d.ts +84 -0
- package/dist/config/env.cascade.js +126 -0
- package/dist/contract/contract.acceptance.d.ts +77 -0
- package/dist/contract/contract.acceptance.js +124 -0
- package/dist/contract/contract.fetcher.d.ts +64 -0
- package/dist/contract/contract.fetcher.js +85 -0
- package/dist/contract/contract.loader.d.ts +32 -0
- package/dist/contract/contract.loader.js +32 -0
- package/dist/emit/banner.emitter.d.ts +31 -0
- package/dist/emit/banner.emitter.js +42 -0
- package/dist/emit/client-surface.emitter.d.ts +32 -0
- package/dist/emit/client-surface.emitter.js +236 -0
- package/dist/emit/client-tree.emitter.d.ts +37 -0
- package/dist/emit/client-tree.emitter.js +103 -0
- package/dist/emit/contract-carrier.emitter.d.ts +13 -0
- package/dist/emit/contract-carrier.emitter.js +60 -0
- package/dist/emit/derivation.emitter.d.ts +45 -0
- package/dist/emit/derivation.emitter.js +233 -0
- package/dist/emit/descriptor.emitter.d.ts +4 -0
- package/dist/emit/descriptor.emitter.js +97 -0
- package/dist/emit/emitted-tree.interface.d.ts +61 -0
- package/dist/emit/emitted-tree.interface.js +18 -0
- package/dist/emit/enum.emitter.d.ts +24 -0
- package/dist/emit/enum.emitter.js +42 -0
- package/dist/emit/name.deriver.d.ts +153 -0
- package/dist/emit/name.deriver.js +411 -0
- package/dist/emit/named-type.emitter.d.ts +32 -0
- package/dist/emit/named-type.emitter.js +50 -0
- package/dist/emit/runtime.emitter.d.ts +87 -0
- package/dist/emit/runtime.emitter.js +707 -0
- package/dist/emit/scalar.codec.d.ts +63 -0
- package/dist/emit/scalar.codec.js +498 -0
- package/dist/emit/transaction.emitter.d.ts +17 -0
- package/dist/emit/transaction.emitter.js +438 -0
- package/dist/generate.d.ts +123 -0
- package/dist/generate.js +98 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/init/client-config.template.d.ts +11 -0
- package/dist/init/client-config.template.js +27 -0
- package/dist/init/client-init.errors.d.ts +9 -0
- package/dist/init/client-init.errors.js +9 -0
- package/dist/init/client-init.orchestrator.d.ts +3 -0
- package/dist/init/client-init.orchestrator.js +86 -0
- package/dist/init/client-init.planner.d.ts +27 -0
- package/dist/init/client-init.planner.js +99 -0
- package/dist/init/client-init.questions.d.ts +52 -0
- package/dist/init/client-init.questions.js +124 -0
- package/dist/init/client-project.inspector.d.ts +15 -0
- package/dist/init/client-project.inspector.js +32 -0
- package/dist/init/command.runner.d.ts +8 -0
- package/dist/init/command.runner.js +17 -0
- package/dist/node-version.guard.d.ts +8 -0
- package/dist/node-version.guard.js +59 -0
- package/dist/output/output.validator.d.ts +75 -0
- package/dist/output/output.validator.js +262 -0
- package/dist/output/output.writer.d.ts +162 -0
- package/dist/output/output.writer.js +499 -0
- package/package.json +47 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ClientContract } from "@aventara/core";
|
|
2
|
+
import type { ClientEntrypoint } from "../config/client-config.interface.js";
|
|
3
|
+
import type { EmittedModule } from "./emitted-tree.interface.js";
|
|
4
|
+
/**
|
|
5
|
+
* The runtime modules the generated client carries: `metadata.ts`, the
|
|
6
|
+
* framework `Decimal`, the outcome codes and error classes, and the transport
|
|
7
|
+
* here; the scalar codec in `scalar.codec.ts`.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* `runtime/decimal.ts` — the framework-owned `Decimal` of §6.2, the generated
|
|
11
|
+
* runtime value of the `decimal` scalar. Bundled with the client and imported
|
|
12
|
+
* from nothing: its public type is its own, never an ORM's (§6.2, C-801).
|
|
13
|
+
*
|
|
14
|
+
* It holds the decimal string it was made from, digit for digit, and does no
|
|
15
|
+
* arithmetic — the surface is core's `Decimal` (a string constructor and
|
|
16
|
+
* `toString`) plus `toJSON`, so a value means the same on both sides of the wire.
|
|
17
|
+
* A proven decimal library may later sit behind it (§6.2); none is needed to
|
|
18
|
+
* carry digits.
|
|
19
|
+
*
|
|
20
|
+
* `toJSON` is the architect's (2026-10-04, S6 answers): it returns the decimal
|
|
21
|
+
* string, so a Decimal in a consumer's own JSON — a log line, a cache entry — is
|
|
22
|
+
* its digits rather than `{}`. No `equals`, no arithmetic. The request body never
|
|
23
|
+
* relies on it: `serializeWireBody` refuses an unencoded Decimal regardless, so a
|
|
24
|
+
* value the codec did not encode cannot slip onto the wire through `toJSON`.
|
|
25
|
+
*
|
|
26
|
+
* The grammar is core's `Decimal` grammar, read from `AvProtocol.scalarFormats`
|
|
27
|
+
* and emitted by value (C2, R7; `protocol-parity.spec.ts`). Unlike
|
|
28
|
+
* core's, the constructor refuses a non-string outright: a pattern test coerces
|
|
29
|
+
* its argument, so `5` would otherwise pass as `"5"` and be kept as a number.
|
|
30
|
+
*/
|
|
31
|
+
export declare function emitDecimalModule(): EmittedModule;
|
|
32
|
+
/**
|
|
33
|
+
* `metadata.ts` — what this client was generated against: the ClientContract
|
|
34
|
+
* hash and the protocol version (Phase 12-partial Q4 = A), and the resolved
|
|
35
|
+
* entrypoint as the client's default (§15.2; Phase 12-rest Q5 = A). Nothing else:
|
|
36
|
+
* no driver, no timestamp, no generator version, no host path — anything a re-run
|
|
37
|
+
* over the same inputs could change breaks byte-equality (§19.3's spirit). The
|
|
38
|
+
* entrypoint is an input like the contract: changing it regenerates different
|
|
39
|
+
* bytes and leaves the hash alone (§15.2), and it never carries credentials
|
|
40
|
+
* (refused at resolution, Q5).
|
|
41
|
+
*
|
|
42
|
+
* The hash and the version are what every operation request sends (§12.4), from
|
|
43
|
+
* `runtime/transport.ts`; all three are internal — `AvClient.ts` exports none.
|
|
44
|
+
*/
|
|
45
|
+
export declare function emitMetadataModule(protocol: ClientContract["protocol"], entrypoint: ClientEntrypoint): EmittedModule;
|
|
46
|
+
/**
|
|
47
|
+
* The `FrameworkError` subclasses the generated runtime declares, in UTF-16
|
|
48
|
+
* code-unit order — names the root namespace reserves (`name.deriver.ts`).
|
|
49
|
+
*/
|
|
50
|
+
export declare const FRAMEWORK_ERROR_CLASS_NAMES: readonly string[];
|
|
51
|
+
/**
|
|
52
|
+
* The names `AvClient.ts` re-exports from `generated/runtime/errors.ts`: the classes and the
|
|
53
|
+
* two code unions §15.4 requires, and `Cause` and `ValidationIssue` — the types a
|
|
54
|
+
* thrown FrameworkError carries, public by the architect's decision of
|
|
55
|
+
* 2026-10-04 — in UTF-16 code-unit order.
|
|
56
|
+
*/
|
|
57
|
+
export declare function errorsModuleExports(): readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* `runtime/errors.ts` — §13's vocabulary as the generated client carries it.
|
|
60
|
+
*
|
|
61
|
+
* Both code unions are emitted from core's exported arrays (Q3), so the emitted
|
|
62
|
+
* tree states each code exactly once and core stays their one source; the
|
|
63
|
+
* subclass set and the code each one throws are Q2's (above), accepted as-is by
|
|
64
|
+
* the architect on 2026-10-04. Exported beyond what `AvClient.ts` re-exports: the
|
|
65
|
+
* two arrays, `OperationErrorCode` and `frameworkErrorOf`, which
|
|
66
|
+
* `runtime/transport.ts` reads.
|
|
67
|
+
*/
|
|
68
|
+
export declare function emitErrorsModule(): EmittedModule;
|
|
69
|
+
/**
|
|
70
|
+
* `runtime/transport.ts` — the happy path of §12 and §13.5, above Phase
|
|
71
|
+
* 12-partial's boundary: one POST per operation to
|
|
72
|
+
* `<entrypoint>/_resources/<resource>/<family>/<variant>` (§12.1–§12.3), the
|
|
73
|
+
* identity headers on every request (§12.4), per-request options that are never
|
|
74
|
+
* serialized (§15.7), and the envelope read back by §13.5's rule.
|
|
75
|
+
*
|
|
76
|
+
* `execute` is Q1 = B's primitive: exported from this module for the
|
|
77
|
+
* per-variant methods to wrap, and re-exported from nowhere — it is not public
|
|
78
|
+
* surface. It reads no capability and no operation descriptor; the caller names
|
|
79
|
+
* the operation.
|
|
80
|
+
*
|
|
81
|
+
* Fetch and AbortSignal are the platform's, reached through the structural types
|
|
82
|
+
* below so the module compiles with neither DOM nor Node types (§15.7, U5).
|
|
83
|
+
*
|
|
84
|
+
* Stale-route recovery is not here: it is F-716, Phase 10's, and the emitted
|
|
85
|
+
* module documents it as a hole in its own doc comment (S9).
|
|
86
|
+
*/
|
|
87
|
+
export declare function emitTransportModule(): EmittedModule;
|