@apideck/unify 0.25.0 → 0.26.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 (97) 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/lib/files.d.ts +5 -0
  15. package/lib/files.d.ts.map +1 -1
  16. package/lib/files.js +41 -0
  17. package/lib/files.js.map +1 -1
  18. package/lib/security.d.ts +2 -2
  19. package/lib/security.d.ts.map +1 -1
  20. package/models/components/bill.d.ts +2 -2
  21. package/models/components/category.d.ts +114 -0
  22. package/models/components/category.d.ts.map +1 -0
  23. package/models/components/category.js +121 -0
  24. package/models/components/category.js.map +1 -0
  25. package/models/components/contact.d.ts +4 -4
  26. package/models/components/contact.d.ts.map +1 -1
  27. package/models/components/contact.js +4 -4
  28. package/models/components/contact.js.map +1 -1
  29. package/models/components/expense.d.ts +10 -0
  30. package/models/components/expense.d.ts.map +1 -1
  31. package/models/components/expense.js +4 -0
  32. package/models/components/expense.js.map +1 -1
  33. package/models/components/formfieldoption.d.ts +6 -6
  34. package/models/components/formfieldoption.d.ts.map +1 -1
  35. package/models/components/formfieldoption.js +4 -4
  36. package/models/components/formfieldoption.js.map +1 -1
  37. package/models/components/getcategoriesresponse.d.ts +79 -0
  38. package/models/components/getcategoriesresponse.d.ts.map +1 -0
  39. package/models/components/getcategoriesresponse.js +89 -0
  40. package/models/components/getcategoriesresponse.js.map +1 -0
  41. package/models/components/getcategoryresponse.d.ts +67 -0
  42. package/models/components/getcategoryresponse.d.ts.map +1 -0
  43. package/models/components/getcategoryresponse.js +83 -0
  44. package/models/components/getcategoryresponse.js.map +1 -0
  45. package/models/components/index.d.ts +3 -0
  46. package/models/components/index.d.ts.map +1 -1
  47. package/models/components/index.js +3 -0
  48. package/models/components/index.js.map +1 -1
  49. package/models/components/invoice.d.ts +2 -2
  50. package/models/components/supplier.d.ts +10 -0
  51. package/models/components/supplier.d.ts.map +1 -1
  52. package/models/components/supplier.js +8 -0
  53. package/models/components/supplier.js.map +1 -1
  54. package/models/operations/accountingcategoriesall.d.ts +131 -0
  55. package/models/operations/accountingcategoriesall.d.ts.map +1 -0
  56. package/models/operations/accountingcategoriesall.js +149 -0
  57. package/models/operations/accountingcategoriesall.js.map +1 -0
  58. package/models/operations/accountingcategoriesone.d.ts +126 -0
  59. package/models/operations/accountingcategoriesone.d.ts.map +1 -0
  60. package/models/operations/accountingcategoriesone.js +145 -0
  61. package/models/operations/accountingcategoriesone.js.map +1 -0
  62. package/models/operations/index.d.ts +2 -0
  63. package/models/operations/index.d.ts.map +1 -1
  64. package/models/operations/index.js +2 -0
  65. package/models/operations/index.js.map +1 -1
  66. package/package.json +1 -1
  67. package/sdk/accounting.d.ts +3 -0
  68. package/sdk/accounting.d.ts.map +1 -1
  69. package/sdk/accounting.js +4 -0
  70. package/sdk/accounting.js.map +1 -1
  71. package/sdk/categories.d.ts +22 -0
  72. package/sdk/categories.d.ts.map +1 -0
  73. package/sdk/categories.js +33 -0
  74. package/sdk/categories.js.map +1 -0
  75. package/src/__tests__/categories.test.ts +127 -0
  76. package/src/funcs/accountingCategoriesGet.ts +230 -0
  77. package/src/funcs/accountingCategoriesList.ts +288 -0
  78. package/src/lib/config.ts +4 -4
  79. package/src/lib/files.ts +42 -0
  80. package/src/lib/security.ts +2 -2
  81. package/src/models/components/bill.ts +2 -2
  82. package/src/models/components/category.ts +193 -0
  83. package/src/models/components/contact.ts +8 -8
  84. package/src/models/components/expense.ts +14 -0
  85. package/src/models/components/formfieldoption.ts +12 -12
  86. package/src/models/components/getcategoriesresponse.ts +154 -0
  87. package/src/models/components/getcategoryresponse.ts +128 -0
  88. package/src/models/components/index.ts +3 -0
  89. package/src/models/components/invoice.ts +2 -2
  90. package/src/models/components/supplier.ts +18 -0
  91. package/src/models/operations/accountingcategoriesall.ts +277 -0
  92. package/src/models/operations/accountingcategoriesone.ts +268 -0
  93. package/src/models/operations/index.ts +2 -0
  94. package/src/sdk/accounting.ts +6 -0
  95. package/src/sdk/categories.ts +48 -0
  96. package/src/types/constdatetime.ts +1 -1
  97. package/types/constdatetime.js +1 -1
