@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
@@ -7,17 +7,14 @@ import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
- export type Six = {};
11
-
12
- export type Four = {};
10
+ export type Five = string | number | boolean | { [k: string]: any };
13
11
 
14
12
  export type Value =
15
- | Four
16
13
  | string
17
14
  | number
18
15
  | boolean
19
- | Array<string>
20
- | Array<Six>;
16
+ | { [k: string]: any }
17
+ | Array<string | number | boolean | { [k: string]: any } | null>;
21
18
 
22
19
  export type CustomField = {
23
20
  /**
@@ -33,111 +30,74 @@ export type CustomField = {
33
30
  */
34
31
  description?: string | null | undefined;
35
32
  value?:
36
- | Four
37
33
  | string
38
34
  | number
39
35
  | boolean
40
- | Array<string>
41
- | Array<Six>
36
+ | { [k: string]: any }
37
+ | Array<string | number | boolean | { [k: string]: any } | null>
42
38
  | null
43
39
  | undefined;
44
40
  };
45
41
 
46
42
  /** @internal */
47
- export const Six$inboundSchema: z.ZodType<Six, z.ZodTypeDef, unknown> = z
48
- .object({});
49
-
50
- /** @internal */
51
- export type Six$Outbound = {};
52
-
53
- /** @internal */
54
- export const Six$outboundSchema: z.ZodType<Six$Outbound, z.ZodTypeDef, Six> = z
55
- .object({});
56
-
57
- /**
58
- * @internal
59
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
60
- */
61
- export namespace Six$ {
62
- /** @deprecated use `Six$inboundSchema` instead. */
63
- export const inboundSchema = Six$inboundSchema;
64
- /** @deprecated use `Six$outboundSchema` instead. */
65
- export const outboundSchema = Six$outboundSchema;
66
- /** @deprecated use `Six$Outbound` instead. */
67
- export type Outbound = Six$Outbound;
68
- }
69
-
70
- export function sixToJSON(six: Six): string {
71
- return JSON.stringify(Six$outboundSchema.parse(six));
72
- }
73
-
74
- export function sixFromJSON(
75
- jsonString: string,
76
- ): SafeParseResult<Six, SDKValidationError> {
77
- return safeParse(
78
- jsonString,
79
- (x) => Six$inboundSchema.parse(JSON.parse(x)),
80
- `Failed to parse 'Six' from JSON`,
81
- );
82
- }
83
-
84
- /** @internal */
85
- export const Four$inboundSchema: z.ZodType<Four, z.ZodTypeDef, unknown> = z
86
- .object({});
43
+ export const Five$inboundSchema: z.ZodType<Five, z.ZodTypeDef, unknown> = z
44
+ .union([z.string(), z.number(), z.boolean(), z.record(z.any())]);
87
45
 
88
46
  /** @internal */
89
- export type Four$Outbound = {};
47
+ export type Five$Outbound = string | number | boolean | { [k: string]: any };
90
48
 
91
49
  /** @internal */
92
- export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
93
- z.object({});
50
+ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
51
+ z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]);
94
52
 
95
53
  /**
96
54
  * @internal
97
55
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
98
56
  */
