@unified-api/typescript-sdk 2.75.2 → 2.76.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 (123) hide show
  1. package/README.md +12 -0
  2. package/docs/sdks/accounting/README.md +482 -0
  3. package/docs/sdks/expense/README.md +489 -0
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/accountingCreateAccountingExpense.d.ts +15 -0
  6. package/funcs/accountingCreateAccountingExpense.d.ts.map +1 -0
  7. package/funcs/accountingCreateAccountingExpense.js +122 -0
  8. package/funcs/accountingCreateAccountingExpense.js.map +1 -0
  9. package/funcs/accountingGetAccountingExpense.d.ts +15 -0
  10. package/funcs/accountingGetAccountingExpense.d.ts.map +1 -0
  11. package/funcs/accountingGetAccountingExpense.js +125 -0
  12. package/funcs/accountingGetAccountingExpense.js.map +1 -0
  13. package/funcs/accountingListAccountingExpenses.d.ts +15 -0
  14. package/funcs/accountingListAccountingExpenses.d.ts.map +1 -0
  15. package/funcs/accountingListAccountingExpenses.js +129 -0
  16. package/funcs/accountingListAccountingExpenses.js.map +1 -0
  17. package/funcs/accountingPatchAccountingExpense.d.ts +15 -0
  18. package/funcs/accountingPatchAccountingExpense.d.ts.map +1 -0
  19. package/funcs/accountingPatchAccountingExpense.js +126 -0
  20. package/funcs/accountingPatchAccountingExpense.js.map +1 -0
  21. package/funcs/accountingRemoveAccountingExpense.d.ts +14 -0
  22. package/funcs/accountingRemoveAccountingExpense.d.ts.map +1 -0
  23. package/funcs/accountingRemoveAccountingExpense.js +122 -0
  24. package/funcs/accountingRemoveAccountingExpense.js.map +1 -0
  25. package/funcs/accountingUpdateAccountingExpense.d.ts +15 -0
  26. package/funcs/accountingUpdateAccountingExpense.d.ts.map +1 -0
  27. package/funcs/accountingUpdateAccountingExpense.js +126 -0
  28. package/funcs/accountingUpdateAccountingExpense.js.map +1 -0
  29. package/funcs/messagingListMessagingMessages.js +1 -0
  30. package/funcs/messagingListMessagingMessages.js.map +1 -1
  31. package/jsr.json +1 -1
  32. package/lib/config.d.ts +3 -3
  33. package/lib/config.js +3 -3
  34. package/lib/config.js.map +1 -1
  35. package/package.json +1 -1
  36. package/sdk/accounting.d.ts +24 -0
  37. package/sdk/accounting.d.ts.map +1 -1
  38. package/sdk/accounting.js +42 -0
  39. package/sdk/accounting.js.map +1 -1
  40. package/sdk/expense.d.ts +30 -0
  41. package/sdk/expense.d.ts.map +1 -0
  42. package/sdk/expense.js +54 -0
  43. package/sdk/expense.js.map +1 -0
  44. package/sdk/models/operations/createaccountingexpense.d.ts +45 -0
  45. package/sdk/models/operations/createaccountingexpense.d.ts.map +1 -0
  46. package/sdk/models/operations/createaccountingexpense.js +87 -0
  47. package/sdk/models/operations/createaccountingexpense.js.map +1 -0
  48. package/sdk/models/operations/getaccountingexpense.d.ts +47 -0
  49. package/sdk/models/operations/getaccountingexpense.d.ts.map +1 -0
  50. package/sdk/models/operations/getaccountingexpense.js +84 -0
  51. package/sdk/models/operations/getaccountingexpense.js.map +1 -0
  52. package/sdk/models/operations/index.d.ts +6 -0
  53. package/sdk/models/operations/index.d.ts.map +1 -1
  54. package/sdk/models/operations/index.js +6 -0
  55. package/sdk/models/operations/index.js.map +1 -1
  56. package/sdk/models/operations/listaccountingexpenses.d.ts +65 -0
  57. package/sdk/models/operations/listaccountingexpenses.d.ts.map +1 -0
  58. package/sdk/models/operations/listaccountingexpenses.js +100 -0
  59. package/sdk/models/operations/listaccountingexpenses.js.map +1 -0
  60. package/sdk/models/operations/listmessagingmessages.d.ts +5 -0
  61. package/sdk/models/operations/listmessagingmessages.d.ts.map +1 -1
  62. package/sdk/models/operations/listmessagingmessages.js +4 -0
  63. package/sdk/models/operations/listmessagingmessages.js.map +1 -1
  64. package/sdk/models/operations/patchaccountingexpense.d.ts +50 -0
  65. package/sdk/models/operations/patchaccountingexpense.d.ts.map +1 -0
  66. package/sdk/models/operations/patchaccountingexpense.js +89 -0
  67. package/sdk/models/operations/patchaccountingexpense.js.map +1 -0
  68. package/sdk/models/operations/removeaccountingexpense.d.ts +66 -0
  69. package/sdk/models/operations/removeaccountingexpense.d.ts.map +1 -0
  70. package/sdk/models/operations/removeaccountingexpense.js +115 -0
  71. package/sdk/models/operations/removeaccountingexpense.js.map +1 -0
  72. package/sdk/models/operations/updateaccountingexpense.d.ts +50 -0
  73. package/sdk/models/operations/updateaccountingexpense.d.ts.map +1 -0
  74. package/sdk/models/operations/updateaccountingexpense.js +89 -0
  75. package/sdk/models/operations/updateaccountingexpense.js.map +1 -0
  76. package/sdk/models/shared/accountingexpense.d.ts +60 -0
  77. package/sdk/models/shared/accountingexpense.d.ts.map +1 -0
  78. package/sdk/models/shared/accountingexpense.js +124 -0
  79. package/sdk/models/shared/accountingexpense.js.map +1 -0
  80. package/sdk/models/shared/atsjob.d.ts +4 -0
  81. package/sdk/models/shared/atsjob.d.ts.map +1 -1
  82. package/sdk/models/shared/atsjob.js +8 -0
  83. package/sdk/models/shared/atsjob.js.map +1 -1
  84. package/sdk/models/shared/index.d.ts +1 -0
  85. package/sdk/models/shared/index.d.ts.map +1 -1
  86. package/sdk/models/shared/index.js +1 -0
  87. package/sdk/models/shared/index.js.map +1 -1
  88. package/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
  89. package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  90. package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  91. package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  92. package/sdk/models/shared/webhook.d.ts +1 -0
  93. package/sdk/models/shared/webhook.d.ts.map +1 -1
  94. package/sdk/models/shared/webhook.js +1 -0
  95. package/sdk/models/shared/webhook.js.map +1 -1
  96. package/sdk/sdk.d.ts +3 -0
  97. package/sdk/sdk.d.ts.map +1 -1
  98. package/sdk/sdk.js +4 -0
  99. package/sdk/sdk.js.map +1 -1
  100. package/src/funcs/accountingCreateAccountingExpense.ts +171 -0
  101. package/src/funcs/accountingGetAccountingExpense.ts +176 -0
  102. package/src/funcs/accountingListAccountingExpenses.ts +178 -0
  103. package/src/funcs/accountingPatchAccountingExpense.ts +177 -0
  104. package/src/funcs/accountingRemoveAccountingExpense.ts +181 -0
  105. package/src/funcs/accountingUpdateAccountingExpense.ts +177 -0
  106. package/src/funcs/messagingListMessagingMessages.ts +1 -0
  107. package/src/lib/config.ts +3 -3
  108. package/src/sdk/accounting.ts +90 -0
  109. package/src/sdk/expense.ts +100 -0
  110. package/src/sdk/models/operations/createaccountingexpense.ts +101 -0
  111. package/src/sdk/models/operations/getaccountingexpense.ts +101 -0
  112. package/src/sdk/models/operations/index.ts +6 -0
  113. package/src/sdk/models/operations/listaccountingexpenses.ts +135 -0
  114. package/src/sdk/models/operations/listmessagingmessages.ts +9 -0
  115. package/src/sdk/models/operations/patchaccountingexpense.ts +108 -0
  116. package/src/sdk/models/operations/removeaccountingexpense.ts +155 -0
  117. package/src/sdk/models/operations/updateaccountingexpense.ts +108 -0
  118. package/src/sdk/models/shared/accountingexpense.ts +154 -0
  119. package/src/sdk/models/shared/atsjob.ts +12 -0
  120. package/src/sdk/models/shared/index.ts +1 -0
  121. package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
  122. package/src/sdk/models/shared/webhook.ts +1 -0
  123. package/src/sdk/sdk.ts +6 -0
