@apideck/unify 0.25.1 → 0.27.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 (94) hide show
  1. package/README.md +7 -0
  2. package/docs/sdks/categories/README.md +181 -0
  3. package/funcs/accountingCategoriesGet.d.ts +18 -0
  4. package/funcs/accountingCategoriesGet.d.ts.map +1 -0
  5. package/funcs/accountingCategoriesGet.js +133 -0
  6. package/funcs/accountingCategoriesGet.js.map +1 -0
  7. package/funcs/accountingCategoriesList.d.ts +21 -0
  8. package/funcs/accountingCategoriesList.d.ts.map +1 -0
  9. package/funcs/accountingCategoriesList.js +151 -0
  10. package/funcs/accountingCategoriesList.js.map +1 -0
  11. package/jsr.json +1 -1
  12. package/lib/config.d.ts +4 -4
  13. package/lib/config.js +4 -4
  14. package/models/components/bill.d.ts +2 -2
  15. package/models/components/category.d.ts +114 -0
  16. package/models/components/category.d.ts.map +1 -0
  17. package/models/components/category.js +121 -0
  18. package/models/components/category.js.map +1 -0
  19. package/models/components/expense.d.ts +10 -0
  20. package/models/components/expense.d.ts.map +1 -1
  21. package/models/components/expense.js +4 -0
  22. package/models/components/expense.js.map +1 -1
  23. package/models/components/formfieldoption.d.ts +6 -6
  24. package/models/components/formfieldoption.d.ts.map +1 -1
  25. package/models/components/formfieldoption.js +4 -4
  26. package/models/components/formfieldoption.js.map +1 -1
  27. package/models/components/getcategoriesresponse.d.ts +79 -0
  28. package/models/components/getcategoriesresponse.d.ts.map +1 -0
  29. package/models/components/getcategoriesresponse.js +89 -0
  30. package/models/components/getcategoriesresponse.js.map +1 -0
  31. package/models/components/getcategoryresponse.d.ts +67 -0
  32. package/models/components/getcategoryresponse.d.ts.map +1 -0
  33. package/models/components/getcategoryresponse.js +83 -0
  34. package/models/components/getcategoryresponse.js.map +1 -0
  35. package/models/components/index.d.ts +3 -0
  36. package/models/components/index.d.ts.map +1 -1
  37. package/models/components/index.js +3 -0
  38. package/models/components/index.js.map +1 -1
  39. package/models/components/invoice.d.ts +2 -2
  40. package/models/components/ledgeraccount.d.ts +9 -9
  41. package/models/components/ledgeraccount.d.ts.map +1 -1
  42. package/models/components/ledgeraccount.js +19 -15
  43. package/models/components/ledgeraccount.js.map +1 -1
  44. package/models/components/ledgeraccountsfilter.d.ts +61 -0
  45. package/models/components/ledgeraccountsfilter.d.ts.map +1 -1
  46. package/models/components/ledgeraccountsfilter.js +33 -1
  47. package/models/components/ledgeraccountsfilter.js.map +1 -1
  48. package/models/components/supplier.d.ts +10 -0
  49. package/models/components/supplier.d.ts.map +1 -1
  50. package/models/components/supplier.js +8 -0
  51. package/models/components/supplier.js.map +1 -1
  52. package/models/operations/accountingcategoriesall.d.ts +131 -0
  53. package/models/operations/accountingcategoriesall.d.ts.map +1 -0
  54. package/models/operations/accountingcategoriesall.js +149 -0
  55. package/models/operations/accountingcategoriesall.js.map +1 -0
  56. package/models/operations/accountingcategoriesone.d.ts +126 -0
  57. package/models/operations/accountingcategoriesone.d.ts.map +1 -0
  58. package/models/operations/accountingcategoriesone.js +145 -0
  59. package/models/operations/accountingcategoriesone.js.map +1 -0
  60. package/models/operations/index.d.ts +2 -0
  61. package/models/operations/index.d.ts.map +1 -1
  62. package/models/operations/index.js +2 -0
  63. package/models/operations/index.js.map +1 -1
  64. package/package.json +1 -1
  65. package/sdk/accounting.d.ts +3 -0
  66. package/sdk/accounting.d.ts.map +1 -1
  67. package/sdk/accounting.js +4 -0
  68. package/sdk/accounting.js.map +1 -1
  69. package/sdk/categories.d.ts +22 -0
  70. package/sdk/categories.d.ts.map +1 -0
  71. package/sdk/categories.js +33 -0
  72. package/sdk/categories.js.map +1 -0
  73. package/src/__tests__/categories.test.ts +127 -0
  74. package/src/funcs/accountingCategoriesGet.ts +230 -0
  75. package/src/funcs/accountingCategoriesList.ts +288 -0
  76. package/src/lib/config.ts +4 -4
  77. package/src/models/components/bill.ts +2 -2
  78. package/src/models/components/category.ts +193 -0
  79. package/src/models/components/expense.ts +14 -0
  80. package/src/models/components/formfieldoption.ts +12 -12
  81. package/src/models/components/getcategoriesresponse.ts +154 -0
  82. package/src/models/components/getcategoryresponse.ts +128 -0
  83. package/src/models/components/index.ts +3 -0
  84. package/src/models/components/invoice.ts +2 -2
  85. package/src/models/components/ledgeraccount.ts +25 -19
  86. package/src/models/components/ledgeraccountsfilter.ts +49 -0
  87. package/src/models/components/supplier.ts +18 -0
  88. package/src/models/operations/accountingcategoriesall.ts +277 -0
  89. package/src/models/operations/accountingcategoriesone.ts +268 -0
  90. package/src/models/operations/index.ts +2 -0
  91. package/src/sdk/accounting.ts +6 -0
  92. package/src/sdk/categories.ts +48 -0
  93. package/src/types/constdatetime.ts +1 -1
  94. package/types/constdatetime.js +1 -1