99
- export namespace Four$ {
100
- /** @deprecated use `Four$inboundSchema` instead. */
101
- export const inboundSchema = Four$inboundSchema;
102
- /** @deprecated use `Four$outboundSchema` instead. */
103
- export const outboundSchema = Four$outboundSchema;
104
- /** @deprecated use `Four$Outbound` instead. */
105
- export type Outbound = Four$Outbound;
57
+ export namespace Five$ {
58
+ /** @deprecated use `Five$inboundSchema` instead. */
59
+ export const inboundSchema = Five$inboundSchema;
60
+ /** @deprecated use `Five$outboundSchema` instead. */
61
+ export const outboundSchema = Five$outboundSchema;
62
+ /** @deprecated use `Five$Outbound` instead. */
63
+ export type Outbound = Five$Outbound;
106
64
  }
107
65
 
108
- export function fourToJSON(four: Four): string {
109
- return JSON.stringify(Four$outboundSchema.parse(four));
66
+ export function fiveToJSON(five: Five): string {
67
+ return JSON.stringify(Five$outboundSchema.parse(five));
110
68
  }
111
69
 
112
- export function fourFromJSON(
70
+ export function fiveFromJSON(
113
71
  jsonString: string,
114
- ): SafeParseResult<Four, SDKValidationError> {
72
+ ): SafeParseResult<Five, SDKValidationError> {
115
73
  return safeParse(
116
74
  jsonString,
117
- (x) => Four$inboundSchema.parse(JSON.parse(x)),
118
- `Failed to parse 'Four' from JSON`,
75
+ (x) => Five$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'Five' from JSON`,
119
77
  );
120
78
  }
121
79
 
122
80
  /** @internal */
123
81
  export const Value$inboundSchema: z.ZodType<Value, z.ZodTypeDef, unknown> = z
124
82
  .union([
125
- z.lazy(() => Four$inboundSchema),
126
83
  z.string(),
127
84
  z.number(),
128
85
  z.boolean(),
129
- z.array(z.string()),
130
- z.array(z.lazy(() => Six$inboundSchema)),
86
+ z.record(z.any()),
87
+ z.array(
88
+ z.nullable(
89
+ z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
90
+ ),
91
+ ),
131
92
  ]);
132
93
 
133
94
  /** @internal */
134
95
  export type Value$Outbound =
135
- | Four$Outbound
136
96
  | string
137
97
  | number
138
98
  | boolean
139
- | Array<string>
140
- | Array<Six$Outbound>;
99
+ | { [k: string]: any }
100
+ | Array<string | number | boolean | { [k: string]: any } | null>;
141
101
 
142
102
  /** @internal */
143
103
  export const Value$outboundSchema: z.ZodType<
@@ -145,12 +105,15 @@ export const Value$outboundSchema: z.ZodType<
145
105
  z.ZodTypeDef,
146
106
  Value
147
107
  > = z.union([
148
- z.lazy(() => Four$outboundSchema),
149
108
  z.string(),
150
109
  z.number(),
151
110
  z.boolean(),
152
- z.array(z.string()),
153
- z.array(z.lazy(() => Six$outboundSchema)),
111
+ z.record(z.any()),
112
+ z.array(
113
+ z.nullable(
114
+ z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
115
+ ),
116
+ ),
154
117
  ]);
155
118
 
156
119
  /**
@@ -191,12 +154,15 @@ export const CustomField$inboundSchema: z.ZodType<
191
154
  description: z.nullable(z.string()).optional(),
192
155
  value: z.nullable(
193
156
  z.union([
194
- z.lazy(() => Four$inboundSchema),
195
157
  z.string(),
196
158
  z.number(),
197
159
  z.boolean(),
198
- z.array(z.string()),
199
- z.array(z.lazy(() => Six$inboundSchema)),
160
+ z.record(z.any()),
161
+ z.array(
162
+ z.nullable(
163
+ z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
164
+ ),
165
+ ),
200
166
  ]),
201
167
  ).optional(),
202
168
  });
@@ -207,12 +173,11 @@ export type CustomField$Outbound = {
207
173
  name?: string | null | undefined;
208
174
  description?: string | null | undefined;
209
175
  value?:
210
- | Four$Outbound
211
176
  | string
212
177
  | number
213
178
  | boolean
214
- | Array<string>
215
- | Array<Six$Outbound>
179
+ | { [k: string]: any }
180
+ | Array<string | number | boolean | { [k: string]: any } | null>
216
181
  | null
217
182
  | undefined;
218
183
  };
@@ -228,12 +193,15 @@ export const CustomField$outboundSchema: z.ZodType<
228
193
  description: z.nullable(z.string()).optional(),
229
194
  value: z.nullable(
230
195
  z.union([
231
- z.lazy(() => Four$outboundSchema),
232
196
  z.string(),
233
197
  z.number(),
234
198
  z.boolean(),
235
- z.array(z.string()),
236
- z.array(z.lazy(() => Six$outboundSchema)),
199
+ z.record(z.any()),
200
+ z.array(
201
+ z.nullable(
202
+ z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
203
+ ),
204
+ ),
237
205
  ]),
238
206
  ).optional(),
239
207
  });
@@ -8,11 +8,11 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import {
11
- Company,
12
- Company$inboundSchema,
13
- Company$Outbound,
14
- Company$outboundSchema,
15
- } from "./company.js";
11
+ Company1,
12
+ Company1$inboundSchema,
13
+ Company1$Outbound,
14
+ Company1$outboundSchema,
15
+ } from "./company1.js";
16
16
  import {
17
17
  Links,
18
18
  Links$inboundSchema,
@@ -50,7 +50,7 @@ export type GetCompaniesResponse = {
50
50
  * Operation performed
51
51
  */
52
52
  operation: string;
53
- data: Array<Company>;
53
+ data: Array<Company1>;
54
54
  /**
55
55
  * Response metadata
56
56
  */
@@ -76,7 +76,7 @@ export const GetCompaniesResponse$inboundSchema: z.ZodType<
76
76
  service: z.string(),
77
77
  resource: z.string(),
78
78
  operation: z.string(),
79
- data: z.array(Company$inboundSchema),
79
+ data: z.array(Company1$inboundSchema),
80
80
  meta: Meta$inboundSchema.optional(),
81
81
  links: Links$inboundSchema.optional(),
82
82
  _raw: z.nullable(z.record(z.any())).optional(),
@@ -94,7 +94,7 @@ export type GetCompaniesResponse$Outbound = {
94
94
  service: string;
95
95
  resource: string;
96
96
  operation: string;
97
- data: Array<Company$Outbound>;
97
+ data: Array<Company1$Outbound>;
98
98
  meta?: Meta$Outbound | undefined;
99
99
  links?: Links$Outbound | undefined;
100
100
  _raw?: { [k: string]: any } | null | undefined;
@@ -111,7 +111,7 @@ export const GetCompaniesResponse$outboundSchema: z.ZodType<
111
111
  service: z.string(),
112
112
  resource: z.string(),
113
113
  operation: z.string(),
114
- data: z.array(Company$outboundSchema),
114
+ data: z.array(Company1$outboundSchema),
115
115
  meta: Meta$outboundSchema.optional(),
116
116
  links: Links$outboundSchema.optional(),
117
117
  raw: z.nullable(z.record(z.any())).optional(),
@@ -8,11 +8,11 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import {
11
- Company,
12
- Company$inboundSchema,
13
- Company$Outbound,
14
- Company$outboundSchema,
15
- } from "./company.js";
11
+ Company1,
12
+ Company1$inboundSchema,
13
+ Company1$Outbound,
14
+ Company1$outboundSchema,
15
+ } from "./company1.js";
16
16
 
17
17
  /**
18
18
  * Company
@@ -38,7 +38,7 @@ export type GetCompanyResponse = {
38
38
  * Operation performed
39
39
  */
40
40
  operation: string;
41
- data: Company;
41
+ data: Company1;
42
42
  /**
43
43
  * Raw response from the integration when raw=true query param is provided
44
44
  */
@@ -56,7 +56,7 @@ export const GetCompanyResponse$inboundSchema: z.ZodType<
56
56
  service: z.string(),
57
57
  resource: z.string(),
58
58
  operation: z.string(),
59
- data: Company$inboundSchema,
59
+ data: Company1$inboundSchema,
60
60
  _raw: z.nullable(z.record(z.any())).optional(),
61
61
  }).transform((v) => {
62
62
  return remap$(v, {
@@ -72,7 +72,7 @@ export type GetCompanyResponse$Outbound = {
72
72
  service: string;
73
73
  resource: string;
74
74
  operation: string;
75
- data: Company$Outbound;
75
+ data: Company1$Outbound;
76
76
  _raw?: { [k: string]: any } | null | undefined;
77
77
  };
78
78
 
@@ -87,7 +87,7 @@ export const GetCompanyResponse$outboundSchema: z.ZodType<
87
87
  service: z.string(),
88
88
  resource: z.string(),
89
89
  operation: z.string(),
90
- data: Company$outboundSchema,
90
+ data: Company1$outboundSchema,
91
91
  raw: z.nullable(z.record(z.any())).optional(),
92
92
  }).transform((v) => {
93
93
  return remap$(v, {
@@ -34,6 +34,7 @@ export * from "./balancebytransaction.js";
34
34
  export * from "./balancesheet.js";
35
35
  export * from "./balancesheetfilter.js";
36
36
  export * from "./bankaccount.js";
37
+ export * from "./bankaccount1.js";
37
38
  export * from "./bankfeedaccount.js";
38
39
  export * from "./bankfeedstatement.js";
39
40
  export * from "./benefit.js";
@@ -42,6 +43,7 @@ export * from "./billlineitem.js";
42
43
  export * from "./billpayment.js";
43
44
  export * from "./billsfilter.js";
44
45
  export * from "./billssort.js";
46
+ export * from "./categoriesfilter.js";
45
47
  export * from "./category.js";
46
48
  export * from "./collection.js";
47
49
  export * from "./collectionssort.js";
@@ -53,7 +55,7 @@ export * from "./collectionuser.js";
53
55
  export * from "./commentssort.js";
54
56
  export * from "./companiesfilter.js";
55
57
  export * from "./companiessort.js";
56
- export * from "./company.js";
58
+ export * from "./company1.js";
57
59
  export * from "./companyinfo.js";
58
60
  export * from "./compensation.js";
59
61
  export * from "./connection.js";
@@ -114,6 +114,10 @@ export type InvoiceLineItem = {
114
114
  * Discount amount applied to the line item when supported downstream.
115
115
  */
116
116
  discountAmount?: number | null | undefined;
117
+ /**
118
+ * ID of the category of the line item
119
+ */
120
+ categoryId?: string | null | undefined;
117
121
  /**
118
122
  * The ID of the location
119
123
  */
@@ -199,6 +203,10 @@ export type InvoiceLineItemInput = {
199
203
  * Discount amount applied to the line item when supported downstream.
200
204
  */
201
205
  discountAmount?: number | null | undefined;
206
+ /**
207
+ * ID of the category of the line item
208
+ */
209
+ categoryId?: string | null | undefined;
202
210
  /**
203
211
  * The ID of the location
204
212
  */
@@ -261,6 +269,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
261
269
  unit_of_measure: z.nullable(z.string()).optional(),
262
270
  discount_percentage: z.nullable(z.number()).optional(),
263
271
  discount_amount: z.nullable(z.number()).optional(),
272
+ category_id: z.nullable(z.string()).optional(),
264
273
  location_id: z.nullable(z.string()).optional(),
265
274
  department_id: z.nullable(z.string()).optional(),
266
275
  item: LinkedInvoiceItem$inboundSchema.optional(),
@@ -289,6 +298,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
289
298
  "unit_of_measure": "unitOfMeasure",
290
299
  "discount_percentage": "discountPercentage",
291
300
  "discount_amount": "discountAmount",
301
+ "category_id": "categoryId",
292
302
  "location_id": "locationId",
293
303
  "department_id": "departmentId",
294
304
  "tax_rate": "taxRate",
@@ -318,6 +328,7 @@ export type InvoiceLineItem$Outbound = {
318
328
  unit_of_measure?: string | null | undefined;
319
329
  discount_percentage?: number | null | undefined;
320
330
  discount_amount?: number | null | undefined;
331
+ category_id?: string | null | undefined;
321
332
  location_id?: string | null | undefined;
322
333
  department_id?: string | null | undefined;
323
334
  item?: LinkedInvoiceItem$Outbound | undefined;
@@ -354,6 +365,7 @@ export const InvoiceLineItem$outboundSchema: z.ZodType<
354
365
  unitOfMeasure: z.nullable(z.string()).optional(),
355
366
  discountPercentage: z.nullable(z.number()).optional(),
356
367
  discountAmount: z.nullable(z.number()).optional(),
368
+ categoryId: z.nullable(z.string()).optional(),
357
369
  locationId: z.nullable(z.string()).optional(),
358
370
  departmentId: z.nullable(z.string()).optional(),
359
371
  item: LinkedInvoiceItem$outboundSchema.optional(),
@@ -378,6 +390,7 @@ export const InvoiceLineItem$outboundSchema: z.ZodType<
378
390
  unitOfMeasure: "unit_of_measure",
379
391
  discountPercentage: "discount_percentage",
380
392
  discountAmount: "discount_amount",
393
+ categoryId: "category_id",
381
394
  locationId: "location_id",
382
395
  departmentId: "department_id",
383
396
  taxRate: "tax_rate",
@@ -440,6 +453,7 @@ export const InvoiceLineItemInput$inboundSchema: z.ZodType<
440
453
  unit_of_measure: z.nullable(z.string()).optional(),
441
454
  discount_percentage: z.nullable(z.number()).optional(),
442
455
  discount_amount: z.nullable(z.number()).optional(),
456
+ category_id: z.nullable(z.string()).optional(),
443
457
  location_id: z.nullable(z.string()).optional(),
444
458
  department_id: z.nullable(z.string()).optional(),
445
459
  item: LinkedInvoiceItem$inboundSchema.optional(),
@@ -460,6 +474,7 @@ export const InvoiceLineItemInput$inboundSchema: z.ZodType<
460
474
  "unit_of_measure": "unitOfMeasure",
461
475
  "discount_percentage": "discountPercentage",
462
476
  "discount_amount": "discountAmount",
477
+ "category_id": "categoryId",
463
478
  "location_id": "locationId",
464
479
  "department_id": "departmentId",
465
480
  "tax_rate": "taxRate",
@@ -485,6 +500,7 @@ export type InvoiceLineItemInput$Outbound = {
485
500
  unit_of_measure?: string | null | undefined;
486
501
  discount_percentage?: number | null | undefined;
487
502
  discount_amount?: number | null | undefined;
503
+ category_id?: string | null | undefined;
488
504
  location_id?: string | null | undefined;
489
505
  department_id?: string | null | undefined;
490
506
  item?: LinkedInvoiceItem$Outbound | undefined;
@@ -517,6 +533,7 @@ export const InvoiceLineItemInput$outboundSchema: z.ZodType<
517
533
  unitOfMeasure: z.nullable(z.string()).optional(),
518
534
  discountPercentage: z.nullable(z.number()).optional(),
519
535
  discountAmount: z.nullable(z.number()).optional(),
536
+ categoryId: z.nullable(z.string()).optional(),
520
537
  locationId: z.nullable(z.string()).optional(),
521
538
  departmentId: z.nullable(z.string()).optional(),
522
539
  item: LinkedInvoiceItem$outboundSchema.optional(),
@@ -537,6 +554,7 @@ export const InvoiceLineItemInput$outboundSchema: z.ZodType<
537
554
  unitOfMeasure: "unit_of_measure",
538
555
  discountPercentage: "discount_percentage",
539
556
  discountAmount: "discount_amount",
557
+ categoryId: "category_id",
540
558
  locationId: "location_id",
541
559
  departmentId: "department_id",
542
560
  taxRate: "tax_rate",
@@ -21,6 +21,10 @@ export type ProfitAndLossFilter = {
21
21
  * Filter by end date. If end date is given, start date is required.
22
22
  */
23
23
  endDate?: string | undefined;
24
+ /**
25
+ * Filter by location id
26
+ */
27
+ locationId?: string | undefined;
24
28
  };
25
29
 
26
30
  /** @internal */
@@ -32,11 +36,13 @@ export const ProfitAndLossFilter$inboundSchema: z.ZodType<
32
36
  customer_id: z.string().optional(),
33
37
  start_date: z.string().optional(),
34
38
  end_date: z.string().optional(),
39
+ location_id: z.string().optional(),
35
40
  }).transform((v) => {
36
41
  return remap$(v, {
37
42
  "customer_id": "customerId",
38
43
  "start_date": "startDate",
39
44
  "end_date": "endDate",
45
+ "location_id": "locationId",
40
46
  });
41
47
  });
42
48
 
@@ -45,6 +51,7 @@ export type ProfitAndLossFilter$Outbound = {
45
51
  customer_id?: string | undefined;
46
52
  start_date?: string | undefined;
47
53
  end_date?: string | undefined;
54
+ location_id?: string | undefined;
48
55
  };
49
56
 
50
57
  /** @internal */
@@ -56,11 +63,13 @@ export const ProfitAndLossFilter$outboundSchema: z.ZodType<
56
63
  customerId: z.string().optional(),
57
64
  startDate: z.string().optional(),
58
65
  endDate: z.string().optional(),
66
+ locationId: z.string().optional(),
59
67
  }).transform((v) => {
60
68
  return remap$(v, {
61
69
  customerId: "customer_id",
62
70
  startDate: "start_date",
63
71
  endDate: "end_date",
72
+ locationId: "location_id",
64
73
  });
65
74
  });
66
75
 
@@ -9,7 +9,7 @@ import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
- export type Five = string | number | number;
12
+ export type Value5 = string | number | number;
13
13
 
14
14
  export type SimpleFormFieldOptionValue =
15
15
  | string
@@ -36,40 +36,43 @@ export type SimpleFormFieldOption = {
36
36
  };
37
37
 
38
38
  /** @internal */
39
- export const Five$inboundSchema: z.ZodType<Five, z.ZodTypeDef, unknown> = z
39
+ export const Value5$inboundSchema: z.ZodType<Value5, z.ZodTypeDef, unknown> = z
40
40
  .union([z.string(), z.number().int(), z.number()]);
41
41
 
42
42
  /** @internal */
43
- export type Five$Outbound = string | number | number;
43
+ export type Value5$Outbound = string | number | number;
44
44
 
45
45
  /** @internal */
46
- export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
47
- z.union([z.string(), z.number().int(), z.number()]);
46
+ export const Value5$outboundSchema: z.ZodType<
47
+ Value5$Outbound,
48
+ z.ZodTypeDef,
49
+ Value5
50
+ > = z.union([z.string(), z.number().int(), z.number()]);
48
51
 
49
52
  /**
50
53
  * @internal
51
54
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
55
  */
53
- export namespace Five$ {
54
- /** @deprecated use `Five$inboundSchema` instead. */
55
- export const inboundSchema = Five$inboundSchema;
56
- /** @deprecated use `Five$outboundSchema` instead. */
57
- export const outboundSchema = Five$outboundSchema;
58
- /** @deprecated use `Five$Outbound` instead. */
59
- export type Outbound = Five$Outbound;
56
+ export namespace Value5$ {
57
+ /** @deprecated use `Value5$inboundSchema` instead. */
58
+ export const inboundSchema = Value5$inboundSchema;
59
+ /** @deprecated use `Value5$outboundSchema` instead. */
60
+ export const outboundSchema = Value5$outboundSchema;
61
+ /** @deprecated use `Value5$Outbound` instead. */
62
+ export type Outbound = Value5$Outbound;
60
63
  }
61
64
 
62
- export function fiveToJSON(five: Five): string {
63
- return JSON.stringify(Five$outboundSchema.parse(five));
65
+ export function value5ToJSON(value5: Value5): string {
66
+ return JSON.stringify(Value5$outboundSchema.parse(value5));
64
67
  }
65
68
 
66
- export function fiveFromJSON(
69
+ export function value5FromJSON(
67
70
  jsonString: string,
68
- ): SafeParseResult<Five, SDKValidationError> {
71
+ ): SafeParseResult<Value5, SDKValidationError> {
69
72
  return safeParse(
70
73
  jsonString,
71
- (x) => Five$inboundSchema.parse(JSON.parse(x)),
72
- `Failed to parse 'Five' from JSON`,
74
+ (x) => Value5$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'Value5' from JSON`,
73
76
  );
74
77
  }
75
78
 
@@ -169,6 +169,10 @@ export type Supplier = {
169
169
  * Payment method used for the transaction, such as cash, credit card, bank transfer, or check
170
170
  */
171
171
  paymentMethod?: string | null | undefined;
172
+ /**
173
+ * Terms of payment.
174
+ */
175
+ terms?: string | null | undefined;
172
176
  /**
173
177
  * The channel through which the transaction is processed.
174
178
  */
@@ -274,6 +278,10 @@ export type SupplierInput = {
274
278
  * Payment method used for the transaction, such as cash, credit card, bank transfer, or check
275
279
  */
276
280
  paymentMethod?: string | null | undefined;
281
+ /**
282
+ * Terms of payment.
283
+ */
284
+ terms?: string | null | undefined;
277
285
  /**
278
286
  * The channel through which the transaction is processed.
279
287
  */
@@ -345,6 +353,7 @@ export const Supplier$inboundSchema: z.ZodType<
345
353
  account: z.nullable(LinkedLedgerAccount$inboundSchema).optional(),
346
354
  status: z.nullable(SupplierStatus$inboundSchema).optional(),
347
355
  payment_method: z.nullable(z.string()).optional(),
356
+ terms: z.nullable(z.string()).optional(),
348
357
  channel: z.nullable(z.string()).optional(),
349
358
  custom_mappings: z.nullable(z.record(z.any())).optional(),
350
359
  custom_fields: z.array(CustomField$inboundSchema).optional(),
@@ -414,6 +423,7 @@ export type Supplier$Outbound = {
414
423
  account?: LinkedLedgerAccount$Outbound | null | undefined;
415
424
  status?: string | null | undefined;
416
425
  payment_method?: string | null | undefined;
426
+ terms?: string | null | undefined;
417
427
  channel?: string | null | undefined;
418
428
  custom_mappings?: { [k: string]: any } | null | undefined;
419
429
  custom_fields?: Array<CustomField$Outbound> | undefined;
@@ -457,6 +467,7 @@ export const Supplier$outboundSchema: z.ZodType<
457
467
  account: z.nullable(LinkedLedgerAccount$outboundSchema).optional(),
458
468
  status: z.nullable(SupplierStatus$outboundSchema).optional(),
459
469
  paymentMethod: z.nullable(z.string()).optional(),
470
+ terms: z.nullable(z.string()).optional(),
460
471
  channel: z.nullable(z.string()).optional(),
461
472
  customMappings: z.nullable(z.record(z.any())).optional(),
462
473
  customFields: z.array(CustomField$outboundSchema).optional(),
@@ -551,6 +562,7 @@ export const SupplierInput$inboundSchema: z.ZodType<
551
562
  account: z.nullable(LinkedLedgerAccountInput$inboundSchema).optional(),
552
563
  status: z.nullable(SupplierStatus$inboundSchema).optional(),
553
564
  payment_method: z.nullable(z.string()).optional(),
565
+ terms: z.nullable(z.string()).optional(),
554
566
  channel: z.nullable(z.string()).optional(),
555
567
  custom_fields: z.array(CustomField$inboundSchema).optional(),
556
568
  row_version: z.nullable(z.string()).optional(),
@@ -603,6 +615,7 @@ export type SupplierInput$Outbound = {
603
615
  account?: LinkedLedgerAccountInput$Outbound | null | undefined;
604
616
  status?: string | null | undefined;
605
617
  payment_method?: string | null | undefined;
618
+ terms?: string | null | undefined;
606
619
  channel?: string | null | undefined;
607
620
  custom_fields?: Array<CustomField$Outbound> | undefined;
608
621
  row_version?: string | null | undefined;
@@ -639,6 +652,7 @@ export const SupplierInput$outboundSchema: z.ZodType<
639
652
  account: z.nullable(LinkedLedgerAccountInput$outboundSchema).optional(),
640
653
  status: z.nullable(SupplierStatus$outboundSchema).optional(),
641
654
  paymentMethod: z.nullable(z.string()).optional(),
655
+ terms: z.nullable(z.string()).optional(),
642
656
  channel: z.nullable(z.string()).optional(),
643
657
  customFields: z.array(CustomField$outboundSchema).optional(),
644
658
  rowVersion: z.nullable(z.string()).optional(),
@@ -25,8 +25,14 @@ export class APIError extends ApideckError {
25
25
  }`;
26
26
  }
27
27
  const body = httpMeta.body || `""`;
28
- message += body.length > 100 ? "\n" : " ";
29
- message += `Body ${body}`;
28
+ message += body.length > 100 ? "\n" : ". ";
29
+ let bodyDisplay = body;
30
+ if (body.length > 10000) {
31
+ const truncated = body.substring(0, 10000);
32
+ const remaining = body.length - 10000;
33
+ bodyDisplay = `${truncated}...and ${remaining} more chars`;
34
+ }
35
+ message += `Body: ${bodyDisplay}`;
30
36
  message = message.trim();
31
37
  super(message, httpMeta);
32
38
  this.name = "APIError";
@@ -76,7 +76,7 @@ export class BadRequestResponse extends ApideckError {
76
76
  err: BadRequestResponseData,
77
77
  httpMeta: { response: Response; request: Request; body: string },
78
78
  ) {
79
- const message = err.message || "API error occurred";
79
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
80
80
  super(message, httpMeta);
81
81
  this.data$ = err;
82
82
  if (err.statusCode != null) this.statusCode = err.statusCode;
@@ -76,7 +76,7 @@ export class NotFoundResponse extends ApideckError {
76
76
  err: NotFoundResponseData,
77
77
  httpMeta: { response: Response; request: Request; body: string },
78
78
  ) {
79
- const message = err.message || "API error occurred";
79
+ const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
80
80
  super(message, httpMeta);
81
81
  this.data$ = err;
82
82
  if (err.statusCode != null) this.statusCode = err.statusCode;