@apideck/unify 0.27.0 → 0.28.1

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 (192) hide show
  1. package/README.md +5 -5
  2. package/docs/sdks/categories/README.md +12 -0
  3. package/docs/sdks/companies/README.md +4 -4
  4. package/examples/README.md +26 -0
  5. package/examples/accountingTaxRatesList.example.ts +41 -0
  6. package/examples/package-lock.json +613 -0
  7. package/examples/package.json +18 -0
  8. package/funcs/accountingCategoriesGet.d.ts.map +1 -1
  9. package/funcs/accountingCategoriesGet.js +4 -2
  10. package/funcs/accountingCategoriesGet.js.map +1 -1
  11. package/funcs/accountingCategoriesList.d.ts.map +1 -1
  12. package/funcs/accountingCategoriesList.js +4 -2
  13. package/funcs/accountingCategoriesList.js.map +1 -1
  14. package/funcs/crmCompaniesCreate.js +1 -1
  15. package/funcs/crmCompaniesCreate.js.map +1 -1
  16. package/funcs/crmCompaniesUpdate.js +1 -1
  17. package/funcs/crmCompaniesUpdate.js.map +1 -1
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +4 -4
  20. package/lib/config.js +4 -4
  21. package/models/components/balancesheetfilter.d.ts +5 -0
  22. package/models/components/balancesheetfilter.d.ts.map +1 -1
  23. package/models/components/balancesheetfilter.js +4 -0
  24. package/models/components/balancesheetfilter.js.map +1 -1
  25. package/models/components/bankaccount.d.ts +5 -0
  26. package/models/components/bankaccount.d.ts.map +1 -1
  27. package/models/components/bankaccount.js +2 -0
  28. package/models/components/bankaccount.js.map +1 -1
  29. package/models/components/bankaccount1.d.ts +123 -0
  30. package/models/components/bankaccount1.d.ts.map +1 -0
  31. package/models/components/bankaccount1.js +128 -0
  32. package/models/components/bankaccount1.js.map +1 -0
  33. package/models/components/categoriesfilter.d.ts +67 -0
  34. package/models/components/categoriesfilter.d.ts.map +1 -0
  35. package/models/components/categoriesfilter.js +82 -0
  36. package/models/components/categoriesfilter.js.map +1 -0
  37. package/models/components/category.d.ts +39 -0
  38. package/models/components/category.d.ts.map +1 -1
  39. package/models/components/category.js +26 -1
  40. package/models/components/category.js.map +1 -1
  41. package/models/components/{company.d.ts → company1.d.ts} +32 -32
  42. package/models/components/company1.d.ts.map +1 -0
  43. package/models/components/{company.js → company1.js} +37 -37
  44. package/models/components/company1.js.map +1 -0
  45. package/models/components/companyinfo.d.ts +5 -0
  46. package/models/components/companyinfo.d.ts.map +1 -1
  47. package/models/components/companyinfo.js +4 -0
  48. package/models/components/companyinfo.js.map +1 -1
  49. package/models/components/connection.d.ts +13 -13
  50. package/models/components/connection.d.ts.map +1 -1
  51. package/models/components/connection.js +16 -17
  52. package/models/components/connection.js.map +1 -1
  53. package/models/components/customfield.d.ts +37 -38
  54. package/models/components/customfield.d.ts.map +1 -1
  55. package/models/components/customfield.js +25 -54
  56. package/models/components/customfield.js.map +1 -1
  57. package/models/components/getcompaniesresponse.d.ts +3 -3
  58. package/models/components/getcompaniesresponse.d.ts.map +1 -1
  59. package/models/components/getcompaniesresponse.js +3 -3
  60. package/models/components/getcompaniesresponse.js.map +1 -1
  61. package/models/components/getcompanyresponse.d.ts +3 -3
  62. package/models/components/getcompanyresponse.d.ts.map +1 -1
  63. package/models/components/getcompanyresponse.js +3 -3
  64. package/models/components/getcompanyresponse.js.map +1 -1
  65. package/models/components/index.d.ts +3 -1
  66. package/models/components/index.d.ts.map +1 -1
  67. package/models/components/index.js +3 -1
  68. package/models/components/index.js.map +1 -1
  69. package/models/components/invoicelineitem.d.ts +10 -0
  70. package/models/components/invoicelineitem.d.ts.map +1 -1
  71. package/models/components/invoicelineitem.js +8 -0
  72. package/models/components/invoicelineitem.js.map +1 -1
  73. package/models/components/profitandlossfilter.d.ts +5 -0
  74. package/models/components/profitandlossfilter.d.ts.map +1 -1
  75. package/models/components/profitandlossfilter.js +4 -0
  76. package/models/components/profitandlossfilter.js.map +1 -1
  77. package/models/components/simpleformfieldoption.d.ts +13 -13
  78. package/models/components/simpleformfieldoption.d.ts.map +1 -1
  79. package/models/components/simpleformfieldoption.js +16 -16
  80. package/models/components/simpleformfieldoption.js.map +1 -1
  81. package/models/components/supplier.d.ts +10 -0
  82. package/models/components/supplier.d.ts.map +1 -1
  83. package/models/components/supplier.js +4 -0
  84. package/models/components/supplier.js.map +1 -1
  85. package/models/errors/apierror.d.ts.map +1 -1
  86. package/models/errors/apierror.js +8 -2
  87. package/models/errors/apierror.js.map +1 -1
  88. package/models/errors/badrequestresponse.js +1 -1
  89. package/models/errors/badrequestresponse.js.map +1 -1
  90. package/models/errors/notfoundresponse.js +1 -1
  91. package/models/errors/notfoundresponse.js.map +1 -1
  92. package/models/errors/paymentrequiredresponse.js +1 -1
  93. package/models/errors/paymentrequiredresponse.js.map +1 -1
  94. package/models/errors/unauthorizedresponse.js +1 -1
  95. package/models/errors/unauthorizedresponse.js.map +1 -1
  96. package/models/errors/unprocessableresponse.js +1 -1
  97. package/models/errors/unprocessableresponse.js.map +1 -1
  98. package/models/operations/accountingcategoriesall.d.ts +5 -0
  99. package/models/operations/accountingcategoriesall.d.ts.map +1 -1
  100. package/models/operations/accountingcategoriesall.js +2 -0
  101. package/models/operations/accountingcategoriesall.js.map +1 -1
  102. package/models/operations/accountingcategoriesone.d.ts +5 -0
  103. package/models/operations/accountingcategoriesone.d.ts.map +1 -1
  104. package/models/operations/accountingcategoriesone.js +2 -0
  105. package/models/operations/accountingcategoriesone.js.map +1 -1
  106. package/models/operations/crmcompaniesadd.d.ts +2 -2
  107. package/models/operations/crmcompaniesadd.d.ts.map +1 -1
  108. package/models/operations/crmcompaniesadd.js +4 -4
  109. package/models/operations/crmcompaniesadd.js.map +1 -1
  110. package/models/operations/crmcompaniesupdate.d.ts +2 -2
  111. package/models/operations/crmcompaniesupdate.d.ts.map +1 -1
  112. package/models/operations/crmcompaniesupdate.js +4 -4
  113. package/models/operations/crmcompaniesupdate.js.map +1 -1
  114. package/package.json +2 -2
  115. package/src/__tests__/activities.test.ts +364 -13
  116. package/src/__tests__/apideckcompanies.test.ts +373 -9
  117. package/src/__tests__/apideckdepartments.test.ts +181 -9
  118. package/src/__tests__/applicants.test.ts +473 -9
  119. package/src/__tests__/applications.test.ts +189 -9
  120. package/src/__tests__/bankfeedaccounts.test.ts +4 -4
  121. package/src/__tests__/billpayments.test.ts +378 -20
  122. package/src/__tests__/bills.test.ts +500 -9
  123. package/src/__tests__/collectionticketcomments.test.ts +183 -7
  124. package/src/__tests__/collectiontickets.test.ts +191 -7
  125. package/src/__tests__/companies.test.ts +607 -78
  126. package/src/__tests__/connections.test.ts +409 -5
  127. package/src/__tests__/connectionsettings.test.ts +410 -5
  128. package/src/__tests__/contacts.test.ts +470 -13
  129. package/src/__tests__/creditnotes.test.ts +819 -148
  130. package/src/__tests__/customers.test.ts +517 -13
  131. package/src/__tests__/customobjects.test.ts +150 -9
  132. package/src/__tests__/customobjectschemas.test.ts +321 -9
  133. package/src/__tests__/departments.test.ts +173 -9
  134. package/src/__tests__/drivegroups.test.ts +181 -9
  135. package/src/__tests__/drives.test.ts +179 -9
  136. package/src/__tests__/employees.test.ts +829 -94
  137. package/src/__tests__/expenses.test.ts +338 -15
  138. package/src/__tests__/files.test.ts +106 -5
  139. package/src/__tests__/folders.test.ts +296 -13
  140. package/src/__tests__/invoiceitems.test.ts +272 -9
  141. package/src/__tests__/invoices.test.ts +695 -89
  142. package/src/__tests__/journalentries.test.ts +490 -8
  143. package/src/__tests__/leads.test.ts +450 -13
  144. package/src/__tests__/ledgeraccounts.test.ts +248 -19
  145. package/src/__tests__/locations.test.ts +298 -9
  146. package/src/__tests__/messages.test.ts +195 -9
  147. package/src/__tests__/notes.test.ts +191 -9
  148. package/src/__tests__/opportunities.test.ts +218 -9
  149. package/src/__tests__/payments.test.ts +323 -20
  150. package/src/__tests__/pipelines.test.ts +194 -9
  151. package/src/__tests__/purchaseorders.test.ts +847 -178
  152. package/src/__tests__/sharedlinks.test.ts +183 -9
  153. package/src/__tests__/subsidiaries.test.ts +183 -9
  154. package/src/__tests__/suppliers.test.ts +509 -13
  155. package/src/__tests__/taxrates.test.ts +235 -12
  156. package/src/__tests__/timeoffrequests.test.ts +210 -9
  157. package/src/__tests__/trackingcategories.test.ts +187 -7
  158. package/src/__tests__/uploadsessions.test.ts +78 -5
  159. package/src/__tests__/users.test.ts +356 -9
  160. package/src/funcs/accountingCategoriesGet.ts +15 -5
  161. package/src/funcs/accountingCategoriesList.ts +17 -7
  162. package/src/funcs/crmCompaniesCreate.ts +1 -1
  163. package/src/funcs/crmCompaniesUpdate.ts +1 -1
  164. package/src/lib/config.ts +4 -4
  165. package/src/models/components/balancesheetfilter.ts +9 -0
  166. package/src/models/components/bankaccount.ts +7 -0
  167. package/src/models/components/bankaccount1.ts +207 -0
  168. package/src/models/components/categoriesfilter.ts +104 -0
  169. package/src/models/components/category.ts +39 -0
  170. package/src/models/components/{company.ts → company1.ts} +131 -128
  171. package/src/models/components/companyinfo.ts +9 -0
  172. package/src/models/components/connection.ts +27 -20
  173. package/src/models/components/customfield.ts +51 -83
  174. package/src/models/components/getcompaniesresponse.ts +9 -9
  175. package/src/models/components/getcompanyresponse.ts +9 -9
  176. package/src/models/components/index.ts +3 -1
  177. package/src/models/components/invoicelineitem.ts +18 -0
  178. package/src/models/components/profitandlossfilter.ts +9 -0
  179. package/src/models/components/simpleformfieldoption.ts +21 -18
  180. package/src/models/components/supplier.ts +14 -0
  181. package/src/models/errors/apierror.ts +8 -2
  182. package/src/models/errors/badrequestresponse.ts +1 -1
  183. package/src/models/errors/notfoundresponse.ts +1 -1
  184. package/src/models/errors/paymentrequiredresponse.ts +1 -1
  185. package/src/models/errors/unauthorizedresponse.ts +1 -1
  186. package/src/models/errors/unprocessableresponse.ts +1 -1
  187. package/src/models/operations/accountingcategoriesall.ts +7 -0
  188. package/src/models/operations/accountingcategoriesone.ts +7 -0
  189. package/src/models/operations/crmcompaniesadd.ts +6 -6
  190. package/src/models/operations/crmcompaniesupdate.ts +6 -6
  191. package/models/components/company.d.ts.map +0 -1
  192. package/models/components/company.js.map +0 -1
