dub 0.71.0 → 0.71.2

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 (77) hide show
  1. package/README.md +7 -2
  2. package/dist/commonjs/funcs/bountiesListSubmissions.d.ts +1 -1
  3. package/dist/commonjs/funcs/bountiesListSubmissions.js +1 -1
  4. package/dist/commonjs/funcs/commissionsList.d.ts +2 -2
  5. package/dist/commonjs/funcs/commissionsList.js +2 -2
  6. package/dist/commonjs/funcs/payoutsList.d.ts +18 -0
  7. package/dist/commonjs/funcs/payoutsList.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/payoutsList.js +141 -0
  9. package/dist/commonjs/funcs/payoutsList.js.map +1 -0
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/models/operations/index.d.ts +1 -0
  13. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  14. package/dist/commonjs/models/operations/index.js +1 -0
  15. package/dist/commonjs/models/operations/index.js.map +1 -1
  16. package/dist/commonjs/models/operations/listbountysubmissions.d.ts +1 -1
  17. package/dist/commonjs/models/operations/listpayouts.d.ts +183 -0
  18. package/dist/commonjs/models/operations/listpayouts.d.ts.map +1 -0
  19. package/dist/commonjs/models/operations/listpayouts.js +156 -0
  20. package/dist/commonjs/models/operations/listpayouts.js.map +1 -0
  21. package/dist/commonjs/sdk/bounties.d.ts +1 -1
  22. package/dist/commonjs/sdk/bounties.js +1 -1
  23. package/dist/commonjs/sdk/commissions.d.ts +2 -2
  24. package/dist/commonjs/sdk/commissions.js +2 -2
  25. package/dist/commonjs/sdk/payouts.d.ts +12 -0
  26. package/dist/commonjs/sdk/payouts.d.ts.map +1 -0
  27. package/dist/commonjs/sdk/payouts.js +22 -0
  28. package/dist/commonjs/sdk/payouts.js.map +1 -0
  29. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  30. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  31. package/dist/commonjs/sdk/sdk.js +4 -0
  32. package/dist/commonjs/sdk/sdk.js.map +1 -1
  33. package/dist/esm/funcs/bountiesListSubmissions.d.ts +1 -1
  34. package/dist/esm/funcs/bountiesListSubmissions.js +1 -1
  35. package/dist/esm/funcs/commissionsList.d.ts +2 -2
  36. package/dist/esm/funcs/commissionsList.js +2 -2
  37. package/dist/esm/funcs/payoutsList.d.ts +18 -0
  38. package/dist/esm/funcs/payoutsList.d.ts.map +1 -0
  39. package/dist/esm/funcs/payoutsList.js +105 -0
  40. package/dist/esm/funcs/payoutsList.js.map +1 -0
  41. package/dist/esm/lib/config.d.ts +3 -3
  42. package/dist/esm/lib/config.js +3 -3
  43. package/dist/esm/models/operations/index.d.ts +1 -0
  44. package/dist/esm/models/operations/index.d.ts.map +1 -1
  45. package/dist/esm/models/operations/index.js +1 -0
  46. package/dist/esm/models/operations/index.js.map +1 -1
  47. package/dist/esm/models/operations/listbountysubmissions.d.ts +1 -1
  48. package/dist/esm/models/operations/listpayouts.d.ts +183 -0
  49. package/dist/esm/models/operations/listpayouts.d.ts.map +1 -0
  50. package/dist/esm/models/operations/listpayouts.js +116 -0
  51. package/dist/esm/models/operations/listpayouts.js.map +1 -0
  52. package/dist/esm/sdk/bounties.d.ts +1 -1
  53. package/dist/esm/sdk/bounties.js +1 -1
  54. package/dist/esm/sdk/commissions.d.ts +2 -2
  55. package/dist/esm/sdk/commissions.js +2 -2
  56. package/dist/esm/sdk/payouts.d.ts +12 -0
  57. package/dist/esm/sdk/payouts.d.ts.map +1 -0
  58. package/dist/esm/sdk/payouts.js +18 -0
  59. package/dist/esm/sdk/payouts.js.map +1 -0
  60. package/dist/esm/sdk/sdk.d.ts +3 -0
  61. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  62. package/dist/esm/sdk/sdk.js +4 -0
  63. package/dist/esm/sdk/sdk.js.map +1 -1
  64. package/examples/package-lock.json +3 -3
  65. package/jsr.json +1 -1
  66. package/package.json +3 -3
  67. package/src/funcs/bountiesListSubmissions.ts +1 -1
  68. package/src/funcs/commissionsList.ts +2 -2
  69. package/src/funcs/payoutsList.ts +226 -0
  70. package/src/lib/config.ts +3 -3
  71. package/src/models/operations/index.ts +1 -0
  72. package/src/models/operations/listbountysubmissions.ts +1 -1
  73. package/src/models/operations/listpayouts.ts +308 -0
  74. package/src/sdk/bounties.ts +1 -1
  75. package/src/sdk/commissions.ts +2 -2
  76. package/src/sdk/payouts.ts +27 -0
  77. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,226 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { DubCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { DubError } from "../models/errors/duberror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List all payouts
31
+ *
32
+ * @remarks
33
+ * Retrieve a list of payouts for your partner program.
34
+ */
35
+ export function payoutsList(
36
+ client: DubCore,
37
+ request?: operations.ListPayoutsRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ Array<operations.ListPayoutsResponseBody>,
42
+ | errors.BadRequest
43
+ | errors.Unauthorized
44
+ | errors.Forbidden
45
+ | errors.NotFound
46
+ | errors.Conflict
47
+ | errors.InviteExpired
48
+ | errors.UnprocessableEntity
49
+ | errors.RateLimitExceeded
50
+ | errors.InternalServerError
51
+ | DubError
52
+ | ResponseValidationError
53
+ | ConnectionError
54
+ | RequestAbortedError
55
+ | RequestTimeoutError
56
+ | InvalidRequestError
57
+ | UnexpectedClientError
58
+ | SDKValidationError
59
+ >
60
+ > {
61
+ return new APIPromise($do(
62
+ client,
63
+ request,
64
+ options,
65
+ ));
66
+ }
67
+
68
+ async function $do(
69
+ client: DubCore,
70
+ request?: operations.ListPayoutsRequest | undefined,
71
+ options?: RequestOptions,
72
+ ): Promise<
73
+ [
74
+ Result<
75
+ Array<operations.ListPayoutsResponseBody>,
76
+ | errors.BadRequest
77
+ | errors.Unauthorized
78
+ | errors.Forbidden
79
+ | errors.NotFound
80
+ | errors.Conflict
81
+ | errors.InviteExpired
82
+ | errors.UnprocessableEntity
83
+ | errors.RateLimitExceeded
84
+ | errors.InternalServerError
85
+ | DubError
86
+ | ResponseValidationError
87
+ | ConnectionError
88
+ | RequestAbortedError
89
+ | RequestTimeoutError
90
+ | InvalidRequestError
91
+ | UnexpectedClientError
92
+ | SDKValidationError
93
+ >,
94
+ APICall,
95
+ ]
96
+ > {
97
+ const parsed = safeParse(
98
+ request,
99
+ (value) =>
100
+ operations.ListPayoutsRequest$outboundSchema.optional().parse(value),
101
+ "Input validation failed",
102
+ );
103
+ if (!parsed.ok) {
104
+ return [parsed, { status: "invalid" }];
105
+ }
106
+ const payload = parsed.value;
107
+ const body = null;
108
+
109
+ const path = pathToFunc("/payouts")();
110
+
111
+ const query = encodeFormQuery({
112
+ "invoiceId": payload?.invoiceId,
113
+ "page": payload?.page,
114
+ "pageSize": payload?.pageSize,
115
+ "partnerId": payload?.partnerId,
116
+ "sortBy": payload?.sortBy,
117
+ "sortOrder": payload?.sortOrder,
118
+ "status": payload?.status,
119
+ "tenantId": payload?.tenantId,
120
+ });
121
+
122
+ const headers = new Headers(compactMap({
123
+ Accept: "application/json",
124
+ }));
125
+
126
+ const secConfig = await extractSecurity(client._options.token);
127
+ const securityInput = secConfig == null ? {} : { token: secConfig };
128
+ const requestSecurity = resolveGlobalSecurity(securityInput);
129
+
130
+ const context = {
131
+ options: client._options,
132
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
133
+ operationID: "listPayouts",
134
+ oAuth2Scopes: null,
135
+
136
+ resolvedSecurity: requestSecurity,
137
+
138
+ securitySource: client._options.token,
139
+ retryConfig: options?.retries
140
+ || client._options.retryConfig
141
+ || { strategy: "none" },
142
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
143
+ };
144
+
145
+ const requestRes = client._createRequest(context, {
146
+ security: requestSecurity,
147
+ method: "GET",
148
+ baseURL: options?.serverURL,
149
+ path: path,
150
+ headers: headers,
151
+ query: query,
152
+ body: body,
153
+ userAgent: client._options.userAgent,
154
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
155
+ }, options);
156
+ if (!requestRes.ok) {
157
+ return [requestRes, { status: "invalid" }];
158
+ }
159
+ const req = requestRes.value;
160
+
161
+ const doResult = await client._do(req, {
162
+ context,
163
+ errorCodes: [
164
+ "400",
165
+ "401",
166
+ "403",
167
+ "404",
168
+ "409",
169
+ "410",
170
+ "422",
171
+ "429",
172
+ "4XX",
173
+ "500",
174
+ "5XX",
175
+ ],
176
+ retryConfig: context.retryConfig,
177
+ retryCodes: context.retryCodes,
178
+ });
179
+ if (!doResult.ok) {
180
+ return [doResult, { status: "request-error", request: req }];
181
+ }
182
+ const response = doResult.value;
183
+
184
+ const responseFields = {
185
+ HttpMeta: { Response: response, Request: req },
186
+ };
187
+
188
+ const [result] = await M.match<
189
+ Array<operations.ListPayoutsResponseBody>,
190
+ | errors.BadRequest
191
+ | errors.Unauthorized
192
+ | errors.Forbidden
193
+ | errors.NotFound
194
+ | errors.Conflict
195
+ | errors.InviteExpired
196
+ | errors.UnprocessableEntity
197
+ | errors.RateLimitExceeded
198
+ | errors.InternalServerError
199
+ | DubError
200
+ | ResponseValidationError
201
+ | ConnectionError
202
+ | RequestAbortedError
203
+ | RequestTimeoutError
204
+ | InvalidRequestError
205
+ | UnexpectedClientError
206
+ | SDKValidationError
207
+ >(
208
+ M.json(200, z.array(operations.ListPayoutsResponseBody$inboundSchema)),
209
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
210
+ M.jsonErr(401, errors.Unauthorized$inboundSchema),
211
+ M.jsonErr(403, errors.Forbidden$inboundSchema),
212
+ M.jsonErr(404, errors.NotFound$inboundSchema),
213
+ M.jsonErr(409, errors.Conflict$inboundSchema),
214
+ M.jsonErr(410, errors.InviteExpired$inboundSchema),
215
+ M.jsonErr(422, errors.UnprocessableEntity$inboundSchema),
216
+ M.jsonErr(429, errors.RateLimitExceeded$inboundSchema),
217
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
218
+ M.fail("4XX"),
219
+ M.fail("5XX"),
220
+ )(response, req, { extraFields: responseFields });
221
+ if (!result.ok) {
222
+ return [result, { status: "complete", request: req, response }];
223
+ }
224
+
225
+ return [result, { status: "complete", request: req, response }];
226
+ }
package/src/lib/config.ts CHANGED
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
- sdkVersion: "0.71.0",
65
- genVersion: "2.803.3",
66
- userAgent: "speakeasy-sdk/typescript 0.71.0 2.803.3 0.0.1 dub",
64
+ sdkVersion: "0.71.2",
65
+ genVersion: "2.814.0",
66
+ userAgent: "speakeasy-sdk/typescript 0.71.2 2.814.0 0.0.1 dub",
67
67
  } as const;
@@ -34,6 +34,7 @@ export * from "./listdomains.js";
34
34
  export * from "./listevents.js";
35
35
  export * from "./listfolders.js";
36
36
  export * from "./listpartners.js";
37
+ export * from "./listpayouts.js";
37
38
  export * from "./registerdomain.js";
38
39
  export * from "./rejectbountysubmission.js";
39
40
  export * from "./retrieveanalytics.js";
@@ -54,7 +54,7 @@ export type ListBountySubmissionsQueryParamSortOrder = ClosedEnum<
54
54
 
55
55
  export type ListBountySubmissionsRequest = {
56
56
  /**
57
- * The ID of the bounty
57
+ * The unique ID of the bounty on Dub. Can be found in the URL of the bounty page, prefixed with `bnty_`.
58
58
  */
59
59
  bountyId: string;
60
60
  /**
@@ -0,0 +1,308 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Filter the list of payouts by their corresponding status.
13
+ */
14
+ export const ListPayoutsQueryParamStatus = {
15
+ Pending: "pending",
16
+ Processing: "processing",
17
+ Processed: "processed",
18
+ Sent: "sent",
19
+ Completed: "completed",
20
+ Failed: "failed",
21
+ Canceled: "canceled",
22
+ } as const;
23
+ /**
24
+ * Filter the list of payouts by their corresponding status.
25
+ */
26
+ export type ListPayoutsQueryParamStatus = ClosedEnum<
27
+ typeof ListPayoutsQueryParamStatus
28
+ >;
29
+
30
+ /**
31
+ * The field to sort the list of payouts by.
32
+ */
33
+ export const ListPayoutsQueryParamSortBy = {
34
+ Amount: "amount",
35
+ InitiatedAt: "initiatedAt",
36
+ PaidAt: "paidAt",
37
+ } as const;
38
+ /**
39
+ * The field to sort the list of payouts by.
40
+ */
41
+ export type ListPayoutsQueryParamSortBy = ClosedEnum<
42
+ typeof ListPayoutsQueryParamSortBy
43
+ >;
44
+
45
+ /**
46
+ * The sort order for the list of payouts.
47
+ */
48
+ export const ListPayoutsQueryParamSortOrder = {
49
+ Asc: "asc",
50
+ Desc: "desc",
51
+ } as const;
52
+ /**
53
+ * The sort order for the list of payouts.
54
+ */
55
+ export type ListPayoutsQueryParamSortOrder = ClosedEnum<
56
+ typeof ListPayoutsQueryParamSortOrder
57
+ >;
58
+
59
+ export type ListPayoutsRequest = {
60
+ /**
61
+ * Filter the list of payouts by their corresponding status.
62
+ */
63
+ status?: ListPayoutsQueryParamStatus | undefined;
64
+ /**
65
+ * Filter the list of payouts by the associated partner. When specified, takes precedence over `tenantId`.
66
+ */
67
+ partnerId?: string | undefined;
68
+ /**
69
+ * Filter the list of payouts by the associated partner's `tenantId` (their unique ID within your database).
70
+ */
71
+ tenantId?: string | undefined;
72
+ /**
73
+ * Filter the list of payouts by invoice ID (the unique ID of the invoice you receive for each batch payout you process on Dub). Pending payouts will not have an invoice ID.
74
+ */
75
+ invoiceId?: string | undefined;
76
+ /**
77
+ * The field to sort the list of payouts by.
78
+ */
79
+ sortBy?: ListPayoutsQueryParamSortBy | undefined;
80
+ /**
81
+ * The sort order for the list of payouts.
82
+ */
83
+ sortOrder?: ListPayoutsQueryParamSortOrder | undefined;
84
+ /**
85
+ * The page number for pagination.
86
+ */
87
+ page?: number | undefined;
88
+ /**
89
+ * The number of items per page.
90
+ */
91
+ pageSize?: number | undefined;
92
+ };
93
+
94
+ export const ListPayoutsStatus = {
95
+ Pending: "pending",
96
+ Processing: "processing",
97
+ Processed: "processed",
98
+ Sent: "sent",
99
+ Completed: "completed",
100
+ Failed: "failed",
101
+ Canceled: "canceled",
102
+ } as const;
103
+ export type ListPayoutsStatus = ClosedEnum<typeof ListPayoutsStatus>;
104
+
105
+ export const ListPayoutsMode = {
106
+ Internal: "internal",
107
+ External: "external",
108
+ } as const;
109
+ export type ListPayoutsMode = ClosedEnum<typeof ListPayoutsMode>;
110
+
111
+ export type ListPayoutsPartner = {
112
+ /**
113
+ * The partner's unique ID on Dub.
114
+ */
115
+ id: string;
116
+ /**
117
+ * The partner's full legal name.
118
+ */
119
+ name: string;
120
+ /**
121
+ * The partner's email address. Should be a unique value across Dub.
122
+ */
123
+ email: string | null;
124
+ /**
125
+ * The partner's avatar image.
126
+ */
127
+ image: string | null;
128
+ /**
129
+ * The date when the partner enabled payouts.
130
+ */
131
+ payoutsEnabledAt: string | null;
132
+ /**
133
+ * The partner's country (required for tax purposes).
134
+ */
135
+ country: string | null;
136
+ /**
137
+ * The partner's group ID on Dub.
138
+ */
139
+ groupId?: string | null | undefined;
140
+ /**
141
+ * The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future.
142
+ */
143
+ tenantId: string | null;
144
+ };
145
+
146
+ export type User = {
147
+ id: string;
148
+ name: string | null;
149
+ email: string | null;
150
+ image: string | null;
151
+ };
152
+
153
+ export type ListPayoutsResponseBody = {
154
+ id: string;
155
+ invoiceId: string | null;
156
+ amount: number;
157
+ currency: string;
158
+ status: ListPayoutsStatus;
159
+ description?: string | null | undefined;
160
+ periodStart: string | null;
161
+ periodEnd: string | null;
162
+ createdAt: string;
163
+ initiatedAt: string | null;
164
+ paidAt: string | null;
165
+ failureReason?: string | null | undefined;
166
+ mode: ListPayoutsMode | null;
167
+ partner: ListPayoutsPartner;
168
+ user?: User | null | undefined;
169
+ };
170
+
171
+ /** @internal */
172
+ export const ListPayoutsQueryParamStatus$outboundSchema: z.ZodNativeEnum<
173
+ typeof ListPayoutsQueryParamStatus
174
+ > = z.nativeEnum(ListPayoutsQueryParamStatus);
175
+
176
+ /** @internal */
177
+ export const ListPayoutsQueryParamSortBy$outboundSchema: z.ZodNativeEnum<
178
+ typeof ListPayoutsQueryParamSortBy
179
+ > = z.nativeEnum(ListPayoutsQueryParamSortBy);
180
+
181
+ /** @internal */
182
+ export const ListPayoutsQueryParamSortOrder$outboundSchema: z.ZodNativeEnum<
183
+ typeof ListPayoutsQueryParamSortOrder
184
+ > = z.nativeEnum(ListPayoutsQueryParamSortOrder);
185
+
186
+ /** @internal */
187
+ export type ListPayoutsRequest$Outbound = {
188
+ status?: string | undefined;
189
+ partnerId?: string | undefined;
190
+ tenantId?: string | undefined;
191
+ invoiceId?: string | undefined;
192
+ sortBy: string;
193
+ sortOrder: string;
194
+ page: number;
195
+ pageSize: number;
196
+ };
197
+
198
+ /** @internal */
199
+ export const ListPayoutsRequest$outboundSchema: z.ZodType<
200
+ ListPayoutsRequest$Outbound,
201
+ z.ZodTypeDef,
202
+ ListPayoutsRequest
203
+ > = z.object({
204
+ status: ListPayoutsQueryParamStatus$outboundSchema.optional(),
205
+ partnerId: z.string().optional(),
206
+ tenantId: z.string().optional(),
207
+ invoiceId: z.string().optional(),
208
+ sortBy: ListPayoutsQueryParamSortBy$outboundSchema.default("amount"),
209
+ sortOrder: ListPayoutsQueryParamSortOrder$outboundSchema.default("desc"),
210
+ page: z.number().default(1),
211
+ pageSize: z.number().default(100),
212
+ });
213
+
214
+ export function listPayoutsRequestToJSON(
215
+ listPayoutsRequest: ListPayoutsRequest,
216
+ ): string {
217
+ return JSON.stringify(
218
+ ListPayoutsRequest$outboundSchema.parse(listPayoutsRequest),
219
+ );
220
+ }
221
+
222
+ /** @internal */
223
+ export const ListPayoutsStatus$inboundSchema: z.ZodNativeEnum<
224
+ typeof ListPayoutsStatus
225
+ > = z.nativeEnum(ListPayoutsStatus);
226
+
227
+ /** @internal */
228
+ export const ListPayoutsMode$inboundSchema: z.ZodNativeEnum<
229
+ typeof ListPayoutsMode
230
+ > = z.nativeEnum(ListPayoutsMode);
231
+
232
+ /** @internal */
233
+ export const ListPayoutsPartner$inboundSchema: z.ZodType<
234
+ ListPayoutsPartner,
235
+ z.ZodTypeDef,
236
+ unknown
237
+ > = z.object({
238
+ id: z.string(),
239
+ name: z.string(),
240
+ email: z.nullable(z.string()),
241
+ image: z.nullable(z.string()),
242
+ payoutsEnabledAt: z.nullable(z.string()),
243
+ country: z.nullable(z.string()),
244
+ groupId: z.nullable(z.string()).optional(),
245
+ tenantId: z.nullable(z.string()),
246
+ });
247
+
248
+ export function listPayoutsPartnerFromJSON(
249
+ jsonString: string,
250
+ ): SafeParseResult<ListPayoutsPartner, SDKValidationError> {
251
+ return safeParse(
252
+ jsonString,
253
+ (x) => ListPayoutsPartner$inboundSchema.parse(JSON.parse(x)),
254
+ `Failed to parse 'ListPayoutsPartner' from JSON`,
255
+ );
256
+ }
257
+
258
+ /** @internal */
259
+ export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
260
+ .object({
261
+ id: z.string(),
262
+ name: z.nullable(z.string()),
263
+ email: z.nullable(z.string()),
264
+ image: z.nullable(z.string()),
265
+ });
266
+
267
+ export function userFromJSON(
268
+ jsonString: string,
269
+ ): SafeParseResult<User, SDKValidationError> {
270
+ return safeParse(
271
+ jsonString,
272
+ (x) => User$inboundSchema.parse(JSON.parse(x)),
273
+ `Failed to parse 'User' from JSON`,
274
+ );
275
+ }
276
+
277
+ /** @internal */
278
+ export const ListPayoutsResponseBody$inboundSchema: z.ZodType<
279
+ ListPayoutsResponseBody,
280
+ z.ZodTypeDef,
281
+ unknown
282
+ > = z.object({
283
+ id: z.string(),
284
+ invoiceId: z.nullable(z.string()),
285
+ amount: z.number(),
286
+ currency: z.string(),
287
+ status: ListPayoutsStatus$inboundSchema,
288
+ description: z.nullable(z.string()).optional(),
289
+ periodStart: z.nullable(z.string()),
290
+ periodEnd: z.nullable(z.string()),
291
+ createdAt: z.string(),
292
+ initiatedAt: z.nullable(z.string()),
293
+ paidAt: z.nullable(z.string()),
294
+ failureReason: z.nullable(z.string()).optional(),
295
+ mode: z.nullable(ListPayoutsMode$inboundSchema),
296
+ partner: z.lazy(() => ListPayoutsPartner$inboundSchema),
297
+ user: z.nullable(z.lazy(() => User$inboundSchema)).optional(),
298
+ });
299
+
300
+ export function listPayoutsResponseBodyFromJSON(
301
+ jsonString: string,
302
+ ): SafeParseResult<ListPayoutsResponseBody, SDKValidationError> {
303
+ return safeParse(
304
+ jsonString,
305
+ (x) => ListPayoutsResponseBody$inboundSchema.parse(JSON.parse(x)),
306
+ `Failed to parse 'ListPayoutsResponseBody' from JSON`,
307
+ );
308
+ }
@@ -14,7 +14,7 @@ export class Bounties extends ClientSDK {
14
14
  * List bounty submissions
15
15
  *
16
16
  * @remarks
17
- * List all submissions for a specific bounty.
17
+ * List all submissions for a specific bounty in your partner program.
18
18
  */
19
19
  async listSubmissions(
20
20
  request: operations.ListBountySubmissionsRequest,
@@ -10,10 +10,10 @@ import { unwrapAsync } from "../types/fp.js";
10
10
 
11
11
  export class Commissions extends ClientSDK {
12
12
  /**
13
- * Get commissions for a program.
13
+ * List all commissions
14
14
  *
15
15
  * @remarks
16
- * Retrieve a list of commissions for a program.
16
+ * Retrieve a list of commissions for your partner program.
17
17
  */
18
18
  async list(
19
19
  request?: operations.ListCommissionsRequest | undefined,
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { payoutsList } from "../funcs/payoutsList.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Payouts extends ClientSDK {
11
+ /**
12
+ * List all payouts
13
+ *
14
+ * @remarks
15
+ * Retrieve a list of payouts for your partner program.
16
+ */
17
+ async list(
18
+ request?: operations.ListPayoutsRequest | undefined,
19
+ options?: RequestOptions,
20
+ ): Promise<Array<operations.ListPayoutsResponseBody>> {
21
+ return unwrapAsync(payoutsList(
22
+ this,
23
+ request,
24
+ options,
25
+ ));
26
+ }
27
+ }
package/src/sdk/sdk.ts CHANGED
@@ -13,6 +13,7 @@ import { Events } from "./events.js";
13
13
  import { Folders } from "./folders.js";
14
14
  import { Links } from "./links.js";
15
15
  import { Partners } from "./partners.js";
16
+ import { Payouts } from "./payouts.js";
16
17
  import { QRCodes } from "./qrcodes.js";
17
18
  import { Tags } from "./tags.js";
18
19
  import { Track } from "./track.js";
@@ -68,6 +69,11 @@ export class Dub extends ClientSDK {
68
69
  return (this._commissions ??= new Commissions(this._options));
69
70
  }
70
71
 
72
+ private _payouts?: Payouts;
73
+ get payouts(): Payouts {
74
+ return (this._payouts ??= new Payouts(this._options));
75
+ }
76
+
71
77
  private _embedTokens?: EmbedTokens;
72
78
  get embedTokens(): EmbedTokens {
73
79
  return (this._embedTokens ??= new EmbedTokens(this._options));