@@ -108,6 +108,7 @@ async function $do(
108
108
  "sort": payload.sort,
109
109
  "start_gte": payload.start_gte,
110
110
  "updated_gte": payload.updated_gte,
111
+ "user_id": payload.user_id,
111
112
  });
112
113
 
113
114
  const headers = new Headers(compactMap({
package/src/lib/config.ts CHANGED
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
73
73
  export const SDK_METADATA = {
74
74
  language: "typescript",
75
75
  openapiDocVersion: "1.0",
76
- sdkVersion: "2.75.2",
77
- genVersion: "2.723.11",
76
+ sdkVersion: "2.76.0",
77
+ genVersion: "2.727.4",
78
78
  userAgent:
79
- "speakeasy-sdk/typescript 2.75.2 2.723.11 1.0 @unified-api/typescript-sdk",
79
+ "speakeasy-sdk/typescript 2.76.0 2.727.4 1.0 @unified-api/typescript-sdk",
80
80
  } as const;
@@ -7,6 +7,7 @@ import { accountingCreateAccountingBill } from "../funcs/accountingCreateAccount
7
7
  import { accountingCreateAccountingCategory } from "../funcs/accountingCreateAccountingCategory.js";
8
8
  import { accountingCreateAccountingContact } from "../funcs/accountingCreateAccountingContact.js";
9
9
  import { accountingCreateAccountingCreditmemo } from "../funcs/accountingCreateAccountingCreditmemo.js";
10
+ import { accountingCreateAccountingExpense } from "../funcs/accountingCreateAccountingExpense.js";
10
11
  import { accountingCreateAccountingInvoice } from "../funcs/accountingCreateAccountingInvoice.js";
11
12
  import { accountingCreateAccountingJournal } from "../funcs/accountingCreateAccountingJournal.js";
12
13
  import { accountingCreateAccountingOrder } from "../funcs/accountingCreateAccountingOrder.js";
@@ -20,6 +21,7 @@ import { accountingGetAccountingBill } from "../funcs/accountingGetAccountingBil
20
21
  import { accountingGetAccountingCategory } from "../funcs/accountingGetAccountingCategory.js";
21
22
  import { accountingGetAccountingContact } from "../funcs/accountingGetAccountingContact.js";
22
23
  import { accountingGetAccountingCreditmemo } from "../funcs/accountingGetAccountingCreditmemo.js";
24
+ import { accountingGetAccountingExpense } from "../funcs/accountingGetAccountingExpense.js";
23
25
  import { accountingGetAccountingInvoice } from "../funcs/accountingGetAccountingInvoice.js";
24
26
  import { accountingGetAccountingJournal } from "../funcs/accountingGetAccountingJournal.js";
25
27
  import { accountingGetAccountingOrder } from "../funcs/accountingGetAccountingOrder.js";
@@ -37,6 +39,7 @@ import { accountingListAccountingBills } from "../funcs/accountingListAccounting
37
39
  import { accountingListAccountingCategories } from "../funcs/accountingListAccountingCategories.js";
38
40
  import { accountingListAccountingContacts } from "../funcs/accountingListAccountingContacts.js";
39
41
  import { accountingListAccountingCreditmemoes } from "../funcs/accountingListAccountingCreditmemoes.js";
42
+ import { accountingListAccountingExpenses } from "../funcs/accountingListAccountingExpenses.js";
40
43
  import { accountingListAccountingInvoices } from "../funcs/accountingListAccountingInvoices.js";
41
44
  import { accountingListAccountingJournals } from "../funcs/accountingListAccountingJournals.js";
42
45
  import { accountingListAccountingOrders } from "../funcs/accountingListAccountingOrders.js";
@@ -53,6 +56,7 @@ import { accountingPatchAccountingBill } from "../funcs/accountingPatchAccountin
53
56
  import { accountingPatchAccountingCategory } from "../funcs/accountingPatchAccountingCategory.js";
54
57
  import { accountingPatchAccountingContact } from "../funcs/accountingPatchAccountingContact.js";
55
58
  import { accountingPatchAccountingCreditmemo } from "../funcs/accountingPatchAccountingCreditmemo.js";
59
+ import { accountingPatchAccountingExpense } from "../funcs/accountingPatchAccountingExpense.js";
56
60
  import { accountingPatchAccountingInvoice } from "../funcs/accountingPatchAccountingInvoice.js";
57
61
  import { accountingPatchAccountingJournal } from "../funcs/accountingPatchAccountingJournal.js";
58
62
  import { accountingPatchAccountingOrder } from "../funcs/accountingPatchAccountingOrder.js";
@@ -65,6 +69,7 @@ import { accountingRemoveAccountingBill } from "../funcs/accountingRemoveAccount
65
69
  import { accountingRemoveAccountingCategory } from "../funcs/accountingRemoveAccountingCategory.js";
66
70
  import { accountingRemoveAccountingContact } from "../funcs/accountingRemoveAccountingContact.js";
67
71
  import { accountingRemoveAccountingCreditmemo } from "../funcs/accountingRemoveAccountingCreditmemo.js";
72
+ import { accountingRemoveAccountingExpense } from "../funcs/accountingRemoveAccountingExpense.js";
68
73
  import { accountingRemoveAccountingInvoice } from "../funcs/accountingRemoveAccountingInvoice.js";
69
74
  import { accountingRemoveAccountingJournal } from "../funcs/accountingRemoveAccountingJournal.js";
70
75
  import { accountingRemoveAccountingOrder } from "../funcs/accountingRemoveAccountingOrder.js";
@@ -77,6 +82,7 @@ import { accountingUpdateAccountingBill } from "../funcs/accountingUpdateAccount
77
82
  import { accountingUpdateAccountingCategory } from "../funcs/accountingUpdateAccountingCategory.js";
78
83
  import { accountingUpdateAccountingContact } from "../funcs/accountingUpdateAccountingContact.js";
79
84
  import { accountingUpdateAccountingCreditmemo } from "../funcs/accountingUpdateAccountingCreditmemo.js";
85
+ import { accountingUpdateAccountingExpense } from "../funcs/accountingUpdateAccountingExpense.js";
80
86
  import { accountingUpdateAccountingInvoice } from "../funcs/accountingUpdateAccountingInvoice.js";
81
87
  import { accountingUpdateAccountingJournal } from "../funcs/accountingUpdateAccountingJournal.js";
82
88
  import { accountingUpdateAccountingOrder } from "../funcs/accountingUpdateAccountingOrder.js";
@@ -160,6 +166,20 @@ export class Accounting extends ClientSDK {
160
166
  ));
161
167
  }
162
168
 
169
+ /**
170
+ * Create an expense
171
+ */
172
+ async createAccountingExpense(
173
+ request: operations.CreateAccountingExpenseRequest,
174
+ options?: RequestOptions,
175
+ ): Promise<shared.AccountingExpense> {
176
+ return unwrapAsync(accountingCreateAccountingExpense(
177
+ this,
178
+ request,
179
+ options,
180
+ ));
181
+ }
182
+
163
183
  /**
164
184
  * Create an invoice
165
185
  */
@@ -342,6 +362,20 @@ export class Accounting extends ClientSDK {
342
362
  ));