@@ -141,7 +141,7 @@ export type Bill = {
141
141
  */
142
142
  poNumber?: string | null | undefined;
143
143
  /**
144
- * Optional bill reference.
144
+ * Optional reference identifier for the transaction.
145
145
  */
146
146
  reference?: string | null | undefined;
147
147
  lineItems?: Array<BillLineItem> | undefined;
@@ -285,7 +285,7 @@ export type BillInput = {
285
285
  */
286
286
  poNumber?: string | null | undefined;
287
287
  /**
288
- * Optional bill reference.
288
+ * Optional reference identifier for the transaction.
289
289
  */
290
290
  reference?: string | null | undefined;
291
291
  lineItems?: Array<BillLineItemInput> | undefined;
@@ -0,0 +1,193 @@
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
+ PassThroughBody,
13
+ PassThroughBody$inboundSchema,
14
+ PassThroughBody$Outbound,
15
+ PassThroughBody$outboundSchema,
16
+ } from "./passthroughbody.js";
17
+
18
+ /**
19
+ * Based on the status some functionality is enabled or disabled.
20
+ */
21
+ export const CategoryStatus = {
22
+ Active: "active",
23
+ Inactive: "inactive",
24
+ } as const;
25
+ /**
26
+ * Based on the status some functionality is enabled or disabled.
27
+ */
28
+ export type CategoryStatus = ClosedEnum<typeof CategoryStatus>;
29
+
30
+ export type Category = {
31
+ /**
32
+ * A unique identifier for an object.
33
+ */
34
+ id?: string | undefined;
35
+ /**
36
+ * The name of the category.
37
+ */
38
+ name?: string | undefined;
39
+ /**
40
+ * Based on the status some functionality is enabled or disabled.
41
+ */
42
+ status?: CategoryStatus | undefined;
43
+ /**
44
+ * When custom mappings are configured on the resource, the result is included here.
45
+ */
46
+ customMappings?: { [k: string]: any } | null | undefined;
47
+ /**
48
+ * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.
49
+ */
50
+ rowVersion?: string | null | undefined;
51
+ /**
52
+ * The user who last updated the object.
53
+ */
54
+ updatedBy?: string | null | undefined;
55
+ /**
56
+ * The user who created the object.
57
+ */
58
+ createdBy?: string | null | undefined;
59
+ /**
60
+ * The date and time when the object was last updated.
61
+ */
62
+ updatedAt?: Date | null | undefined;
63
+ /**
64
+ * The date and time when the object was created.
65
+ */
66
+ createdAt?: Date | null | undefined;
67
+ /**
68
+ * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.
69
+ */
70
+ passThrough?: Array<PassThroughBody> | undefined;
71
+ };
72
+
73
+ /** @internal */
74
+ export const CategoryStatus$inboundSchema: z.ZodNativeEnum<
75
+ typeof CategoryStatus
76
+ > = z.nativeEnum(CategoryStatus);
77
+
78
+ /** @internal */
79
+ export const CategoryStatus$outboundSchema: z.ZodNativeEnum<
80
+ typeof CategoryStatus
81
+ > = CategoryStatus$inboundSchema;
82
+
83
+ /**
84
+ * @internal
85
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
86
+ */
87
+ export namespace CategoryStatus$ {
88
+ /** @deprecated use `CategoryStatus$inboundSchema` instead. */
89
+ export const inboundSchema = CategoryStatus$inboundSchema;
90
+ /** @deprecated use `CategoryStatus$outboundSchema` instead. */
91
+ export const outboundSchema = CategoryStatus$outboundSchema;
92
+ }
93
+
94
+ /** @internal */
95
+ export const Category$inboundSchema: z.ZodType<
96
+ Category,
97
+ z.ZodTypeDef,
98
+ unknown
99
+ > = z.object({
100
+ id: z.string().optional(),
101
+ name: z.string().optional(),
102
+ status: CategoryStatus$inboundSchema.optional(),
103
+ custom_mappings: z.nullable(z.record(z.any())).optional(),
104
+ row_version: z.nullable(z.string()).optional(),
105
+ updated_by: z.nullable(z.string()).optional(),
106
+ created_by: z.nullable(z.string()).optional(),
107
+ updated_at: z.nullable(
108
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
109
+ ).optional(),
110
+ created_at: z.nullable(
111
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
112
+ ).optional(),
113
+ pass_through: z.array(PassThroughBody$inboundSchema).optional(),
114
+ }).transform((v) => {
115
+ return remap$(v, {
116
+ "custom_mappings": "customMappings",
117
+ "row_version": "rowVersion",
118
+ "updated_by": "updatedBy",
119
+ "created_by": "createdBy",
120
+ "updated_at": "updatedAt",
121
+ "created_at": "createdAt",
122
+ "pass_through": "passThrough",
123
+ });
124
+ });
125
+
126
+ /** @internal */
127
+ export type Category$Outbound = {
128
+ id?: string | undefined;
129
+ name?: string | undefined;
130
+ status?: string | undefined;
131
+ custom_mappings?: { [k: string]: any } | null | undefined;
132
+ row_version?: string | null | undefined;
133
+ updated_by?: string | null | undefined;
134
+ created_by?: string | null | undefined;
135
+ updated_at?: string | null | undefined;
136
+ created_at?: string | null | undefined;
137
+ pass_through?: Array<PassThroughBody$Outbound> | undefined;
138
+ };
139
+
140
+ /** @internal */
141
+ export const Category$outboundSchema: z.ZodType<
142
+ Category$Outbound,
143
+ z.ZodTypeDef,
144
+ Category
145
+ > = z.object({
146
+ id: z.string().optional(),
147
+ name: z.string().optional(),
148
+ status: CategoryStatus$outboundSchema.optional(),
149
+ customMappings: z.nullable(z.record(z.any())).optional(),
150
+ rowVersion: z.nullable(z.string()).optional(),
151
+ updatedBy: z.nullable(z.string()).optional(),
152
+ createdBy: z.nullable(z.string()).optional(),
153
+ updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
154
+ createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
155
+ passThrough: z.array(PassThroughBody$outboundSchema).optional(),
156
+ }).transform((v) => {
157
+ return remap$(v, {
158
+ customMappings: "custom_mappings",
159
+ rowVersion: "row_version",
160
+ updatedBy: "updated_by",
161
+ createdBy: "created_by",
162
+ updatedAt: "updated_at",
163
+ createdAt: "created_at",
164
+ passThrough: "pass_through",
165
+ });
166
+ });
167
+
168
+ /**
169
+ * @internal
170
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
171
+ */
172
+ export namespace Category$ {
173
+ /** @deprecated use `Category$inboundSchema` instead. */
174
+ export const inboundSchema = Category$inboundSchema;
175
+ /** @deprecated use `Category$outboundSchema` instead. */
176
+ export const outboundSchema = Category$outboundSchema;
177
+ /** @deprecated use `Category$Outbound` instead. */
178
+ export type Outbound = Category$Outbound;
179
+ }
180
+
181
+ export function categoryToJSON(category: Category): string {
182
+ return JSON.stringify(Category$outboundSchema.parse(category));
183
+ }
184
+
185
+ export function categoryFromJSON(
186
+ jsonString: string,
187
+ ): SafeParseResult<Category, SDKValidationError> {
188
+ return safeParse(
189
+ jsonString,
190
+ (x) => Category$inboundSchema.parse(JSON.parse(x)),
191
+ `Failed to parse 'Category' from JSON`,
192
+ );
193
+ }
@@ -137,6 +137,10 @@ export type Expense = {
137
137
  * Expense line items linked to this expense.
138
138
  */
139
139
  lineItems: Array<ExpenseLineItem>;
140
+ /**
141
+ * Optional reference identifier for the transaction.
142
+ */
143
+ reference?: string | null | undefined;
140
144
  customFields?: Array<CustomField> | undefined;
141
145
  /**
142
146
  * When custom mappings are configured on the resource, the result is included here.
@@ -226,6 +230,10 @@ export type ExpenseInput = {
226
230
  * Expense line items linked to this expense.
227
231
  */
228
232
  lineItems: Array<ExpenseLineItemInput>;
233
+ /**
234
+ * Optional reference identifier for the transaction.
235
+ */
236
+ reference?: string | null | undefined;
229
237
  customFields?: Array<CustomField> | undefined;
230
238
  /**
231
239
  * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.
@@ -298,6 +306,7 @@ export const Expense$inboundSchema: z.ZodType<Expense, z.ZodTypeDef, unknown> =
298
306
  tax_rate: LinkedTaxRate$inboundSchema.optional(),
299
307
  total_amount: z.nullable(z.number()).optional(),
300
308
  line_items: z.array(ExpenseLineItem$inboundSchema),
309
+ reference: z.nullable(z.string()).optional(),
301
310
  custom_fields: z.array(CustomField$inboundSchema).optional(),
302
311
  custom_mappings: z.nullable(z.record(z.any())).optional(),
303
312
  updated_at: z.nullable(
@@ -352,6 +361,7 @@ export type Expense$Outbound = {
352
361
  tax_rate?: LinkedTaxRate$Outbound | undefined;
353
362
  total_amount?: number | null | undefined;
354
363
  line_items: Array<ExpenseLineItem$Outbound>;
364
+ reference?: string | null | undefined;
355
365
  custom_fields?: Array<CustomField$Outbound> | undefined;
356
366
  custom_mappings?: { [k: string]: any } | null | undefined;
357
367
  updated_at?: string | null | undefined;
@@ -384,6 +394,7 @@ export const Expense$outboundSchema: z.ZodType<
384
394
  taxRate: LinkedTaxRate$outboundSchema.optional(),
385
395
  totalAmount: z.nullable(z.number()).optional(),
386
396
  lineItems: z.array(ExpenseLineItem$outboundSchema),
397
+ reference: z.nullable(z.string()).optional(),
387
398
  customFields: z.array(CustomField$outboundSchema).optional(),
388
399
  customMappings: z.nullable(z.record(z.any())).optional(),
389
400
  updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
@@ -466,6 +477,7 @@ export const ExpenseInput$inboundSchema: z.ZodType<
466
477
  tax_rate: LinkedTaxRateInput$inboundSchema.optional(),
467
478
  total_amount: z.nullable(z.number()).optional(),
468
479
  line_items: z.array(ExpenseLineItemInput$inboundSchema),
480
+ reference: z.nullable(z.string()).optional(),
469
481
  custom_fields: z.array(CustomField$inboundSchema).optional(),
470
482
  row_version: z.nullable(z.string()).optional(),
471
483
  pass_through: z.array(PassThroughBody$inboundSchema).optional(),
@@ -505,6 +517,7 @@ export type ExpenseInput$Outbound = {
505
517
  tax_rate?: LinkedTaxRateInput$Outbound | undefined;
506
518
  total_amount?: number | null | undefined;
507
519
  line_items: Array<ExpenseLineItemInput$Outbound>;
520
+ reference?: string | null | undefined;
508
521
  custom_fields?: Array<CustomField$Outbound> | undefined;
509
522
  row_version?: string | null | undefined;
510
523
  pass_through?: Array<PassThroughBody$Outbound> | undefined;
@@ -531,6 +544,7 @@ export const ExpenseInput$outboundSchema: z.ZodType<
531
544
  taxRate: LinkedTaxRateInput$outboundSchema.optional(),
532
545
  totalAmount: z.nullable(z.number()).optional(),
533
546
  lineItems: z.array(ExpenseLineItemInput$outboundSchema),
547
+ reference: z.nullable(z.string()).optional(),
534
548
  customFields: z.array(CustomField$outboundSchema).optional(),
535
549
  rowVersion: z.nullable(z.string()).optional(),
536
550
  passThrough: z.array(PassThroughBody$outboundSchema).optional(),
@@ -20,8 +20,8 @@ import {
20
20
  } from "./simpleformfieldoption.js";
21
21
 
22
22
  export type FormFieldOption =
23
- | (SimpleFormFieldOption & { optionType: "simple" })
24
- | (FormFieldOptionGroup & { optionType: "group" });
23
+ | (FormFieldOptionGroup & { optionType: "group" })
24
+ | (SimpleFormFieldOption & { optionType: "simple" });
25
25
 
26
26
  /** @internal */
27
27
  export const FormFieldOption$inboundSchema: z.ZodType<
@@ -29,13 +29,13 @@ export const FormFieldOption$inboundSchema: z.ZodType<
29
29
  z.ZodTypeDef,
30
30
  unknown
31
31
  > = z.union([
32
- SimpleFormFieldOption$inboundSchema.and(
33
- z.object({ option_type: z.literal("simple") }).transform((v) => ({
32
+ FormFieldOptionGroup$inboundSchema.and(
33
+ z.object({ option_type: z.literal("group") }).transform((v) => ({
34
34
  optionType: v.option_type,
35
35
  })),
36
36
  ),
37
- FormFieldOptionGroup$inboundSchema.and(
38
- z.object({ option_type: z.literal("group") }).transform((v) => ({
37
+ SimpleFormFieldOption$inboundSchema.and(
38
+ z.object({ option_type: z.literal("simple") }).transform((v) => ({
39
39
  optionType: v.option_type,
40
40
  })),
41
41
  ),
@@ -43,8 +43,8 @@ export const FormFieldOption$inboundSchema: z.ZodType<
43
43
 
44
44
  /** @internal */
45
45
  export type FormFieldOption$Outbound =
46
- | (SimpleFormFieldOption$Outbound & { option_type: "simple" })
47
- | (FormFieldOptionGroup$Outbound & { option_type: "group" });
46
+ | (FormFieldOptionGroup$Outbound & { option_type: "group" })
47
+ | (SimpleFormFieldOption$Outbound & { option_type: "simple" });
48
48
 
49
49
  /** @internal */
50
50
  export const FormFieldOption$outboundSchema: z.ZodType<
@@ -52,13 +52,13 @@ export const FormFieldOption$outboundSchema: z.ZodType<
52
52
  z.ZodTypeDef,
53
53
  FormFieldOption
54
54
  > = z.union([
55
- SimpleFormFieldOption$outboundSchema.and(
56
- z.object({ optionType: z.literal("simple") }).transform((v) => ({
55
+ FormFieldOptionGroup$outboundSchema.and(
56
+ z.object({ optionType: z.literal("group") }).transform((v) => ({
57
57
  option_type: v.optionType,
58
58
  })),
59
59
  ),
60
- FormFieldOptionGroup$outboundSchema.and(
61
- z.object({ optionType: z.literal("group") }).transform((v) => ({
60
+ SimpleFormFieldOption$outboundSchema.and(
61
+ z.object({ optionType: z.literal("simple") }).transform((v) => ({
62
62
  option_type: v.optionType,
63
63
  })),
64
64
  ),
@@ -0,0 +1,154 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ Category,
12
+ Category$inboundSchema,
13
+ Category$Outbound,
14
+ Category$outboundSchema,
15
+ } from "./category.js";
16
+ import {
17
+ Links,
18
+ Links$inboundSchema,
19
+ Links$Outbound,
20
+ Links$outboundSchema,
21
+ } from "./links.js";
22
+ import {
23
+ Meta,
24
+ Meta$inboundSchema,
25
+ Meta$Outbound,
26
+ Meta$outboundSchema,
27
+ } from "./meta.js";
28
+
29
+ /**
30
+ * Categories
31
+ */
32
+ export type GetCategoriesResponse = {
33
+ /**
34
+ * HTTP Response Status Code
35
+ */
36
+ statusCode: number;
37
+ /**
38
+ * HTTP Response Status
39
+ */
40
+ status: string;
41
+ /**
42
+ * Apideck ID of service provider
43
+ */
44
+ service: string;
45
+ /**
46
+ * Unified API resource name
47
+ */
48
+ resource: string;
49
+ /**
50
+ * Operation performed
51
+ */
52
+ operation: string;
53
+ data: Array<Category>;
54
+ /**
55
+ * Response metadata
56
+ */
57
+ meta?: Meta | undefined;
58
+ /**
59
+ * Links to navigate to previous or next pages through the API
60
+ */
61
+ links?: Links | undefined;
62
+ /**
63
+ * Raw response from the integration when raw=true query param is provided
64
+ */
65
+ raw?: { [k: string]: any } | null | undefined;
66
+ };
67
+
68
+ /** @internal */
69
+ export const GetCategoriesResponse$inboundSchema: z.ZodType<
70
+ GetCategoriesResponse,
71
+ z.ZodTypeDef,
72
+ unknown
73
+ > = z.object({
74
+ status_code: z.number().int(),
75
+ status: z.string(),
76
+ service: z.string(),
77
+ resource: z.string(),
78
+ operation: z.string(),
79
+ data: z.array(Category$inboundSchema),
80
+ meta: Meta$inboundSchema.optional(),
81
+ links: Links$inboundSchema.optional(),
82
+ _raw: z.nullable(z.record(z.any())).optional(),
83
+ }).transform((v) => {
84
+ return remap$(v, {
85
+ "status_code": "statusCode",
86
+ "_raw": "raw",
87
+ });
88
+ });
89
+
90
+ /** @internal */
91
+ export type GetCategoriesResponse$Outbound = {
92
+ status_code: number;
93
+ status: string;
94
+ service: string;
95
+ resource: string;
96
+ operation: string;
97
+ data: Array<Category$Outbound>;
98
+ meta?: Meta$Outbound | undefined;
99
+ links?: Links$Outbound | undefined;
100
+ _raw?: { [k: string]: any } | null | undefined;
101
+ };
102
+
103
+ /** @internal */
104
+ export const GetCategoriesResponse$outboundSchema: z.ZodType<
105
+ GetCategoriesResponse$Outbound,
106
+ z.ZodTypeDef,
107
+ GetCategoriesResponse
108
+ > = z.object({
109
+ statusCode: z.number().int(),
110
+ status: z.string(),
111
+ service: z.string(),
112
+ resource: z.string(),
113
+ operation: z.string(),
114
+ data: z.array(Category$outboundSchema),
115
+ meta: Meta$outboundSchema.optional(),
116
+ links: Links$outboundSchema.optional(),
117
+ raw: z.nullable(z.record(z.any())).optional(),
118
+ }).transform((v) => {
119
+ return remap$(v, {
120
+ statusCode: "status_code",
121
+ raw: "_raw",
122
+ });
123
+ });
124
+
125
+ /**
126
+ * @internal
127
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
128
+ */
129
+ export namespace GetCategoriesResponse$ {
130
+ /** @deprecated use `GetCategoriesResponse$inboundSchema` instead. */
131
+ export const inboundSchema = GetCategoriesResponse$inboundSchema;
132
+ /** @deprecated use `GetCategoriesResponse$outboundSchema` instead. */
133
+ export const outboundSchema = GetCategoriesResponse$outboundSchema;
134
+ /** @deprecated use `GetCategoriesResponse$Outbound` instead. */
135
+ export type Outbound = GetCategoriesResponse$Outbound;
136
+ }
137
+
138
+ export function getCategoriesResponseToJSON(
139
+ getCategoriesResponse: GetCategoriesResponse,
140
+ ): string {
141
+ return JSON.stringify(
142
+ GetCategoriesResponse$outboundSchema.parse(getCategoriesResponse),
143
+ );
144
+ }
145
+
146
+ export function getCategoriesResponseFromJSON(
147
+ jsonString: string,
148
+ ): SafeParseResult<GetCategoriesResponse, SDKValidationError> {
149
+ return safeParse(
150
+ jsonString,
151
+ (x) => GetCategoriesResponse$inboundSchema.parse(JSON.parse(x)),
152
+ `Failed to parse 'GetCategoriesResponse' from JSON`,
153
+ );
154
+ }
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ Category,
12
+ Category$inboundSchema,
13
+ Category$Outbound,
14
+ Category$outboundSchema,
15
+ } from "./category.js";
16
+
17
+ /**
18
+ * Category
19
+ */
20
+ export type GetCategoryResponse = {
21
+ /**
22
+ * HTTP Response Status Code
23
+ */
24
+ statusCode: number;
25
+ /**
26
+ * HTTP Response Status
27
+ */
28
+ status: string;
29
+ /**
30
+ * Apideck ID of service provider
31
+ */
32
+ service: string;
33
+ /**
34
+ * Unified API resource name
35
+ */
36
+ resource: string;
37
+ /**
38
+ * Operation performed
39
+ */
40
+ operation: string;
41
+ data: Category;
42
+ /**
43
+ * Raw response from the integration when raw=true query param is provided
44
+ */
45
+ raw?: { [k: string]: any } | null | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const GetCategoryResponse$inboundSchema: z.ZodType<
50
+ GetCategoryResponse,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ status_code: z.number().int(),
55
+ status: z.string(),
56
+ service: z.string(),
57
+ resource: z.string(),
58
+ operation: z.string(),
59
+ data: Category$inboundSchema,
60
+ _raw: z.nullable(z.record(z.any())).optional(),
61
+ }).transform((v) => {
62
+ return remap$(v, {
63
+ "status_code": "statusCode",
64
+ "_raw": "raw",
65
+ });
66
+ });
67
+
68
+ /** @internal */
69
+ export type GetCategoryResponse$Outbound = {
70
+ status_code: number;
71
+ status: string;
72
+ service: string;
73
+ resource: string;
74
+ operation: string;
75
+ data: Category$Outbound;
76
+ _raw?: { [k: string]: any } | null | undefined;
77
+ };
78
+
79
+ /** @internal */
80
+ export const GetCategoryResponse$outboundSchema: z.ZodType<
81
+ GetCategoryResponse$Outbound,
82
+ z.ZodTypeDef,
83
+ GetCategoryResponse
84
+ > = z.object({
85
+ statusCode: z.number().int(),
86
+ status: z.string(),
87
+ service: z.string(),
88
+ resource: z.string(),
89
+ operation: z.string(),
90
+ data: Category$outboundSchema,
91
+ raw: z.nullable(z.record(z.any())).optional(),
92
+ }).transform((v) => {
93
+ return remap$(v, {
94
+ statusCode: "status_code",
95
+ raw: "_raw",
96
+ });
97
+ });
98
+
99
+ /**
100
+ * @internal
101
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
102
+ */
103
+ export namespace GetCategoryResponse$ {
104
+ /** @deprecated use `GetCategoryResponse$inboundSchema` instead. */
105
+ export const inboundSchema = GetCategoryResponse$inboundSchema;
106
+ /** @deprecated use `GetCategoryResponse$outboundSchema` instead. */
107
+ export const outboundSchema = GetCategoryResponse$outboundSchema;
108
+ /** @deprecated use `GetCategoryResponse$Outbound` instead. */
109
+ export type Outbound = GetCategoryResponse$Outbound;
110
+ }
111
+
112
+ export function getCategoryResponseToJSON(
113
+ getCategoryResponse: GetCategoryResponse,
114
+ ): string {
115
+ return JSON.stringify(
116
+ GetCategoryResponse$outboundSchema.parse(getCategoryResponse),
117
+ );
118
+ }
119
+
120
+ export function getCategoryResponseFromJSON(
121
+ jsonString: string,
122
+ ): SafeParseResult<GetCategoryResponse, SDKValidationError> {
123
+ return safeParse(
124
+ jsonString,
125
+ (x) => GetCategoryResponse$inboundSchema.parse(JSON.parse(x)),
126
+ `Failed to parse 'GetCategoryResponse' from JSON`,
127
+ );
128
+ }
@@ -42,6 +42,7 @@ export * from "./billlineitem.js";
42
42
  export * from "./billpayment.js";
43
43
  export * from "./billsfilter.js";
44
44
  export * from "./billssort.js";
45
+ export * from "./category.js";
45
46
  export * from "./collection.js";
46
47
  export * from "./collectionssort.js";
47
48
  export * from "./collectiontag.js";
@@ -259,6 +260,8 @@ export * from "./getbillpaymentresponse.js";
259
260
  export * from "./getbillpaymentsresponse.js";
260
261
  export * from "./getbillresponse.js";
261
262
  export * from "./getbillsresponse.js";
263
+ export * from "./getcategoriesresponse.js";
264
+ export * from "./getcategoryresponse.js";
262
265
  export * from "./getcollectionresponse.js";
263
266
  export * from "./getcollectionsresponse.js";
264
267
  export * from "./getcollectiontagsresponse.js";
@@ -176,7 +176,7 @@ export type Invoice = {
176
176
  */
177
177
  poNumber?: string | null | undefined;
178
178
  /**
179
- * Optional invoice reference.
179
+ * Optional reference identifier for the transaction.
180
180
  */
181
181
  reference?: string | null | undefined;
182
182
  /**
@@ -341,7 +341,7 @@ export type InvoiceInput = {
341
341
  */
342
342
  poNumber?: string | null | undefined;
343
343
  /**
344
- * Optional invoice reference.
344
+ * Optional reference identifier for the transaction.
345
345
  */
346
346
  reference?: string | null | undefined;
347
347
  /**