@@ -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
+ }
@@ -86,7 +86,7 @@ export type Contact = {
86
86
  /**
87
87
  * Full name of the contact.
88
88
  */
89
- name: string | null;
89
+ name?: string | null | undefined;
90
90
  /**
91
91
  * The owner of the contact.
92
92
  */
@@ -225,7 +225,7 @@ export type ContactInput = {
225
225
  /**
226
226
  * Full name of the contact.
227
227
  */
228
- name: string | null;
228
+ name?: string | null | undefined;
229
229
  /**
230
230
  * The owner of the contact.
231
231
  */
@@ -380,7 +380,7 @@ export namespace ContactGender$ {
380
380
  export const Contact$inboundSchema: z.ZodType<Contact, z.ZodTypeDef, unknown> =
381
381
  z.object({
382
382
  id: z.string().optional(),
383
- name: z.nullable(z.string()),
383
+ name: z.nullable(z.string()).optional(),
384
384
  owner_id: z.nullable(z.string()).optional(),
385
385
  type: z.nullable(ContactType$inboundSchema).optional(),
386
386
  company_id: z.nullable(z.string()).optional(),
@@ -460,7 +460,7 @@ export const Contact$inboundSchema: z.ZodType<Contact, z.ZodTypeDef, unknown> =
460
460
  /** @internal */
461
461
  export type Contact$Outbound = {
462
462
  id?: string | undefined;
463
- name: string | null;
463
+ name?: string | null | undefined;
464
464
  owner_id?: string | null | undefined;
465
465
  type?: string | null | undefined;
466
466
  company_id?: string | null | undefined;
@@ -509,7 +509,7 @@ export const Contact$outboundSchema: z.ZodType<
509
509
  Contact
510
510
  > = z.object({
511
511
  id: z.string().optional(),
512
- name: z.nullable(z.string()),
512
+ name: z.nullable(z.string()).optional(),
513
513
  ownerId: z.nullable(z.string()).optional(),
514
514
  type: z.nullable(ContactType$outboundSchema).optional(),
515
515
  companyId: z.nullable(z.string()).optional(),
@@ -610,7 +610,7 @@ export const ContactInput$inboundSchema: z.ZodType<
610
610
  z.ZodTypeDef,
611
611
  unknown
612
612
  > = z.object({
613
- name: z.nullable(z.string()),
613
+ name: z.nullable(z.string()).optional(),
614
614
  owner_id: z.nullable(z.string()).optional(),
615
615
  type: z.nullable(ContactType$inboundSchema).optional(),
616
616
  company_id: z.nullable(z.string()).optional(),
@@ -667,7 +667,7 @@ export const ContactInput$inboundSchema: z.ZodType<
667
667
 
668
668
  /** @internal */
669
669
  export type ContactInput$Outbound = {
670
- name: string | null;
670
+ name?: string | null | undefined;
671
671
  owner_id?: string | null | undefined;
672
672
  type?: string | null | undefined;
673
673
  company_id?: string | null | undefined;
@@ -709,7 +709,7 @@ export const ContactInput$outboundSchema: z.ZodType<
709
709
  z.ZodTypeDef,
710
710
  ContactInput
711
711
  > = z.object({
712
- name: z.nullable(z.string()),
712
+ name: z.nullable(z.string()).optional(),
713
713
  ownerId: z.nullable(z.string()).optional(),
714
714
  type: z.nullable(ContactType$outboundSchema).optional(),
715
715
  companyId: z.nullable(z.string()).optional(),
@@ -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";