343
363
  }
344
364
 
365
+ /**
366
+ * Retrieve an expense
367
+ */
368
+ async getAccountingExpense(
369
+ request: operations.GetAccountingExpenseRequest,
370
+ options?: RequestOptions,
371
+ ): Promise<shared.AccountingExpense> {
372
+ return unwrapAsync(accountingGetAccountingExpense(
373
+ this,
374
+ request,
375
+ options,
376
+ ));
377
+ }
378
+
345
379
  /**
346
380
  * Retrieve an invoice
347
381
  */
@@ -580,6 +614,20 @@ export class Accounting extends ClientSDK {
580
614
  ));
581
615
  }
582
616
 
617
+ /**
618
+ * List all expenses
619
+ */
620
+ async listAccountingExpenses(
621
+ request: operations.ListAccountingExpensesRequest,
622
+ options?: RequestOptions,
623
+ ): Promise<Array<shared.AccountingExpense>> {
624
+ return unwrapAsync(accountingListAccountingExpenses(
625
+ this,
626
+ request,
627
+ options,
628
+ ));
629
+ }
630
+
583
631
  /**
584
632
  * List all invoices
585
633
  */
@@ -804,6 +852,20 @@ export class Accounting extends ClientSDK {
804
852
  ));
805
853
  }
806
854
 
