@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
@@ -48,7 +48,7 @@ import {
48
48
  /**
49
49
  * The classification of account.
50
50
  */
51
- export const Classification = {
51
+ export const LedgerAccountClassification = {
52
52
  Asset: "asset",
53
53
  Equity: "equity",
54
54
  Expense: "expense",
@@ -63,7 +63,9 @@ export const Classification = {
63
63
  /**
64
64
  * The classification of account.
65
65
  */
66
- export type Classification = ClosedEnum<typeof Classification>;
66
+ export type LedgerAccountClassification = ClosedEnum<
67
+ typeof LedgerAccountClassification
68
+ >;
67
69
 
68
70
  /**
69
71
  * The type of account.
@@ -171,7 +173,7 @@ export type LedgerAccount = {
171
173
  /**
172
174
  * The classification of account.
173
175
  */
174
- classification?: Classification | null | undefined;
176
+ classification?: LedgerAccountClassification | null | undefined;
175
177
  /**
176
178
  * The type of account.
177
179
  */
@@ -293,7 +295,7 @@ export type LedgerAccountInput = {
293
295
  /**
294
296
  * The classification of account.
295
297
  */
296
- classification?: Classification | null | undefined;
298
+ classification?: LedgerAccountClassification | null | undefined;
297
299
  /**
298
300
  * The type of account.
299
301
  */
@@ -370,24 +372,24 @@ export type LedgerAccountInput = {
370
372
  };
371
373
 
372
374
  /** @internal */
373
- export const Classification$inboundSchema: z.ZodNativeEnum<
374
- typeof Classification
375
- > = z.nativeEnum(Classification);
375
+ export const LedgerAccountClassification$inboundSchema: z.ZodNativeEnum<
376
+ typeof LedgerAccountClassification
377
+ > = z.nativeEnum(LedgerAccountClassification);
376
378
 
377
379
  /** @internal */
378
- export const Classification$outboundSchema: z.ZodNativeEnum<
379
- typeof Classification
380
- > = Classification$inboundSchema;
380
+ export const LedgerAccountClassification$outboundSchema: z.ZodNativeEnum<
381
+ typeof LedgerAccountClassification
382
+ > = LedgerAccountClassification$inboundSchema;
381
383
 
382
384
  /**
383
385
  * @internal
384
386
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
385
387
  */
386
- export namespace Classification$ {
387
- /** @deprecated use `Classification$inboundSchema` instead. */
388
- export const inboundSchema = Classification$inboundSchema;
389
- /** @deprecated use `Classification$outboundSchema` instead. */
390
- export const outboundSchema = Classification$outboundSchema;
388
+ export namespace LedgerAccountClassification$ {
389
+ /** @deprecated use `LedgerAccountClassification$inboundSchema` instead. */
390
+ export const inboundSchema = LedgerAccountClassification$inboundSchema;
391
+ /** @deprecated use `LedgerAccountClassification$outboundSchema` instead. */
392
+ export const outboundSchema = LedgerAccountClassification$outboundSchema;
391
393
  }
392
394
 
393
395
  /** @internal */
@@ -674,7 +676,8 @@ export const LedgerAccount$inboundSchema: z.ZodType<
674
676
  display_id: z.string().optional(),
675
677
  nominal_code: z.nullable(z.string()).optional(),
676
678
  code: z.nullable(z.string()).optional(),
677
- classification: z.nullable(Classification$inboundSchema).optional(),
679
+ classification: z.nullable(LedgerAccountClassification$inboundSchema)
680
+ .optional(),
678
681
  type: LedgerAccountType$inboundSchema.optional(),
679
682
  sub_type: z.nullable(z.string()).optional(),
680
683
  name: z.nullable(z.string()).optional(),
@@ -785,7 +788,8 @@ export const LedgerAccount$outboundSchema: z.ZodType<
785
788
  displayId: z.string().optional(),
786
789
  nominalCode: z.nullable(z.string()).optional(),
787
790
  code: z.nullable(z.string()).optional(),
788
- classification: z.nullable(Classification$outboundSchema).optional(),
791
+ classification: z.nullable(LedgerAccountClassification$outboundSchema)
792
+ .optional(),
789
793
  type: LedgerAccountType$outboundSchema.optional(),
790
794
  subType: z.nullable(z.string()).optional(),
791
795
  name: z.nullable(z.string()).optional(),
@@ -880,7 +884,8 @@ export const LedgerAccountInput$inboundSchema: z.ZodType<
880
884
  display_id: z.string().optional(),
881
885
  nominal_code: z.nullable(z.string()).optional(),
882
886
  code: z.nullable(z.string()).optional(),
883
- classification: z.nullable(Classification$inboundSchema).optional(),
887
+ classification: z.nullable(LedgerAccountClassification$inboundSchema)
888
+ .optional(),
884
889
  type: LedgerAccountType$inboundSchema.optional(),
885
890
  sub_type: z.nullable(z.string()).optional(),
886
891
  name: z.nullable(z.string()).optional(),
@@ -965,7 +970,8 @@ export const LedgerAccountInput$outboundSchema: z.ZodType<
965
970
  displayId: z.string().optional(),
966
971
  nominalCode: z.nullable(z.string()).optional(),
967
972
  code: z.nullable(z.string()).optional(),
968
- classification: z.nullable(Classification$outboundSchema).optional(),
973
+ classification: z.nullable(LedgerAccountClassification$outboundSchema)
974
+ .optional(),
969
975
  type: LedgerAccountType$outboundSchema.optional(),
970
976
  subType: z.nullable(z.string()).optional(),
971
977
  name: z.nullable(z.string()).optional(),
@@ -5,13 +5,59 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
11
 
12
+ /**
13
+ * Filter by account classification.
14
+ */
15
+ export const Classification = {
16
+ Asset: "asset",
17
+ Equity: "equity",
18
+ Expense: "expense",
19
+ Liability: "liability",
20
+ Revenue: "revenue",
21
+ Income: "income",
22
+ OtherIncome: "other_income",
23
+ OtherExpense: "other_expense",
24
+ CostsOfSales: "costs_of_sales",
25
+ Other: "other",
26
+ } as const;
27
+ /**
28
+ * Filter by account classification.
29
+ */
30
+ export type Classification = ClosedEnum<typeof Classification>;
31
+
11
32
  export type LedgerAccountsFilter = {
12
33
  updatedSince?: Date | undefined;
34
+ /**
35
+ * Filter by account classification.
36
+ */
37
+ classification?: Classification | undefined;
13
38
  };
14
39
 
40
+ /** @internal */
41
+ export const Classification$inboundSchema: z.ZodNativeEnum<
42
+ typeof Classification
43
+ > = z.nativeEnum(Classification);
44
+
45
+ /** @internal */
46
+ export const Classification$outboundSchema: z.ZodNativeEnum<
47
+ typeof Classification
48
+ > = Classification$inboundSchema;
49
+
50
+ /**
51
+ * @internal
52
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
53
+ */
54
+ export namespace Classification$ {
55
+ /** @deprecated use `Classification$inboundSchema` instead. */
56
+ export const inboundSchema = Classification$inboundSchema;
57
+ /** @deprecated use `Classification$outboundSchema` instead. */
58
+ export const outboundSchema = Classification$outboundSchema;
59
+ }
60
+
15
61
  /** @internal */
16
62
  export const LedgerAccountsFilter$inboundSchema: z.ZodType<
17
63
  LedgerAccountsFilter,
@@ -21,6 +67,7 @@ export const LedgerAccountsFilter$inboundSchema: z.ZodType<
21
67
  updated_since: z.string().datetime({ offset: true }).transform(v =>
22
68
  new Date(v)
23
69
  ).optional(),
70
+ classification: Classification$inboundSchema.optional(),
24
71
  }).transform((v) => {
25
72
  return remap$(v, {
26
73
  "updated_since": "updatedSince",
@@ -30,6 +77,7 @@ export const LedgerAccountsFilter$inboundSchema: z.ZodType<
30
77
  /** @internal */
31
78
  export type LedgerAccountsFilter$Outbound = {
32
79
  updated_since?: string | undefined;
80
+ classification?: string | undefined;
33
81
  };
34
82
 
35
83
  /** @internal */
@@ -39,6 +87,7 @@ export const LedgerAccountsFilter$outboundSchema: z.ZodType<
39
87
  LedgerAccountsFilter
40
88
  > = z.object({
41
89
  updatedSince: z.date().transform(v => v.toISOString()).optional(),
90
+ classification: Classification$outboundSchema.optional(),
42
91
  }).transform((v) => {
43
92
  return remap$(v, {
44
93
  updatedSince: "updated_since",
@@ -120,6 +120,10 @@ export type Supplier = {
120
120
  * The company or subsidiary id the transaction belongs to
121
121
  */
122
122
  companyId?: string | null | undefined;
123
+ /**
124
+ * The category/type of the supplier
125
+ */
126
+ supplierCategory?: string | null | undefined;
123
127
  /**
124
128
  * The job title of the person.
125
129
  */
@@ -221,6 +225,10 @@ export type SupplierInput = {
221
225
  * The company or subsidiary id the transaction belongs to
222
226
  */
223
227
  companyId?: string | null | undefined;
228
+ /**
229
+ * The category/type of the supplier
230
+ */
231
+ supplierCategory?: string | null | undefined;
224
232
  /**
225
233
  * The job title of the person.
226
234
  */
@@ -318,6 +326,7 @@ export const Supplier$inboundSchema: z.ZodType<
318
326
  display_name: z.nullable(z.string()).optional(),
319
327
  company_name: z.nullable(z.string()).optional(),
320
328
  company_id: z.nullable(z.string()).optional(),
329
+ supplier_category: z.nullable(z.string()).optional(),
321
330
  title: z.nullable(z.string()).optional(),
322
331
  first_name: z.nullable(z.string()).optional(),
323
332
  middle_name: z.nullable(z.string()).optional(),
@@ -357,6 +366,7 @@ export const Supplier$inboundSchema: z.ZodType<
357
366
  "display_name": "displayName",
358
367
  "company_name": "companyName",
359
368
  "company_id": "companyId",
369
+ "supplier_category": "supplierCategory",
360
370
  "first_name": "firstName",
361
371
  "middle_name": "middleName",
362
372
  "last_name": "lastName",
@@ -385,6 +395,7 @@ export type Supplier$Outbound = {
385
395
  display_name?: string | null | undefined;
386
396
  company_name?: string | null | undefined;
387
397
  company_id?: string | null | undefined;
398
+ supplier_category?: string | null | undefined;
388
399
  title?: string | null | undefined;
389
400
  first_name?: string | null | undefined;
390
401
  middle_name?: string | null | undefined;
@@ -427,6 +438,7 @@ export const Supplier$outboundSchema: z.ZodType<
427
438
  displayName: z.nullable(z.string()).optional(),
428
439
  companyName: z.nullable(z.string()).optional(),
429
440
  companyId: z.nullable(z.string()).optional(),
441
+ supplierCategory: z.nullable(z.string()).optional(),
430
442
  title: z.nullable(z.string()).optional(),
431
443
  firstName: z.nullable(z.string()).optional(),
432
444
  middleName: z.nullable(z.string()).optional(),
@@ -462,6 +474,7 @@ export const Supplier$outboundSchema: z.ZodType<
462
474
  displayName: "display_name",
463
475
  companyName: "company_name",
464
476
  companyId: "company_id",
477
+ supplierCategory: "supplier_category",
465
478
  firstName: "first_name",
466
479
  middleName: "middle_name",
467
480
  lastName: "last_name",
@@ -519,6 +532,7 @@ export const SupplierInput$inboundSchema: z.ZodType<
519
532
  display_name: z.nullable(z.string()).optional(),
520
533
  company_name: z.nullable(z.string()).optional(),
521
534
  company_id: z.nullable(z.string()).optional(),
535
+ supplier_category: z.nullable(z.string()).optional(),
522
536
  title: z.nullable(z.string()).optional(),
523
537
  first_name: z.nullable(z.string()).optional(),
524
538
  middle_name: z.nullable(z.string()).optional(),
@@ -548,6 +562,7 @@ export const SupplierInput$inboundSchema: z.ZodType<
548
562
  "display_name": "displayName",
549
563
  "company_name": "companyName",
550
564
  "company_id": "companyId",
565
+ "supplier_category": "supplierCategory",
551
566
  "first_name": "firstName",
552
567
  "middle_name": "middleName",
553
568
  "last_name": "lastName",
@@ -569,6 +584,7 @@ export type SupplierInput$Outbound = {
569
584
  display_name?: string | null | undefined;
570
585
  company_name?: string | null | undefined;
571
586
  company_id?: string | null | undefined;
587
+ supplier_category?: string | null | undefined;
572
588
  title?: string | null | undefined;
573
589
  first_name?: string | null | undefined;
574
590
  middle_name?: string | null | undefined;
@@ -604,6 +620,7 @@ export const SupplierInput$outboundSchema: z.ZodType<
604
620
  displayName: z.nullable(z.string()).optional(),
605
621
  companyName: z.nullable(z.string()).optional(),
606
622
  companyId: z.nullable(z.string()).optional(),
623
+ supplierCategory: z.nullable(z.string()).optional(),
607
624
  title: z.nullable(z.string()).optional(),
608
625
  firstName: z.nullable(z.string()).optional(),
609
626
  middleName: z.nullable(z.string()).optional(),
@@ -633,6 +650,7 @@ export const SupplierInput$outboundSchema: z.ZodType<
633
650
  displayName: "display_name",
634
651
  companyName: "company_name",
635
652
  companyId: "company_id",
653
+ supplierCategory: "supplier_category",
636
654
  firstName: "first_name",
637
655
  middleName: "middle_name",
638
656
  lastName: "last_name",
@@ -0,0 +1,277 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type AccountingCategoriesAllGlobals = {
13
+ /**
14
+ * ID of the consumer which you want to get or push data from
15
+ */
16
+ consumerId?: string | undefined;
17
+ /**
18
+ * The ID of your Unify application
19
+ */
20
+ appId?: string | undefined;
21
+ };
22
+
23
+ export type AccountingCategoriesAllRequest = {
24
+ /**
25
+ * Include raw response. Mostly used for debugging purposes
26
+ */
27
+ raw?: boolean | undefined;
28
+ /**
29
+ * ID of the consumer which you want to get or push data from
30
+ */
31
+ consumerId?: string | undefined;
32
+ /**
33
+ * The ID of your Unify application
34
+ */
35
+ appId?: string | undefined;
36
+ /**
37
+ * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.
38
+ */
39
+ serviceId?: string | undefined;
40
+ /**
41
+ * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.
42
+ */
43
+ cursor?: string | null | undefined;
44
+ /**
45
+ * Number of results to return. Minimum 1, Maximum 200, Default 20
46
+ */
47
+ limit?: number | undefined;
48
+ /**
49
+ * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
50
+ */
51
+ fields?: string | null | undefined;
52
+ };
53
+
54
+ export type AccountingCategoriesAllResponse = {
55
+ httpMeta: components.HTTPMetadata;
56
+ /**
57
+ * Categories
58
+ */
59
+ getCategoriesResponse?: components.GetCategoriesResponse | undefined;
60
+ /**
61
+ * Unexpected error
62
+ */
63
+ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined;
64
+ };
65
+
66
+ /** @internal */
67
+ export const AccountingCategoriesAllGlobals$inboundSchema: z.ZodType<
68
+ AccountingCategoriesAllGlobals,
69
+ z.ZodTypeDef,
70
+ unknown
71
+ > = z.object({
72
+ consumerId: z.string().optional(),
73
+ appId: z.string().optional(),
74
+ });
75
+
76
+ /** @internal */
77
+ export type AccountingCategoriesAllGlobals$Outbound = {
78
+ consumerId?: string | undefined;
79
+ appId?: string | undefined;
80
+ };
81
+
82
+ /** @internal */
83
+ export const AccountingCategoriesAllGlobals$outboundSchema: z.ZodType<
84
+ AccountingCategoriesAllGlobals$Outbound,
85
+ z.ZodTypeDef,
86
+ AccountingCategoriesAllGlobals
87
+ > = z.object({
88
+ consumerId: z.string().optional(),
89
+ appId: z.string().optional(),
90
+ });
91
+
92
+ /**
93
+ * @internal
94
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
95
+ */
96
+ export namespace AccountingCategoriesAllGlobals$ {
97
+ /** @deprecated use `AccountingCategoriesAllGlobals$inboundSchema` instead. */
98
+ export const inboundSchema = AccountingCategoriesAllGlobals$inboundSchema;
99
+ /** @deprecated use `AccountingCategoriesAllGlobals$outboundSchema` instead. */
100
+ export const outboundSchema = AccountingCategoriesAllGlobals$outboundSchema;
101
+ /** @deprecated use `AccountingCategoriesAllGlobals$Outbound` instead. */
102
+ export type Outbound = AccountingCategoriesAllGlobals$Outbound;
103
+ }
104
+
105
+ export function accountingCategoriesAllGlobalsToJSON(
106
+ accountingCategoriesAllGlobals: AccountingCategoriesAllGlobals,
107
+ ): string {
108
+ return JSON.stringify(
109
+ AccountingCategoriesAllGlobals$outboundSchema.parse(
110
+ accountingCategoriesAllGlobals,
111
+ ),
112
+ );
113
+ }
114
+
115
+ export function accountingCategoriesAllGlobalsFromJSON(
116
+ jsonString: string,
117
+ ): SafeParseResult<AccountingCategoriesAllGlobals, SDKValidationError> {
118
+ return safeParse(
119
+ jsonString,
120
+ (x) => AccountingCategoriesAllGlobals$inboundSchema.parse(JSON.parse(x)),
121
+ `Failed to parse 'AccountingCategoriesAllGlobals' from JSON`,
122
+ );
123
+ }
124
+
125
+ /** @internal */
126
+ export const AccountingCategoriesAllRequest$inboundSchema: z.ZodType<
127
+ AccountingCategoriesAllRequest,
128
+ z.ZodTypeDef,
129
+ unknown
130
+ > = z.object({
131
+ raw: z.boolean().default(false),
132
+ consumerId: z.string().optional(),
133
+ appId: z.string().optional(),
134
+ serviceId: z.string().optional(),
135
+ cursor: z.nullable(z.string()).optional(),
136
+ limit: z.number().int().default(20),
137
+ fields: z.nullable(z.string()).optional(),
138
+ });
139
+
140
+ /** @internal */
141
+ export type AccountingCategoriesAllRequest$Outbound = {
142
+ raw: boolean;
143
+ consumerId?: string | undefined;
144
+ appId?: string | undefined;
145
+ serviceId?: string | undefined;
146
+ cursor?: string | null | undefined;
147
+ limit: number;
148
+ fields?: string | null | undefined;
149
+ };
150
+
151
+ /** @internal */
152
+ export const AccountingCategoriesAllRequest$outboundSchema: z.ZodType<
153
+ AccountingCategoriesAllRequest$Outbound,
154
+ z.ZodTypeDef,
155
+ AccountingCategoriesAllRequest
156
+ > = z.object({
157
+ raw: z.boolean().default(false),
158
+ consumerId: z.string().optional(),
159
+ appId: z.string().optional(),
160
+ serviceId: z.string().optional(),
161
+ cursor: z.nullable(z.string()).optional(),
162
+ limit: z.number().int().default(20),
163
+ fields: z.nullable(z.string()).optional(),
164
+ });
165
+
166
+ /**
167
+ * @internal
168
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
169
+ */
170
+ export namespace AccountingCategoriesAllRequest$ {
171
+ /** @deprecated use `AccountingCategoriesAllRequest$inboundSchema` instead. */
172
+ export const inboundSchema = AccountingCategoriesAllRequest$inboundSchema;
173
+ /** @deprecated use `AccountingCategoriesAllRequest$outboundSchema` instead. */
174
+ export const outboundSchema = AccountingCategoriesAllRequest$outboundSchema;
175
+ /** @deprecated use `AccountingCategoriesAllRequest$Outbound` instead. */
176
+ export type Outbound = AccountingCategoriesAllRequest$Outbound;
177
+ }
178
+
179
+ export function accountingCategoriesAllRequestToJSON(
180
+ accountingCategoriesAllRequest: AccountingCategoriesAllRequest,
181
+ ): string {
182
+ return JSON.stringify(
183
+ AccountingCategoriesAllRequest$outboundSchema.parse(
184
+ accountingCategoriesAllRequest,
185
+ ),
186
+ );
187
+ }
188
+
189
+ export function accountingCategoriesAllRequestFromJSON(
190
+ jsonString: string,
191
+ ): SafeParseResult<AccountingCategoriesAllRequest, SDKValidationError> {
192
+ return safeParse(
193
+ jsonString,
194
+ (x) => AccountingCategoriesAllRequest$inboundSchema.parse(JSON.parse(x)),
195
+ `Failed to parse 'AccountingCategoriesAllRequest' from JSON`,
196
+ );
197
+ }
198
+
199
+ /** @internal */
200
+ export const AccountingCategoriesAllResponse$inboundSchema: z.ZodType<
201
+ AccountingCategoriesAllResponse,
202
+ z.ZodTypeDef,
203
+ unknown
204
+ > = z.object({
205
+ HttpMeta: components.HTTPMetadata$inboundSchema,
206
+ GetCategoriesResponse: components.GetCategoriesResponse$inboundSchema
207
+ .optional(),
208
+ UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema
209
+ .optional(),
210
+ }).transform((v) => {
211
+ return remap$(v, {
212
+ "HttpMeta": "httpMeta",
213
+ "GetCategoriesResponse": "getCategoriesResponse",
214
+ "UnexpectedErrorResponse": "unexpectedErrorResponse",
215
+ });
216
+ });
217
+
218
+ /** @internal */
219
+ export type AccountingCategoriesAllResponse$Outbound = {
220
+ HttpMeta: components.HTTPMetadata$Outbound;
221
+ GetCategoriesResponse?: components.GetCategoriesResponse$Outbound | undefined;
222
+ UnexpectedErrorResponse?:
223
+ | components.UnexpectedErrorResponse$Outbound
224
+ | undefined;
225
+ };
226
+
227
+ /** @internal */
228
+ export const AccountingCategoriesAllResponse$outboundSchema: z.ZodType<
229
+ AccountingCategoriesAllResponse$Outbound,
230
+ z.ZodTypeDef,
231
+ AccountingCategoriesAllResponse
232
+ > = z.object({
233
+ httpMeta: components.HTTPMetadata$outboundSchema,
234
+ getCategoriesResponse: components.GetCategoriesResponse$outboundSchema
235
+ .optional(),
236
+ unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema
237
+ .optional(),
238
+ }).transform((v) => {
239
+ return remap$(v, {
240
+ httpMeta: "HttpMeta",
241
+ getCategoriesResponse: "GetCategoriesResponse",
242
+ unexpectedErrorResponse: "UnexpectedErrorResponse",
243
+ });
244
+ });
245
+
246
+ /**
247
+ * @internal
248
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
249
+ */
250
+ export namespace AccountingCategoriesAllResponse$ {
251
+ /** @deprecated use `AccountingCategoriesAllResponse$inboundSchema` instead. */
252
+ export const inboundSchema = AccountingCategoriesAllResponse$inboundSchema;
253
+ /** @deprecated use `AccountingCategoriesAllResponse$outboundSchema` instead. */
254
+ export const outboundSchema = AccountingCategoriesAllResponse$outboundSchema;
255
+ /** @deprecated use `AccountingCategoriesAllResponse$Outbound` instead. */
256
+ export type Outbound = AccountingCategoriesAllResponse$Outbound;
257
+ }
258
+
259
+ export function accountingCategoriesAllResponseToJSON(
260
+ accountingCategoriesAllResponse: AccountingCategoriesAllResponse,
261
+ ): string {
262
+ return JSON.stringify(
263
+ AccountingCategoriesAllResponse$outboundSchema.parse(
264
+ accountingCategoriesAllResponse,
265
+ ),
266
+ );
267
+ }
268
+
269
+ export function accountingCategoriesAllResponseFromJSON(
270
+ jsonString: string,
271
+ ): SafeParseResult<AccountingCategoriesAllResponse, SDKValidationError> {
272
+ return safeParse(
273
+ jsonString,
274
+ (x) => AccountingCategoriesAllResponse$inboundSchema.parse(JSON.parse(x)),
275
+ `Failed to parse 'AccountingCategoriesAllResponse' from JSON`,
276
+ );
277
+ }