@unified-api/typescript-sdk 2.6.4 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +12 -0
  2. package/funcs/accountingCreateAccountingOrder.d.ts +13 -0
  3. package/funcs/accountingCreateAccountingOrder.d.ts.map +1 -0
  4. package/funcs/accountingCreateAccountingOrder.js +98 -0
  5. package/funcs/accountingCreateAccountingOrder.js.map +1 -0
  6. package/funcs/accountingGetAccountingOrder.d.ts +13 -0
  7. package/funcs/accountingGetAccountingOrder.d.ts.map +1 -0
  8. package/funcs/accountingGetAccountingOrder.js +101 -0
  9. package/funcs/accountingGetAccountingOrder.js.map +1 -0
  10. package/funcs/accountingListAccountingOrders.d.ts +13 -0
  11. package/funcs/accountingListAccountingOrders.d.ts.map +1 -0
  12. package/funcs/accountingListAccountingOrders.js +105 -0
  13. package/funcs/accountingListAccountingOrders.js.map +1 -0
  14. package/funcs/accountingPatchAccountingOrder.d.ts +13 -0
  15. package/funcs/accountingPatchAccountingOrder.d.ts.map +1 -0
  16. package/funcs/accountingPatchAccountingOrder.js +102 -0
  17. package/funcs/accountingPatchAccountingOrder.js.map +1 -0
  18. package/funcs/accountingRemoveAccountingOrder.d.ts +12 -0
  19. package/funcs/accountingRemoveAccountingOrder.d.ts.map +1 -0
  20. package/funcs/accountingRemoveAccountingOrder.js +97 -0
  21. package/funcs/accountingRemoveAccountingOrder.js.map +1 -0
  22. package/funcs/accountingUpdateAccountingOrder.d.ts +13 -0
  23. package/funcs/accountingUpdateAccountingOrder.d.ts.map +1 -0
  24. package/funcs/accountingUpdateAccountingOrder.js +102 -0
  25. package/funcs/accountingUpdateAccountingOrder.js.map +1 -0
  26. package/funcs/orderCreateAccountingOrder.d.ts +13 -0
  27. package/funcs/orderCreateAccountingOrder.d.ts.map +1 -0
  28. package/funcs/orderCreateAccountingOrder.js +98 -0
  29. package/funcs/orderCreateAccountingOrder.js.map +1 -0
  30. package/funcs/orderGetAccountingOrder.d.ts +13 -0
  31. package/funcs/orderGetAccountingOrder.d.ts.map +1 -0
  32. package/funcs/orderGetAccountingOrder.js +101 -0
  33. package/funcs/orderGetAccountingOrder.js.map +1 -0
  34. package/funcs/orderListAccountingOrders.d.ts +13 -0
  35. package/funcs/orderListAccountingOrders.d.ts.map +1 -0
  36. package/funcs/orderListAccountingOrders.js +105 -0
  37. package/funcs/orderListAccountingOrders.js.map +1 -0
  38. package/funcs/orderPatchAccountingOrder.d.ts +13 -0
  39. package/funcs/orderPatchAccountingOrder.d.ts.map +1 -0
  40. package/funcs/orderPatchAccountingOrder.js +102 -0
  41. package/funcs/orderPatchAccountingOrder.js.map +1 -0
  42. package/funcs/orderRemoveAccountingOrder.d.ts +12 -0
  43. package/funcs/orderRemoveAccountingOrder.d.ts.map +1 -0
  44. package/funcs/orderRemoveAccountingOrder.js +97 -0
  45. package/funcs/orderRemoveAccountingOrder.js.map +1 -0
  46. package/funcs/orderUpdateAccountingOrder.d.ts +13 -0
  47. package/funcs/orderUpdateAccountingOrder.d.ts.map +1 -0
  48. package/funcs/orderUpdateAccountingOrder.js +102 -0
  49. package/funcs/orderUpdateAccountingOrder.js.map +1 -0
  50. package/lib/config.d.ts +3 -3
  51. package/lib/config.js +3 -3
  52. package/lib/config.js.map +1 -1
  53. package/package.json +1 -1
  54. package/sdk/accounting.d.ts +24 -0
  55. package/sdk/accounting.d.ts.map +1 -1
  56. package/sdk/accounting.js +42 -0
  57. package/sdk/accounting.js.map +1 -1
  58. package/sdk/models/operations/createaccountingorder.d.ts +36 -0
  59. package/sdk/models/operations/createaccountingorder.d.ts.map +1 -0
  60. package/sdk/models/operations/createaccountingorder.js +66 -0
  61. package/sdk/models/operations/createaccountingorder.js.map +1 -0
  62. package/sdk/models/operations/getaccountingorder.d.ts +38 -0
  63. package/sdk/models/operations/getaccountingorder.d.ts.map +1 -0
  64. package/sdk/models/operations/getaccountingorder.js +63 -0
  65. package/sdk/models/operations/getaccountingorder.js.map +1 -0
  66. package/sdk/models/operations/getunifiedintegrationauth.d.ts +6 -0
  67. package/sdk/models/operations/getunifiedintegrationauth.d.ts.map +1 -1
  68. package/sdk/models/operations/getunifiedintegrationauth.js +2 -0
  69. package/sdk/models/operations/getunifiedintegrationauth.js.map +1 -1
  70. package/sdk/models/operations/index.d.ts +6 -0
  71. package/sdk/models/operations/index.d.ts.map +1 -1
  72. package/sdk/models/operations/index.js +6 -0
  73. package/sdk/models/operations/index.js.map +1 -1
  74. package/sdk/models/operations/listaccountingorders.d.ts +53 -0
  75. package/sdk/models/operations/listaccountingorders.d.ts.map +1 -0
  76. package/sdk/models/operations/listaccountingorders.js +78 -0
  77. package/sdk/models/operations/listaccountingorders.js.map +1 -0
  78. package/sdk/models/operations/patchaccountingorder.d.ts +41 -0
  79. package/sdk/models/operations/patchaccountingorder.d.ts.map +1 -0
  80. package/sdk/models/operations/patchaccountingorder.js +68 -0
  81. package/sdk/models/operations/patchaccountingorder.js.map +1 -0
  82. package/sdk/models/operations/removeaccountingorder.d.ts +33 -0
  83. package/sdk/models/operations/removeaccountingorder.d.ts.map +1 -0
  84. package/sdk/models/operations/removeaccountingorder.js +61 -0
  85. package/sdk/models/operations/removeaccountingorder.js.map +1 -0
  86. package/sdk/models/operations/updateaccountingorder.d.ts +41 -0
  87. package/sdk/models/operations/updateaccountingorder.d.ts.map +1 -0
  88. package/sdk/models/operations/updateaccountingorder.js +68 -0
  89. package/sdk/models/operations/updateaccountingorder.js.map +1 -0
  90. package/sdk/models/shared/accountinginvoice.d.ts +29 -0
  91. package/sdk/models/shared/accountinginvoice.d.ts.map +1 -1
  92. package/sdk/models/shared/accountinginvoice.js +27 -1
  93. package/sdk/models/shared/accountinginvoice.js.map +1 -1
  94. package/sdk/models/shared/accountingorder.d.ts +122 -0
  95. package/sdk/models/shared/accountingorder.d.ts.map +1 -0
  96. package/sdk/models/shared/accountingorder.js +147 -0
  97. package/sdk/models/shared/accountingorder.js.map +1 -0
  98. package/sdk/models/shared/index.d.ts +3 -0
  99. package/sdk/models/shared/index.d.ts.map +1 -1
  100. package/sdk/models/shared/index.js +3 -0
  101. package/sdk/models/shared/index.js.map +1 -1
  102. package/sdk/models/shared/propertyaccountingorderbillingaddress.d.ts +39 -0
  103. package/sdk/models/shared/propertyaccountingorderbillingaddress.d.ts.map +1 -0
  104. package/sdk/models/shared/propertyaccountingorderbillingaddress.js +77 -0
  105. package/sdk/models/shared/propertyaccountingorderbillingaddress.js.map +1 -0
  106. package/sdk/models/shared/propertyaccountingordershippingaddress.d.ts +39 -0
  107. package/sdk/models/shared/propertyaccountingordershippingaddress.d.ts.map +1 -0
  108. package/sdk/models/shared/propertyaccountingordershippingaddress.js +77 -0
  109. package/sdk/models/shared/propertyaccountingordershippingaddress.js.map +1 -0
  110. package/sdk/models/shared/propertyconnectionpermissions.d.ts +6 -0
  111. package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  112. package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  113. package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  114. package/sdk/models/shared/webhook.d.ts +3 -0
  115. package/sdk/models/shared/webhook.d.ts.map +1 -1
  116. package/sdk/models/shared/webhook.js +1 -0
  117. package/sdk/models/shared/webhook.js.map +1 -1
  118. package/sdk/order.d.ts +30 -0
  119. package/sdk/order.d.ts.map +1 -0
  120. package/sdk/order.js +54 -0
  121. package/sdk/order.js.map +1 -0
  122. package/sdk/sdk.d.ts +3 -0
  123. package/sdk/sdk.d.ts.map +1 -1
  124. package/sdk/sdk.js +5 -0
  125. package/sdk/sdk.js.map +1 -1
  126. package/src/funcs/accountingCreateAccountingOrder.ts +126 -0
  127. package/src/funcs/accountingGetAccountingOrder.ts +128 -0
  128. package/src/funcs/accountingListAccountingOrders.ts +133 -0
  129. package/src/funcs/accountingPatchAccountingOrder.ts +130 -0
  130. package/src/funcs/accountingRemoveAccountingOrder.ts +124 -0
  131. package/src/funcs/accountingUpdateAccountingOrder.ts +130 -0
  132. package/src/funcs/orderCreateAccountingOrder.ts +126 -0
  133. package/src/funcs/orderGetAccountingOrder.ts +128 -0
  134. package/src/funcs/orderListAccountingOrders.ts +133 -0
  135. package/src/funcs/orderPatchAccountingOrder.ts +130 -0
  136. package/src/funcs/orderRemoveAccountingOrder.ts +124 -0
  137. package/src/funcs/orderUpdateAccountingOrder.ts +130 -0
  138. package/src/lib/config.ts +3 -3
  139. package/src/sdk/accounting.ts +90 -0
  140. package/src/sdk/models/operations/createaccountingorder.ts +71 -0
  141. package/src/sdk/models/operations/getaccountingorder.ts +71 -0
  142. package/src/sdk/models/operations/getunifiedintegrationauth.ts +2 -0
  143. package/src/sdk/models/operations/index.ts +6 -0
  144. package/src/sdk/models/operations/listaccountingorders.ts +101 -0
  145. package/src/sdk/models/operations/patchaccountingorder.ts +78 -0
  146. package/src/sdk/models/operations/removeaccountingorder.ts +64 -0
  147. package/src/sdk/models/operations/updateaccountingorder.ts +78 -0
  148. package/src/sdk/models/shared/accountinginvoice.ts +38 -0
  149. package/src/sdk/models/shared/accountingorder.ts +200 -0
  150. package/src/sdk/models/shared/index.ts +3 -0
  151. package/src/sdk/models/shared/propertyaccountingorderbillingaddress.ts +88 -0
  152. package/src/sdk/models/shared/propertyaccountingordershippingaddress.ts +88 -0
  153. package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
  154. package/src/sdk/models/shared/webhook.ts +1 -0
  155. package/src/sdk/order.ts +100 -0
  156. package/src/sdk/sdk.ts +6 -0