855
+ /**
856
+ * Update an expense
857
+ */
858
+ async patchAccountingExpense(
859
+ request: operations.PatchAccountingExpenseRequest,
860
+ options?: RequestOptions,
861
+ ): Promise<shared.AccountingExpense> {
862
+ return unwrapAsync(accountingPatchAccountingExpense(
863
+ this,
864
+ request,
865
+ options,
866
+ ));
867
+ }
868
+
807
869
  /**
808
870
  * Update an invoice
809
871
  */
@@ -972,6 +1034,20 @@ export class Accounting extends ClientSDK {
972
1034
  ));
973
1035
  }
974
1036
 
1037
+ /**
1038
+ * Remove an expense
1039
+ */
1040
+ async removeAccountingExpense(
1041
+ request: operations.RemoveAccountingExpenseRequest,
1042
+ options?: RequestOptions,
1043
+ ): Promise<operations.RemoveAccountingExpenseResponse | undefined> {
1044
+ return unwrapAsync(accountingRemoveAccountingExpense(
1045
+ this,
1046
+ request,
1047
+ options,
1048
+ ));
1049
+ }
1050
+
975
1051
  /**
976
1052
  * Remove an invoice
977
1053
  */
@@ -1140,6 +1216,20 @@ export class Accounting extends ClientSDK {
1140
1216
  ));
