@zinn-digital/sdk 0.0.0-stage → 0.1.1308

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.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @zinn/sdk-ts — the typed client for the Zinn Digital Platform API.
3
+ *
4
+ * `src/generated/schema.d.ts` is produced from `openapi/openapi.yaml` by
5
+ * openapi-typescript and is NEVER hand-edited (the spec is the single source of
6
+ * truth — CLAUDE.md §2.5). This file is the small, stable hand-written surface:
7
+ * a typed `openapi-fetch` client factory plus ergonomic type aliases.
8
+ *
9
+ * The client is intentionally un-configured here. @zinn/app-kit builds on it,
10
+ * attaching middleware for `Authorization: Bearer`, `Idempotency-Key`, the
11
+ * active-org header, `Accept-Language`, and error-envelope → typed `ApiError`
12
+ * normalisation (docs/32 §1.3). Anonymous callers (the public site) use it as-is.
13
+ */
14
+ import { type Client, type ClientOptions, type Middleware } from "openapi-fetch";
15
+ import type { components, operations, paths } from "./generated/schema";
16
+ export type { components, operations, paths };
17
+ /** Fully-typed client bound to the API's path map. */
18
+ export type ZinnApiClient = Client<paths>;
19
+ /**
20
+ * Create a typed API client. Pass `{ baseUrl }` (e.g. the dev/prod API origin).
21
+ * Attach cross-cutting behaviour with `client.use(middleware)` — see @zinn/app-kit.
22
+ */
23
+ export declare function createApiClient(options?: ClientOptions): ZinnApiClient;
24
+ export type { Client, ClientOptions, Middleware };
25
+ type Schemas = components["schemas"];
26
+ export type Health = Schemas["Health"];
27
+ export type Principal = Schemas["Principal"];
28
+ export type User = Schemas["User"];
29
+ export type Membership = Schemas["Membership"];
30
+ export type Organization = Schemas["Organization"];
31
+ export type OrganizationCreate = Schemas["OrganizationCreate"];
32
+ export type OrganizationPage = Schemas["OrganizationPage"];
33
+ export type OrgType = Schemas["OrgType"];
34
+ export type PageMeta = Schemas["PageMeta"];
35
+ export type CurrencyCode = Schemas["CurrencyCode"];
36
+ export type LocaleCode = Schemas["LocaleCode"];
37
+ export type Uuid = Schemas["Uuid"];
38
+ /** The standard error envelope every non-2xx response carries (docs/09 §2). */
39
+ export type ApiErrorEnvelope = Schemas["Error"];
40
+ export type ApiErrorDetail = Schemas["ErrorDetail"];
41
+ /** `CLAUDE.md` §57 — the classified AI/vendor failure an error envelope may carry. */
42
+ export type VendorFailure = Schemas["VendorFailure"];
43
+ /**
44
+ * `CLAUDE.md` §2.19 — a refusal's message KEY and its parameters, so a console renders the
45
+ * sentence in the reader's own language instead of the English the engine composed (W43-138).
46
+ *
47
+ * ⛔ Not a replacement for `error.message`: the SDK, the CLI and a direct caller have no
48
+ * catalogue and go on reading the English. This is the half a console with 58 catalogues uses.
49
+ */
50
+ export type Refusal = Schemas["Refusal"];
51
+ /**
52
+ * Q225 — the order a one-click purchase was PLACED as, waiting for the customer to pay it
53
+ * on-session. Carried by a `PAYMENT_METHOD_REQUIRED` envelope as `error.payment`.
54
+ */
55
+ export type PaymentStep = Schemas["PaymentStep"];
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @zinn/sdk-ts — the typed client for the Zinn Digital Platform API.
3
+ *
4
+ * `src/generated/schema.d.ts` is produced from `openapi/openapi.yaml` by
5
+ * openapi-typescript and is NEVER hand-edited (the spec is the single source of
6
+ * truth — CLAUDE.md §2.5). This file is the small, stable hand-written surface:
7
+ * a typed `openapi-fetch` client factory plus ergonomic type aliases.
8
+ *
9
+ * The client is intentionally un-configured here. @zinn/app-kit builds on it,
10
+ * attaching middleware for `Authorization: Bearer`, `Idempotency-Key`, the
11
+ * active-org header, `Accept-Language`, and error-envelope → typed `ApiError`
12
+ * normalisation (docs/32 §1.3). Anonymous callers (the public site) use it as-is.
13
+ */
14
+ import createClient, {} from "openapi-fetch";
15
+ /**
16
+ * Create a typed API client. Pass `{ baseUrl }` (e.g. the dev/prod API origin).
17
+ * Attach cross-cutting behaviour with `client.use(middleware)` — see @zinn/app-kit.
18
+ */
19
+ export function createApiClient(options) {
20
+ return createClient(options);
21
+ }
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1308",
4
+ "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
+ "license": "MIT",
6
+ "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",
7
+ "homepage": "https://zinndigital.com/developers",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Zinn-Digital/platform.git",
11
+ "directory": "sdks"
12
+ },
13
+ "keywords": [
14
+ "zinn",
15
+ "hosting",
16
+ "api",
17
+ "sdk",
18
+ "openapi"
19
+ ],
20
+ "type": "module",
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ },
28
+ "./schema": {
29
+ "types": "./dist/generated/schema.d.ts"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "sideEffects": false,
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "dependencies": {
42
+ "openapi-fetch": "^0.17.0"
43
+ }
44
+ }