@onabl/contracts 0.1.1 → 0.1.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.
- package/README.md +21 -1
- package/dist/forms.d.ts +1 -0
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +5 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@onabl/contracts`
|
|
2
|
+
|
|
3
|
+
Zod schemas for onabl's public API — the request/response contract used by
|
|
4
|
+
`@onabl/js`. You won't normally install this directly; it comes in as a
|
|
5
|
+
dependency of `@onabl/js`, `@onabl/react`, or `@onabl/next`.
|
|
6
|
+
|
|
7
|
+
Install it directly only if you're validating onabl API payloads outside
|
|
8
|
+
the SDK (e.g. in your own backend, without going through `@onabl/js`):
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @onabl/contracts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import {PublicFormSchema, QuoteSchema} from "@onabl/contracts/public-api";
|
|
16
|
+
|
|
17
|
+
const form = PublicFormSchema.parse(rawResponseBody);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Schemas are grouped by resource under `@onabl/contracts/public-api` (forms,
|
|
21
|
+
submissions, quotes, invoices, discount codes).
|
package/dist/forms.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export declare const UpdateFormConfigSchema: z.ZodObject<{
|
|
|
69
69
|
depositDueDays: z.ZodOptional<z.ZodNumber>;
|
|
70
70
|
balanceDueDays: z.ZodOptional<z.ZodNumber>;
|
|
71
71
|
websiteBaseUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
invoiceBaseUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
73
|
}, z.core.$strip>;
|
|
73
74
|
export type CreateForm = z.infer<typeof CreateFormSchema>;
|
|
74
75
|
export type UpdateFormConfig = z.infer<typeof UpdateFormConfigSchema>;
|
package/dist/forms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AA4BpD,eAAO,MAAM,oBAAoB;;;;;;;;iBAUjB,CAAC;AAEjB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBb,CAAC;AAEjB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AA4BpD,eAAO,MAAM,oBAAoB;;;;;;;;iBAUjB,CAAC;AAEjB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBb,CAAC;AAEjB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;iBAcjC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
package/dist/forms.js
CHANGED
|
@@ -66,8 +66,11 @@ exports.UpdateFormConfigSchema = zod_1.z.object({
|
|
|
66
66
|
depositPercent: zod_1.z.number().int().min(1).max(99).nullable().optional(),
|
|
67
67
|
depositDueDays: zod_1.z.number().int().min(1).max(365).optional(),
|
|
68
68
|
balanceDueDays: zod_1.z.number().int().min(1).max(365).optional(),
|
|
69
|
-
//
|
|
70
|
-
//
|
|
69
|
+
// The tenant's own quote-view page (e.g. https://client.com/get-a-quote) — when set,
|
|
70
|
+
// customer quote emails and dashboard links point at `${websiteBaseUrl}/:uuid` instead of
|
|
71
|
+
// Onabl's hosted /q/:handle/:slug/quote/:uuid page. Pass null to clear back to
|
|
71
72
|
// Onabl-hosted, matching the depositPercent nullable-clear pattern above.
|
|
72
73
|
websiteBaseUrl: zod_1.z.string().url().nullable().optional(),
|
|
74
|
+
// Same idea, for the invoice-view page — separate field since it's rarely the same path.
|
|
75
|
+
invoiceBaseUrl: zod_1.z.string().url().nullable().optional(),
|
|
73
76
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onabl/contracts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Zod request/response validation schemas for onabl's public API — the SDK's typed contract with the API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "latest",
|
|
26
|
-
"@onabl/
|
|
27
|
-
"@onabl/
|
|
26
|
+
"@onabl/typescript-config": "0.0.1",
|
|
27
|
+
"@onabl/eslint-config": "0.0.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@onabl/types": "0.1.
|
|
30
|
+
"@onabl/types": "0.1.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"zod": "^4"
|