1141
1217
  }
1142
1218
 
1219
+ /**
1220
+ * Update an expense
1221
+ */
1222
+ async updateAccountingExpense(
1223
+ request: operations.UpdateAccountingExpenseRequest,
1224
+ options?: RequestOptions,
1225
+ ): Promise<shared.AccountingExpense> {
1226
+ return unwrapAsync(accountingUpdateAccountingExpense(
1227
+ this,
1228
+ request,
1229
+ options,
1230
+ ));
1231
+ }
1232
+
1143
1233
  /**
1144
1234
  * Update an invoice
1145
1235
  */
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { accountingCreateAccountingExpense } from "../funcs/accountingCreateAccountingExpense.js";
6
+ import { accountingGetAccountingExpense } from "../funcs/accountingGetAccountingExpense.js";
7
+ import { accountingListAccountingExpenses } from "../funcs/accountingListAccountingExpenses.js";
8
+ import { accountingPatchAccountingExpense } from "../funcs/accountingPatchAccountingExpense.js";
9
+ import { accountingRemoveAccountingExpense } from "../funcs/accountingRemoveAccountingExpense.js";
10
+ import { accountingUpdateAccountingExpense } from "../funcs/accountingUpdateAccountingExpense.js";
11
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
+ import * as operations from "./models/operations/index.js";
13
+ import * as shared from "./models/shared/index.js";
14
+ import { unwrapAsync } from "./types/fp.js";
15
+
16
+ export class Expense extends ClientSDK {
17
+ /**
18
+ * Create an expense
19
+ */
20
+ async createAccountingExpense(
21
+ request: operations.CreateAccountingExpenseRequest,
22
+ options?: RequestOptions,
23
+ ): Promise<shared.AccountingExpense> {
24
+ return unwrapAsync(accountingCreateAccountingExpense(
25
+ this,
26
+ request,
27
+ options,
28
+ ));
29
+ }
30
+
31
+ /**
32
+ * Retrieve an expense
33
+ */
34
+ async getAccountingExpense(
35
+ request: operations.GetAccountingExpenseRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<shared.AccountingExpense> {
38
+ return unwrapAsync(accountingGetAccountingExpense(
39
+ this,
40
+ request,
41
+ options,
42
+ ));
43
+ }
44
+
45
+ /**
46
+ * List all expenses
47
+ */
48
+ async listAccountingExpenses(
49
+ request: operations.ListAccountingExpensesRequest,
50
+ options?: RequestOptions,
51
+ ): Promise<Array<shared.AccountingExpense>> {
52
+ return unwrapAsync(accountingListAccountingExpenses(
53
+ this,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ /**
60
+ * Update an expense
61
+ */
62
+ async patchAccountingExpense(
63
+ request: operations.PatchAccountingExpenseRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<shared.AccountingExpense> {
66
+ return unwrapAsync(accountingPatchAccountingExpense(
67
+ this,
68
+ request,
69
+ options,
70
+ ));
71
+ }
72
+
73
+ /**
74
+ * Remove an expense
75
+ */
76
+ async removeAccountingExpense(
77
+ request: operations.RemoveAccountingExpenseRequest,
78
+ options?: RequestOptions,
79
+ ): Promise<operations.RemoveAccountingExpenseResponse | undefined> {
80
+ return unwrapAsync(accountingRemoveAccountingExpense(
81
+ this,
82
+ request,
83
+ options,
84
+ ));
85
+ }
86
+
87
+ /**
88
+ * Update an expense
89
+ */
90
+ async updateAccountingExpense(
91
+ request: operations.UpdateAccountingExpenseRequest,
92
+ options?: RequestOptions,
93
+ ): Promise<shared.AccountingExpense> {
94
+ return unwrapAsync(accountingUpdateAccountingExpense(
95
+ this,
96
+ request,
97
+ options,
98
+ ));
99
+ }
100
+ }
@@ -0,0 +1,101 @@
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 * as shared from "../shared/index.js";
11
+
12
+ export type CreateAccountingExpenseRequest = {
13
+ accountingExpense: shared.AccountingExpense;
14
+ /**
15
+ * ID of the connection
16
+ */
17
+ connectionId: string;
18
+ /**
19
+ * Comma-delimited fields to return
20
+ */
21
+ fields?: Array<string> | undefined;
22
+ /**
23
+ * Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
24
+ */
25
+ raw?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const CreateAccountingExpenseRequest$inboundSchema: z.ZodType<
30
+ CreateAccountingExpenseRequest,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ AccountingExpense: shared.AccountingExpense$inboundSchema,
35
+ connection_id: z.string(),
36
+ fields: z.array(z.string()).optional(),
37
+ raw: z.string().optional(),
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ "AccountingExpense": "accountingExpense",
41
+ "connection_id": "connectionId",
42
+ });
43
+ });
44
+
45
+ /** @internal */
46
+ export type CreateAccountingExpenseRequest$Outbound = {
47
+ AccountingExpense: shared.AccountingExpense$Outbound;
48
+ connection_id: string;
49
+ fields?: Array<string> | undefined;
50
+ raw?: string | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const CreateAccountingExpenseRequest$outboundSchema: z.ZodType<
55
+ CreateAccountingExpenseRequest$Outbound,
56
+ z.ZodTypeDef,
57
+ CreateAccountingExpenseRequest
58
+ > = z.object({
59
+ accountingExpense: shared.AccountingExpense$outboundSchema,
60
+ connectionId: z.string(),
61
+ fields: z.array(z.string()).optional(),
62
+ raw: z.string().optional(),
63
+ }).transform((v) => {
64
+ return remap$(v, {
65
+ accountingExpense: "AccountingExpense",
66
+ connectionId: "connection_id",
67
+ });
68
+ });
69
+
70
+ /**
71
+ * @internal
72
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
73
+ */
74
+ export namespace CreateAccountingExpenseRequest$ {
75
+ /** @deprecated use `CreateAccountingExpenseRequest$inboundSchema` instead. */
76
+ export const inboundSchema = CreateAccountingExpenseRequest$inboundSchema;
77
+ /** @deprecated use `CreateAccountingExpenseRequest$outboundSchema` instead. */
78
+ export const outboundSchema = CreateAccountingExpenseRequest$outboundSchema;
79
+ /** @deprecated use `CreateAccountingExpenseRequest$Outbound` instead. */
80
+ export type Outbound = CreateAccountingExpenseRequest$Outbound;
81
+ }
82
+
83
+ export function createAccountingExpenseRequestToJSON(
84
+ createAccountingExpenseRequest: CreateAccountingExpenseRequest,
85
+ ): string {
86
+ return JSON.stringify(
87
+ CreateAccountingExpenseRequest$outboundSchema.parse(
88
+ createAccountingExpenseRequest,
89
+ ),
90
+ );
91
+ }
92
+
93
+ export function createAccountingExpenseRequestFromJSON(
94
+ jsonString: string,
95
+ ): SafeParseResult<CreateAccountingExpenseRequest, SDKValidationError> {
96
+ return safeParse(
97
+ jsonString,
98
+ (x) => CreateAccountingExpenseRequest$inboundSchema.parse(JSON.parse(x)),
99
+ `Failed to parse 'CreateAccountingExpenseRequest' from JSON`,
100
+ );
101
+ }
@@ -0,0 +1,101 @@
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
+
11
+ export type GetAccountingExpenseRequest = {
12
+ /**
13
+ * ID of the connection
14
+ */
15
+ connectionId: string;
16
+ /**
17
+ * Comma-delimited fields to return
18
+ */
19
+ fields?: Array<string> | undefined;
20
+ /**
21
+ * ID of the Expense
22
+ */
23
+ id: string;
24
+ /**
25
+ * Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
26
+ */
27
+ raw?: string | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const GetAccountingExpenseRequest$inboundSchema: z.ZodType<
32
+ GetAccountingExpenseRequest,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ connection_id: z.string(),
37
+ fields: z.array(z.string()).optional(),
38
+ id: z.string(),
39
+ raw: z.string().optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "connection_id": "connectionId",
43
+ });
44
+ });
45
+
46
+ /** @internal */
47
+ export type GetAccountingExpenseRequest$Outbound = {
48
+ connection_id: string;
49
+ fields?: Array<string> | undefined;
50
+ id: string;
51
+ raw?: string | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export const GetAccountingExpenseRequest$outboundSchema: z.ZodType<
56
+ GetAccountingExpenseRequest$Outbound,
57
+ z.ZodTypeDef,
58
+ GetAccountingExpenseRequest
59
+ > = z.object({
60
+ connectionId: z.string(),
61
+ fields: z.array(z.string()).optional(),
62
+ id: z.string(),
63
+ raw: z.string().optional(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ connectionId: "connection_id",
67
+ });
68
+ });
69
+
70
+ /**
71
+ * @internal
72
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
73
+ */
74
+ export namespace GetAccountingExpenseRequest$ {
75
+ /** @deprecated use `GetAccountingExpenseRequest$inboundSchema` instead. */
76
+ export const inboundSchema = GetAccountingExpenseRequest$inboundSchema;
77
+ /** @deprecated use `GetAccountingExpenseRequest$outboundSchema` instead. */
78
+ export const outboundSchema = GetAccountingExpenseRequest$outboundSchema;
79
+ /** @deprecated use `GetAccountingExpenseRequest$Outbound` instead. */
80
+ export type Outbound = GetAccountingExpenseRequest$Outbound;
81
+ }
82
+
83
+ export function getAccountingExpenseRequestToJSON(
84
+ getAccountingExpenseRequest: GetAccountingExpenseRequest,
85
+ ): string {
86
+ return JSON.stringify(
87
+ GetAccountingExpenseRequest$outboundSchema.parse(
88
+ getAccountingExpenseRequest,
89
+ ),
90
+ );
91
+ }
92
+
93
+ export function getAccountingExpenseRequestFromJSON(
94
+ jsonString: string,
95
+ ): SafeParseResult<GetAccountingExpenseRequest, SDKValidationError> {
96
+ return safeParse(
97
+ jsonString,
98
+ (x) => GetAccountingExpenseRequest$inboundSchema.parse(JSON.parse(x)),
99
+ `Failed to parse 'GetAccountingExpenseRequest' from JSON`,
100
+ );
101
+ }
@@ -7,6 +7,7 @@ export * from "./createaccountingbill.js";
7
7
  export * from "./createaccountingcategory.js";
