@polar-sh/sdk 0.29.0 → 0.29.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/FUNCTIONS.md +5 -1
- package/README.md +48 -12
- package/bin/mcp-server.js +866 -148
- package/bin/mcp-server.js.map +29 -14
- package/dist/commonjs/funcs/customersGetState.d.ts +27 -0
- package/dist/commonjs/funcs/customersGetState.d.ts.map +1 -0
- package/dist/commonjs/funcs/customersGetState.js +121 -0
- package/dist/commonjs/funcs/customersGetState.js.map +1 -0
- package/dist/commonjs/funcs/customersGetStateExternal.d.ts +27 -0
- package/dist/commonjs/funcs/customersGetStateExternal.d.ts.map +1 -0
- package/dist/commonjs/funcs/customersGetStateExternal.js +121 -0
- package/dist/commonjs/funcs/customersGetStateExternal.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/customersGetState.d.ts +7 -0
- package/dist/commonjs/mcp-server/tools/customersGetState.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/customersGetState.js +40 -0
- package/dist/commonjs/mcp-server/tools/customersGetState.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/customersGetStateExternal.d.ts +7 -0
- package/dist/commonjs/mcp-server/tools/customersGetStateExternal.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/customersGetStateExternal.js +40 -0
- package/dist/commonjs/mcp-server/tools/customersGetStateExternal.js.map +1 -0
- package/dist/commonjs/models/components/customer.d.ts +11 -5
- package/dist/commonjs/models/components/customer.d.ts.map +1 -1
- package/dist/commonjs/models/components/customer.js +2 -2
- package/dist/commonjs/models/components/customer.js.map +1 -1
- package/dist/commonjs/models/components/customercreate.d.ts +3 -0
- package/dist/commonjs/models/components/customercreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customercreate.js.map +1 -1
- package/dist/commonjs/models/components/customerordersubscription.d.ts +39 -0
- package/dist/commonjs/models/components/customerordersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerordersubscription.js.map +1 -1
- package/dist/commonjs/models/components/customerstate.d.ts +143 -0
- package/dist/commonjs/models/components/customerstate.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerstate.js +162 -0
- package/dist/commonjs/models/components/customerstate.js.map +1 -0
- package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts +86 -0
- package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerstatebenefitgrant.js +141 -0
- package/dist/commonjs/models/components/customerstatebenefitgrant.js.map +1 -0
- package/dist/commonjs/models/components/customerstatesubscription.d.ts +162 -0
- package/dist/commonjs/models/components/customerstatesubscription.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerstatesubscription.js +193 -0
- package/dist/commonjs/models/components/customerstatesubscription.js.map +1 -0
- package/dist/commonjs/models/components/customersubscription.d.ts +9 -0
- package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersubscription.js.map +1 -1
- package/dist/commonjs/models/components/customerupdate.d.ts +3 -0
- package/dist/commonjs/models/components/customerupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerupdate.js.map +1 -1
- package/dist/commonjs/models/components/licensekeycustomer.d.ts +11 -5
- package/dist/commonjs/models/components/licensekeycustomer.d.ts.map +1 -1
- package/dist/commonjs/models/components/licensekeycustomer.js +2 -2
- package/dist/commonjs/models/components/licensekeycustomer.js.map +1 -1
- package/dist/commonjs/models/components/ordercustomer.d.ts +11 -5
- package/dist/commonjs/models/components/ordercustomer.d.ts.map +1 -1
- package/dist/commonjs/models/components/ordercustomer.js +2 -2
- package/dist/commonjs/models/components/ordercustomer.js.map +1 -1
- package/dist/commonjs/models/components/ordersubscription.d.ts +39 -0
- package/dist/commonjs/models/components/ordersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/ordersubscription.js.map +1 -1
- package/dist/commonjs/models/components/subscription.d.ts +39 -0
- package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscription.js.map +1 -1
- package/dist/commonjs/models/components/subscriptioncustomer.d.ts +11 -5
- package/dist/commonjs/models/components/subscriptioncustomer.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptioncustomer.js +2 -2
- package/dist/commonjs/models/components/subscriptioncustomer.js.map +1 -1
- package/dist/commonjs/models/components/webhookcustomercreatedpayload.d.ts +47 -0
- package/dist/commonjs/models/components/webhookcustomercreatedpayload.d.ts.map +1 -0
- package/dist/commonjs/models/components/webhookcustomercreatedpayload.js +62 -0
- package/dist/commonjs/models/components/webhookcustomercreatedpayload.js.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerdeletedpayload.d.ts +42 -0
- package/dist/commonjs/models/components/webhookcustomerdeletedpayload.d.ts.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerdeletedpayload.js +62 -0
- package/dist/commonjs/models/components/webhookcustomerdeletedpayload.js.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.d.ts +53 -0
- package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.d.ts.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.js +62 -0
- package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.js.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerupdatedpayload.d.ts +46 -0
- package/dist/commonjs/models/components/webhookcustomerupdatedpayload.d.ts.map +1 -0
- package/dist/commonjs/models/components/webhookcustomerupdatedpayload.js +62 -0
- package/dist/commonjs/models/components/webhookcustomerupdatedpayload.js.map +1 -0
- package/dist/commonjs/models/components/webhookordercreatedpayload.d.ts +7 -0
- package/dist/commonjs/models/components/webhookordercreatedpayload.d.ts.map +1 -1
- package/dist/commonjs/models/components/webhookordercreatedpayload.js.map +1 -1
- package/dist/commonjs/models/components/webhooksubscriptioncreatedpayload.d.ts +2 -0
- package/dist/commonjs/models/components/webhooksubscriptioncreatedpayload.d.ts.map +1 -1
- package/dist/commonjs/models/components/webhooksubscriptioncreatedpayload.js.map +1 -1
- package/dist/commonjs/models/operations/customersgetstate.d.ts +32 -0
- package/dist/commonjs/models/operations/customersgetstate.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customersgetstate.js +59 -0
- package/dist/commonjs/models/operations/customersgetstate.js.map +1 -0
- package/dist/commonjs/models/operations/customersgetstateexternal.d.ts +32 -0
- package/dist/commonjs/models/operations/customersgetstateexternal.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customersgetstateexternal.js +68 -0
- package/dist/commonjs/models/operations/customersgetstateexternal.js.map +1 -0
- package/dist/commonjs/sdk/customers.d.ts +33 -0
- package/dist/commonjs/sdk/customers.d.ts.map +1 -1
- package/dist/commonjs/sdk/customers.js +36 -0
- package/dist/commonjs/sdk/customers.js.map +1 -1
- package/dist/commonjs/webhooks.d.ts +2 -2
- package/dist/commonjs/webhooks.d.ts.map +1 -1
- package/dist/commonjs/webhooks.js +36 -24
- package/dist/commonjs/webhooks.js.map +1 -1
- package/dist/esm/funcs/customersGetState.d.ts +27 -0
- package/dist/esm/funcs/customersGetState.d.ts.map +1 -0
- package/dist/esm/funcs/customersGetState.js +95 -0
- package/dist/esm/funcs/customersGetState.js.map +1 -0
- package/dist/esm/funcs/customersGetStateExternal.d.ts +27 -0
- package/dist/esm/funcs/customersGetStateExternal.d.ts.map +1 -0
- package/dist/esm/funcs/customersGetStateExternal.js +95 -0
- package/dist/esm/funcs/customersGetStateExternal.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/customersGetState.d.ts +7 -0
- package/dist/esm/mcp-server/tools/customersGetState.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/customersGetState.js +37 -0
- package/dist/esm/mcp-server/tools/customersGetState.js.map +1 -0
- package/dist/esm/mcp-server/tools/customersGetStateExternal.d.ts +7 -0
- package/dist/esm/mcp-server/tools/customersGetStateExternal.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/customersGetStateExternal.js +37 -0
- package/dist/esm/mcp-server/tools/customersGetStateExternal.js.map +1 -0
- package/dist/esm/models/components/customer.d.ts +11 -5
- package/dist/esm/models/components/customer.d.ts.map +1 -1
- package/dist/esm/models/components/customer.js +2 -2
- package/dist/esm/models/components/customer.js.map +1 -1
- package/dist/esm/models/components/customercreate.d.ts +3 -0
- package/dist/esm/models/components/customercreate.d.ts.map +1 -1
- package/dist/esm/models/components/customercreate.js.map +1 -1
- package/dist/esm/models/components/customerordersubscription.d.ts +39 -0
- package/dist/esm/models/components/customerordersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customerordersubscription.js.map +1 -1
- package/dist/esm/models/components/customerstate.d.ts +143 -0
- package/dist/esm/models/components/customerstate.d.ts.map +1 -0
- package/dist/esm/models/components/customerstate.js +130 -0
- package/dist/esm/models/components/customerstate.js.map +1 -0
- package/dist/esm/models/components/customerstatebenefitgrant.d.ts +86 -0
- package/dist/esm/models/components/customerstatebenefitgrant.d.ts.map +1 -0
- package/dist/esm/models/components/customerstatebenefitgrant.js +111 -0
- package/dist/esm/models/components/customerstatebenefitgrant.js.map +1 -0
- package/dist/esm/models/components/customerstatesubscription.d.ts +162 -0
- package/dist/esm/models/components/customerstatesubscription.d.ts.map +1 -0
- package/dist/esm/models/components/customerstatesubscription.js +161 -0
- package/dist/esm/models/components/customerstatesubscription.js.map +1 -0
- package/dist/esm/models/components/customersubscription.d.ts +9 -0
- package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customersubscription.js.map +1 -1
- package/dist/esm/models/components/customerupdate.d.ts +3 -0
- package/dist/esm/models/components/customerupdate.d.ts.map +1 -1
- package/dist/esm/models/components/customerupdate.js.map +1 -1
- package/dist/esm/models/components/licensekeycustomer.d.ts +11 -5
- package/dist/esm/models/components/licensekeycustomer.d.ts.map +1 -1
- package/dist/esm/models/components/licensekeycustomer.js +2 -2
- package/dist/esm/models/components/licensekeycustomer.js.map +1 -1
- package/dist/esm/models/components/ordercustomer.d.ts +11 -5
- package/dist/esm/models/components/ordercustomer.d.ts.map +1 -1
- package/dist/esm/models/components/ordercustomer.js +2 -2
- package/dist/esm/models/components/ordercustomer.js.map +1 -1
- package/dist/esm/models/components/ordersubscription.d.ts +39 -0
- package/dist/esm/models/components/ordersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/ordersubscription.js.map +1 -1
- package/dist/esm/models/components/subscription.d.ts +39 -0
- package/dist/esm/models/components/subscription.d.ts.map +1 -1
- package/dist/esm/models/components/subscription.js.map +1 -1
- package/dist/esm/models/components/subscriptioncustomer.d.ts +11 -5
- package/dist/esm/models/components/subscriptioncustomer.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptioncustomer.js +2 -2
- package/dist/esm/models/components/subscriptioncustomer.js.map +1 -1
- package/dist/esm/models/components/webhookcustomercreatedpayload.d.ts +47 -0
- package/dist/esm/models/components/webhookcustomercreatedpayload.d.ts.map +1 -0
- package/dist/esm/models/components/webhookcustomercreatedpayload.js +34 -0
- package/dist/esm/models/components/webhookcustomercreatedpayload.js.map +1 -0
- package/dist/esm/models/components/webhookcustomerdeletedpayload.d.ts +42 -0
- package/dist/esm/models/components/webhookcustomerdeletedpayload.d.ts.map +1 -0
- package/dist/esm/models/components/webhookcustomerdeletedpayload.js +34 -0
- package/dist/esm/models/components/webhookcustomerdeletedpayload.js.map +1 -0
- package/dist/esm/models/components/webhookcustomerstatechangedpayload.d.ts +53 -0
- package/dist/esm/models/components/webhookcustomerstatechangedpayload.d.ts.map +1 -0
- package/dist/esm/models/components/webhookcustomerstatechangedpayload.js +34 -0
- package/dist/esm/models/components/webhookcustomerstatechangedpayload.js.map +1 -0
- package/dist/esm/models/components/webhookcustomerupdatedpayload.d.ts +46 -0
- package/dist/esm/models/components/webhookcustomerupdatedpayload.d.ts.map +1 -0
- package/dist/esm/models/components/webhookcustomerupdatedpayload.js +34 -0
- package/dist/esm/models/components/webhookcustomerupdatedpayload.js.map +1 -0
- package/dist/esm/models/components/webhookordercreatedpayload.d.ts +7 -0
- package/dist/esm/models/components/webhookordercreatedpayload.d.ts.map +1 -1
- package/dist/esm/models/components/webhookordercreatedpayload.js.map +1 -1
- package/dist/esm/models/components/webhooksubscriptioncreatedpayload.d.ts +2 -0
- package/dist/esm/models/components/webhooksubscriptioncreatedpayload.d.ts.map +1 -1
- package/dist/esm/models/components/webhooksubscriptioncreatedpayload.js.map +1 -1
- package/dist/esm/models/operations/customersgetstate.d.ts +32 -0
- package/dist/esm/models/operations/customersgetstate.d.ts.map +1 -0
- package/dist/esm/models/operations/customersgetstate.js +31 -0
- package/dist/esm/models/operations/customersgetstate.js.map +1 -0
- package/dist/esm/models/operations/customersgetstateexternal.d.ts +32 -0
- package/dist/esm/models/operations/customersgetstateexternal.d.ts.map +1 -0
- package/dist/esm/models/operations/customersgetstateexternal.js +40 -0
- package/dist/esm/models/operations/customersgetstateexternal.js.map +1 -0
- package/dist/esm/sdk/customers.d.ts +33 -0
- package/dist/esm/sdk/customers.d.ts.map +1 -1
- package/dist/esm/sdk/customers.js +36 -0
- package/dist/esm/sdk/customers.js.map +1 -1
- package/dist/esm/webhooks.d.ts +2 -2
- package/dist/esm/webhooks.d.ts.map +1 -1
- package/dist/esm/webhooks.js +39 -27
- package/dist/esm/webhooks.js.map +1 -1
- package/docs/sdks/benefitgrants/README.md +10 -2
- package/docs/sdks/benefits/README.md +12 -2
- package/docs/sdks/checkoutlinks/README.md +10 -2
- package/docs/sdks/checkouts/README.md +16 -2
- package/docs/sdks/customers/README.md +206 -4
- package/docs/sdks/customfields/README.md +12 -2
- package/docs/sdks/discounts/README.md +12 -2
- package/docs/sdks/downloadables/README.md +10 -2
- package/docs/sdks/events/README.md +14 -2
- package/docs/sdks/externalorganizations/README.md +10 -2
- package/docs/sdks/files/README.md +8 -2
- package/docs/sdks/licensekeys/README.md +10 -2
- package/docs/sdks/meters/README.md +12 -2
- package/docs/sdks/metrics/README.md +6 -0
- package/docs/sdks/orders/README.md +10 -2
- package/docs/sdks/organizations/README.md +4 -4
- package/docs/sdks/polarlicensekeys/README.md +10 -2
- package/docs/sdks/polarorders/README.md +10 -2
- package/docs/sdks/polarsubscriptions/README.md +10 -2
- package/docs/sdks/products/README.md +12 -2
- package/docs/sdks/refunds/README.md +10 -2
- package/docs/sdks/repositories/README.md +10 -2
- package/docs/sdks/subscriptions/README.md +20 -4
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/customersGetState.ts +195 -0
- package/src/funcs/customersGetStateExternal.ts +197 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/customersGetState.ts +46 -0
- package/src/mcp-server/tools/customersGetStateExternal.ts +46 -0
- package/src/models/components/customer.ts +13 -7
- package/src/models/components/customercreate.ts +3 -0
- package/src/models/components/customerordersubscription.ts +39 -0
- package/src/models/components/customerstate.ts +308 -0
- package/src/models/components/customerstatebenefitgrant.ts +261 -0
- package/src/models/components/customerstatesubscription.ts +389 -0
- package/src/models/components/customersubscription.ts +9 -0
- package/src/models/components/customerupdate.ts +3 -0
- package/src/models/components/licensekeycustomer.ts +13 -7
- package/src/models/components/ordercustomer.ts +13 -7
- package/src/models/components/ordersubscription.ts +39 -0
- package/src/models/components/subscription.ts +39 -0
- package/src/models/components/subscriptioncustomer.ts +13 -7
- package/src/models/components/webhookcustomercreatedpayload.ts +93 -0
- package/src/models/components/webhookcustomerdeletedpayload.ts +88 -0
- package/src/models/components/webhookcustomerstatechangedpayload.ts +103 -0
- package/src/models/components/webhookcustomerupdatedpayload.ts +92 -0
- package/src/models/components/webhookordercreatedpayload.ts +7 -0
- package/src/models/components/webhooksubscriptioncreatedpayload.ts +2 -0
- package/src/models/operations/customersgetstate.ts +69 -0
- package/src/models/operations/customersgetstateexternal.ts +80 -0
- package/src/sdk/customers.ts +55 -0
- package/src/webhooks.ts +95 -78
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
Address,
|
|
12
|
+
Address$inboundSchema,
|
|
13
|
+
Address$Outbound,
|
|
14
|
+
Address$outboundSchema,
|
|
15
|
+
} from "./address.js";
|
|
16
|
+
import {
|
|
17
|
+
CustomerStateBenefitGrant,
|
|
18
|
+
CustomerStateBenefitGrant$inboundSchema,
|
|
19
|
+
CustomerStateBenefitGrant$Outbound,
|
|
20
|
+
CustomerStateBenefitGrant$outboundSchema,
|
|
21
|
+
} from "./customerstatebenefitgrant.js";
|
|
22
|
+
import {
|
|
23
|
+
CustomerStateSubscription,
|
|
24
|
+
CustomerStateSubscription$inboundSchema,
|
|
25
|
+
CustomerStateSubscription$Outbound,
|
|
26
|
+
CustomerStateSubscription$outboundSchema,
|
|
27
|
+
} from "./customerstatesubscription.js";
|
|
28
|
+
import {
|
|
29
|
+
TaxIDFormat,
|
|
30
|
+
TaxIDFormat$inboundSchema,
|
|
31
|
+
TaxIDFormat$outboundSchema,
|
|
32
|
+
} from "./taxidformat.js";
|
|
33
|
+
|
|
34
|
+
export type CustomerStateMetadata = string | number | boolean;
|
|
35
|
+
|
|
36
|
+
export type CustomerStateTaxId = string | TaxIDFormat;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A customer along with additional state information:
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*
|
|
43
|
+
* * Active subscriptions
|
|
44
|
+
* * Active benefits
|
|
45
|
+
*/
|
|
46
|
+
export type CustomerState = {
|
|
47
|
+
/**
|
|
48
|
+
* The ID of the customer.
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Creation timestamp of the object.
|
|
53
|
+
*/
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
/**
|
|
56
|
+
* Last modification timestamp of the object.
|
|
57
|
+
*/
|
|
58
|
+
modifiedAt: Date | null;
|
|
59
|
+
metadata: { [k: string]: string | number | boolean };
|
|
60
|
+
/**
|
|
61
|
+
* The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
|
|
62
|
+
*/
|
|
63
|
+
externalId: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* The email address of the customer. This must be unique within the organization.
|
|
66
|
+
*/
|
|
67
|
+
email: string;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.
|
|
70
|
+
*/
|
|
71
|
+
emailVerified: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The name of the customer.
|
|
74
|
+
*/
|
|
75
|
+
name: string | null;
|
|
76
|
+
billingAddress: Address | null;
|
|
77
|
+
taxId: Array<string | TaxIDFormat | null> | null;
|
|
78
|
+
/**
|
|
79
|
+
* The ID of the organization owning the customer.
|
|
80
|
+
*/
|
|
81
|
+
organizationId: string;
|
|
82
|
+
/**
|
|
83
|
+
* The customer's active subscriptions.
|
|
84
|
+
*/
|
|
85
|
+
activeSubscriptions: Array<CustomerStateSubscription>;
|
|
86
|
+
/**
|
|
87
|
+
* The customer's active benefit grants.
|
|
88
|
+
*/
|
|
89
|
+
grantedBenefits: Array<CustomerStateBenefitGrant>;
|
|
90
|
+
avatarUrl: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const CustomerStateMetadata$inboundSchema: z.ZodType<
|
|
95
|
+
CustomerStateMetadata,
|
|
96
|
+
z.ZodTypeDef,
|
|
97
|
+
unknown
|
|
98
|
+
> = z.union([z.string(), z.number().int(), z.boolean()]);
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export type CustomerStateMetadata$Outbound = string | number | boolean;
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export const CustomerStateMetadata$outboundSchema: z.ZodType<
|
|
105
|
+
CustomerStateMetadata$Outbound,
|
|
106
|
+
z.ZodTypeDef,
|
|
107
|
+
CustomerStateMetadata
|
|
108
|
+
> = z.union([z.string(), z.number().int(), z.boolean()]);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
113
|
+
*/
|
|
114
|
+
export namespace CustomerStateMetadata$ {
|
|
115
|
+
/** @deprecated use `CustomerStateMetadata$inboundSchema` instead. */
|
|
116
|
+
export const inboundSchema = CustomerStateMetadata$inboundSchema;
|
|
117
|
+
/** @deprecated use `CustomerStateMetadata$outboundSchema` instead. */
|
|
118
|
+
export const outboundSchema = CustomerStateMetadata$outboundSchema;
|
|
119
|
+
/** @deprecated use `CustomerStateMetadata$Outbound` instead. */
|
|
120
|
+
export type Outbound = CustomerStateMetadata$Outbound;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function customerStateMetadataToJSON(
|
|
124
|
+
customerStateMetadata: CustomerStateMetadata,
|
|
125
|
+
): string {
|
|
126
|
+
return JSON.stringify(
|
|
127
|
+
CustomerStateMetadata$outboundSchema.parse(customerStateMetadata),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function customerStateMetadataFromJSON(
|
|
132
|
+
jsonString: string,
|
|
133
|
+
): SafeParseResult<CustomerStateMetadata, SDKValidationError> {
|
|
134
|
+
return safeParse(
|
|
135
|
+
jsonString,
|
|
136
|
+
(x) => CustomerStateMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
137
|
+
`Failed to parse 'CustomerStateMetadata' from JSON`,
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** @internal */
|
|
142
|
+
export const CustomerStateTaxId$inboundSchema: z.ZodType<
|
|
143
|
+
CustomerStateTaxId,
|
|
144
|
+
z.ZodTypeDef,
|
|
145
|
+
unknown
|
|
146
|
+
> = z.union([z.string(), TaxIDFormat$inboundSchema]);
|
|
147
|
+
|
|
148
|
+
/** @internal */
|
|
149
|
+
export type CustomerStateTaxId$Outbound = string | string;
|
|
150
|
+
|
|
151
|
+
/** @internal */
|
|
152
|
+
export const CustomerStateTaxId$outboundSchema: z.ZodType<
|
|
153
|
+
CustomerStateTaxId$Outbound,
|
|
154
|
+
z.ZodTypeDef,
|
|
155
|
+
CustomerStateTaxId
|
|
156
|
+
> = z.union([z.string(), TaxIDFormat$outboundSchema]);
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
161
|
+
*/
|
|
162
|
+
export namespace CustomerStateTaxId$ {
|
|
163
|
+
/** @deprecated use `CustomerStateTaxId$inboundSchema` instead. */
|
|
164
|
+
export const inboundSchema = CustomerStateTaxId$inboundSchema;
|
|
165
|
+
/** @deprecated use `CustomerStateTaxId$outboundSchema` instead. */
|
|
166
|
+
export const outboundSchema = CustomerStateTaxId$outboundSchema;
|
|
167
|
+
/** @deprecated use `CustomerStateTaxId$Outbound` instead. */
|
|
168
|
+
export type Outbound = CustomerStateTaxId$Outbound;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function customerStateTaxIdToJSON(
|
|
172
|
+
customerStateTaxId: CustomerStateTaxId,
|
|
173
|
+
): string {
|
|
174
|
+
return JSON.stringify(
|
|
175
|
+
CustomerStateTaxId$outboundSchema.parse(customerStateTaxId),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function customerStateTaxIdFromJSON(
|
|
180
|
+
jsonString: string,
|
|
181
|
+
): SafeParseResult<CustomerStateTaxId, SDKValidationError> {
|
|
182
|
+
return safeParse(
|
|
183
|
+
jsonString,
|
|
184
|
+
(x) => CustomerStateTaxId$inboundSchema.parse(JSON.parse(x)),
|
|
185
|
+
`Failed to parse 'CustomerStateTaxId' from JSON`,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** @internal */
|
|
190
|
+
export const CustomerState$inboundSchema: z.ZodType<
|
|
191
|
+
CustomerState,
|
|
192
|
+
z.ZodTypeDef,
|
|
193
|
+
unknown
|
|
194
|
+
> = z.object({
|
|
195
|
+
id: z.string(),
|
|
196
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
197
|
+
modified_at: z.nullable(
|
|
198
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
199
|
+
),
|
|
200
|
+
metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
|
|
201
|
+
external_id: z.nullable(z.string()),
|
|
202
|
+
email: z.string(),
|
|
203
|
+
email_verified: z.boolean(),
|
|
204
|
+
name: z.nullable(z.string()),
|
|
205
|
+
billing_address: z.nullable(Address$inboundSchema),
|
|
206
|
+
tax_id: z.nullable(
|
|
207
|
+
z.array(z.nullable(z.union([z.string(), TaxIDFormat$inboundSchema]))),
|
|
208
|
+
),
|
|
209
|
+
organization_id: z.string(),
|
|
210
|
+
active_subscriptions: z.array(CustomerStateSubscription$inboundSchema),
|
|
211
|
+
granted_benefits: z.array(CustomerStateBenefitGrant$inboundSchema),
|
|
212
|
+
avatar_url: z.string(),
|
|
213
|
+
}).transform((v) => {
|
|
214
|
+
return remap$(v, {
|
|
215
|
+
"created_at": "createdAt",
|
|
216
|
+
"modified_at": "modifiedAt",
|
|
217
|
+
"external_id": "externalId",
|
|
218
|
+
"email_verified": "emailVerified",
|
|
219
|
+
"billing_address": "billingAddress",
|
|
220
|
+
"tax_id": "taxId",
|
|
221
|
+
"organization_id": "organizationId",
|
|
222
|
+
"active_subscriptions": "activeSubscriptions",
|
|
223
|
+
"granted_benefits": "grantedBenefits",
|
|
224
|
+
"avatar_url": "avatarUrl",
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
/** @internal */
|
|
229
|
+
export type CustomerState$Outbound = {
|
|
230
|
+
id: string;
|
|
231
|
+
created_at: string;
|
|
232
|
+
modified_at: string | null;
|
|
233
|
+
metadata: { [k: string]: string | number | boolean };
|
|
234
|
+
external_id: string | null;
|
|
235
|
+
email: string;
|
|
236
|
+
email_verified: boolean;
|
|
237
|
+
name: string | null;
|
|
238
|
+
billing_address: Address$Outbound | null;
|
|
239
|
+
tax_id: Array<string | string | null> | null;
|
|
240
|
+
organization_id: string;
|
|
241
|
+
active_subscriptions: Array<CustomerStateSubscription$Outbound>;
|
|
242
|
+
granted_benefits: Array<CustomerStateBenefitGrant$Outbound>;
|
|
243
|
+
avatar_url: string;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/** @internal */
|
|
247
|
+
export const CustomerState$outboundSchema: z.ZodType<
|
|
248
|
+
CustomerState$Outbound,
|
|
249
|
+
z.ZodTypeDef,
|
|
250
|
+
CustomerState
|
|
251
|
+
> = z.object({
|
|
252
|
+
id: z.string(),
|
|
253
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
254
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
255
|
+
metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
|
|
256
|
+
externalId: z.nullable(z.string()),
|
|
257
|
+
email: z.string(),
|
|
258
|
+
emailVerified: z.boolean(),
|
|
259
|
+
name: z.nullable(z.string()),
|
|
260
|
+
billingAddress: z.nullable(Address$outboundSchema),
|
|
261
|
+
taxId: z.nullable(
|
|
262
|
+
z.array(z.nullable(z.union([z.string(), TaxIDFormat$outboundSchema]))),
|
|
263
|
+
),
|
|
264
|
+
organizationId: z.string(),
|
|
265
|
+
activeSubscriptions: z.array(CustomerStateSubscription$outboundSchema),
|
|
266
|
+
grantedBenefits: z.array(CustomerStateBenefitGrant$outboundSchema),
|
|
267
|
+
avatarUrl: z.string(),
|
|
268
|
+
}).transform((v) => {
|
|
269
|
+
return remap$(v, {
|
|
270
|
+
createdAt: "created_at",
|
|
271
|
+
modifiedAt: "modified_at",
|
|
272
|
+
externalId: "external_id",
|
|
273
|
+
emailVerified: "email_verified",
|
|
274
|
+
billingAddress: "billing_address",
|
|
275
|
+
taxId: "tax_id",
|
|
276
|
+
organizationId: "organization_id",
|
|
277
|
+
activeSubscriptions: "active_subscriptions",
|
|
278
|
+
grantedBenefits: "granted_benefits",
|
|
279
|
+
avatarUrl: "avatar_url",
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @internal
|
|
285
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
286
|
+
*/
|
|
287
|
+
export namespace CustomerState$ {
|
|
288
|
+
/** @deprecated use `CustomerState$inboundSchema` instead. */
|
|
289
|
+
export const inboundSchema = CustomerState$inboundSchema;
|
|
290
|
+
/** @deprecated use `CustomerState$outboundSchema` instead. */
|
|
291
|
+
export const outboundSchema = CustomerState$outboundSchema;
|
|
292
|
+
/** @deprecated use `CustomerState$Outbound` instead. */
|
|
293
|
+
export type Outbound = CustomerState$Outbound;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export function customerStateToJSON(customerState: CustomerState): string {
|
|
297
|
+
return JSON.stringify(CustomerState$outboundSchema.parse(customerState));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export function customerStateFromJSON(
|
|
301
|
+
jsonString: string,
|
|
302
|
+
): SafeParseResult<CustomerState, SDKValidationError> {
|
|
303
|
+
return safeParse(
|
|
304
|
+
jsonString,
|
|
305
|
+
(x) => CustomerState$inboundSchema.parse(JSON.parse(x)),
|
|
306
|
+
`Failed to parse 'CustomerState' from JSON`,
|
|
307
|
+
);
|
|
308
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
BenefitGrantCustomProperties,
|
|
12
|
+
BenefitGrantCustomProperties$inboundSchema,
|
|
13
|
+
BenefitGrantCustomProperties$Outbound,
|
|
14
|
+
BenefitGrantCustomProperties$outboundSchema,
|
|
15
|
+
} from "./benefitgrantcustomproperties.js";
|
|
16
|
+
import {
|
|
17
|
+
BenefitGrantDiscordProperties,
|
|
18
|
+
BenefitGrantDiscordProperties$inboundSchema,
|
|
19
|
+
BenefitGrantDiscordProperties$Outbound,
|
|
20
|
+
BenefitGrantDiscordProperties$outboundSchema,
|
|
21
|
+
} from "./benefitgrantdiscordproperties.js";
|
|
22
|
+
import {
|
|
23
|
+
BenefitGrantDownloadablesProperties,
|
|
24
|
+
BenefitGrantDownloadablesProperties$inboundSchema,
|
|
25
|
+
BenefitGrantDownloadablesProperties$Outbound,
|
|
26
|
+
BenefitGrantDownloadablesProperties$outboundSchema,
|
|
27
|
+
} from "./benefitgrantdownloadablesproperties.js";
|
|
28
|
+
import {
|
|
29
|
+
BenefitGrantGitHubRepositoryProperties,
|
|
30
|
+
BenefitGrantGitHubRepositoryProperties$inboundSchema,
|
|
31
|
+
BenefitGrantGitHubRepositoryProperties$Outbound,
|
|
32
|
+
BenefitGrantGitHubRepositoryProperties$outboundSchema,
|
|
33
|
+
} from "./benefitgrantgithubrepositoryproperties.js";
|
|
34
|
+
import {
|
|
35
|
+
BenefitGrantLicenseKeysProperties,
|
|
36
|
+
BenefitGrantLicenseKeysProperties$inboundSchema,
|
|
37
|
+
BenefitGrantLicenseKeysProperties$Outbound,
|
|
38
|
+
BenefitGrantLicenseKeysProperties$outboundSchema,
|
|
39
|
+
} from "./benefitgrantlicensekeysproperties.js";
|
|
40
|
+
import {
|
|
41
|
+
BenefitType,
|
|
42
|
+
BenefitType$inboundSchema,
|
|
43
|
+
BenefitType$outboundSchema,
|
|
44
|
+
} from "./benefittype.js";
|
|
45
|
+
|
|
46
|
+
export type CustomerStateBenefitGrantProperties =
|
|
47
|
+
| BenefitGrantCustomProperties
|
|
48
|
+
| BenefitGrantDownloadablesProperties
|
|
49
|
+
| BenefitGrantLicenseKeysProperties
|
|
50
|
+
| BenefitGrantDiscordProperties
|
|
51
|
+
| BenefitGrantGitHubRepositoryProperties;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* An active benefit grant for a customer.
|
|
55
|
+
*/
|
|
56
|
+
export type CustomerStateBenefitGrant = {
|
|
57
|
+
/**
|
|
58
|
+
* The ID of the grant.
|
|
59
|
+
*/
|
|
60
|
+
id: string;
|
|
61
|
+
/**
|
|
62
|
+
* Creation timestamp of the object.
|
|
63
|
+
*/
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
/**
|
|
66
|
+
* Last modification timestamp of the object.
|
|
67
|
+
*/
|
|
68
|
+
modifiedAt: Date | null;
|
|
69
|
+
/**
|
|
70
|
+
* The timestamp when the benefit was granted.
|
|
71
|
+
*/
|
|
72
|
+
grantedAt: Date;
|
|
73
|
+
/**
|
|
74
|
+
* The ID of the benefit concerned by this grant.
|
|
75
|
+
*/
|
|
76
|
+
benefitId: string;
|
|
77
|
+
benefitType: BenefitType;
|
|
78
|
+
properties:
|
|
79
|
+
| BenefitGrantCustomProperties
|
|
80
|
+
| BenefitGrantDownloadablesProperties
|
|
81
|
+
| BenefitGrantLicenseKeysProperties
|
|
82
|
+
| BenefitGrantDiscordProperties
|
|
83
|
+
| BenefitGrantGitHubRepositoryProperties;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const CustomerStateBenefitGrantProperties$inboundSchema: z.ZodType<
|
|
88
|
+
CustomerStateBenefitGrantProperties,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
unknown
|
|
91
|
+
> = z.union([
|
|
92
|
+
BenefitGrantCustomProperties$inboundSchema,
|
|
93
|
+
BenefitGrantDownloadablesProperties$inboundSchema,
|
|
94
|
+
BenefitGrantLicenseKeysProperties$inboundSchema,
|
|
95
|
+
BenefitGrantDiscordProperties$inboundSchema,
|
|
96
|
+
BenefitGrantGitHubRepositoryProperties$inboundSchema,
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export type CustomerStateBenefitGrantProperties$Outbound =
|
|
101
|
+
| BenefitGrantCustomProperties$Outbound
|
|
102
|
+
| BenefitGrantDownloadablesProperties$Outbound
|
|
103
|
+
| BenefitGrantLicenseKeysProperties$Outbound
|
|
104
|
+
| BenefitGrantDiscordProperties$Outbound
|
|
105
|
+
| BenefitGrantGitHubRepositoryProperties$Outbound;
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const CustomerStateBenefitGrantProperties$outboundSchema: z.ZodType<
|
|
109
|
+
CustomerStateBenefitGrantProperties$Outbound,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
CustomerStateBenefitGrantProperties
|
|
112
|
+
> = z.union([
|
|
113
|
+
BenefitGrantCustomProperties$outboundSchema,
|
|
114
|
+
BenefitGrantDownloadablesProperties$outboundSchema,
|
|
115
|
+
BenefitGrantLicenseKeysProperties$outboundSchema,
|
|
116
|
+
BenefitGrantDiscordProperties$outboundSchema,
|
|
117
|
+
BenefitGrantGitHubRepositoryProperties$outboundSchema,
|
|
118
|
+
]);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
123
|
+
*/
|
|
124
|
+
export namespace CustomerStateBenefitGrantProperties$ {
|
|
125
|
+
/** @deprecated use `CustomerStateBenefitGrantProperties$inboundSchema` instead. */
|
|
126
|
+
export const inboundSchema =
|
|
127
|
+
CustomerStateBenefitGrantProperties$inboundSchema;
|
|
128
|
+
/** @deprecated use `CustomerStateBenefitGrantProperties$outboundSchema` instead. */
|
|
129
|
+
export const outboundSchema =
|
|
130
|
+
CustomerStateBenefitGrantProperties$outboundSchema;
|
|
131
|
+
/** @deprecated use `CustomerStateBenefitGrantProperties$Outbound` instead. */
|
|
132
|
+
export type Outbound = CustomerStateBenefitGrantProperties$Outbound;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function customerStateBenefitGrantPropertiesToJSON(
|
|
136
|
+
customerStateBenefitGrantProperties: CustomerStateBenefitGrantProperties,
|
|
137
|
+
): string {
|
|
138
|
+
return JSON.stringify(
|
|
139
|
+
CustomerStateBenefitGrantProperties$outboundSchema.parse(
|
|
140
|
+
customerStateBenefitGrantProperties,
|
|
141
|
+
),
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function customerStateBenefitGrantPropertiesFromJSON(
|
|
146
|
+
jsonString: string,
|
|
147
|
+
): SafeParseResult<CustomerStateBenefitGrantProperties, SDKValidationError> {
|
|
148
|
+
return safeParse(
|
|
149
|
+
jsonString,
|
|
150
|
+
(x) =>
|
|
151
|
+
CustomerStateBenefitGrantProperties$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'CustomerStateBenefitGrantProperties' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const CustomerStateBenefitGrant$inboundSchema: z.ZodType<
|
|
158
|
+
CustomerStateBenefitGrant,
|
|
159
|
+
z.ZodTypeDef,
|
|
160
|
+
unknown
|
|
161
|
+
> = z.object({
|
|
162
|
+
id: z.string(),
|
|
163
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
164
|
+
modified_at: z.nullable(
|
|
165
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
166
|
+
),
|
|
167
|
+
granted_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
168
|
+
benefit_id: z.string(),
|
|
169
|
+
benefit_type: BenefitType$inboundSchema,
|
|
170
|
+
properties: z.union([
|
|
171
|
+
BenefitGrantCustomProperties$inboundSchema,
|
|
172
|
+
BenefitGrantDownloadablesProperties$inboundSchema,
|
|
173
|
+
BenefitGrantLicenseKeysProperties$inboundSchema,
|
|
174
|
+
BenefitGrantDiscordProperties$inboundSchema,
|
|
175
|
+
BenefitGrantGitHubRepositoryProperties$inboundSchema,
|
|
176
|
+
]),
|
|
177
|
+
}).transform((v) => {
|
|
178
|
+
return remap$(v, {
|
|
179
|
+
"created_at": "createdAt",
|
|
180
|
+
"modified_at": "modifiedAt",
|
|
181
|
+
"granted_at": "grantedAt",
|
|
182
|
+
"benefit_id": "benefitId",
|
|
183
|
+
"benefit_type": "benefitType",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/** @internal */
|
|
188
|
+
export type CustomerStateBenefitGrant$Outbound = {
|
|
189
|
+
id: string;
|
|
190
|
+
created_at: string;
|
|
191
|
+
modified_at: string | null;
|
|
192
|
+
granted_at: string;
|
|
193
|
+
benefit_id: string;
|
|
194
|
+
benefit_type: string;
|
|
195
|
+
properties:
|
|
196
|
+
| BenefitGrantCustomProperties$Outbound
|
|
197
|
+
| BenefitGrantDownloadablesProperties$Outbound
|
|
198
|
+
| BenefitGrantLicenseKeysProperties$Outbound
|
|
199
|
+
| BenefitGrantDiscordProperties$Outbound
|
|
200
|
+
| BenefitGrantGitHubRepositoryProperties$Outbound;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/** @internal */
|
|
204
|
+
export const CustomerStateBenefitGrant$outboundSchema: z.ZodType<
|
|
205
|
+
CustomerStateBenefitGrant$Outbound,
|
|
206
|
+
z.ZodTypeDef,
|
|
207
|
+
CustomerStateBenefitGrant
|
|
208
|
+
> = z.object({
|
|
209
|
+
id: z.string(),
|
|
210
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
211
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
212
|
+
grantedAt: z.date().transform(v => v.toISOString()),
|
|
213
|
+
benefitId: z.string(),
|
|
214
|
+
benefitType: BenefitType$outboundSchema,
|
|
215
|
+
properties: z.union([
|
|
216
|
+
BenefitGrantCustomProperties$outboundSchema,
|
|
217
|
+
BenefitGrantDownloadablesProperties$outboundSchema,
|
|
218
|
+
BenefitGrantLicenseKeysProperties$outboundSchema,
|
|
219
|
+
BenefitGrantDiscordProperties$outboundSchema,
|
|
220
|
+
BenefitGrantGitHubRepositoryProperties$outboundSchema,
|
|
221
|
+
]),
|
|
222
|
+
}).transform((v) => {
|
|
223
|
+
return remap$(v, {
|
|
224
|
+
createdAt: "created_at",
|
|
225
|
+
modifiedAt: "modified_at",
|
|
226
|
+
grantedAt: "granted_at",
|
|
227
|
+
benefitId: "benefit_id",
|
|
228
|
+
benefitType: "benefit_type",
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @internal
|
|
234
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
235
|
+
*/
|
|
236
|
+
export namespace CustomerStateBenefitGrant$ {
|
|
237
|
+
/** @deprecated use `CustomerStateBenefitGrant$inboundSchema` instead. */
|
|
238
|
+
export const inboundSchema = CustomerStateBenefitGrant$inboundSchema;
|
|
239
|
+
/** @deprecated use `CustomerStateBenefitGrant$outboundSchema` instead. */
|
|
240
|
+
export const outboundSchema = CustomerStateBenefitGrant$outboundSchema;
|
|
241
|
+
/** @deprecated use `CustomerStateBenefitGrant$Outbound` instead. */
|
|
242
|
+
export type Outbound = CustomerStateBenefitGrant$Outbound;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function customerStateBenefitGrantToJSON(
|
|
246
|
+
customerStateBenefitGrant: CustomerStateBenefitGrant,
|
|
247
|
+
): string {
|
|
248
|
+
return JSON.stringify(
|
|
249
|
+
CustomerStateBenefitGrant$outboundSchema.parse(customerStateBenefitGrant),
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export function customerStateBenefitGrantFromJSON(
|
|
254
|
+
jsonString: string,
|
|
255
|
+
): SafeParseResult<CustomerStateBenefitGrant, SDKValidationError> {
|
|
256
|
+
return safeParse(
|
|
257
|
+
jsonString,
|
|
258
|
+
(x) => CustomerStateBenefitGrant$inboundSchema.parse(JSON.parse(x)),
|
|
259
|
+
`Failed to parse 'CustomerStateBenefitGrant' from JSON`,
|
|
260
|
+
);
|
|
261
|
+
}
|