@@ -33,6 +33,12 @@ export type AccountingInvoiceStatus = ClosedEnum<
33
33
  typeof AccountingInvoiceStatus
34
34
  >;
35
35
 
36
+ export const AccountingInvoiceType = {
37
+ Bill: "BILL",
38
+ Invoice: "INVOICE",
39
+ } as const;
40
+ export type AccountingInvoiceType = ClosedEnum<typeof AccountingInvoiceType>;
41
+
36
42
  export type AccountingInvoice = {
37
43
  balanceAmount?: number | undefined;
38
44
  cancelledAt?: Date | undefined;
@@ -42,6 +48,7 @@ export type AccountingInvoice = {
42
48
  discountAmount?: number | undefined;
43
49
  dueAt?: Date | undefined;
44
50
  id?: string | undefined;
51
+ invoiceAt?: Date | undefined;
45
52
  invoiceNumber?: string | undefined;
46
53
  lineitems?: Array<AccountingLineitem> | undefined;
47
54
  notes?: string | undefined;
@@ -55,6 +62,7 @@ export type AccountingInvoice = {
55
62
  status?: AccountingInvoiceStatus | undefined;
56
63
  taxAmount?: number | undefined;
57
64
  totalAmount?: number | undefined;
65
+ type?: AccountingInvoiceType | undefined;
58
66
  updatedAt?: Date | undefined;
59
67
  url?: string | undefined;
60
68
  };
@@ -101,6 +109,27 @@ export namespace AccountingInvoiceStatus$ {
101
109
  export const outboundSchema = AccountingInvoiceStatus$outboundSchema;
102
110
  }
103
111
 
112
+ /** @internal */
113
+ export const AccountingInvoiceType$inboundSchema: z.ZodNativeEnum<
114
+ typeof AccountingInvoiceType
115
+ > = z.nativeEnum(AccountingInvoiceType);
116
+
117
+ /** @internal */
118
+ export const AccountingInvoiceType$outboundSchema: z.ZodNativeEnum<
119
+ typeof AccountingInvoiceType
120
+ > = AccountingInvoiceType$inboundSchema;
121
+
122
+ /**
123
+ * @internal
124
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
125
+ */
126
+ export namespace AccountingInvoiceType$ {
127
+ /** @deprecated use `AccountingInvoiceType$inboundSchema` instead. */
128
+ export const inboundSchema = AccountingInvoiceType$inboundSchema;
129
+ /** @deprecated use `AccountingInvoiceType$outboundSchema` instead. */
130
+ export const outboundSchema = AccountingInvoiceType$outboundSchema;
131
+ }
132
+
104
133
  /** @internal */
105
134
  export const AccountingInvoice$inboundSchema: z.ZodType<
106
135
  AccountingInvoice,
@@ -119,6 +148,8 @@ export const AccountingInvoice$inboundSchema: z.ZodType<
119
148
  due_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
120
149
  .optional(),
121
150
  id: z.string().optional(),
151
+ invoice_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
152
+ .optional(),
122
153
  invoice_number: z.string().optional(),
123
154
  lineitems: z.array(AccountingLineitem$inboundSchema).optional(),
124
155
  notes: z.string().optional(),
@@ -134,6 +165,7 @@ export const AccountingInvoice$inboundSchema: z.ZodType<
134
165
  status: AccountingInvoiceStatus$inboundSchema.optional(),
135
166
  tax_amount: z.number().optional(),
136
167
  total_amount: z.number().optional(),
168
+ type: AccountingInvoiceType$inboundSchema.optional(),
137
169
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
138
170
  .optional(),
139
171
  url: z.string().optional(),
@@ -145,6 +177,7 @@ export const AccountingInvoice$inboundSchema: z.ZodType<
145
177
  "created_at": "createdAt",
146
178
  "discount_amount": "discountAmount",
147
179
  "due_at": "dueAt",
180
+ "invoice_at": "invoiceAt",
148
181
  "invoice_number": "invoiceNumber",
149
182
  "paid_amount": "paidAmount",
150
183
  "paid_at": "paidAt",
@@ -168,6 +201,7 @@ export type AccountingInvoice$Outbound = {
168
201
  discount_amount?: number | undefined;
169
202
  due_at?: string | undefined;
170
203
  id?: string | undefined;
204
+ invoice_at?: string | undefined;
171
205
  invoice_number?: string | undefined;
172
206
  lineitems?: Array<AccountingLineitem$Outbound> | undefined;
173
207
  notes?: string | undefined;
@@ -181,6 +215,7 @@ export type AccountingInvoice$Outbound = {
181
215
  status?: string | undefined;
182
216
  tax_amount?: number | undefined;
183
217
  total_amount?: number | undefined;
218
+ type?: string | undefined;
184
219
  updated_at?: string | undefined;
185
220
  url?: string | undefined;
186
221
  };
@@ -199,6 +234,7 @@ export const AccountingInvoice$outboundSchema: z.ZodType<
199
234
  discountAmount: z.number().optional(),
200
235
  dueAt: z.date().transform(v => v.toISOString()).optional(),
201
236
  id: z.string().optional(),
237
+ invoiceAt: z.date().transform(v => v.toISOString()).optional(),
202
238
  invoiceNumber: z.string().optional(),
203
239
  lineitems: z.array(AccountingLineitem$outboundSchema).optional(),
204
240
  notes: z.string().optional(),
@@ -212,6 +248,7 @@ export const AccountingInvoice$outboundSchema: z.ZodType<
212
248
  status: AccountingInvoiceStatus$outboundSchema.optional(),
213
249
  taxAmount: z.number().optional(),
214
250
  totalAmount: z.number().optional(),
251
+ type: AccountingInvoiceType$outboundSchema.optional(),
215
252
  updatedAt: z.date().transform(v => v.toISOString()).optional(),
216
253
  url: z.string().optional(),
217
254
  }).transform((v) => {
@@ -222,6 +259,7 @@ export const AccountingInvoice$outboundSchema: z.ZodType<
222
259
  createdAt: "created_at",
223
260
  discountAmount: "discount_amount",
224
261
  dueAt: "due_at",
262
+ invoiceAt: "invoice_at",
225
263
  invoiceNumber: "invoice_number",
226
264
  paidAmount: "paid_amount",
227
265
  paidAt: "paid_at",
@@ -0,0 +1,200 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+ import {
9
+ AccountingLineitem,
10
+ AccountingLineitem$inboundSchema,
11
+ AccountingLineitem$Outbound,
12
+ AccountingLineitem$outboundSchema,
13
+ } from "./accountinglineitem.js";
14
+ import {
15
+ PropertyAccountingOrderBillingAddress,
16
+ PropertyAccountingOrderBillingAddress$inboundSchema,
17
+ PropertyAccountingOrderBillingAddress$Outbound,
18
+ PropertyAccountingOrderBillingAddress$outboundSchema,
19
+ } from "./propertyaccountingorderbillingaddress.js";
20
+ import {
21
+ PropertyAccountingOrderShippingAddress,
22
+ PropertyAccountingOrderShippingAddress$inboundSchema,
23
+ PropertyAccountingOrderShippingAddress$Outbound,
24
+ PropertyAccountingOrderShippingAddress$outboundSchema,
25
+ } from "./propertyaccountingordershippingaddress.js";
26
+
27
+ export const AccountingOrderStatus = {
28
+ Draft: "DRAFT",
29
+ Voided: "VOIDED",
30
+ Authorized: "AUTHORIZED",
31
+ Paid: "PAID",
32
+ PartiallyPaid: "PARTIALLY_PAID",
33
+ PartiallyRefunded: "PARTIALLY_REFUNDED",
34
+ Refunded: "REFUNDED",
35
+ } as const;
36
+ export type AccountingOrderStatus = ClosedEnum<typeof AccountingOrderStatus>;
37
+
38
+ export const AccountingOrderType = {
39
+ Sales: "SALES",
40
+ Purchase: "PURCHASE",
41
+ } as const;
42
+ export type AccountingOrderType = ClosedEnum<typeof AccountingOrderType>;
43
+
44
+ export type AccountingOrder = {
45
+ accountId?: string | undefined;
46
+ billingAddress?: PropertyAccountingOrderBillingAddress | undefined;
47
+ contactId?: string | undefined;
48
+ createdAt?: Date | undefined;
49
+ currency?: string | undefined;
50
+ id?: string | undefined;
51
+ lineitems?: Array<AccountingLineitem> | undefined;
52
+ raw?: { [k: string]: any } | undefined;
53
+ shippingAddress?: PropertyAccountingOrderShippingAddress | undefined;
54
+ status?: AccountingOrderStatus | undefined;
55
+ totalAmount?: number | undefined;
56
+ type?: AccountingOrderType | undefined;
57
+ updatedAt?: Date | undefined;
58
+ };
59
+
60
+ /** @internal */
61
+ export const AccountingOrderStatus$inboundSchema: z.ZodNativeEnum<
62
+ typeof AccountingOrderStatus
63
+ > = z.nativeEnum(AccountingOrderStatus);
64
+
65
+ /** @internal */
66
+ export const AccountingOrderStatus$outboundSchema: z.ZodNativeEnum<
67
+ typeof AccountingOrderStatus
68
+ > = AccountingOrderStatus$inboundSchema;
69
+
70
+ /**
71
+ * @internal
72
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
73
+ */
74
+ export namespace AccountingOrderStatus$ {
75
+ /** @deprecated use `AccountingOrderStatus$inboundSchema` instead. */
76
+ export const inboundSchema = AccountingOrderStatus$inboundSchema;
77
+ /** @deprecated use `AccountingOrderStatus$outboundSchema` instead. */
78
+ export const outboundSchema = AccountingOrderStatus$outboundSchema;
79
+ }
80
+
81
+ /** @internal */
82
+ export const AccountingOrderType$inboundSchema: z.ZodNativeEnum<
83
+ typeof AccountingOrderType
84
+ > = z.nativeEnum(AccountingOrderType);
85
+
86
+ /** @internal */
87
+ export const AccountingOrderType$outboundSchema: z.ZodNativeEnum<
88
+ typeof AccountingOrderType
89
+ > = AccountingOrderType$inboundSchema;
90
+
91
+ /**
92
+ * @internal
93
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
94
+ */
95
+ export namespace AccountingOrderType$ {
96
+ /** @deprecated use `AccountingOrderType$inboundSchema` instead. */
97
+ export const inboundSchema = AccountingOrderType$inboundSchema;
98
+ /** @deprecated use `AccountingOrderType$outboundSchema` instead. */
99
+ export const outboundSchema = AccountingOrderType$outboundSchema;
100
+ }
101
+
102
+ /** @internal */
103
+ export const AccountingOrder$inboundSchema: z.ZodType<
104
+ AccountingOrder,
105
+ z.ZodTypeDef,
106
+ unknown
107
+ > = z.object({
108
+ account_id: z.string().optional(),
109
+ billing_address: PropertyAccountingOrderBillingAddress$inboundSchema
110
+ .optional(),
111
+ contact_id: z.string().optional(),
112
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
113
+ .optional(),
114
+ currency: z.string().optional(),
115
+ id: z.string().optional(),
116
+ lineitems: z.array(AccountingLineitem$inboundSchema).optional(),
117
+ raw: z.record(z.any()).optional(),
118
+ shipping_address: PropertyAccountingOrderShippingAddress$inboundSchema
119
+ .optional(),
120
+ status: AccountingOrderStatus$inboundSchema.optional(),
121
+ total_amount: z.number().optional(),
122
+ type: AccountingOrderType$inboundSchema.optional(),
123
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
124
+ .optional(),
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ "account_id": "accountId",
128
+ "billing_address": "billingAddress",
129
+ "contact_id": "contactId",
130
+ "created_at": "createdAt",
131
+ "shipping_address": "shippingAddress",
132
+ "total_amount": "totalAmount",
133
+ "updated_at": "updatedAt",
134
+ });
135
+ });
136
+
137
+ /** @internal */
138
+ export type AccountingOrder$Outbound = {
139
+ account_id?: string | undefined;
140
+ billing_address?: PropertyAccountingOrderBillingAddress$Outbound | undefined;
141
+ contact_id?: string | undefined;
142
+ created_at?: string | undefined;
143
+ currency?: string | undefined;
144
+ id?: string | undefined;
145
+ lineitems?: Array<AccountingLineitem$Outbound> | undefined;
146
+ raw?: { [k: string]: any } | undefined;
147
+ shipping_address?:
148
+ | PropertyAccountingOrderShippingAddress$Outbound
149
+ | undefined;
150
+ status?: string | undefined;
151
+ total_amount?: number | undefined;
152
+ type?: string | undefined;
153
+ updated_at?: string | undefined;
154
+ };
155
+
156
+ /** @internal */
157
+ export const AccountingOrder$outboundSchema: z.ZodType<
158
+ AccountingOrder$Outbound,
159
+ z.ZodTypeDef,
160
+ AccountingOrder
161
+ > = z.object({
162
+ accountId: z.string().optional(),
163
+ billingAddress: PropertyAccountingOrderBillingAddress$outboundSchema
164
+ .optional(),
165
+ contactId: z.string().optional(),
166
+ createdAt: z.date().transform(v => v.toISOString()).optional(),
167
+ currency: z.string().optional(),
168
+ id: z.string().optional(),
169
+ lineitems: z.array(AccountingLineitem$outboundSchema).optional(),
170
+ raw: z.record(z.any()).optional(),
171
+ shippingAddress: PropertyAccountingOrderShippingAddress$outboundSchema
172
+ .optional(),
173
+ status: AccountingOrderStatus$outboundSchema.optional(),
174
+ totalAmount: z.number().optional(),
175
+ type: AccountingOrderType$outboundSchema.optional(),
176
+ updatedAt: z.date().transform(v => v.toISOString()).optional(),
177
+ }).transform((v) => {
178
+ return remap$(v, {
179
+ accountId: "account_id",
180
+ billingAddress: "billing_address",
181
+ contactId: "contact_id",
182
+ createdAt: "created_at",
183
+ shippingAddress: "shipping_address",
184
+ totalAmount: "total_amount",
185
+ updatedAt: "updated_at",
186
+ });
187
+ });
188
+
189
+ /**
190
+ * @internal
191
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
192
+ */
193
+ export namespace AccountingOrder$ {
194
+ /** @deprecated use `AccountingOrder$inboundSchema` instead. */
195
+ export const inboundSchema = AccountingOrder$inboundSchema;
196
+ /** @deprecated use `AccountingOrder$outboundSchema` instead. */
197
+ export const outboundSchema = AccountingOrder$outboundSchema;
198
+ /** @deprecated use `AccountingOrder$Outbound` instead. */
199
+ export type Outbound = AccountingOrder$Outbound;
200
+ }
@@ -10,6 +10,7 @@ export * from "./accountinginvoice.js";
10
10
  export * from "./accountingjournal.js";
11
11
  export * from "./accountingjournallineitem.js";
12
12
  export * from "./accountinglineitem.js";
13
+ export * from "./accountingorder.js";
13
14
  export * from "./accountingorganization.js";
14
15
  export * from "./accountingtaxrate.js";
15
16
  export * from "./accountingtelephone.js";
@@ -91,6 +92,8 @@ export * from "./paymentpayout.js";
91
92
  export * from "./paymentrefund.js";
92
93
  export * from "./propertyaccountingcontactbillingaddress.js";
93
94
  export * from "./propertyaccountingcontactshippingaddress.js";
95
+ export * from "./propertyaccountingorderbillingaddress.js";
96
+ export * from "./propertyaccountingordershippingaddress.js";
94
97
  export * from "./propertyaccountingorganizationaddress.js";
95
98
  export * from "./propertyatsactivityfrom.js";
96
99
  export * from "./propertyatscandidateaddress.js";
@@ -0,0 +1,88 @@
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
+
8
+ export type PropertyAccountingOrderBillingAddress = {
9
+ address1?: string | undefined;
10
+ address2?: string | undefined;
11
+ city?: string | undefined;
12
+ country?: string | undefined;
13
+ countryCode?: string | undefined;
14
+ postalCode?: string | undefined;
15
+ region?: string | undefined;
16
+ regionCode?: string | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const PropertyAccountingOrderBillingAddress$inboundSchema: z.ZodType<
21
+ PropertyAccountingOrderBillingAddress,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ address1: z.string().optional(),
26
+ address2: z.string().optional(),
27
+ city: z.string().optional(),
28
+ country: z.string().optional(),
29
+ country_code: z.string().optional(),
30
+ postal_code: z.string().optional(),
31
+ region: z.string().optional(),
32
+ region_code: z.string().optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "country_code": "countryCode",
36
+ "postal_code": "postalCode",
37
+ "region_code": "regionCode",
38
+ });
39
+ });
40
+
41
+ /** @internal */
42
+ export type PropertyAccountingOrderBillingAddress$Outbound = {
43
+ address1?: string | undefined;
44
+ address2?: string | undefined;
45
+ city?: string | undefined;
46
+ country?: string | undefined;
47
+ country_code?: string | undefined;
48
+ postal_code?: string | undefined;
49
+ region?: string | undefined;
50
+ region_code?: string | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const PropertyAccountingOrderBillingAddress$outboundSchema: z.ZodType<
55
+ PropertyAccountingOrderBillingAddress$Outbound,
56
+ z.ZodTypeDef,
57
+ PropertyAccountingOrderBillingAddress
58
+ > = z.object({
59
+ address1: z.string().optional(),
60
+ address2: z.string().optional(),
61
+ city: z.string().optional(),
62
+ country: z.string().optional(),
63
+ countryCode: z.string().optional(),
64
+ postalCode: z.string().optional(),
65
+ region: z.string().optional(),
66
+ regionCode: z.string().optional(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ countryCode: "country_code",
70
+ postalCode: "postal_code",
71
+ regionCode: "region_code",
72
+ });
73
+ });
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace PropertyAccountingOrderBillingAddress$ {
80
+ /** @deprecated use `PropertyAccountingOrderBillingAddress$inboundSchema` instead. */
81
+ export const inboundSchema =
82
+ PropertyAccountingOrderBillingAddress$inboundSchema;
83
+ /** @deprecated use `PropertyAccountingOrderBillingAddress$outboundSchema` instead. */
84
+ export const outboundSchema =
85
+ PropertyAccountingOrderBillingAddress$outboundSchema;
86
+ /** @deprecated use `PropertyAccountingOrderBillingAddress$Outbound` instead. */
87
+ export type Outbound = PropertyAccountingOrderBillingAddress$Outbound;
88
+ }
@@ -0,0 +1,88 @@
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
+
8
+ export type PropertyAccountingOrderShippingAddress = {
9
+ address1?: string | undefined;
10
+ address2?: string | undefined;
11
+ city?: string | undefined;
12
+ country?: string | undefined;
13
+ countryCode?: string | undefined;
14
+ postalCode?: string | undefined;
15
+ region?: string | undefined;
16
+ regionCode?: string | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const PropertyAccountingOrderShippingAddress$inboundSchema: z.ZodType<
21
+ PropertyAccountingOrderShippingAddress,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ address1: z.string().optional(),
26
+ address2: z.string().optional(),
27
+ city: z.string().optional(),
28
+ country: z.string().optional(),
29
+ country_code: z.string().optional(),
30
+ postal_code: z.string().optional(),
31
+ region: z.string().optional(),
32
+ region_code: z.string().optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "country_code": "countryCode",
36
+ "postal_code": "postalCode",
37
+ "region_code": "regionCode",
38
+ });
39
+ });
40
+
41
+ /** @internal */
42
+ export type PropertyAccountingOrderShippingAddress$Outbound = {
43
+ address1?: string | undefined;
44
+ address2?: string | undefined;
45
+ city?: string | undefined;
46
+ country?: string | undefined;
47
+ country_code?: string | undefined;
48
+ postal_code?: string | undefined;
49
+ region?: string | undefined;
50
+ region_code?: string | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const PropertyAccountingOrderShippingAddress$outboundSchema: z.ZodType<
55
+ PropertyAccountingOrderShippingAddress$Outbound,
56
+ z.ZodTypeDef,
57
+ PropertyAccountingOrderShippingAddress
58
+ > = z.object({
59
+ address1: z.string().optional(),
60
+ address2: z.string().optional(),
61
+ city: z.string().optional(),
62
+ country: z.string().optional(),
63
+ countryCode: z.string().optional(),
64
+ postalCode: z.string().optional(),
65
+ region: z.string().optional(),
66
+ regionCode: z.string().optional(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ countryCode: "country_code",
70
+ postalCode: "postal_code",
71
+ regionCode: "region_code",
72
+ });
73
+ });
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace PropertyAccountingOrderShippingAddress$ {
80
+ /** @deprecated use `PropertyAccountingOrderShippingAddress$inboundSchema` instead. */
81
+ export const inboundSchema =
82
+ PropertyAccountingOrderShippingAddress$inboundSchema;
83
+ /** @deprecated use `PropertyAccountingOrderShippingAddress$outboundSchema` instead. */
84
+ export const outboundSchema =
85
+ PropertyAccountingOrderShippingAddress$outboundSchema;
86
+ /** @deprecated use `PropertyAccountingOrderShippingAddress$Outbound` instead. */
87
+ export type Outbound = PropertyAccountingOrderShippingAddress$Outbound;
88
+ }
@@ -20,6 +20,8 @@ export const PropertyConnectionPermissions = {
20
20
  AccountingTaxrateRead: "accounting_taxrate_read",
21
21
  AccountingTaxrateWrite: "accounting_taxrate_write",
22
22
  AccountingOrganizationRead: "accounting_organization_read",
23
+ AccountingOrderRead: "accounting_order_read",
24
+ AccountingOrderWrite: "accounting_order_write",
23
25
  PaymentPaymentRead: "payment_payment_read",
24
26
  PaymentPaymentWrite: "payment_payment_write",
25
27
  PaymentPayoutRead: "payment_payout_read",
@@ -21,6 +21,7 @@ export const ObjectType = {
21
21
  AccountingInvoice: "accounting_invoice",
22
22
  AccountingTaxrate: "accounting_taxrate",
23
23
  AccountingOrganization: "accounting_organization",
24
+ AccountingOrder: "accounting_order",
24
25
  PaymentPayment: "payment_payment",
25
26
  PaymentLink: "payment_link",
26
27
  PaymentPayout: "payment_payout",
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { orderCreateAccountingOrder } from "../funcs/orderCreateAccountingOrder.js";
6
+ import { orderGetAccountingOrder } from "../funcs/orderGetAccountingOrder.js";
7
+ import { orderListAccountingOrders } from "../funcs/orderListAccountingOrders.js";
8
+ import { orderPatchAccountingOrder } from "../funcs/orderPatchAccountingOrder.js";
9
+ import { orderRemoveAccountingOrder } from "../funcs/orderRemoveAccountingOrder.js";
10
+ import { orderUpdateAccountingOrder } from "../funcs/orderUpdateAccountingOrder.js";
11
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
+ import * as operations from "./models/operations/index.js";
13
+ import * as shared from "./models/shared/index.js";
14
+ import { unwrapAsync } from "./types/fp.js";
15
+
16
+ export class Order extends ClientSDK {
17
+ /**
18
+ * Create an order
19
+ */
20
+ async createAccountingOrder(
21
+ request: operations.CreateAccountingOrderRequest,
22
+ options?: RequestOptions,
23
+ ): Promise<shared.AccountingOrder> {
24
+ return unwrapAsync(orderCreateAccountingOrder(
25
+ this,
26
+ request,
27
+ options,
28
+ ));
29
+ }
30
+
31
+ /**
32
+ * Retrieve an order
33
+ */
34
+ async getAccountingOrder(
35
+ request: operations.GetAccountingOrderRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<shared.AccountingOrder> {
38
+ return unwrapAsync(orderGetAccountingOrder(
39
+ this,
40
+ request,
41
+ options,
42
+ ));
43
+ }
44
+
45
+ /**
46
+ * List all orders
47
+ */
48
+ async listAccountingOrders(
49
+ request: operations.ListAccountingOrdersRequest,
50
+ options?: RequestOptions,
51
+ ): Promise<Array<shared.AccountingOrder>> {
52
+ return unwrapAsync(orderListAccountingOrders(
53
+ this,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ /**
60
+ * Update an order
61
+ */
62
+ async patchAccountingOrder(
63
+ request: operations.PatchAccountingOrderRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<shared.AccountingOrder> {
66
+ return unwrapAsync(orderPatchAccountingOrder(
67
+ this,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ /**
74
+ * Remove an order
75
+ */
76
+ async removeAccountingOrder(
77
+ request: operations.RemoveAccountingOrderRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<void> {
80
+ return unwrapAsync(orderRemoveAccountingOrder(
81
+ this,
82
+ request,
83
+ options,
84
+ ));
85
+ }
86
+
87
+ /**
88
+ * Update an order
89
+ */
90
+ async updateAccountingOrder(
91
+ request: operations.UpdateAccountingOrderRequest,
92
+ options?: RequestOptions,
93
+ ): Promise<shared.AccountingOrder> {
94
+ return unwrapAsync(orderUpdateAccountingOrder(
95
+ this,
96
+ request,
97
+ options,
98
+ ));
99
+ }
100
+ }
package/src/sdk/sdk.ts CHANGED
@@ -50,6 +50,7 @@ import { Message } from "./message.js";
50
50
  import { Messaging } from "./messaging.js";
51
51
  import { Model } from "./model.js";
52
52
  import { Note } from "./note.js";
53
+ import { Order } from "./order.js";
53
54
  import { Organization } from "./organization.js";
54
55
  import { Page } from "./page.js";
55
56
  import { Passthrough } from "./passthrough.js";
@@ -102,6 +103,11 @@ export class UnifiedTo extends ClientSDK {
102
103
  return (this._journal ??= new Journal(this._options));
103
104
  }
104
105
 
106
+ private _order?: Order;
107
+ get order(): Order {
108
+ return (this._order ??= new Order(this._options));
109
+ }
110
+
105
111
  private _organization?: Organization;
106
112
  get organization(): Organization {
107
113
  return (this._organization ??= new Organization(this._options));