8
8
  export * from "./createaccountingcontact.js";
9
9
  export * from "./createaccountingcreditmemo.js";
10
+ export * from "./createaccountingexpense.js";
10
11
  export * from "./createaccountinginvoice.js";
11
12
  export * from "./createaccountingjournal.js";
12
13
  export * from "./createaccountingorder.js";
@@ -86,6 +87,7 @@ export * from "./getaccountingbill.js";
86
87
  export * from "./getaccountingcategory.js";
87
88
  export * from "./getaccountingcontact.js";
88
89
  export * from "./getaccountingcreditmemo.js";
90
+ export * from "./getaccountingexpense.js";
89
91
  export * from "./getaccountinginvoice.js";
90
92
  export * from "./getaccountingjournal.js";
91
93
  export * from "./getaccountingorder.js";
@@ -179,6 +181,7 @@ export * from "./listaccountingbills.js";
179
181
  export * from "./listaccountingcategories.js";
180
182
  export * from "./listaccountingcontacts.js";
181
183
  export * from "./listaccountingcreditmemoes.js";
184
+ export * from "./listaccountingexpenses.js";
182
185
  export * from "./listaccountinginvoices.js";
183
186
  export * from "./listaccountingjournals.js";
184
187
  export * from "./listaccountingorders.js";
