@unified-api/typescript-sdk 2.34.0 → 2.36.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 (83) hide show
  1. package/README.md +4 -0
  2. package/docs/sdks/accounting/README.md +164 -0
  3. package/docs/sdks/report/README.md +171 -0
  4. package/funcs/accountingGetAccountingReport.d.ts +14 -0
  5. package/funcs/accountingGetAccountingReport.d.ts.map +1 -0
  6. package/funcs/accountingGetAccountingReport.js +112 -0
  7. package/funcs/accountingGetAccountingReport.js.map +1 -0
  8. package/funcs/accountingListAccountingReports.d.ts +14 -0
  9. package/funcs/accountingListAccountingReports.d.ts.map +1 -0
  10. package/funcs/accountingListAccountingReports.js +116 -0
  11. package/funcs/accountingListAccountingReports.js.map +1 -0
  12. package/funcs/reportGetAccountingReport.d.ts +14 -0
  13. package/funcs/reportGetAccountingReport.d.ts.map +1 -0
  14. package/funcs/reportGetAccountingReport.js +112 -0
  15. package/funcs/reportGetAccountingReport.js.map +1 -0
  16. package/funcs/reportListAccountingReports.d.ts +14 -0
  17. package/funcs/reportListAccountingReports.d.ts.map +1 -0
  18. package/funcs/reportListAccountingReports.js +116 -0
  19. package/funcs/reportListAccountingReports.js.map +1 -0
  20. package/jsr.json +1 -1
  21. package/lib/config.d.ts +2 -2
  22. package/lib/config.js +2 -2
  23. package/package.json +1 -1
  24. package/sdk/accounting.d.ts +8 -0
  25. package/sdk/accounting.d.ts.map +1 -1
  26. package/sdk/accounting.js +14 -0
  27. package/sdk/accounting.js.map +1 -1
  28. package/sdk/models/operations/getaccountingreport.d.ts +42 -0
  29. package/sdk/models/operations/getaccountingreport.d.ts.map +1 -0
  30. package/sdk/models/operations/getaccountingreport.js +72 -0
  31. package/sdk/models/operations/getaccountingreport.js.map +1 -0
  32. package/sdk/models/operations/index.d.ts +2 -0
  33. package/sdk/models/operations/index.d.ts.map +1 -1
  34. package/sdk/models/operations/index.js +2 -0
  35. package/sdk/models/operations/index.js.map +1 -1
  36. package/sdk/models/operations/listaccountingreports.d.ts +57 -0
  37. package/sdk/models/operations/listaccountingreports.d.ts.map +1 -0
  38. package/sdk/models/operations/listaccountingreports.js +87 -0
  39. package/sdk/models/operations/listaccountingreports.js.map +1 -0
  40. package/sdk/models/shared/accountingreport.d.ts +97 -0
  41. package/sdk/models/shared/accountingreport.d.ts.map +1 -0
  42. package/sdk/models/shared/accountingreport.js +137 -0
  43. package/sdk/models/shared/accountingreport.js.map +1 -0
  44. package/sdk/models/shared/index.d.ts +1 -0
  45. package/sdk/models/shared/index.d.ts.map +1 -1
  46. package/sdk/models/shared/index.js +1 -0
  47. package/sdk/models/shared/index.js.map +1 -1
  48. package/sdk/models/shared/integrationsupport.d.ts +2 -2
  49. package/sdk/models/shared/integrationsupport.d.ts.map +1 -1
  50. package/sdk/models/shared/integrationsupport.js +2 -2
  51. package/sdk/models/shared/integrationsupport.js.map +1 -1
  52. package/sdk/models/shared/propertyconnectionpermissions.d.ts +6 -0
  53. package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  54. package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
  55. package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  56. package/sdk/models/shared/webhook.d.ts +5 -2
  57. package/sdk/models/shared/webhook.d.ts.map +1 -1
  58. package/sdk/models/shared/webhook.js +3 -2
  59. package/sdk/models/shared/webhook.js.map +1 -1
  60. package/sdk/report.d.ts +14 -0
  61. package/sdk/report.d.ts.map +1 -0
  62. package/sdk/report.js +26 -0
  63. package/sdk/report.js.map +1 -0
  64. package/sdk/sdk.d.ts +3 -0
  65. package/sdk/sdk.d.ts.map +1 -1
  66. package/sdk/sdk.js +4 -0
  67. package/sdk/sdk.js.map +1 -1
  68. package/src/funcs/accountingGetAccountingReport.ts +169 -0
  69. package/src/funcs/accountingListAccountingReports.ts +171 -0
  70. package/src/funcs/reportGetAccountingReport.ts +169 -0
  71. package/src/funcs/reportListAccountingReports.ts +171 -0
  72. package/src/lib/config.ts +2 -2
  73. package/src/sdk/accounting.ts +30 -0
  74. package/src/sdk/models/operations/getaccountingreport.ts +92 -0
  75. package/src/sdk/models/operations/index.ts +2 -0
  76. package/src/sdk/models/operations/listaccountingreports.ts +124 -0
  77. package/src/sdk/models/shared/accountingreport.ts +198 -0
  78. package/src/sdk/models/shared/index.ts +1 -0
  79. package/src/sdk/models/shared/integrationsupport.ts +4 -4
  80. package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
  81. package/src/sdk/models/shared/webhook.ts +5 -4
  82. package/src/sdk/report.ts +40 -0
  83. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,198 @@
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
+
12
+ export type AccountingReportRaw = {};
13
+
14
+ export const AccountingReportType = {
15
+ TrialBalance: "TRIAL_BALANCE",
16
+ BalanceSheet: "BALANCE_SHEET",
17
+ ProfitAndLoss: "PROFIT_AND_LOSS",
18
+ } as const;
19
+ export type AccountingReportType = ClosedEnum<typeof AccountingReportType>;
20
+
21
+ export type AccountingReport = {
22
+ accountId?: string | undefined;
23
+ amount?: number | undefined;
24
+ contactId?: string | undefined;
25
+ createdAt?: Date | undefined;
26
+ group?: string | undefined;
27
+ id?: string | undefined;
28
+ raw?: AccountingReportRaw | undefined;
29
+ subgroup?: string | undefined;
30
+ type?: AccountingReportType | undefined;
31
+ updatedAt?: Date | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const AccountingReportRaw$inboundSchema: z.ZodType<
36
+ AccountingReportRaw,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({});
40
+
41
+ /** @internal */
42
+ export type AccountingReportRaw$Outbound = {};
43
+
44
+ /** @internal */
45
+ export const AccountingReportRaw$outboundSchema: z.ZodType<
46
+ AccountingReportRaw$Outbound,
47
+ z.ZodTypeDef,
48
+ AccountingReportRaw
49
+ > = z.object({});
50
+
51
+ /**
52
+ * @internal
53
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
54
+ */
55
+ export namespace AccountingReportRaw$ {
56
+ /** @deprecated use `AccountingReportRaw$inboundSchema` instead. */
57
+ export const inboundSchema = AccountingReportRaw$inboundSchema;
58
+ /** @deprecated use `AccountingReportRaw$outboundSchema` instead. */
59
+ export const outboundSchema = AccountingReportRaw$outboundSchema;
60
+ /** @deprecated use `AccountingReportRaw$Outbound` instead. */
61
+ export type Outbound = AccountingReportRaw$Outbound;
62
+ }
63
+
64
+ export function accountingReportRawToJSON(
65
+ accountingReportRaw: AccountingReportRaw,
66
+ ): string {
67
+ return JSON.stringify(
68
+ AccountingReportRaw$outboundSchema.parse(accountingReportRaw),
69
+ );
70
+ }
71
+
72
+ export function accountingReportRawFromJSON(
73
+ jsonString: string,
74
+ ): SafeParseResult<AccountingReportRaw, SDKValidationError> {
75
+ return safeParse(
76
+ jsonString,
77
+ (x) => AccountingReportRaw$inboundSchema.parse(JSON.parse(x)),
78
+ `Failed to parse 'AccountingReportRaw' from JSON`,
79
+ );
80
+ }
81
+
82
+ /** @internal */
83
+ export const AccountingReportType$inboundSchema: z.ZodNativeEnum<
84
+ typeof AccountingReportType
85
+ > = z.nativeEnum(AccountingReportType);
86
+
87
+ /** @internal */
88
+ export const AccountingReportType$outboundSchema: z.ZodNativeEnum<
89
+ typeof AccountingReportType
90
+ > = AccountingReportType$inboundSchema;
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 AccountingReportType$ {
97
+ /** @deprecated use `AccountingReportType$inboundSchema` instead. */
98
+ export const inboundSchema = AccountingReportType$inboundSchema;
99
+ /** @deprecated use `AccountingReportType$outboundSchema` instead. */
100
+ export const outboundSchema = AccountingReportType$outboundSchema;
101
+ }
102
+
103
+ /** @internal */
104
+ export const AccountingReport$inboundSchema: z.ZodType<
105
+ AccountingReport,
106
+ z.ZodTypeDef,
107
+ unknown
108
+ > = z.object({
109
+ account_id: z.string().optional(),
110
+ amount: z.number().optional(),
111
+ contact_id: z.string().optional(),
112
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
113
+ .optional(),
114
+ group: z.string().optional(),
115
+ id: z.string().optional(),
116
+ raw: z.lazy(() => AccountingReportRaw$inboundSchema).optional(),
117
+ subgroup: z.string().optional(),
118
+ type: AccountingReportType$inboundSchema.optional(),
119
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
120
+ .optional(),
121
+ }).transform((v) => {
122
+ return remap$(v, {
123
+ "account_id": "accountId",
124
+ "contact_id": "contactId",
125
+ "created_at": "createdAt",
126
+ "updated_at": "updatedAt",
127
+ });
128
+ });
129
+
130
+ /** @internal */
131
+ export type AccountingReport$Outbound = {
132
+ account_id?: string | undefined;
133
+ amount?: number | undefined;
134
+ contact_id?: string | undefined;
135
+ created_at?: string | undefined;
136
+ group?: string | undefined;
137
+ id?: string | undefined;
138
+ raw?: AccountingReportRaw$Outbound | undefined;
139
+ subgroup?: string | undefined;
140
+ type?: string | undefined;
141
+ updated_at?: string | undefined;
142
+ };
143
+
144
+ /** @internal */
145
+ export const AccountingReport$outboundSchema: z.ZodType<
146
+ AccountingReport$Outbound,
147
+ z.ZodTypeDef,
148
+ AccountingReport
149
+ > = z.object({
150
+ accountId: z.string().optional(),
151
+ amount: z.number().optional(),
152
+ contactId: z.string().optional(),
153
+ createdAt: z.date().transform(v => v.toISOString()).optional(),
154
+ group: z.string().optional(),
155
+ id: z.string().optional(),
156
+ raw: z.lazy(() => AccountingReportRaw$outboundSchema).optional(),
157
+ subgroup: z.string().optional(),
158
+ type: AccountingReportType$outboundSchema.optional(),
159
+ updatedAt: z.date().transform(v => v.toISOString()).optional(),
160
+ }).transform((v) => {
161
+ return remap$(v, {
162
+ accountId: "account_id",
163
+ contactId: "contact_id",
164
+ createdAt: "created_at",
165
+ updatedAt: "updated_at",
166
+ });
167
+ });
168
+
169
+ /**
170
+ * @internal
171
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
172
+ */
173
+ export namespace AccountingReport$ {
174
+ /** @deprecated use `AccountingReport$inboundSchema` instead. */
175
+ export const inboundSchema = AccountingReport$inboundSchema;
176
+ /** @deprecated use `AccountingReport$outboundSchema` instead. */
177
+ export const outboundSchema = AccountingReport$outboundSchema;
178
+ /** @deprecated use `AccountingReport$Outbound` instead. */
179
+ export type Outbound = AccountingReport$Outbound;
180
+ }
181
+
182
+ export function accountingReportToJSON(
183
+ accountingReport: AccountingReport,
184
+ ): string {
185
+ return JSON.stringify(
186
+ AccountingReport$outboundSchema.parse(accountingReport),
187
+ );
188
+ }
189
+
190
+ export function accountingReportFromJSON(
191
+ jsonString: string,
192
+ ): SafeParseResult<AccountingReport, SDKValidationError> {
193
+ return safeParse(
194
+ jsonString,
195
+ (x) => AccountingReport$inboundSchema.parse(JSON.parse(x)),
196
+ `Failed to parse 'AccountingReport' from JSON`,
197
+ );
198
+ }
@@ -12,6 +12,7 @@ export * from "./accountingjournallineitem.js";
12
12
  export * from "./accountinglineitem.js";
13
13
  export * from "./accountingorder.js";
14
14
  export * from "./accountingorganization.js";
15
+ export * from "./accountingreport.js";
15
16
  export * from "./accountingtaxrate.js";
16
17
  export * from "./accountingtelephone.js";
17
18
  export * from "./accountingtransaction.js";
@@ -527,7 +527,7 @@ export type IntegrationSupport = {
527
527
  listType?: ListType | undefined;
528
528
  listUpdatedGte?: ListUpdatedGte | undefined;
529
529
  listUserId?: ListUserId | undefined;
530
- methods?: { [k: string]: boolean } | undefined;
530
+ methods?: { [k: string]: any } | undefined;
531
531
  nativeWebhookParentId?: NativeWebhookParentId | undefined;
532
532
  nativeWebhookProjectId?: NativeWebhookProjectId | undefined;
533
533
  outboundFields?: { [k: string]: any } | undefined;
@@ -1916,7 +1916,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
1916
1916
  list_type: ListType$inboundSchema.optional(),
1917
1917
  list_updated_gte: ListUpdatedGte$inboundSchema.optional(),
1918
1918
  list_user_id: ListUserId$inboundSchema.optional(),
1919
- methods: z.record(z.boolean()).optional(),
1919
+ methods: z.record(z.any()).optional(),
1920
1920
  native_webhook_parent_id: NativeWebhookParentId$inboundSchema.optional(),
1921
1921
  native_webhook_project_id: NativeWebhookProjectId$inboundSchema.optional(),
1922
1922
  outbound_fields: z.record(z.any()).optional(),
@@ -2066,7 +2066,7 @@ export type IntegrationSupport$Outbound = {
2066
2066
  list_type?: string | undefined;
2067
2067
  list_updated_gte?: string | undefined;
2068
2068
  list_user_id?: string | undefined;
2069
- methods?: { [k: string]: boolean } | undefined;
2069
+ methods?: { [k: string]: any } | undefined;
2070
2070
  native_webhook_parent_id?: string | undefined;
2071
2071
  native_webhook_project_id?: string | undefined;
2072
2072
  outbound_fields?: { [k: string]: any } | undefined;
@@ -2145,7 +2145,7 @@ export const IntegrationSupport$outboundSchema: z.ZodType<
2145
2145
  listType: ListType$outboundSchema.optional(),
2146
2146
  listUpdatedGte: ListUpdatedGte$outboundSchema.optional(),
2147
2147
  listUserId: ListUserId$outboundSchema.optional(),
2148
- methods: z.record(z.boolean()).optional(),
2148
+ methods: z.record(z.any()).optional(),
2149
2149
  nativeWebhookParentId: NativeWebhookParentId$outboundSchema.optional(),
2150
2150
  nativeWebhookProjectId: NativeWebhookProjectId$outboundSchema.optional(),
2151
2151
  outboundFields: z.record(z.any()).optional(),
@@ -22,6 +22,8 @@ export const PropertyConnectionPermissions = {
22
22
  AccountingOrganizationRead: "accounting_organization_read",
23
23
  AccountingOrderRead: "accounting_order_read",
24
24
  AccountingOrderWrite: "accounting_order_write",
25
+ AccountingReportRead: "accounting_report_read",
26
+ AccountingReportWrite: "accounting_report_write",
25
27
  PaymentPaymentRead: "payment_payment_read",
26
28
  PaymentPaymentWrite: "payment_payment_write",
27
29
  PaymentPayoutRead: "payment_payout_read",
@@ -34,6 +34,7 @@ export const ObjectType = {
34
34
  AccountingTaxrate: "accounting_taxrate",
35
35
  AccountingOrganization: "accounting_organization",
36
36
  AccountingOrder: "accounting_order",
37
+ AccountingReport: "accounting_report",
37
38
  PaymentPayment: "payment_payment",
38
39
  PaymentLink: "payment_link",
39
40
  PaymentPayout: "payment_payout",
@@ -124,7 +125,7 @@ export type Webhook = {
124
125
  environment?: string | undefined;
125
126
  event: Event;
126
127
  fields?: string | undefined;
127
- filters?: { [k: string]: string } | undefined;
128
+ filters?: { [k: string]: any } | undefined;
128
129
  hookUrl?: string | undefined;
129
130
  id?: string | undefined;
130
131
  integrationType?: string | undefined;
@@ -236,7 +237,7 @@ export const Webhook$inboundSchema: z.ZodType<Webhook, z.ZodTypeDef, unknown> =
236
237
  environment: z.string().default("Production"),
237
238
  event: Event$inboundSchema,
238
239
  fields: z.string().optional(),
239
- filters: z.record(z.string()).optional(),
240
+ filters: z.record(z.any()).optional(),
240
241
  hook_url: z.string().optional(),
241
242
  id: z.string().optional(),
242
243
  integration_type: z.string().optional(),
@@ -283,7 +284,7 @@ export type Webhook$Outbound = {
283
284
  environment: string;
284
285
  event: string;
285
286
  fields?: string | undefined;
286
- filters?: { [k: string]: string } | undefined;
287
+ filters?: { [k: string]: any } | undefined;
287
288
  hook_url?: string | undefined;
288
289
  id?: string | undefined;
289
290
  integration_type?: string | undefined;
@@ -314,7 +315,7 @@ export const Webhook$outboundSchema: z.ZodType<
314
315
  environment: z.string().default("Production"),
315
316
  event: Event$outboundSchema,
316
317
  fields: z.string().optional(),
317
- filters: z.record(z.string()).optional(),
318
+ filters: z.record(z.any()).optional(),
318
319
  hookUrl: z.string().optional(),
319
320
  id: z.string().optional(),
320
321
  integrationType: z.string().optional(),
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { reportGetAccountingReport } from "../funcs/reportGetAccountingReport.js";
6
+ import { reportListAccountingReports } from "../funcs/reportListAccountingReports.js";
7
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
+ import * as operations from "./models/operations/index.js";
9
+ import * as shared from "./models/shared/index.js";
10
+ import { unwrapAsync } from "./types/fp.js";
11
+
12
+ export class Report extends ClientSDK {
13
+ /**
14
+ * Retrieve a report
15
+ */
16
+ async getAccountingReport(
17
+ request: operations.GetAccountingReportRequest,
18
+ options?: RequestOptions,
19
+ ): Promise<shared.AccountingReport> {
20
+ return unwrapAsync(reportGetAccountingReport(
21
+ this,
22
+ request,
23
+ options,
24
+ ));
25
+ }
26
+
27
+ /**
28
+ * List all reports
29
+ */
30
+ async listAccountingReports(
31
+ request: operations.ListAccountingReportsRequest,
32
+ options?: RequestOptions,
33
+ ): Promise<Array<shared.AccountingReport>> {
34
+ return unwrapAsync(reportListAccountingReports(
35
+ this,
36
+ request,
37
+ options,
38
+ ));
39
+ }
40
+ }
package/src/sdk/sdk.ts CHANGED
@@ -75,6 +75,7 @@ import { Pullrequest } from "./pullrequest.js";
75
75
  import { Recording } from "./recording.js";
76
76
  import { Refund } from "./refund.js";
77
77
  import { Repo } from "./repo.js";
78
+ import { Report } from "./report.js";
78
79
  import { Repository } from "./repository.js";
79
80
  import { Scim } from "./scim.js";
80
81
  import { Scorecard } from "./scorecard.js";
@@ -129,6 +130,11 @@ export class UnifiedTo extends ClientSDK {
129
130
  return (this._organization ??= new Organization(this._options));
130
131
  }
131
132
 
133
+ private _report?: Report;
134
+ get report(): Report {
135
+ return (this._report ??= new Report(this._options));
136
+ }
137
+
132
138
  private _taxrate?: Taxrate;
133
139
  get taxrate(): Taxrate {
134
140
  return (this._taxrate ??= new Taxrate(this._options));