@inventarch/service-contracts 3.1.0 → 3.1.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.
Files changed (2) hide show
  1. package/README.md +62 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,64 @@
1
1
  # @inventarch/service-contracts
2
2
 
3
- See [the package contract](SPEC.md) and the exported TypeScript declarations.
3
+ [![npm](https://img.shields.io/npm/v/@inventarch/service-contracts?label=npm)](https://www.npmjs.com/package/@inventarch/service-contracts) [![Public quality](https://github.com/inventarch/ia/actions/workflows/platform-quality.yml/badge.svg?branch=main)](https://github.com/inventarch/ia/actions/workflows/platform-quality.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE) [![Node](https://img.shields.io/badge/node-22.x-brightgreen)](package.json)
4
+
5
+ > `@inventarch/service-contracts` holds browser-safe structural wire contracts between an independently supplied IA service host and its clients: strict Zod schemas for requests, responses and views, with JSON Schema export. Zod is its only runtime dependency, and importing any export starts no filesystem, network, identity, native runtime, provider or storage work. It stands apart from the `@inventarch/language` to `@inventarch/workspace-runtime` stack and imports none of it.
6
+
7
+ ## ⚡ Quick start
8
+
9
+ ```sh
10
+ npm install @inventarch/service-contracts
11
+ ```
12
+
13
+ Decode a request against its contract, and export the contract as JSON Schema:
14
+
15
+ ```js
16
+ import { decode, jsonSchema, ServiceError } from '@inventarch/service-contracts';
17
+ import { workspaceRequest } from '@inventarch/service-contracts/tenancy';
18
+
19
+ console.log(decode(workspaceRequest, { workspaceId: 'ws-1' }));
20
+
21
+ try {
22
+ decode(workspaceRequest, { workspaceId: 'ws-1', role: 'owner' });
23
+ } catch (error) {
24
+ if (error instanceof ServiceError) console.log(error.category, error.code);
25
+ }
26
+
27
+ console.log(jsonSchema(workspaceRequest).additionalProperties);
28
+ ```
29
+
30
+ ```text
31
+ { workspaceId: 'ws-1' }
32
+ invalid invalid-request
33
+ false
34
+ ```
35
+
36
+ `decode` returns the parsed value or throws a `ServiceError` with a category and a code. Objects reject unknown fields, so the extra `role` is refused rather than ignored. `jsonSchema` returns draft-07 JSON Schema. The package also re-exports `z` from Zod, with `SERVICE_VERSION` and `LIMITS`.
37
+
38
+ ## 🧭 What it does
39
+
40
+ | Entry point | Contracts |
41
+ | --- | --- |
42
+ | `.` | Version and limits, binding, offering and operation descriptors, invocation, public sessions and events, errors, strict decoding and JSON Schema |
43
+ | `./tenancy` | Organization, department, membership and workspace commands, views and pages |
44
+ | `./sources` | Exact source references, upload, history and admission, and bounded file chunks |
45
+ | `./session-lifecycle` | Session directory summaries, continuation and deadline renewal |
46
+ | `./source-apply` | Exact candidates, preparation, review, application and bounded inspection |
47
+ | `./marketplace` | Native release descriptors, publication selectors, acquisition quotes and receipts, bounded artifact chunks, and registry kit and workspace indexes |
48
+ | `./installation` | Installation planning, explicit review, application and inspection |
49
+
50
+ The `./internal/*` subpaths expose the same pure modules for compatibility; they expand no authority.
51
+
52
+ ## ⚖️ What it does not do
53
+
54
+ - **It validates message shape, nothing more.** Authentication, current tenancy authorization, disclosure filtering, exact source byte verification, semantic admission, replay, scheduler fencing and effects belong to the application host that serves these messages.
55
+ - **Data is never a grant.** Selectors, the permissions a published view lists, command IDs, digests and opaque tokens are data, not authority.
56
+ - **It ships no implementation.** There is no SQL-backed directory, marketplace implementation, transport or inspection method here, only contracts.
57
+ - **Its qualification proves an interoperable boundary.** Release checks install a packed consumer that imports every subpath and bundles for a browser target. They do not establish hosted authentication, deployment, registry publication or a complete application journey.
58
+
59
+ ## 📚 Learn more
60
+
61
+ - [SPEC.md](SPEC.md): the contract for each export, its limits and its release qualification.
62
+ - [LANGUAGE.md](LANGUAGE.md): the public vocabulary this release carries.
63
+ - The [root README](../../README.md) and the [architecture reference](../../docs/reference/architecture/README.md).
64
+ - Related: [`@inventarch/runtime`](../runtime/README.md), whose `./authoring` subpath holds the remote authoring client contracts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inventarch/service-contracts",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",