@@ -277,6 +280,7 @@ export * from "./patchaccountingbill.js";
277
280
  export * from "./patchaccountingcategory.js";
278
281
  export * from "./patchaccountingcontact.js";
279
282
  export * from "./patchaccountingcreditmemo.js";
283
+ export * from "./patchaccountingexpense.js";
280
284
  export * from "./patchaccountinginvoice.js";
281
285
  export * from "./patchaccountingjournal.js";
282
286
  export * from "./patchaccountingorder.js";
@@ -355,6 +359,7 @@ export * from "./removeaccountingbill.js";
355
359
  export * from "./removeaccountingcategory.js";
356
360
  export * from "./removeaccountingcontact.js";
357
361
  export * from "./removeaccountingcreditmemo.js";
362
+ export * from "./removeaccountingexpense.js";
358
363
  export * from "./removeaccountinginvoice.js";
359
364
  export * from "./removeaccountingjournal.js";
360
365
  export * from "./removeaccountingorder.js";
@@ -431,6 +436,7 @@ export * from "./updateaccountingbill.js";
431
436
  export * from "./updateaccountingcategory.js";
432
437
  export * from "./updateaccountingcontact.js";
433
438
  export * from "./updateaccountingcreditmemo.js";
439
+ export * from "./updateaccountingexpense.js";
434
440
  export * from "./updateaccountinginvoice.js";
435
441
  export * from "./updateaccountingjournal.js";
436
442
  export * from "./updateaccountingorder.js";
