@flexprice/sdk 2.1.40 → 2.1.42
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/docs/sdk/models/analytics-query-meta.md +5 -1
- package/docs/sdk/models/analytics-query-request.md +1 -1
- package/docs/sdk/models/analytics-view-definition-compare.md +17 -0
- package/docs/sdk/models/analytics-view-definition.md +15 -12
- package/docs/sdk/models/cancel-self-billing-checkout-request.md +17 -0
- package/docs/sdk/models/create-view-request.md +1 -1
- package/docs/sdk/models/default-shape.md +17 -0
- package/docs/sdk/models/delete-analytics-view-request.md +17 -0
- package/docs/sdk/models/dir.md +15 -0
- package/docs/sdk/models/display.md +17 -0
- package/docs/sdk/models/family.md +2 -2
- package/docs/sdk/models/get-analytics-view-request.md +17 -0
- package/docs/sdk/models/improvement-direction.md +17 -0
- package/docs/sdk/models/invoice-response.md +1 -0
- package/docs/sdk/models/list-analytics-views-request.md +15 -0
- package/docs/sdk/models/list-views-response.md +15 -0
- package/docs/sdk/models/metric.md +2 -2
- package/docs/sdk/models/op.md +15 -0
- package/docs/sdk/models/poll-self-billing-checkout-request.md +17 -0
- package/docs/sdk/models/report-catalog-entry-grain.md +17 -0
- package/docs/sdk/models/report-catalog-entry-shape.md +17 -0
- package/docs/sdk/models/report-catalog-entry.md +29 -0
- package/docs/sdk/models/report-catalog-response.md +15 -0
- package/docs/sdk/models/report-category.md +17 -0
- package/docs/sdk/models/report-dimension.md +16 -0
- package/docs/sdk/models/report-filter.md +17 -0
- package/docs/sdk/models/report-kind.md +17 -0
- package/docs/sdk/models/report-query-request-compare.md +15 -0
- package/docs/sdk/models/report-query-request-grain.md +15 -0
- package/docs/sdk/models/report-query-request-shape.md +15 -0
- package/docs/sdk/models/report-query-request.md +26 -0
- package/docs/sdk/models/report-sort.md +16 -0
- package/docs/sdk/models/report-value-type.md +17 -0
- package/docs/sdk/models/run-analytics-report-request.md +22 -0
- package/docs/sdk/models/self-billing-checkout-request.md +30 -0
- package/docs/sdk/models/self-billing-checkout-response.md +19 -0
- package/docs/sdk/models/self-billing-invoice.md +22 -0
- package/docs/sdk/models/self-billing-portal-response.md +16 -0
- package/docs/sdk/models/self-billing-status-response.md +16 -0
- package/docs/sdk/models/self-billing-summary-response.md +37 -0
- package/docs/sdk/models/tenant-internal-status.md +17 -0
- package/docs/sdk/models/top-up-wallet-request.md +1 -0
- package/docs/sdk/models/update-analytics-view-request.md +27 -0
- package/docs/sdk/models/view-response.md +9 -6
- package/docs/sdks/analytics/README.md +455 -4
- package/docs/sdks/selfbilling/README.md +517 -0
- package/docs/sdks/tenants/README.md +0 -71
- package/esm/funcs/{tenants-get-tenant-billing-usage.d.ts → analytics-delete-analytics-view.d.ts} +4 -4
- package/esm/funcs/analytics-delete-analytics-view.d.ts.map +1 -0
- package/esm/funcs/analytics-delete-analytics-view.js +91 -0
- package/esm/funcs/analytics-delete-analytics-view.js.map +1 -0
- package/esm/funcs/analytics-get-analytics-view.d.ts +17 -0
- package/esm/funcs/analytics-get-analytics-view.d.ts.map +1 -0
- package/esm/funcs/analytics-get-analytics-view.js +91 -0
- package/esm/funcs/analytics-get-analytics-view.js.map +1 -0
- package/esm/funcs/analytics-list-analytics-reports.d.ts +17 -0
- package/esm/funcs/{tenants-get-tenant-billing-usage.d.ts.map → analytics-list-analytics-reports.d.ts.map} +1 -1
- package/esm/funcs/analytics-list-analytics-reports.js +72 -0
- package/esm/funcs/{tenants-get-tenant-billing-usage.js.map → analytics-list-analytics-reports.js.map} +1 -1
- package/esm/funcs/analytics-list-analytics-views.d.ts +17 -0
- package/esm/funcs/analytics-list-analytics-views.d.ts.map +1 -0
- package/esm/funcs/analytics-list-analytics-views.js +89 -0
- package/esm/funcs/analytics-list-analytics-views.js.map +1 -0
- package/esm/funcs/analytics-run-analytics-report.d.ts +17 -0
- package/esm/funcs/analytics-run-analytics-report.d.ts.map +1 -0
- package/esm/funcs/analytics-run-analytics-report.js +93 -0
- package/esm/funcs/analytics-run-analytics-report.js.map +1 -0
- package/esm/funcs/analytics-update-analytics-view.d.ts +17 -0
- package/esm/funcs/analytics-update-analytics-view.d.ts.map +1 -0
- package/esm/funcs/analytics-update-analytics-view.js +93 -0
- package/esm/funcs/analytics-update-analytics-view.js.map +1 -0
- package/esm/funcs/self-billing-cancel-self-billing-checkout.d.ts +16 -0
- package/esm/funcs/self-billing-cancel-self-billing-checkout.d.ts.map +1 -0
- package/esm/funcs/self-billing-cancel-self-billing-checkout.js +88 -0
- package/esm/funcs/self-billing-cancel-self-billing-checkout.js.map +1 -0
- package/esm/funcs/self-billing-create-self-billing-portal-session.d.ts +17 -0
- package/esm/funcs/self-billing-create-self-billing-portal-session.d.ts.map +1 -0
- package/esm/funcs/{tenants-get-tenant-billing-usage.js → self-billing-create-self-billing-portal-session.js} +8 -8
- package/esm/funcs/self-billing-create-self-billing-portal-session.js.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-status.d.ts +17 -0
- package/esm/funcs/self-billing-get-self-billing-status.d.ts.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-status.js +72 -0
- package/esm/funcs/self-billing-get-self-billing-status.js.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-summary.d.ts +17 -0
- package/esm/funcs/self-billing-get-self-billing-summary.d.ts.map +1 -0
- package/esm/funcs/self-billing-get-self-billing-summary.js +72 -0
- package/esm/funcs/self-billing-get-self-billing-summary.js.map +1 -0
- package/esm/funcs/self-billing-get-tenant-billing-summary.d.ts +17 -0
- package/esm/funcs/self-billing-get-tenant-billing-summary.d.ts.map +1 -0
- package/esm/funcs/self-billing-get-tenant-billing-summary.js +72 -0
- package/esm/funcs/self-billing-get-tenant-billing-summary.js.map +1 -0
- package/esm/funcs/self-billing-poll-self-billing-checkout.d.ts +17 -0
- package/esm/funcs/self-billing-poll-self-billing-checkout.d.ts.map +1 -0
- package/esm/funcs/self-billing-poll-self-billing-checkout.js +91 -0
- package/esm/funcs/self-billing-poll-self-billing-checkout.js.map +1 -0
- package/esm/funcs/self-billing-start-self-billing-checkout.d.ts +17 -0
- package/esm/funcs/self-billing-start-self-billing-checkout.d.ts.map +1 -0
- package/esm/funcs/self-billing-start-self-billing-checkout.js +83 -0
- package/esm/funcs/self-billing-start-self-billing-checkout.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/sdk/analytics.d.ts +42 -0
- package/esm/sdk/analytics.d.ts.map +1 -1
- package/esm/sdk/analytics.js +60 -0
- package/esm/sdk/analytics.js.map +1 -1
- package/esm/sdk/models/analytics-query-meta.d.ts +4 -0
- package/esm/sdk/models/analytics-query-meta.d.ts.map +1 -1
- package/esm/sdk/models/analytics-query-meta.js +6 -0
- package/esm/sdk/models/analytics-query-meta.js.map +1 -1
- package/esm/sdk/models/analytics-view-definition.d.ts +25 -0
- package/esm/sdk/models/analytics-view-definition.d.ts.map +1 -1
- package/esm/sdk/models/analytics-view-definition.js +25 -0
- package/esm/sdk/models/analytics-view-definition.js.map +1 -1
- package/esm/sdk/models/cancel-self-billing-checkout-op.d.ts +15 -0
- package/esm/sdk/models/cancel-self-billing-checkout-op.d.ts.map +1 -0
- package/esm/sdk/models/cancel-self-billing-checkout-op.js +12 -0
- package/esm/sdk/models/cancel-self-billing-checkout-op.js.map +1 -0
- package/esm/sdk/models/delete-analytics-view-op.d.ts +15 -0
- package/esm/sdk/models/delete-analytics-view-op.d.ts.map +1 -0
- package/esm/sdk/models/delete-analytics-view-op.js +12 -0
- package/esm/sdk/models/delete-analytics-view-op.js.map +1 -0
- package/esm/sdk/models/family.d.ts +1 -0
- package/esm/sdk/models/family.d.ts.map +1 -1
- package/esm/sdk/models/family.js +1 -0
- package/esm/sdk/models/family.js.map +1 -1
- package/esm/sdk/models/get-analytics-view-op.d.ts +15 -0
- package/esm/sdk/models/get-analytics-view-op.d.ts.map +1 -0
- package/esm/sdk/models/get-analytics-view-op.js +12 -0
- package/esm/sdk/models/get-analytics-view-op.js.map +1 -0
- package/esm/sdk/models/improvement-direction.d.ts +10 -0
- package/esm/sdk/models/improvement-direction.d.ts.map +1 -0
- package/esm/sdk/models/improvement-direction.js +11 -0
- package/esm/sdk/models/improvement-direction.js.map +1 -0
- package/esm/sdk/models/index.d.ts +25 -1
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +25 -1
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-response.d.ts +4 -0
- package/esm/sdk/models/invoice-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-response.js +2 -0
- package/esm/sdk/models/invoice-response.js.map +1 -1
- package/esm/sdk/models/list-analytics-views-op.d.ts +15 -0
- package/esm/sdk/models/list-analytics-views-op.d.ts.map +1 -0
- package/esm/sdk/models/list-analytics-views-op.js +12 -0
- package/esm/sdk/models/list-analytics-views-op.js.map +1 -0
- package/esm/sdk/models/list-views-response.d.ts +11 -0
- package/esm/sdk/models/list-views-response.d.ts.map +1 -0
- package/esm/sdk/models/list-views-response.js +15 -0
- package/esm/sdk/models/list-views-response.js.map +1 -0
- package/esm/sdk/models/metric.d.ts +12 -0
- package/esm/sdk/models/metric.d.ts.map +1 -1
- package/esm/sdk/models/metric.js +12 -0
- package/esm/sdk/models/metric.js.map +1 -1
- package/esm/sdk/models/poll-self-billing-checkout-op.d.ts +15 -0
- package/esm/sdk/models/poll-self-billing-checkout-op.d.ts.map +1 -0
- package/esm/sdk/models/poll-self-billing-checkout-op.js +12 -0
- package/esm/sdk/models/poll-self-billing-checkout-op.js.map +1 -0
- package/esm/sdk/models/report-catalog-entry.d.ts +54 -0
- package/esm/sdk/models/report-catalog-entry.d.ts.map +1 -0
- package/esm/sdk/models/report-catalog-entry.js +65 -0
- package/esm/sdk/models/report-catalog-entry.js.map +1 -0
- package/esm/sdk/models/report-catalog-response.d.ts +11 -0
- package/esm/sdk/models/report-catalog-response.d.ts.map +1 -0
- package/esm/sdk/models/report-catalog-response.js +15 -0
- package/esm/sdk/models/report-catalog-response.js.map +1 -0
- package/esm/sdk/models/report-category.d.ts +13 -0
- package/esm/sdk/models/report-category.d.ts.map +1 -0
- package/esm/sdk/models/report-category.js +14 -0
- package/esm/sdk/models/report-category.js.map +1 -0
- package/esm/sdk/models/report-dimension.d.ts +11 -0
- package/esm/sdk/models/report-dimension.d.ts.map +1 -0
- package/esm/sdk/models/report-dimension.js +15 -0
- package/esm/sdk/models/report-dimension.js.map +1 -0
- package/esm/sdk/models/report-filter.d.ts +24 -0
- package/esm/sdk/models/report-filter.d.ts.map +1 -0
- package/esm/sdk/models/report-filter.js +20 -0
- package/esm/sdk/models/report-filter.js.map +1 -0
- package/esm/sdk/models/report-kind.d.ts +11 -0
- package/esm/sdk/models/report-kind.d.ts.map +1 -0
- package/esm/sdk/models/report-kind.js +12 -0
- package/esm/sdk/models/report-kind.js.map +1 -0
- package/esm/sdk/models/report-query-request.d.ts +54 -0
- package/esm/sdk/models/report-query-request.d.ts.map +1 -0
- package/esm/sdk/models/report-query-request.js +42 -0
- package/esm/sdk/models/report-query-request.js.map +1 -0
- package/esm/sdk/models/report-sort.d.ts +22 -0
- package/esm/sdk/models/report-sort.d.ts.map +1 -0
- package/esm/sdk/models/report-sort.js +19 -0
- package/esm/sdk/models/report-sort.js.map +1 -0
- package/esm/sdk/models/report-value-type.d.ts +11 -0
- package/esm/sdk/models/report-value-type.d.ts.map +1 -0
- package/esm/sdk/models/report-value-type.js +12 -0
- package/esm/sdk/models/report-value-type.js.map +1 -0
- package/esm/sdk/models/run-analytics-report-op.d.ts +21 -0
- package/esm/sdk/models/run-analytics-report-op.d.ts.map +1 -0
- package/esm/sdk/models/run-analytics-report-op.js +14 -0
- package/esm/sdk/models/run-analytics-report-op.js.map +1 -0
- package/esm/sdk/models/self-billing-checkout-request.d.ts +28 -0
- package/esm/sdk/models/self-billing-checkout-request.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-checkout-request.js +31 -0
- package/esm/sdk/models/self-billing-checkout-request.js.map +1 -0
- package/esm/sdk/models/self-billing-checkout-response.d.ts +16 -0
- package/esm/sdk/models/self-billing-checkout-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-checkout-response.js +26 -0
- package/esm/sdk/models/self-billing-checkout-response.js.map +1 -0
- package/esm/sdk/models/self-billing-invoice.d.ts +19 -0
- package/esm/sdk/models/self-billing-invoice.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-invoice.js +30 -0
- package/esm/sdk/models/self-billing-invoice.js.map +1 -0
- package/esm/sdk/models/self-billing-portal-response.d.ts +11 -0
- package/esm/sdk/models/self-billing-portal-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-portal-response.js +20 -0
- package/esm/sdk/models/self-billing-portal-response.js.map +1 -0
- package/esm/sdk/models/self-billing-status-response.d.ts +12 -0
- package/esm/sdk/models/self-billing-status-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-status-response.js +16 -0
- package/esm/sdk/models/self-billing-status-response.js.map +1 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts +18 -0
- package/esm/sdk/models/self-billing-summary-response.d.ts.map +1 -0
- package/esm/sdk/models/self-billing-summary-response.js +28 -0
- package/esm/sdk/models/self-billing-summary-response.js.map +1 -0
- package/esm/sdk/models/tenant-internal-status.d.ts +11 -0
- package/esm/sdk/models/tenant-internal-status.d.ts.map +1 -0
- package/esm/sdk/models/tenant-internal-status.js +12 -0
- package/esm/sdk/models/tenant-internal-status.js.map +1 -0
- package/esm/sdk/models/top-up-wallet-request.d.ts +8 -0
- package/esm/sdk/models/top-up-wallet-request.d.ts.map +1 -1
- package/esm/sdk/models/top-up-wallet-request.js +2 -0
- package/esm/sdk/models/top-up-wallet-request.js.map +1 -1
- package/esm/sdk/models/update-analytics-view-op.d.ts +21 -0
- package/esm/sdk/models/update-analytics-view-op.d.ts.map +1 -0
- package/esm/sdk/models/update-analytics-view-op.js +14 -0
- package/esm/sdk/models/update-analytics-view-op.js.map +1 -0
- package/esm/sdk/models/view-response.d.ts +3 -0
- package/esm/sdk/models/view-response.d.ts.map +1 -1
- package/esm/sdk/models/view-response.js +12 -2
- package/esm/sdk/models/view-response.js.map +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/self-billing.d.ts +54 -0
- package/esm/sdk/self-billing.d.ts.map +1 -0
- package/esm/sdk/self-billing.js +78 -0
- package/esm/sdk/self-billing.js.map +1 -0
- package/esm/sdk/tenants.d.ts +0 -7
- package/esm/sdk/tenants.d.ts.map +1 -1
- package/esm/sdk/tenants.js +0 -10
- package/esm/sdk/tenants.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analytics-delete-analytics-view.ts +181 -0
- package/src/funcs/analytics-get-analytics-view.ts +181 -0
- package/src/funcs/{tenants-get-tenant-billing-usage.ts → analytics-list-analytics-reports.ts} +10 -10
- package/src/funcs/analytics-list-analytics-views.ts +184 -0
- package/src/funcs/analytics-run-analytics-report.ts +186 -0
- package/src/funcs/analytics-update-analytics-view.ts +186 -0
- package/src/funcs/self-billing-cancel-self-billing-checkout.ts +173 -0
- package/src/funcs/self-billing-create-self-billing-portal-session.ts +153 -0
- package/src/funcs/self-billing-get-self-billing-status.ts +152 -0
- package/src/funcs/self-billing-get-self-billing-summary.ts +153 -0
- package/src/funcs/self-billing-get-tenant-billing-summary.ts +153 -0
- package/src/funcs/self-billing-poll-self-billing-checkout.ts +182 -0
- package/src/funcs/self-billing-start-self-billing-checkout.ts +172 -0
- package/src/lib/config.ts +2 -2
- package/src/sdk/analytics.ts +110 -0
- package/src/sdk/models/analytics-query-meta.ts +10 -0
- package/src/sdk/models/analytics-view-definition.ts +46 -0
- package/src/sdk/models/cancel-self-billing-checkout-op.ts +35 -0
- package/src/sdk/models/delete-analytics-view-op.ts +33 -0
- package/src/sdk/models/family.ts +1 -0
- package/src/sdk/models/get-analytics-view-op.ts +33 -0
- package/src/sdk/models/improvement-direction.ts +19 -0
- package/src/sdk/models/index.ts +25 -1
- package/src/sdk/models/invoice-response.ts +6 -0
- package/src/sdk/models/list-analytics-views-op.ts +33 -0
- package/src/sdk/models/list-views-response.ts +32 -0
- package/src/sdk/models/metric.ts +12 -0
- package/src/sdk/models/poll-self-billing-checkout-op.ts +35 -0
- package/src/sdk/models/report-catalog-entry.ts +128 -0
- package/src/sdk/models/report-catalog-response.ts +35 -0
- package/src/sdk/models/report-category.ts +22 -0
- package/src/sdk/models/report-dimension.ts +33 -0
- package/src/sdk/models/report-filter.ts +42 -0
- package/src/sdk/models/report-kind.ts +18 -0
- package/src/sdk/models/report-query-request.ts +106 -0
- package/src/sdk/models/report-sort.ts +39 -0
- package/src/sdk/models/report-value-type.ts +20 -0
- package/src/sdk/models/run-analytics-report-op.ts +44 -0
- package/src/sdk/models/self-billing-checkout-request.ts +68 -0
- package/src/sdk/models/self-billing-checkout-response.ts +56 -0
- package/src/sdk/models/self-billing-invoice.ts +63 -0
- package/src/sdk/models/self-billing-portal-response.ts +41 -0
- package/src/sdk/models/self-billing-status-response.ts +37 -0
- package/src/sdk/models/self-billing-summary-response.ts +64 -0
- package/src/sdk/models/tenant-internal-status.ts +20 -0
- package/src/sdk/models/top-up-wallet-request.ts +12 -0
- package/src/sdk/models/update-analytics-view-op.ts +44 -0
- package/src/sdk/models/view-response.ts +22 -6
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/self-billing.ts +127 -0
- package/src/sdk/tenants.ts +0 -16
- package/docs/sdk/models/tenant-billing-usage.md +0 -144
- package/esm/sdk/models/tenant-billing-usage.d.ts +0 -13
- package/esm/sdk/models/tenant-billing-usage.d.ts.map +0 -1
- package/esm/sdk/models/tenant-billing-usage.js +0 -17
- package/esm/sdk/models/tenant-billing-usage.js.map +0 -1
- package/src/sdk/models/tenant-billing-usage.ts +0 -41
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import * as types from "../../types/primitives.js";
|
|
12
|
+
import {
|
|
13
|
+
ImprovementDirection,
|
|
14
|
+
ImprovementDirection$inboundSchema,
|
|
15
|
+
} from "./improvement-direction.js";
|
|
16
|
+
import {
|
|
17
|
+
ReportCategory,
|
|
18
|
+
ReportCategory$inboundSchema,
|
|
19
|
+
} from "./report-category.js";
|
|
20
|
+
import {
|
|
21
|
+
ReportDimension,
|
|
22
|
+
ReportDimension$inboundSchema,
|
|
23
|
+
} from "./report-dimension.js";
|
|
24
|
+
import { ReportKind, ReportKind$inboundSchema } from "./report-kind.js";
|
|
25
|
+
import {
|
|
26
|
+
ReportValueType,
|
|
27
|
+
ReportValueType$inboundSchema,
|
|
28
|
+
} from "./report-value-type.js";
|
|
29
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
30
|
+
|
|
31
|
+
export const DefaultShape = {
|
|
32
|
+
Timeseries: "timeseries",
|
|
33
|
+
Breakdown: "breakdown",
|
|
34
|
+
Scalar: "scalar",
|
|
35
|
+
} as const;
|
|
36
|
+
export type DefaultShape = OpenEnum<typeof DefaultShape>;
|
|
37
|
+
|
|
38
|
+
export const ReportCatalogEntryGrain = {
|
|
39
|
+
Day: "day",
|
|
40
|
+
Week: "week",
|
|
41
|
+
Month: "month",
|
|
42
|
+
} as const;
|
|
43
|
+
export type ReportCatalogEntryGrain = OpenEnum<typeof ReportCatalogEntryGrain>;
|
|
44
|
+
|
|
45
|
+
export const ReportCatalogEntryShape = {
|
|
46
|
+
Timeseries: "timeseries",
|
|
47
|
+
Breakdown: "breakdown",
|
|
48
|
+
Scalar: "scalar",
|
|
49
|
+
} as const;
|
|
50
|
+
export type ReportCatalogEntryShape = OpenEnum<typeof ReportCatalogEntryShape>;
|
|
51
|
+
|
|
52
|
+
export type ReportCatalogEntry = {
|
|
53
|
+
category?: ReportCategory | undefined;
|
|
54
|
+
defaultShape?: DefaultShape | undefined;
|
|
55
|
+
description?: string | undefined;
|
|
56
|
+
dimensions?: Array<ReportDimension> | undefined;
|
|
57
|
+
grains?: Array<ReportCatalogEntryGrain> | undefined;
|
|
58
|
+
improvement?: ImprovementDirection | undefined;
|
|
59
|
+
key?: string | undefined;
|
|
60
|
+
kind?: ReportKind | undefined;
|
|
61
|
+
maxRangeDays?: number | undefined;
|
|
62
|
+
name?: string | undefined;
|
|
63
|
+
shapes?: Array<ReportCatalogEntryShape> | undefined;
|
|
64
|
+
supportsCompare?: boolean | undefined;
|
|
65
|
+
valueType?: ReportValueType | undefined;
|
|
66
|
+
variantLabel?: string | undefined;
|
|
67
|
+
variantOf?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const DefaultShape$inboundSchema: z.ZodMiniType<DefaultShape, unknown> =
|
|
72
|
+
openEnums.inboundSchema(DefaultShape);
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const ReportCatalogEntryGrain$inboundSchema: z.ZodMiniType<
|
|
76
|
+
ReportCatalogEntryGrain,
|
|
77
|
+
unknown
|
|
78
|
+
> = openEnums.inboundSchema(ReportCatalogEntryGrain);
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const ReportCatalogEntryShape$inboundSchema: z.ZodMiniType<
|
|
82
|
+
ReportCatalogEntryShape,
|
|
83
|
+
unknown
|
|
84
|
+
> = openEnums.inboundSchema(ReportCatalogEntryShape);
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const ReportCatalogEntry$inboundSchema: z.ZodMiniType<
|
|
88
|
+
ReportCatalogEntry,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.pipe(
|
|
91
|
+
z.object({
|
|
92
|
+
category: types.optional(ReportCategory$inboundSchema),
|
|
93
|
+
default_shape: types.optional(DefaultShape$inboundSchema),
|
|
94
|
+
description: types.optional(types.string()),
|
|
95
|
+
dimensions: types.optional(z.array(ReportDimension$inboundSchema)),
|
|
96
|
+
grains: types.optional(z.array(ReportCatalogEntryGrain$inboundSchema)),
|
|
97
|
+
improvement: types.optional(ImprovementDirection$inboundSchema),
|
|
98
|
+
key: types.optional(types.string()),
|
|
99
|
+
kind: types.optional(ReportKind$inboundSchema),
|
|
100
|
+
max_range_days: types.optional(types.number()),
|
|
101
|
+
name: types.optional(types.string()),
|
|
102
|
+
shapes: types.optional(z.array(ReportCatalogEntryShape$inboundSchema)),
|
|
103
|
+
supports_compare: types.optional(types.boolean()),
|
|
104
|
+
value_type: types.optional(ReportValueType$inboundSchema),
|
|
105
|
+
variant_label: types.optional(types.string()),
|
|
106
|
+
variant_of: types.optional(types.string()),
|
|
107
|
+
}),
|
|
108
|
+
z.transform((v) => {
|
|
109
|
+
return remap$(v, {
|
|
110
|
+
"default_shape": "defaultShape",
|
|
111
|
+
"max_range_days": "maxRangeDays",
|
|
112
|
+
"supports_compare": "supportsCompare",
|
|
113
|
+
"value_type": "valueType",
|
|
114
|
+
"variant_label": "variantLabel",
|
|
115
|
+
"variant_of": "variantOf",
|
|
116
|
+
});
|
|
117
|
+
}),
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export function reportCatalogEntryFromJSON(
|
|
121
|
+
jsonString: string,
|
|
122
|
+
): SafeParseResult<ReportCatalogEntry, SDKValidationError> {
|
|
123
|
+
return safeParse(
|
|
124
|
+
jsonString,
|
|
125
|
+
(x) => ReportCatalogEntry$inboundSchema.parse(JSON.parse(x)),
|
|
126
|
+
`Failed to parse 'ReportCatalogEntry' from JSON`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import {
|
|
10
|
+
ReportCatalogEntry,
|
|
11
|
+
ReportCatalogEntry$inboundSchema,
|
|
12
|
+
} from "./report-catalog-entry.js";
|
|
13
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
14
|
+
|
|
15
|
+
export type ReportCatalogResponse = {
|
|
16
|
+
items?: Array<ReportCatalogEntry> | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ReportCatalogResponse$inboundSchema: z.ZodMiniType<
|
|
21
|
+
ReportCatalogResponse,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
items: types.optional(z.array(ReportCatalogEntry$inboundSchema)),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function reportCatalogResponseFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<ReportCatalogResponse, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => ReportCatalogResponse$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'ReportCatalogResponse' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ReportCategory = {
|
|
10
|
+
Billing: "billing",
|
|
11
|
+
Receivables: "receivables",
|
|
12
|
+
Customers: "customers",
|
|
13
|
+
Credits: "credits",
|
|
14
|
+
Usage: "usage",
|
|
15
|
+
} as const;
|
|
16
|
+
export type ReportCategory = OpenEnum<typeof ReportCategory>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const ReportCategory$inboundSchema: z.ZodMiniType<
|
|
20
|
+
ReportCategory,
|
|
21
|
+
unknown
|
|
22
|
+
> = openEnums.inboundSchema(ReportCategory);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type ReportDimension = {
|
|
12
|
+
key?: string | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ReportDimension$inboundSchema: z.ZodMiniType<
|
|
18
|
+
ReportDimension,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
key: types.optional(types.string()),
|
|
22
|
+
label: types.optional(types.string()),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export function reportDimensionFromJSON(
|
|
26
|
+
jsonString: string,
|
|
27
|
+
): SafeParseResult<ReportDimension, SDKValidationError> {
|
|
28
|
+
return safeParse(
|
|
29
|
+
jsonString,
|
|
30
|
+
(x) => ReportDimension$inboundSchema.parse(JSON.parse(x)),
|
|
31
|
+
`Failed to parse 'ReportDimension' from JSON`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const Op = {
|
|
9
|
+
Eq: "eq",
|
|
10
|
+
In: "in",
|
|
11
|
+
} as const;
|
|
12
|
+
export type Op = ClosedEnum<typeof Op>;
|
|
13
|
+
|
|
14
|
+
export type ReportFilter = {
|
|
15
|
+
field?: string | undefined;
|
|
16
|
+
op?: Op | undefined;
|
|
17
|
+
value?: Array<string> | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const Op$outboundSchema: z.ZodMiniEnum<typeof Op> = z.enum(Op);
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type ReportFilter$Outbound = {
|
|
25
|
+
field?: string | undefined;
|
|
26
|
+
op?: string | undefined;
|
|
27
|
+
value?: Array<string> | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const ReportFilter$outboundSchema: z.ZodMiniType<
|
|
32
|
+
ReportFilter$Outbound,
|
|
33
|
+
ReportFilter
|
|
34
|
+
> = z.object({
|
|
35
|
+
field: z.optional(z.string()),
|
|
36
|
+
op: z.optional(Op$outboundSchema),
|
|
37
|
+
value: z.optional(z.array(z.string())),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function reportFilterToJSON(reportFilter: ReportFilter): string {
|
|
41
|
+
return JSON.stringify(ReportFilter$outboundSchema.parse(reportFilter));
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ReportKind = {
|
|
10
|
+
Flow: "flow",
|
|
11
|
+
Ratio: "ratio",
|
|
12
|
+
Snapshot: "snapshot",
|
|
13
|
+
} as const;
|
|
14
|
+
export type ReportKind = OpenEnum<typeof ReportKind>;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ReportKind$inboundSchema: z.ZodMiniType<ReportKind, unknown> =
|
|
18
|
+
openEnums.inboundSchema(ReportKind);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
import {
|
|
8
|
+
ReportFilter,
|
|
9
|
+
ReportFilter$Outbound,
|
|
10
|
+
ReportFilter$outboundSchema,
|
|
11
|
+
} from "./report-filter.js";
|
|
12
|
+
import {
|
|
13
|
+
ReportSort,
|
|
14
|
+
ReportSort$Outbound,
|
|
15
|
+
ReportSort$outboundSchema,
|
|
16
|
+
} from "./report-sort.js";
|
|
17
|
+
|
|
18
|
+
export const ReportQueryRequestCompare = {
|
|
19
|
+
PreviousPeriod: "previous_period",
|
|
20
|
+
PreviousYear: "previous_year",
|
|
21
|
+
} as const;
|
|
22
|
+
export type ReportQueryRequestCompare = ClosedEnum<
|
|
23
|
+
typeof ReportQueryRequestCompare
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export const ReportQueryRequestGrain = {
|
|
27
|
+
Day: "day",
|
|
28
|
+
Week: "week",
|
|
29
|
+
Month: "month",
|
|
30
|
+
} as const;
|
|
31
|
+
export type ReportQueryRequestGrain = ClosedEnum<
|
|
32
|
+
typeof ReportQueryRequestGrain
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
export const ReportQueryRequestShape = {
|
|
36
|
+
Timeseries: "timeseries",
|
|
37
|
+
Breakdown: "breakdown",
|
|
38
|
+
Scalar: "scalar",
|
|
39
|
+
} as const;
|
|
40
|
+
export type ReportQueryRequestShape = ClosedEnum<
|
|
41
|
+
typeof ReportQueryRequestShape
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
export type ReportQueryRequest = {
|
|
45
|
+
compare?: ReportQueryRequestCompare | undefined;
|
|
46
|
+
currency?: string | undefined;
|
|
47
|
+
dimensions?: Array<string> | undefined;
|
|
48
|
+
filters?: Array<ReportFilter> | undefined;
|
|
49
|
+
grain?: ReportQueryRequestGrain | undefined;
|
|
50
|
+
limit?: number | undefined;
|
|
51
|
+
range: string;
|
|
52
|
+
shape: ReportQueryRequestShape;
|
|
53
|
+
sort?: Array<ReportSort> | undefined;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const ReportQueryRequestCompare$outboundSchema: z.ZodMiniEnum<
|
|
58
|
+
typeof ReportQueryRequestCompare
|
|
59
|
+
> = z.enum(ReportQueryRequestCompare);
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const ReportQueryRequestGrain$outboundSchema: z.ZodMiniEnum<
|
|
63
|
+
typeof ReportQueryRequestGrain
|
|
64
|
+
> = z.enum(ReportQueryRequestGrain);
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const ReportQueryRequestShape$outboundSchema: z.ZodMiniEnum<
|
|
68
|
+
typeof ReportQueryRequestShape
|
|
69
|
+
> = z.enum(ReportQueryRequestShape);
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export type ReportQueryRequest$Outbound = {
|
|
73
|
+
compare?: string | undefined;
|
|
74
|
+
currency?: string | undefined;
|
|
75
|
+
dimensions?: Array<string> | undefined;
|
|
76
|
+
filters?: Array<ReportFilter$Outbound> | undefined;
|
|
77
|
+
grain?: string | undefined;
|
|
78
|
+
limit?: number | undefined;
|
|
79
|
+
range: string;
|
|
80
|
+
shape: string;
|
|
81
|
+
sort?: Array<ReportSort$Outbound> | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const ReportQueryRequest$outboundSchema: z.ZodMiniType<
|
|
86
|
+
ReportQueryRequest$Outbound,
|
|
87
|
+
ReportQueryRequest
|
|
88
|
+
> = z.object({
|
|
89
|
+
compare: z.optional(ReportQueryRequestCompare$outboundSchema),
|
|
90
|
+
currency: z.optional(z.string()),
|
|
91
|
+
dimensions: z.optional(z.array(z.string())),
|
|
92
|
+
filters: z.optional(z.array(ReportFilter$outboundSchema)),
|
|
93
|
+
grain: z.optional(ReportQueryRequestGrain$outboundSchema),
|
|
94
|
+
limit: z.optional(z.int()),
|
|
95
|
+
range: z.string(),
|
|
96
|
+
shape: ReportQueryRequestShape$outboundSchema,
|
|
97
|
+
sort: z.optional(z.array(ReportSort$outboundSchema)),
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export function reportQueryRequestToJSON(
|
|
101
|
+
reportQueryRequest: ReportQueryRequest,
|
|
102
|
+
): string {
|
|
103
|
+
return JSON.stringify(
|
|
104
|
+
ReportQueryRequest$outboundSchema.parse(reportQueryRequest),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const Dir = {
|
|
9
|
+
Asc: "asc",
|
|
10
|
+
Desc: "desc",
|
|
11
|
+
} as const;
|
|
12
|
+
export type Dir = ClosedEnum<typeof Dir>;
|
|
13
|
+
|
|
14
|
+
export type ReportSort = {
|
|
15
|
+
dir?: Dir | undefined;
|
|
16
|
+
field?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Dir$outboundSchema: z.ZodMiniEnum<typeof Dir> = z.enum(Dir);
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type ReportSort$Outbound = {
|
|
24
|
+
dir?: string | undefined;
|
|
25
|
+
field?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const ReportSort$outboundSchema: z.ZodMiniType<
|
|
30
|
+
ReportSort$Outbound,
|
|
31
|
+
ReportSort
|
|
32
|
+
> = z.object({
|
|
33
|
+
dir: z.optional(Dir$outboundSchema),
|
|
34
|
+
field: z.optional(z.string()),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function reportSortToJSON(reportSort: ReportSort): string {
|
|
38
|
+
return JSON.stringify(ReportSort$outboundSchema.parse(reportSort));
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ReportValueType = {
|
|
10
|
+
Money: "money",
|
|
11
|
+
Count: "count",
|
|
12
|
+
Days: "days",
|
|
13
|
+
} as const;
|
|
14
|
+
export type ReportValueType = OpenEnum<typeof ReportValueType>;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ReportValueType$inboundSchema: z.ZodMiniType<
|
|
18
|
+
ReportValueType,
|
|
19
|
+
unknown
|
|
20
|
+
> = openEnums.inboundSchema(ReportValueType);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
ReportQueryRequest,
|
|
8
|
+
ReportQueryRequest$Outbound,
|
|
9
|
+
ReportQueryRequest$outboundSchema,
|
|
10
|
+
} from "./report-query-request.js";
|
|
11
|
+
|
|
12
|
+
export type RunAnalyticsReportRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Report key
|
|
15
|
+
*/
|
|
16
|
+
key: string;
|
|
17
|
+
/**
|
|
18
|
+
* Report query request
|
|
19
|
+
*/
|
|
20
|
+
body: ReportQueryRequest;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type RunAnalyticsReportRequest$Outbound = {
|
|
25
|
+
key: string;
|
|
26
|
+
body: ReportQueryRequest$Outbound;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const RunAnalyticsReportRequest$outboundSchema: z.ZodMiniType<
|
|
31
|
+
RunAnalyticsReportRequest$Outbound,
|
|
32
|
+
RunAnalyticsReportRequest
|
|
33
|
+
> = z.object({
|
|
34
|
+
key: z.string(),
|
|
35
|
+
body: ReportQueryRequest$outboundSchema,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function runAnalyticsReportRequestToJSON(
|
|
39
|
+
runAnalyticsReportRequest: RunAnalyticsReportRequest,
|
|
40
|
+
): string {
|
|
41
|
+
return JSON.stringify(
|
|
42
|
+
RunAnalyticsReportRequest$outboundSchema.parse(runAnalyticsReportRequest),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type SelfBillingCheckoutRequest = {
|
|
9
|
+
addressCity: string;
|
|
10
|
+
addressCountry: string;
|
|
11
|
+
addressLine1: string;
|
|
12
|
+
addressLine2?: string | undefined;
|
|
13
|
+
addressPostalCode: string;
|
|
14
|
+
addressState?: string | undefined;
|
|
15
|
+
email: string;
|
|
16
|
+
name: string;
|
|
17
|
+
taxId?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type SelfBillingCheckoutRequest$Outbound = {
|
|
22
|
+
address_city: string;
|
|
23
|
+
address_country: string;
|
|
24
|
+
address_line1: string;
|
|
25
|
+
address_line2?: string | undefined;
|
|
26
|
+
address_postal_code: string;
|
|
27
|
+
address_state?: string | undefined;
|
|
28
|
+
email: string;
|
|
29
|
+
name: string;
|
|
30
|
+
tax_id?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const SelfBillingCheckoutRequest$outboundSchema: z.ZodMiniType<
|
|
35
|
+
SelfBillingCheckoutRequest$Outbound,
|
|
36
|
+
SelfBillingCheckoutRequest
|
|
37
|
+
> = z.pipe(
|
|
38
|
+
z.object({
|
|
39
|
+
addressCity: z.string(),
|
|
40
|
+
addressCountry: z.string(),
|
|
41
|
+
addressLine1: z.string(),
|
|
42
|
+
addressLine2: z.optional(z.string()),
|
|
43
|
+
addressPostalCode: z.string(),
|
|
44
|
+
addressState: z.optional(z.string()),
|
|
45
|
+
email: z.string(),
|
|
46
|
+
name: z.string(),
|
|
47
|
+
taxId: z.optional(z.string()),
|
|
48
|
+
}),
|
|
49
|
+
z.transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
addressCity: "address_city",
|
|
52
|
+
addressCountry: "address_country",
|
|
53
|
+
addressLine1: "address_line1",
|
|
54
|
+
addressLine2: "address_line2",
|
|
55
|
+
addressPostalCode: "address_postal_code",
|
|
56
|
+
addressState: "address_state",
|
|
57
|
+
taxId: "tax_id",
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export function selfBillingCheckoutRequestToJSON(
|
|
63
|
+
selfBillingCheckoutRequest: SelfBillingCheckoutRequest,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
SelfBillingCheckoutRequest$outboundSchema.parse(selfBillingCheckoutRequest),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
CheckoutStatus,
|
|
12
|
+
CheckoutStatus$inboundSchema,
|
|
13
|
+
} from "./checkout-status.js";
|
|
14
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
15
|
+
import {
|
|
16
|
+
TenantInternalStatus,
|
|
17
|
+
TenantInternalStatus$inboundSchema,
|
|
18
|
+
} from "./tenant-internal-status.js";
|
|
19
|
+
|
|
20
|
+
export type SelfBillingCheckoutResponse = {
|
|
21
|
+
checkoutId?: string | undefined;
|
|
22
|
+
status?: CheckoutStatus | undefined;
|
|
23
|
+
tenantStatus?: TenantInternalStatus | undefined;
|
|
24
|
+
terminal?: boolean | undefined;
|
|
25
|
+
url?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const SelfBillingCheckoutResponse$inboundSchema: z.ZodMiniType<
|
|
30
|
+
SelfBillingCheckoutResponse,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
checkout_id: types.optional(types.string()),
|
|
35
|
+
status: types.optional(CheckoutStatus$inboundSchema),
|
|
36
|
+
tenant_status: types.optional(TenantInternalStatus$inboundSchema),
|
|
37
|
+
terminal: types.optional(types.boolean()),
|
|
38
|
+
url: types.optional(types.string()),
|
|
39
|
+
}),
|
|
40
|
+
z.transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"checkout_id": "checkoutId",
|
|
43
|
+
"tenant_status": "tenantStatus",
|
|
44
|
+
});
|
|
45
|
+
}),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export function selfBillingCheckoutResponseFromJSON(
|
|
49
|
+
jsonString: string,
|
|
50
|
+
): SafeParseResult<SelfBillingCheckoutResponse, SDKValidationError> {
|
|
51
|
+
return safeParse(
|
|
52
|
+
jsonString,
|
|
53
|
+
(x) => SelfBillingCheckoutResponse$inboundSchema.parse(JSON.parse(x)),
|
|
54
|
+
`Failed to parse 'SelfBillingCheckoutResponse' from JSON`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
InvoiceStatus,
|
|
12
|
+
InvoiceStatus$inboundSchema,
|
|
13
|
+
} from "./invoice-status.js";
|
|
14
|
+
import {
|
|
15
|
+
PaymentStatus,
|
|
16
|
+
PaymentStatus$inboundSchema,
|
|
17
|
+
} from "./payment-status.js";
|
|
18
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
19
|
+
|
|
20
|
+
export type SelfBillingInvoice = {
|
|
21
|
+
currency?: string | undefined;
|
|
22
|
+
dueDate?: Date | undefined;
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
number?: string | undefined;
|
|
25
|
+
paymentStatus?: PaymentStatus | undefined;
|
|
26
|
+
pdfUrl?: string | undefined;
|
|
27
|
+
status?: InvoiceStatus | undefined;
|
|
28
|
+
total?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const SelfBillingInvoice$inboundSchema: z.ZodMiniType<
|
|
33
|
+
SelfBillingInvoice,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.pipe(
|
|
36
|
+
z.object({
|
|
37
|
+
currency: types.optional(types.string()),
|
|
38
|
+
due_date: types.optional(types.date()),
|
|
39
|
+
id: types.optional(types.string()),
|
|
40
|
+
number: types.optional(types.string()),
|
|
41
|
+
payment_status: types.optional(PaymentStatus$inboundSchema),
|
|
42
|
+
pdf_url: types.optional(types.string()),
|
|
43
|
+
status: types.optional(InvoiceStatus$inboundSchema),
|
|
44
|
+
total: types.optional(types.string()),
|
|
45
|
+
}),
|
|
46
|
+
z.transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"due_date": "dueDate",
|
|
49
|
+
"payment_status": "paymentStatus",
|
|
50
|
+
"pdf_url": "pdfUrl",
|
|
51
|
+
});
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export function selfBillingInvoiceFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<SelfBillingInvoice, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => SelfBillingInvoice$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'SelfBillingInvoice' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|