@@ -3,7 +3,12 @@
3
3
  */
4
4
 
5
5
  import { ApideckCore } from "../core.js";
6
- import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
6
+ import {
7
+ encodeDeepObjectQuery,
8
+ encodeFormQuery,
9
+ encodeSimple,
10
+ queryJoin,
11
+ } from "../lib/encodings.js";
7
12
  import * as M from "../lib/matchers.js";
8
13
  import { compactMap } from "../lib/primitives.js";
9
14
  import { safeParse } from "../lib/schemas.js";
@@ -106,10 +111,15 @@ async function $do(
106
111
 
107
112
  const path = pathToFunc("/accounting/categories/{id}")(pathParams);
108
113
 
109
- const query = encodeFormQuery({
110
- "fields": payload.fields,
111
- "raw": payload.raw,
112
- });
114
+ const query = queryJoin(
115
+ encodeDeepObjectQuery({
116
+ "filter": payload.filter,
117
+ }),
118
+ encodeFormQuery({
119
+ "fields": payload.fields,
120
+ "raw": payload.raw,
121
+ }),
122
+ );
113
123
 
114
124
  const headers = new Headers(compactMap({
115
125
  Accept: "application/json",
@@ -4,7 +4,12 @@
4
4
 
5
5
  import { ApideckCore } from "../core.js";
6
6
  import { dlv } from "../lib/dlv.js";
7
- import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import {
8
+ encodeDeepObjectQuery,
9
+ encodeFormQuery,
10
+ encodeSimple,
11
+ queryJoin,
12
+ } from "../lib/encodings.js";
8
13
  import * as M from "../lib/matchers.js";
9
14
  import { compactMap } from "../lib/primitives.js";
10
15
  import { safeParse } from "../lib/schemas.js";
@@ -112,12 +117,17 @@ async function $do(
112
117
 
113
118
  const path = pathToFunc("/accounting/categories")();
114
119
 
115
- const query = encodeFormQuery({
116
- "cursor": payload.cursor,
117
- "fields": payload.fields,
118
- "limit": payload.limit,
119
- "raw": payload.raw,
120
- });
120
+ const query = queryJoin(
121
+ encodeDeepObjectQuery({
122
+ "filter": payload.filter,
123
+ }),
124
+ encodeFormQuery({
125
+ "cursor": payload.cursor,
126
+ "fields": payload.fields,
127
+ "limit": payload.limit,
128
+ "raw": payload.raw,
129
+ }),
130
+ );
121
131
 
122
132
  const headers = new Headers(compactMap({
123
133
  Accept: "application/json",
@@ -94,7 +94,7 @@ async function $do(
94
94
  return [parsed, { status: "invalid" }];
95
95
  }
96
96
  const payload = parsed.value;
97
- const body = encodeJSON("body", payload.Company, { explode: true });
97
+ const body = encodeJSON("body", payload.Company1, { explode: true });
98
98
 
99
99
  const path = pathToFunc("/crm/companies")();
100
100
 
@@ -94,7 +94,7 @@ async function $do(
94
94
  return [parsed, { status: "invalid" }];
95
95
  }
96
96
  const payload = parsed.value;
97
- const body = encodeJSON("body", payload.Company, { explode: true });
97
+ const body = encodeJSON("body", payload.Company1, { explode: true });
98
98
 
99
99
  const pathParams = {
100
100
  id: encodeSimple("id", payload.id, {
package/src/lib/config.ts CHANGED
@@ -67,8 +67,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
67
67
 
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
- openapiDocVersion: "10.18.0",
71
- sdkVersion: "0.27.0",
72
- genVersion: "2.638.1",
73
- userAgent: "speakeasy-sdk/typescript 0.27.0 2.638.1 10.18.0 @apideck/unify",
70
+ openapiDocVersion: "10.18.2",
71
+ sdkVersion: "0.28.1",
72
+ genVersion: "2.656.3",
73
+ userAgent: "speakeasy-sdk/typescript 0.28.1 2.656.3 10.18.2 @apideck/unify",
74
74
  } as const;
@@ -41,6 +41,10 @@ export type BalanceSheetFilter = {
41
41
  * The type of period to include in the resource: month, quarter, year.
42
42
  */
43
43
  periodType?: PeriodType | undefined;
44
+ /**
45
+ * The ID of the location to include in the resource.
46
+ */
47
+ locationId?: string | undefined;
44
48
  };
45
49
 
46
50
  /** @internal */
@@ -72,12 +76,14 @@ export const BalanceSheetFilter$inboundSchema: z.ZodType<
72
76
  end_date: z.string().optional(),
73
77
  period_count: z.number().int().optional(),
74
78
  period_type: PeriodType$inboundSchema.optional(),
79
+ location_id: z.string().optional(),
75
80
  }).transform((v) => {
76
81
  return remap$(v, {
77
82
  "start_date": "startDate",
78
83
  "end_date": "endDate",
79
84
  "period_count": "periodCount",
80
85
  "period_type": "periodType",
86
+ "location_id": "locationId",
81
87
  });
82
88
  });
83
89
 
@@ -87,6 +93,7 @@ export type BalanceSheetFilter$Outbound = {
87
93
  end_date?: string | undefined;
88
94
  period_count?: number | undefined;
89
95
  period_type?: string | undefined;
96
+ location_id?: string | undefined;
90
97
  };
91
98
 
92
99
  /** @internal */
@@ -99,12 +106,14 @@ export const BalanceSheetFilter$outboundSchema: z.ZodType<
99
106
  endDate: z.string().optional(),
100
107
  periodCount: z.number().int().optional(),
101
108
  periodType: PeriodType$outboundSchema.optional(),
109
+ locationId: z.string().optional(),
102
110
  }).transform((v) => {
103
111
  return remap$(v, {
104
112
  startDate: "start_date",
105
113
  endDate: "end_date",
106
114
  periodCount: "period_count",
107
115
  periodType: "period_type",
116
+ locationId: "location_id",
108
117
  });
109
118
  });
110
119
 
@@ -72,6 +72,10 @@ export type BankAccount = {
72
72
  * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).
73
73
  */
74
74
  currency?: Currency | null | undefined;
75
+ /**
76
+ * Country code according to ISO 3166-1 alpha-2.
77
+ */
78
+ country?: string | null | undefined;
75
79
  };
76
80
 
77
81
  /** @internal */
@@ -110,6 +114,7 @@ export const BankAccount$inboundSchema: z.ZodType<
110
114
  branch_identifier: z.nullable(z.string()).optional(),
111
115
  bank_code: z.nullable(z.string()).optional(),
112
116
  currency: z.nullable(Currency$inboundSchema).optional(),
117
+ country: z.nullable(z.string()).optional(),
113
118
  }).transform((v) => {
114
119
  return remap$(v, {
115
120
  "bank_name": "bankName",
@@ -136,6 +141,7 @@ export type BankAccount$Outbound = {
136
141
  branch_identifier?: string | null | undefined;
137
142
  bank_code?: string | null | undefined;
138
143
  currency?: string | null | undefined;
144
+ country?: string | null | undefined;
139
145
  };
140
146
 
141
147
  /** @internal */
@@ -155,6 +161,7 @@ export const BankAccount$outboundSchema: z.ZodType<
155
161
  branchIdentifier: z.nullable(z.string()).optional(),
156
162
  bankCode: z.nullable(z.string()).optional(),
157
163
  currency: z.nullable(Currency$outboundSchema).optional(),
164
+ country: z.nullable(z.string()).optional(),
158
165
  }).transform((v) => {
159
166
  return remap$(v, {
160
167
  bankName: "bank_name",
@@ -0,0 +1,207 @@
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 { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ Currency,
13
+ Currency$inboundSchema,
14
+ Currency$outboundSchema,
15
+ } from "./currency.js";
16
+
17
+ /**
18
+ * The type of bank account.
19
+ */
20
+ export const BankAccount1AccountType = {
21
+ BankAccount: "bank_account",
22
+ CreditCard: "credit_card",
23
+ Other: "other",
24
+ } as const;
25
+ /**
26
+ * The type of bank account.
27
+ */
28
+ export type BankAccount1AccountType = ClosedEnum<
29
+ typeof BankAccount1AccountType
30
+ >;
31
+
32
+ export type BankAccount1 = {
33
+ /**
34
+ * The name of the bank
35
+ */
36
+ bankName?: string | null | undefined;
37
+ /**
38
+ * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number.
39
+ */
40
+ accountNumber?: string | null | undefined;
41
+ /**
42
+ * The name which you used in opening your bank account.
43
+ */
44
+ accountName?: string | null | undefined;
45
+ /**
46
+ * The type of bank account.
47
+ */
48
+ accountType?: BankAccount1AccountType | null | undefined;
49
+ /**
50
+ * The International Bank Account Number (IBAN).
51
+ */
52
+ iban?: string | null | undefined;
53
+ /**
54
+ * The Bank Identifier Code (BIC).
55
+ */
56
+ bic?: string | null | undefined;
57
+ /**
58
+ * A routing number is a nine-digit code used to identify a financial institution in the United States.
59
+ */
60
+ routingNumber?: string | null | undefined;
61
+ /**
62
+ * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution.
63
+ */
64
+ bsbNumber?: string | null | undefined;
65
+ /**
66
+ * A branch identifier is a unique identifier for a branch of a bank or financial institution.
67
+ */
68
+ branchIdentifier?: string | null | undefined;
69
+ /**
70
+ * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions.
71
+ */
72
+ bankCode?: string | null | undefined;
73
+ /**
74
+ * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).
75
+ */
76
+ currency?: Currency | null | undefined;
77
+ /**
78
+ * Country code according to ISO 3166-1 alpha-2.
79
+ */
80
+ country?: string | null | undefined;
81
+ };
82
+
83
+ /** @internal */
84
+ export const BankAccount1AccountType$inboundSchema: z.ZodNativeEnum<
85
+ typeof BankAccount1AccountType
86
+ > = z.nativeEnum(BankAccount1AccountType);
87
+
88
+ /** @internal */
89
+ export const BankAccount1AccountType$outboundSchema: z.ZodNativeEnum<
90
+ typeof BankAccount1AccountType
91
+ > = BankAccount1AccountType$inboundSchema;
92
+
93
+ /**
94
+ * @internal
95
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
96
+ */
97
+ export namespace BankAccount1AccountType$ {
98
+ /** @deprecated use `BankAccount1AccountType$inboundSchema` instead. */
99
+ export const inboundSchema = BankAccount1AccountType$inboundSchema;
100
+ /** @deprecated use `BankAccount1AccountType$outboundSchema` instead. */
101
+ export const outboundSchema = BankAccount1AccountType$outboundSchema;
102
+ }
103
+
104
+ /** @internal */
105
+ export const BankAccount1$inboundSchema: z.ZodType<
106
+ BankAccount1,
107
+ z.ZodTypeDef,
108
+ unknown
109
+ > = z.object({
110
+ bank_name: z.nullable(z.string()).optional(),
111
+ account_number: z.nullable(z.string()).optional(),
112
+ account_name: z.nullable(z.string()).optional(),
113
+ account_type: z.nullable(BankAccount1AccountType$inboundSchema).optional(),
114
+ iban: z.nullable(z.string()).optional(),
115
+ bic: z.nullable(z.string()).optional(),
116
+ routing_number: z.nullable(z.string()).optional(),
117
+ bsb_number: z.nullable(z.string()).optional(),
118
+ branch_identifier: z.nullable(z.string()).optional(),
119
+ bank_code: z.nullable(z.string()).optional(),
120
+ currency: z.nullable(Currency$inboundSchema).optional(),
121
+ country: z.nullable(z.string()).optional(),
122
+ }).transform((v) => {
123
+ return remap$(v, {
124
+ "bank_name": "bankName",
125
+ "account_number": "accountNumber",
126
+ "account_name": "accountName",
127
+ "account_type": "accountType",
128
+ "routing_number": "routingNumber",
129
+ "bsb_number": "bsbNumber",
130
+ "branch_identifier": "branchIdentifier",
131
+ "bank_code": "bankCode",
132
+ });
133
+ });
134
+
135
+ /** @internal */
136
+ export type BankAccount1$Outbound = {
137
+ bank_name?: string | null | undefined;
138
+ account_number?: string | null | undefined;
139
+ account_name?: string | null | undefined;
140
+ account_type?: string | null | undefined;
141
+ iban?: string | null | undefined;
142
+ bic?: string | null | undefined;
143
+ routing_number?: string | null | undefined;
144
+ bsb_number?: string | null | undefined;
145
+ branch_identifier?: string | null | undefined;
146
+ bank_code?: string | null | undefined;
147
+ currency?: string | null | undefined;
148
+ country?: string | null | undefined;
149
+ };
150
+
151
+ /** @internal */
152
+ export const BankAccount1$outboundSchema: z.ZodType<
153
+ BankAccount1$Outbound,
154
+ z.ZodTypeDef,
155
+ BankAccount1
156
+ > = z.object({
157
+ bankName: z.nullable(z.string()).optional(),
158
+ accountNumber: z.nullable(z.string()).optional(),
159
+ accountName: z.nullable(z.string()).optional(),
160
+ accountType: z.nullable(BankAccount1AccountType$outboundSchema).optional(),
161
+ iban: z.nullable(z.string()).optional(),
162
+ bic: z.nullable(z.string()).optional(),
163
+ routingNumber: z.nullable(z.string()).optional(),
164
+ bsbNumber: z.nullable(z.string()).optional(),
165
+ branchIdentifier: z.nullable(z.string()).optional(),
166
+ bankCode: z.nullable(z.string()).optional(),
167
+ currency: z.nullable(Currency$outboundSchema).optional(),
168
+ country: z.nullable(z.string()).optional(),
169
+ }).transform((v) => {
170
+ return remap$(v, {
171
+ bankName: "bank_name",
172
+ accountNumber: "account_number",
173
+ accountName: "account_name",
174
+ accountType: "account_type",
175
+ routingNumber: "routing_number",
176
+ bsbNumber: "bsb_number",
177
+ branchIdentifier: "branch_identifier",
178
+ bankCode: "bank_code",
179
+ });
180
+ });
181
+
182
+ /**
183
+ * @internal
184
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
185
+ */
186
+ export namespace BankAccount1$ {
187
+ /** @deprecated use `BankAccount1$inboundSchema` instead. */
188
+ export const inboundSchema = BankAccount1$inboundSchema;
189
+ /** @deprecated use `BankAccount1$outboundSchema` instead. */
190
+ export const outboundSchema = BankAccount1$outboundSchema;
191
+ /** @deprecated use `BankAccount1$Outbound` instead. */
192
+ export type Outbound = BankAccount1$Outbound;
193
+ }
194
+
195
+ export function bankAccount1ToJSON(bankAccount1: BankAccount1): string {
196
+ return JSON.stringify(BankAccount1$outboundSchema.parse(bankAccount1));
197
+ }
198
+
199
+ export function bankAccount1FromJSON(
200
+ jsonString: string,
201
+ ): SafeParseResult<BankAccount1, SDKValidationError> {
202
+ return safeParse(
203
+ jsonString,
204
+ (x) => BankAccount1$inboundSchema.parse(JSON.parse(x)),
205
+ `Failed to parse 'BankAccount1' from JSON`,
206
+ );
207
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The type of the category.
13
+ */
14
+ export const CategoriesFilterType = {
15
+ Supplier: "supplier",
16
+ Expense: "expense",
17
+ Revenue: "revenue",
18
+ } as const;
19
+ /**
20
+ * The type of the category.
21
+ */
22
+ export type CategoriesFilterType = ClosedEnum<typeof CategoriesFilterType>;
23
+
24
+ export type CategoriesFilter = {
25
+ /**
26
+ * The type of the category.
27
+ */
28
+ type?: CategoriesFilterType | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const CategoriesFilterType$inboundSchema: z.ZodNativeEnum<
33
+ typeof CategoriesFilterType
34
+ > = z.nativeEnum(CategoriesFilterType);
35
+
36
+ /** @internal */
37
+ export const CategoriesFilterType$outboundSchema: z.ZodNativeEnum<
38
+ typeof CategoriesFilterType
39
+ > = CategoriesFilterType$inboundSchema;
40
+
41
+ /**
42
+ * @internal
43
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
44
+ */
45
+ export namespace CategoriesFilterType$ {
46
+ /** @deprecated use `CategoriesFilterType$inboundSchema` instead. */
47
+ export const inboundSchema = CategoriesFilterType$inboundSchema;
48
+ /** @deprecated use `CategoriesFilterType$outboundSchema` instead. */
49
+ export const outboundSchema = CategoriesFilterType$outboundSchema;
50
+ }
51
+
52
+ /** @internal */
53
+ export const CategoriesFilter$inboundSchema: z.ZodType<
54
+ CategoriesFilter,
55
+ z.ZodTypeDef,
56
+ unknown
57
+ > = z.object({
58
+ type: CategoriesFilterType$inboundSchema.optional(),
59
+ });
60
+
61
+ /** @internal */
62
+ export type CategoriesFilter$Outbound = {
63
+ type?: string | undefined;
64
+ };
65
+
66
+ /** @internal */
67
+ export const CategoriesFilter$outboundSchema: z.ZodType<
68
+ CategoriesFilter$Outbound,
69
+ z.ZodTypeDef,
70
+ CategoriesFilter
71
+ > = z.object({
72
+ type: CategoriesFilterType$outboundSchema.optional(),
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 CategoriesFilter$ {
80
+ /** @deprecated use `CategoriesFilter$inboundSchema` instead. */
81
+ export const inboundSchema = CategoriesFilter$inboundSchema;
82
+ /** @deprecated use `CategoriesFilter$outboundSchema` instead. */
83
+ export const outboundSchema = CategoriesFilter$outboundSchema;
84
+ /** @deprecated use `CategoriesFilter$Outbound` instead. */
85
+ export type Outbound = CategoriesFilter$Outbound;
86
+ }
87
+
88
+ export function categoriesFilterToJSON(
89
+ categoriesFilter: CategoriesFilter,
90
+ ): string {
91
+ return JSON.stringify(
92
+ CategoriesFilter$outboundSchema.parse(categoriesFilter),
93
+ );
94
+ }
95
+
96
+ export function categoriesFilterFromJSON(
97
+ jsonString: string,
98
+ ): SafeParseResult<CategoriesFilter, SDKValidationError> {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) => CategoriesFilter$inboundSchema.parse(JSON.parse(x)),
102
+ `Failed to parse 'CategoriesFilter' from JSON`,
103
+ );
104
+ }
@@ -15,6 +15,19 @@ import {
15
15
  PassThroughBody$outboundSchema,
16
16
  } from "./passthroughbody.js";
17
17
 
18
+ /**
19
+ * The type of the category.
20
+ */
21
+ export const CategoryType = {
22
+ Supplier: "supplier",
23
+ Expense: "expense",
24
+ Revenue: "revenue",
25
+ } as const;
26
+ /**
27
+ * The type of the category.
28
+ */
29
+ export type CategoryType = ClosedEnum<typeof CategoryType>;
30
+
18
31
  /**
19
32
  * Based on the status some functionality is enabled or disabled.
20
33
  */
@@ -36,6 +49,10 @@ export type Category = {
36
49
  * The name of the category.
37
50
  */
38
51
  name?: string | undefined;
52
+ /**
53
+ * The type of the category.
54
+ */
55
+ type?: CategoryType | undefined;
39
56
  /**
40
57
  * Based on the status some functionality is enabled or disabled.
41
58
  */
@@ -70,6 +87,25 @@ export type Category = {
70
87
  passThrough?: Array<PassThroughBody> | undefined;
71
88
  };
72
89
 
90
+ /** @internal */
91
+ export const CategoryType$inboundSchema: z.ZodNativeEnum<typeof CategoryType> =
92
+ z.nativeEnum(CategoryType);
93
+
94
+ /** @internal */
95
+ export const CategoryType$outboundSchema: z.ZodNativeEnum<typeof CategoryType> =
96
+ CategoryType$inboundSchema;
97
+
98
+ /**
99
+ * @internal
100
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
+ */
102
+ export namespace CategoryType$ {
103
+ /** @deprecated use `CategoryType$inboundSchema` instead. */
104
+ export const inboundSchema = CategoryType$inboundSchema;
105
+ /** @deprecated use `CategoryType$outboundSchema` instead. */
106
+ export const outboundSchema = CategoryType$outboundSchema;
107
+ }
108
+
73
109
  /** @internal */
74
110
  export const CategoryStatus$inboundSchema: z.ZodNativeEnum<
75
111
  typeof CategoryStatus
@@ -99,6 +135,7 @@ export const Category$inboundSchema: z.ZodType<
99
135
  > = z.object({
100
136
  id: z.string().optional(),
101
137
  name: z.string().optional(),
138
+ type: CategoryType$inboundSchema.optional(),
102
139
  status: CategoryStatus$inboundSchema.optional(),
103
140
  custom_mappings: z.nullable(z.record(z.any())).optional(),
104
141
  row_version: z.nullable(z.string()).optional(),
@@ -127,6 +164,7 @@ export const Category$inboundSchema: z.ZodType<
127
164
  export type Category$Outbound = {
128
165
  id?: string | undefined;
129
166
  name?: string | undefined;
167
+ type?: string | undefined;
130
168
  status?: string | undefined;
131
169
  custom_mappings?: { [k: string]: any } | null | undefined;
132
170
  row_version?: string | null | undefined;
@@ -145,6 +183,7 @@ export const Category$outboundSchema: z.ZodType<
145
183
  > = z.object({
146
184
  id: z.string().optional(),
147
185
  name: z.string().optional(),
186
+ type: CategoryType$outboundSchema.optional(),
148
187
  status: CategoryStatus$outboundSchema.optional(),
149
188
  customMappings: z.nullable(z.record(z.any())).optional(),
150
189
  rowVersion: z.nullable(z.string()).optional(),