@@ -0,0 +1,135 @@
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
+
11
+ export type ListAccountingExpensesRequest = {
12
+ /**
13
+ * ID of the connection
14
+ */
15
+ connectionId: string;
16
+ /**
17
+ * Comma-delimited fields to return
18
+ */
19
+ fields?: Array<string> | undefined;
20
+ limit?: number | undefined;
21
+ offset?: number | undefined;
22
+ order?: string | undefined;
23
+ /**
24
+ * Query string to search. eg. email address or name
25
+ */
26
+ query?: string | undefined;
27
+ /**
28
+ * Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
29
+ */
30
+ raw?: string | undefined;
31
+ sort?: string | undefined;
32
+ /**
33
+ * Return only results whose updated date is equal or greater to this value
34
+ */
35
+ updatedGte?: string | undefined;
36
+ /**
37
+ * The user/employee ID to filter by
38
+ */
39
+ userId?: string | undefined;
40
+ };
41
+
42
+ /** @internal */
43
+ export const ListAccountingExpensesRequest$inboundSchema: z.ZodType<
44
+ ListAccountingExpensesRequest,
45
+ z.ZodTypeDef,
46
+ unknown
47
+ > = z.object({
48
+ connection_id: z.string(),
49
+ fields: z.array(z.string()).optional(),
50
+ limit: z.number().optional(),
51
+ offset: z.number().optional(),
52
+ order: z.string().optional(),
53
+ query: z.string().optional(),
54
+ raw: z.string().optional(),
55
+ sort: z.string().optional(),
56
+ updated_gte: z.string().optional(),
57
+ user_id: z.string().optional(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ "connection_id": "connectionId",
61
+ "updated_gte": "updatedGte",
62
+ "user_id": "userId",
63
+ });
64
+ });
65
+
66
+ /** @internal */
67
+ export type ListAccountingExpensesRequest$Outbound = {
68
+ connection_id: string;
69
+ fields?: Array<string> | undefined;
70
+ limit?: number | undefined;
71
+ offset?: number | undefined;
72
+ order?: string | undefined;
73
+ query?: string | undefined;
74
+ raw?: string | undefined;
75
+ sort?: string | undefined;
76
+ updated_gte?: string | undefined;
77
+ user_id?: string | undefined;
78
+ };
79
+
80
+ /** @internal */
81
+ export const ListAccountingExpensesRequest$outboundSchema: z.ZodType<
82
+ ListAccountingExpensesRequest$Outbound,
83
+ z.ZodTypeDef,
84
+ ListAccountingExpensesRequest
85
+ > = z.object({
86
+ connectionId: z.string(),
87
+ fields: z.array(z.string()).optional(),
88
+ limit: z.number().optional(),
89
+ offset: z.number().optional(),
90
+ order: z.string().optional(),
91
+ query: z.string().optional(),
92
+ raw: z.string().optional(),
93
+ sort: z.string().optional(),
94
+ updatedGte: z.string().optional(),
95
+ userId: z.string().optional(),
96
+ }).transform((v) => {
97
+ return remap$(v, {
98
+ connectionId: "connection_id",
99
+ updatedGte: "updated_gte",
100
+ userId: "user_id",
101
+ });
102
+ });
103
+
104
+ /**
105
+ * @internal
106
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
107
+ */
108
+ export namespace ListAccountingExpensesRequest$ {
109
+ /** @deprecated use `ListAccountingExpensesRequest$inboundSchema` instead. */
110
+ export const inboundSchema = ListAccountingExpensesRequest$inboundSchema;
111
+ /** @deprecated use `ListAccountingExpensesRequest$outboundSchema` instead. */
112
+ export const outboundSchema = ListAccountingExpensesRequest$outboundSchema;
113
+ /** @deprecated use `ListAccountingExpensesRequest$Outbound` instead. */
114
+ export type Outbound = ListAccountingExpensesRequest$Outbound;
115
+ }
116
+
117
+ export function listAccountingExpensesRequestToJSON(
118
+ listAccountingExpensesRequest: ListAccountingExpensesRequest,
119
+ ): string {
120
+ return JSON.stringify(
121
+ ListAccountingExpensesRequest$outboundSchema.parse(
122
+ listAccountingExpensesRequest,
123
+ ),
124
+ );
125
+ }
126
+
127
+ export function listAccountingExpensesRequestFromJSON(
128
+ jsonString: string,
129
+ ): SafeParseResult<ListAccountingExpensesRequest, SDKValidationError> {
130
+ return safeParse(
131
+ jsonString,
132
+ (x) => ListAccountingExpensesRequest$inboundSchema.parse(JSON.parse(x)),
133
+ `Failed to parse 'ListAccountingExpensesRequest' from JSON`,
134
+ );
135
+ }