dub 0.64.0 → 0.64.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.
- package/README.md +2 -0
- package/bin/mcp-server.js +887 -158
- package/bin/mcp-server.js.map +25 -21
- package/dist/commonjs/funcs/analyticsRetrieve.js +1 -0
- package/dist/commonjs/funcs/analyticsRetrieve.js.map +1 -1
- package/dist/commonjs/funcs/eventsList.js +1 -0
- package/dist/commonjs/funcs/eventsList.js.map +1 -1
- package/dist/commonjs/funcs/partnersList.d.ts +18 -0
- package/dist/commonjs/funcs/partnersList.d.ts.map +1 -0
- package/dist/commonjs/funcs/partnersList.js +133 -0
- package/dist/commonjs/funcs/partnersList.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/partnersList.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/partnersList.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/partnersList.js +54 -0
- package/dist/commonjs/mcp-server/tools/partnersList.js.map +1 -0
- package/dist/commonjs/models/components/analyticstriggers.d.ts +6 -0
- package/dist/commonjs/models/components/analyticstriggers.d.ts.map +1 -1
- package/dist/commonjs/models/components/analyticstriggers.js +2 -0
- package/dist/commonjs/models/components/analyticstriggers.js.map +1 -1
- package/dist/commonjs/models/components/commissioncreatedevent.d.ts +310 -0
- package/dist/commonjs/models/components/commissioncreatedevent.d.ts.map +1 -0
- package/dist/commonjs/models/components/commissioncreatedevent.js +261 -0
- package/dist/commonjs/models/components/commissioncreatedevent.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/partnerenrolledevent.d.ts +131 -52
- package/dist/commonjs/models/components/partnerenrolledevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/partnerenrolledevent.js +79 -21
- package/dist/commonjs/models/components/partnerenrolledevent.js.map +1 -1
- package/dist/commonjs/models/components/saleevent.d.ts +3 -0
- package/dist/commonjs/models/components/saleevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/saleevent.js +1 -0
- package/dist/commonjs/models/components/saleevent.js.map +1 -1
- package/dist/commonjs/models/components/webhookevent.d.ts +3 -2
- package/dist/commonjs/models/components/webhookevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/webhookevent.js +3 -0
- package/dist/commonjs/models/components/webhookevent.js.map +1 -1
- package/dist/commonjs/models/operations/createpartner.d.ts +131 -52
- package/dist/commonjs/models/operations/createpartner.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createpartner.js +79 -21
- package/dist/commonjs/models/operations/createpartner.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listcommissions.d.ts +136 -4
- package/dist/commonjs/models/operations/listcommissions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listcommissions.js +95 -5
- package/dist/commonjs/models/operations/listcommissions.js.map +1 -1
- package/dist/commonjs/models/operations/listevents.d.ts +42 -0
- package/dist/commonjs/models/operations/listevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listevents.js +27 -1
- package/dist/commonjs/models/operations/listevents.js.map +1 -1
- package/dist/commonjs/models/operations/listpartners.d.ts +549 -0
- package/dist/commonjs/models/operations/listpartners.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpartners.js +358 -0
- package/dist/commonjs/models/operations/listpartners.js.map +1 -0
- package/dist/commonjs/models/operations/retrieveanalytics.d.ts +42 -0
- package/dist/commonjs/models/operations/retrieveanalytics.d.ts.map +1 -1
- package/dist/commonjs/models/operations/retrieveanalytics.js +28 -1
- package/dist/commonjs/models/operations/retrieveanalytics.js.map +1 -1
- package/dist/commonjs/models/operations/tracklead.d.ts +2 -2
- package/dist/commonjs/models/operations/tracklead.d.ts.map +1 -1
- package/dist/commonjs/models/operations/tracklead.js +2 -2
- package/dist/commonjs/models/operations/tracklead.js.map +1 -1
- package/dist/commonjs/models/operations/tracksale.d.ts +5 -2
- package/dist/commonjs/models/operations/tracksale.d.ts.map +1 -1
- package/dist/commonjs/models/operations/tracksale.js +3 -2
- package/dist/commonjs/models/operations/tracksale.js.map +1 -1
- package/dist/commonjs/models/operations/updatecommission.d.ts +136 -4
- package/dist/commonjs/models/operations/updatecommission.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatecommission.js +95 -5
- package/dist/commonjs/models/operations/updatecommission.js.map +1 -1
- package/dist/commonjs/sdk/partners.d.ts +7 -0
- package/dist/commonjs/sdk/partners.d.ts.map +1 -1
- package/dist/commonjs/sdk/partners.js +10 -0
- package/dist/commonjs/sdk/partners.js.map +1 -1
- package/dist/esm/funcs/analyticsRetrieve.js +1 -0
- package/dist/esm/funcs/analyticsRetrieve.js.map +1 -1
- package/dist/esm/funcs/eventsList.js +1 -0
- package/dist/esm/funcs/eventsList.js.map +1 -1
- package/dist/esm/funcs/partnersList.d.ts +18 -0
- package/dist/esm/funcs/partnersList.d.ts.map +1 -0
- package/dist/esm/funcs/partnersList.js +106 -0
- package/dist/esm/funcs/partnersList.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/partnersList.d.ts +8 -0
- package/dist/esm/mcp-server/tools/partnersList.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/partnersList.js +28 -0
- package/dist/esm/mcp-server/tools/partnersList.js.map +1 -0
- package/dist/esm/models/components/analyticstriggers.d.ts +6 -0
- package/dist/esm/models/components/analyticstriggers.d.ts.map +1 -1
- package/dist/esm/models/components/analyticstriggers.js +2 -0
- package/dist/esm/models/components/analyticstriggers.js.map +1 -1
- package/dist/esm/models/components/commissioncreatedevent.d.ts +310 -0
- package/dist/esm/models/components/commissioncreatedevent.d.ts.map +1 -0
- package/dist/esm/models/components/commissioncreatedevent.js +227 -0
- package/dist/esm/models/components/commissioncreatedevent.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/partnerenrolledevent.d.ts +131 -52
- package/dist/esm/models/components/partnerenrolledevent.d.ts.map +1 -1
- package/dist/esm/models/components/partnerenrolledevent.js +78 -20
- package/dist/esm/models/components/partnerenrolledevent.js.map +1 -1
- package/dist/esm/models/components/saleevent.d.ts +3 -0
- package/dist/esm/models/components/saleevent.d.ts.map +1 -1
- package/dist/esm/models/components/saleevent.js +1 -0
- package/dist/esm/models/components/saleevent.js.map +1 -1
- package/dist/esm/models/components/webhookevent.d.ts +3 -2
- package/dist/esm/models/components/webhookevent.d.ts.map +1 -1
- package/dist/esm/models/components/webhookevent.js +3 -0
- package/dist/esm/models/components/webhookevent.js.map +1 -1
- package/dist/esm/models/operations/createpartner.d.ts +131 -52
- package/dist/esm/models/operations/createpartner.d.ts.map +1 -1
- package/dist/esm/models/operations/createpartner.js +78 -20
- package/dist/esm/models/operations/createpartner.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listcommissions.d.ts +136 -4
- package/dist/esm/models/operations/listcommissions.d.ts.map +1 -1
- package/dist/esm/models/operations/listcommissions.js +90 -4
- package/dist/esm/models/operations/listcommissions.js.map +1 -1
- package/dist/esm/models/operations/listevents.d.ts +42 -0
- package/dist/esm/models/operations/listevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listevents.js +26 -0
- package/dist/esm/models/operations/listevents.js.map +1 -1
- package/dist/esm/models/operations/listpartners.d.ts +549 -0
- package/dist/esm/models/operations/listpartners.d.ts.map +1 -0
- package/dist/esm/models/operations/listpartners.js +326 -0
- package/dist/esm/models/operations/listpartners.js.map +1 -0
- package/dist/esm/models/operations/retrieveanalytics.d.ts +42 -0
- package/dist/esm/models/operations/retrieveanalytics.d.ts.map +1 -1
- package/dist/esm/models/operations/retrieveanalytics.js +27 -0
- package/dist/esm/models/operations/retrieveanalytics.js.map +1 -1
- package/dist/esm/models/operations/tracklead.d.ts +2 -2
- package/dist/esm/models/operations/tracklead.d.ts.map +1 -1
- package/dist/esm/models/operations/tracklead.js +2 -2
- package/dist/esm/models/operations/tracklead.js.map +1 -1
- package/dist/esm/models/operations/tracksale.d.ts +5 -2
- package/dist/esm/models/operations/tracksale.d.ts.map +1 -1
- package/dist/esm/models/operations/tracksale.js +3 -2
- package/dist/esm/models/operations/tracksale.js.map +1 -1
- package/dist/esm/models/operations/updatecommission.d.ts +136 -4
- package/dist/esm/models/operations/updatecommission.d.ts.map +1 -1
- package/dist/esm/models/operations/updatecommission.js +90 -4
- package/dist/esm/models/operations/updatecommission.js.map +1 -1
- package/dist/esm/sdk/partners.d.ts +7 -0
- package/dist/esm/sdk/partners.d.ts.map +1 -1
- package/dist/esm/sdk/partners.js +10 -0
- package/dist/esm/sdk/partners.js.map +1 -1
- package/docs/sdks/partners/README.md +78 -0
- package/examples/README.md +5 -0
- package/examples/linksCreate.example.ts +2 -0
- package/examples/package-lock.json +2 -2
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/analyticsRetrieve.ts +1 -0
- package/src/funcs/eventsList.ts +1 -0
- package/src/funcs/partnersList.ts +227 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/partnersList.ts +37 -0
- package/src/models/components/analyticstriggers.ts +2 -0
- package/src/models/components/commissioncreatedevent.ts +503 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/partnerenrolledevent.ts +175 -72
- package/src/models/components/saleevent.ts +1 -0
- package/src/models/components/webhookevent.ts +12 -2
- package/src/models/operations/createpartner.ts +175 -72
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listcommissions.ts +242 -8
- package/src/models/operations/listevents.ts +42 -0
- package/src/models/operations/listpartners.ts +748 -0
- package/src/models/operations/retrieveanalytics.ts +40 -0
- package/src/models/operations/tracklead.ts +4 -4
- package/src/models/operations/tracksale.ts +5 -4
- package/src/models/operations/updatecommission.ts +242 -8
- package/src/sdk/partners.ts +18 -0
|
@@ -80,6 +80,8 @@ export type Interval = ClosedEnum<typeof Interval>;
|
|
|
80
80
|
export const Trigger = {
|
|
81
81
|
Qr: "qr",
|
|
82
82
|
Link: "link",
|
|
83
|
+
Pageview: "pageview",
|
|
84
|
+
Deeplink: "deeplink",
|
|
83
85
|
} as const;
|
|
84
86
|
/**
|
|
85
87
|
* The trigger to retrieve analytics for. If undefined, return both QR and link clicks.
|
|
@@ -91,6 +93,18 @@ export type Trigger = ClosedEnum<typeof Trigger>;
|
|
|
91
93
|
*/
|
|
92
94
|
export type RetrieveAnalyticsQueryParamTagIds = string | Array<string>;
|
|
93
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.
|
|
98
|
+
*/
|
|
99
|
+
export const SaleType = {
|
|
100
|
+
New: "new",
|
|
101
|
+
Recurring: "recurring",
|
|
102
|
+
} as const;
|
|
103
|
+
/**
|
|
104
|
+
* Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.
|
|
105
|
+
*/
|
|
106
|
+
export type SaleType = ClosedEnum<typeof SaleType>;
|
|
107
|
+
|
|
94
108
|
export type RetrieveAnalyticsRequest = {
|
|
95
109
|
/**
|
|
96
110
|
* The type of event to retrieve analytics for. Defaults to `clicks`.
|
|
@@ -212,6 +226,10 @@ export type RetrieveAnalyticsRequest = {
|
|
|
212
226
|
* Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both.
|
|
213
227
|
*/
|
|
214
228
|
root?: boolean | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.
|
|
231
|
+
*/
|
|
232
|
+
saleType?: SaleType | undefined;
|
|
215
233
|
/**
|
|
216
234
|
* The UTM source of the short link.
|
|
217
235
|
*/
|
|
@@ -383,6 +401,25 @@ export function retrieveAnalyticsQueryParamTagIdsFromJSON(
|
|
|
383
401
|
);
|
|
384
402
|
}
|
|
385
403
|
|
|
404
|
+
/** @internal */
|
|
405
|
+
export const SaleType$inboundSchema: z.ZodNativeEnum<typeof SaleType> = z
|
|
406
|
+
.nativeEnum(SaleType);
|
|
407
|
+
|
|
408
|
+
/** @internal */
|
|
409
|
+
export const SaleType$outboundSchema: z.ZodNativeEnum<typeof SaleType> =
|
|
410
|
+
SaleType$inboundSchema;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* @internal
|
|
414
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
415
|
+
*/
|
|
416
|
+
export namespace SaleType$ {
|
|
417
|
+
/** @deprecated use `SaleType$inboundSchema` instead. */
|
|
418
|
+
export const inboundSchema = SaleType$inboundSchema;
|
|
419
|
+
/** @deprecated use `SaleType$outboundSchema` instead. */
|
|
420
|
+
export const outboundSchema = SaleType$outboundSchema;
|
|
421
|
+
}
|
|
422
|
+
|
|
386
423
|
/** @internal */
|
|
387
424
|
export const RetrieveAnalyticsRequest$inboundSchema: z.ZodType<
|
|
388
425
|
RetrieveAnalyticsRequest,
|
|
@@ -419,6 +456,7 @@ export const RetrieveAnalyticsRequest$inboundSchema: z.ZodType<
|
|
|
419
456
|
folderId: z.string().optional(),
|
|
420
457
|
qr: z.boolean().optional(),
|
|
421
458
|
root: z.boolean().optional(),
|
|
459
|
+
saleType: SaleType$inboundSchema.optional(),
|
|
422
460
|
utm_source: z.nullable(z.string()).optional(),
|
|
423
461
|
utm_medium: z.nullable(z.string()).optional(),
|
|
424
462
|
utm_campaign: z.nullable(z.string()).optional(),
|
|
@@ -466,6 +504,7 @@ export type RetrieveAnalyticsRequest$Outbound = {
|
|
|
466
504
|
folderId?: string | undefined;
|
|
467
505
|
qr?: boolean | undefined;
|
|
468
506
|
root?: boolean | undefined;
|
|
507
|
+
saleType?: string | undefined;
|
|
469
508
|
utm_source?: string | null | undefined;
|
|
470
509
|
utm_medium?: string | null | undefined;
|
|
471
510
|
utm_campaign?: string | null | undefined;
|
|
@@ -509,6 +548,7 @@ export const RetrieveAnalyticsRequest$outboundSchema: z.ZodType<
|
|
|
509
548
|
folderId: z.string().optional(),
|
|
510
549
|
qr: z.boolean().optional(),
|
|
511
550
|
root: z.boolean().optional(),
|
|
551
|
+
saleType: SaleType$outboundSchema.optional(),
|
|
512
552
|
utmSource: z.nullable(z.string()).optional(),
|
|
513
553
|
utmMedium: z.nullable(z.string()).optional(),
|
|
514
554
|
utmCampaign: z.nullable(z.string()).optional(),
|
|
@@ -32,7 +32,7 @@ export type TrackLeadRequestBody = {
|
|
|
32
32
|
/**
|
|
33
33
|
* The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
customerExternalId: string;
|
|
36
36
|
/**
|
|
37
37
|
* The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).
|
|
38
38
|
*/
|
|
@@ -106,7 +106,7 @@ export const TrackLeadRequestBody$inboundSchema: z.ZodType<
|
|
|
106
106
|
> = z.object({
|
|
107
107
|
clickId: z.string(),
|
|
108
108
|
eventName: z.string(),
|
|
109
|
-
|
|
109
|
+
customerExternalId: z.string(),
|
|
110
110
|
customerName: z.nullable(z.string()).default(null),
|
|
111
111
|
customerEmail: z.nullable(z.string()).default(null),
|
|
112
112
|
customerAvatar: z.nullable(z.string()).default(null),
|
|
@@ -119,7 +119,7 @@ export const TrackLeadRequestBody$inboundSchema: z.ZodType<
|
|
|
119
119
|
export type TrackLeadRequestBody$Outbound = {
|
|
120
120
|
clickId: string;
|
|
121
121
|
eventName: string;
|
|
122
|
-
|
|
122
|
+
customerExternalId: string;
|
|
123
123
|
customerName: string | null;
|
|
124
124
|
customerEmail: string | null;
|
|
125
125
|
customerAvatar: string | null;
|
|
@@ -136,7 +136,7 @@ export const TrackLeadRequestBody$outboundSchema: z.ZodType<
|
|
|
136
136
|
> = z.object({
|
|
137
137
|
clickId: z.string(),
|
|
138
138
|
eventName: z.string(),
|
|
139
|
-
|
|
139
|
+
customerExternalId: z.string(),
|
|
140
140
|
customerName: z.nullable(z.string()).default(null),
|
|
141
141
|
customerEmail: z.nullable(z.string()).default(null),
|
|
142
142
|
customerAvatar: z.nullable(z.string()).default(null),
|
|
@@ -16,6 +16,7 @@ export const PaymentProcessor = {
|
|
|
16
16
|
Shopify: "shopify",
|
|
17
17
|
Polar: "polar",
|
|
18
18
|
Paddle: "paddle",
|
|
19
|
+
Revenuecat: "revenuecat",
|
|
19
20
|
Custom: "custom",
|
|
20
21
|
} as const;
|
|
21
22
|
/**
|
|
@@ -27,7 +28,7 @@ export type TrackSaleRequestBody = {
|
|
|
27
28
|
/**
|
|
28
29
|
* The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer.
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
customerExternalId: string;
|
|
31
32
|
/**
|
|
32
33
|
* The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency
|
|
33
34
|
*/
|
|
@@ -110,7 +111,7 @@ export const TrackSaleRequestBody$inboundSchema: z.ZodType<
|
|
|
110
111
|
z.ZodTypeDef,
|
|
111
112
|
unknown
|
|
112
113
|
> = z.object({
|
|
113
|
-
|
|
114
|
+
customerExternalId: z.string(),
|
|
114
115
|
amount: z.number().int(),
|
|
115
116
|
currency: z.string().default("usd"),
|
|
116
117
|
eventName: z.string().default("Purchase"),
|
|
@@ -122,7 +123,7 @@ export const TrackSaleRequestBody$inboundSchema: z.ZodType<
|
|
|
122
123
|
|
|
123
124
|
/** @internal */
|
|
124
125
|
export type TrackSaleRequestBody$Outbound = {
|
|
125
|
-
|
|
126
|
+
customerExternalId: string;
|
|
126
127
|
amount: number;
|
|
127
128
|
currency: string;
|
|
128
129
|
eventName: string;
|
|
@@ -138,7 +139,7 @@ export const TrackSaleRequestBody$outboundSchema: z.ZodType<
|
|
|
138
139
|
z.ZodTypeDef,
|
|
139
140
|
TrackSaleRequestBody
|
|
140
141
|
> = z.object({
|
|
141
|
-
|
|
142
|
+
customerExternalId: z.string(),
|
|
142
143
|
amount: z.number().int(),
|
|
143
144
|
currency: z.string().default("usd"),
|
|
144
145
|
eventName: z.string().default("Purchase"),
|
|
@@ -69,6 +69,72 @@ export const UpdateCommissionStatus = {
|
|
|
69
69
|
} as const;
|
|
70
70
|
export type UpdateCommissionStatus = ClosedEnum<typeof UpdateCommissionStatus>;
|
|
71
71
|
|
|
72
|
+
export type UpdateCommissionPartner = {
|
|
73
|
+
/**
|
|
74
|
+
* The partner's unique ID on Dub.
|
|
75
|
+
*/
|
|
76
|
+
id: string;
|
|
77
|
+
/**
|
|
78
|
+
* The partner's full legal name.
|
|
79
|
+
*/
|
|
80
|
+
name: string;
|
|
81
|
+
/**
|
|
82
|
+
* The partner's email address. Should be a unique value across Dub.
|
|
83
|
+
*/
|
|
84
|
+
email: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* The partner's avatar image.
|
|
87
|
+
*/
|
|
88
|
+
image: string | null;
|
|
89
|
+
/**
|
|
90
|
+
* The date when the partner enabled payouts.
|
|
91
|
+
*/
|
|
92
|
+
payoutsEnabledAt: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* The partner's country (required for tax purposes).
|
|
95
|
+
*/
|
|
96
|
+
country: string | null;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type UpdateCommissionCustomer = {
|
|
100
|
+
/**
|
|
101
|
+
* The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`).
|
|
102
|
+
*/
|
|
103
|
+
id: string;
|
|
104
|
+
/**
|
|
105
|
+
* Unique identifier for the customer in the client's app.
|
|
106
|
+
*/
|
|
107
|
+
externalId: string;
|
|
108
|
+
/**
|
|
109
|
+
* Name of the customer.
|
|
110
|
+
*/
|
|
111
|
+
name: string;
|
|
112
|
+
/**
|
|
113
|
+
* Email of the customer.
|
|
114
|
+
*/
|
|
115
|
+
email?: string | null | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Avatar URL of the customer.
|
|
118
|
+
*/
|
|
119
|
+
avatar?: string | null | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Country of the customer.
|
|
122
|
+
*/
|
|
123
|
+
country?: string | null | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Total number of sales for the customer.
|
|
126
|
+
*/
|
|
127
|
+
sales?: number | null | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Total amount of sales for the customer.
|
|
130
|
+
*/
|
|
131
|
+
saleAmount?: number | null | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The date the customer was created.
|
|
134
|
+
*/
|
|
135
|
+
createdAt: string;
|
|
136
|
+
};
|
|
137
|
+
|
|
72
138
|
/**
|
|
73
139
|
* The updated commission.
|
|
74
140
|
*/
|
|
@@ -82,10 +148,17 @@ export type UpdateCommissionResponseBody = {
|
|
|
82
148
|
earnings: number;
|
|
83
149
|
currency: string;
|
|
84
150
|
status: UpdateCommissionStatus;
|
|
85
|
-
invoiceId
|
|
86
|
-
description
|
|
151
|
+
invoiceId: string | null;
|
|
152
|
+
description: string | null;
|
|
153
|
+
quantity: number;
|
|
154
|
+
/**
|
|
155
|
+
* The user who created the manual commission.
|
|
156
|
+
*/
|
|
157
|
+
userId?: string | null | undefined;
|
|
87
158
|
createdAt: string;
|
|
88
159
|
updatedAt: string;
|
|
160
|
+
partner: UpdateCommissionPartner;
|
|
161
|
+
customer?: UpdateCommissionCustomer | null | undefined;
|
|
89
162
|
};
|
|
90
163
|
|
|
91
164
|
/** @internal */
|
|
@@ -281,6 +354,153 @@ export namespace UpdateCommissionStatus$ {
|
|
|
281
354
|
export const outboundSchema = UpdateCommissionStatus$outboundSchema;
|
|
282
355
|
}
|
|
283
356
|
|
|
357
|
+
/** @internal */
|
|
358
|
+
export const UpdateCommissionPartner$inboundSchema: z.ZodType<
|
|
359
|
+
UpdateCommissionPartner,
|
|
360
|
+
z.ZodTypeDef,
|
|
361
|
+
unknown
|
|
362
|
+
> = z.object({
|
|
363
|
+
id: z.string(),
|
|
364
|
+
name: z.string(),
|
|
365
|
+
email: z.nullable(z.string()),
|
|
366
|
+
image: z.nullable(z.string()),
|
|
367
|
+
payoutsEnabledAt: z.nullable(z.string()),
|
|
368
|
+
country: z.nullable(z.string()),
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
/** @internal */
|
|
372
|
+
export type UpdateCommissionPartner$Outbound = {
|
|
373
|
+
id: string;
|
|
374
|
+
name: string;
|
|
375
|
+
email: string | null;
|
|
376
|
+
image: string | null;
|
|
377
|
+
payoutsEnabledAt: string | null;
|
|
378
|
+
country: string | null;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
/** @internal */
|
|
382
|
+
export const UpdateCommissionPartner$outboundSchema: z.ZodType<
|
|
383
|
+
UpdateCommissionPartner$Outbound,
|
|
384
|
+
z.ZodTypeDef,
|
|
385
|
+
UpdateCommissionPartner
|
|
386
|
+
> = z.object({
|
|
387
|
+
id: z.string(),
|
|
388
|
+
name: z.string(),
|
|
389
|
+
email: z.nullable(z.string()),
|
|
390
|
+
image: z.nullable(z.string()),
|
|
391
|
+
payoutsEnabledAt: z.nullable(z.string()),
|
|
392
|
+
country: z.nullable(z.string()),
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @internal
|
|
397
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
398
|
+
*/
|
|
399
|
+
export namespace UpdateCommissionPartner$ {
|
|
400
|
+
/** @deprecated use `UpdateCommissionPartner$inboundSchema` instead. */
|
|
401
|
+
export const inboundSchema = UpdateCommissionPartner$inboundSchema;
|
|
402
|
+
/** @deprecated use `UpdateCommissionPartner$outboundSchema` instead. */
|
|
403
|
+
export const outboundSchema = UpdateCommissionPartner$outboundSchema;
|
|
404
|
+
/** @deprecated use `UpdateCommissionPartner$Outbound` instead. */
|
|
405
|
+
export type Outbound = UpdateCommissionPartner$Outbound;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export function updateCommissionPartnerToJSON(
|
|
409
|
+
updateCommissionPartner: UpdateCommissionPartner,
|
|
410
|
+
): string {
|
|
411
|
+
return JSON.stringify(
|
|
412
|
+
UpdateCommissionPartner$outboundSchema.parse(updateCommissionPartner),
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export function updateCommissionPartnerFromJSON(
|
|
417
|
+
jsonString: string,
|
|
418
|
+
): SafeParseResult<UpdateCommissionPartner, SDKValidationError> {
|
|
419
|
+
return safeParse(
|
|
420
|
+
jsonString,
|
|
421
|
+
(x) => UpdateCommissionPartner$inboundSchema.parse(JSON.parse(x)),
|
|
422
|
+
`Failed to parse 'UpdateCommissionPartner' from JSON`,
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** @internal */
|
|
427
|
+
export const UpdateCommissionCustomer$inboundSchema: z.ZodType<
|
|
428
|
+
UpdateCommissionCustomer,
|
|
429
|
+
z.ZodTypeDef,
|
|
430
|
+
unknown
|
|
431
|
+
> = z.object({
|
|
432
|
+
id: z.string(),
|
|
433
|
+
externalId: z.string(),
|
|
434
|
+
name: z.string(),
|
|
435
|
+
email: z.nullable(z.string()).optional(),
|
|
436
|
+
avatar: z.nullable(z.string()).optional(),
|
|
437
|
+
country: z.nullable(z.string()).optional(),
|
|
438
|
+
sales: z.nullable(z.number()).optional(),
|
|
439
|
+
saleAmount: z.nullable(z.number()).optional(),
|
|
440
|
+
createdAt: z.string(),
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
/** @internal */
|
|
444
|
+
export type UpdateCommissionCustomer$Outbound = {
|
|
445
|
+
id: string;
|
|
446
|
+
externalId: string;
|
|
447
|
+
name: string;
|
|
448
|
+
email?: string | null | undefined;
|
|
449
|
+
avatar?: string | null | undefined;
|
|
450
|
+
country?: string | null | undefined;
|
|
451
|
+
sales?: number | null | undefined;
|
|
452
|
+
saleAmount?: number | null | undefined;
|
|
453
|
+
createdAt: string;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
/** @internal */
|
|
457
|
+
export const UpdateCommissionCustomer$outboundSchema: z.ZodType<
|
|
458
|
+
UpdateCommissionCustomer$Outbound,
|
|
459
|
+
z.ZodTypeDef,
|
|
460
|
+
UpdateCommissionCustomer
|
|
461
|
+
> = z.object({
|
|
462
|
+
id: z.string(),
|
|
463
|
+
externalId: z.string(),
|
|
464
|
+
name: z.string(),
|
|
465
|
+
email: z.nullable(z.string()).optional(),
|
|
466
|
+
avatar: z.nullable(z.string()).optional(),
|
|
467
|
+
country: z.nullable(z.string()).optional(),
|
|
468
|
+
sales: z.nullable(z.number()).optional(),
|
|
469
|
+
saleAmount: z.nullable(z.number()).optional(),
|
|
470
|
+
createdAt: z.string(),
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* @internal
|
|
475
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
476
|
+
*/
|
|
477
|
+
export namespace UpdateCommissionCustomer$ {
|
|
478
|
+
/** @deprecated use `UpdateCommissionCustomer$inboundSchema` instead. */
|
|
479
|
+
export const inboundSchema = UpdateCommissionCustomer$inboundSchema;
|
|
480
|
+
/** @deprecated use `UpdateCommissionCustomer$outboundSchema` instead. */
|
|
481
|
+
export const outboundSchema = UpdateCommissionCustomer$outboundSchema;
|
|
482
|
+
/** @deprecated use `UpdateCommissionCustomer$Outbound` instead. */
|
|
483
|
+
export type Outbound = UpdateCommissionCustomer$Outbound;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export function updateCommissionCustomerToJSON(
|
|
487
|
+
updateCommissionCustomer: UpdateCommissionCustomer,
|
|
488
|
+
): string {
|
|
489
|
+
return JSON.stringify(
|
|
490
|
+
UpdateCommissionCustomer$outboundSchema.parse(updateCommissionCustomer),
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export function updateCommissionCustomerFromJSON(
|
|
495
|
+
jsonString: string,
|
|
496
|
+
): SafeParseResult<UpdateCommissionCustomer, SDKValidationError> {
|
|
497
|
+
return safeParse(
|
|
498
|
+
jsonString,
|
|
499
|
+
(x) => UpdateCommissionCustomer$inboundSchema.parse(JSON.parse(x)),
|
|
500
|
+
`Failed to parse 'UpdateCommissionCustomer' from JSON`,
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
|
|
284
504
|
/** @internal */
|
|
285
505
|
export const UpdateCommissionResponseBody$inboundSchema: z.ZodType<
|
|
286
506
|
UpdateCommissionResponseBody,
|
|
@@ -293,10 +513,15 @@ export const UpdateCommissionResponseBody$inboundSchema: z.ZodType<
|
|
|
293
513
|
earnings: z.number(),
|
|
294
514
|
currency: z.string(),
|
|
295
515
|
status: UpdateCommissionStatus$inboundSchema,
|
|
296
|
-
invoiceId: z.nullable(z.string())
|
|
297
|
-
description: z.nullable(z.string())
|
|
516
|
+
invoiceId: z.nullable(z.string()),
|
|
517
|
+
description: z.nullable(z.string()),
|
|
518
|
+
quantity: z.number(),
|
|
519
|
+
userId: z.nullable(z.string()).optional(),
|
|
298
520
|
createdAt: z.string(),
|
|
299
521
|
updatedAt: z.string(),
|
|
522
|
+
partner: z.lazy(() => UpdateCommissionPartner$inboundSchema),
|
|
523
|
+
customer: z.nullable(z.lazy(() => UpdateCommissionCustomer$inboundSchema))
|
|
524
|
+
.optional(),
|
|
300
525
|
});
|
|
301
526
|
|
|
302
527
|
/** @internal */
|
|
@@ -307,10 +532,14 @@ export type UpdateCommissionResponseBody$Outbound = {
|
|
|
307
532
|
earnings: number;
|
|
308
533
|
currency: string;
|
|
309
534
|
status: string;
|
|
310
|
-
invoiceId
|
|
311
|
-
description
|
|
535
|
+
invoiceId: string | null;
|
|
536
|
+
description: string | null;
|
|
537
|
+
quantity: number;
|
|
538
|
+
userId?: string | null | undefined;
|
|
312
539
|
createdAt: string;
|
|
313
540
|
updatedAt: string;
|
|
541
|
+
partner: UpdateCommissionPartner$Outbound;
|
|
542
|
+
customer?: UpdateCommissionCustomer$Outbound | null | undefined;
|
|
314
543
|
};
|
|
315
544
|
|
|
316
545
|
/** @internal */
|
|
@@ -325,10 +554,15 @@ export const UpdateCommissionResponseBody$outboundSchema: z.ZodType<
|
|
|
325
554
|
earnings: z.number(),
|
|
326
555
|
currency: z.string(),
|
|
327
556
|
status: UpdateCommissionStatus$outboundSchema,
|
|
328
|
-
invoiceId: z.nullable(z.string())
|
|
329
|
-
description: z.nullable(z.string())
|
|
557
|
+
invoiceId: z.nullable(z.string()),
|
|
558
|
+
description: z.nullable(z.string()),
|
|
559
|
+
quantity: z.number(),
|
|
560
|
+
userId: z.nullable(z.string()).optional(),
|
|
330
561
|
createdAt: z.string(),
|
|
331
562
|
updatedAt: z.string(),
|
|
563
|
+
partner: z.lazy(() => UpdateCommissionPartner$outboundSchema),
|
|
564
|
+
customer: z.nullable(z.lazy(() => UpdateCommissionCustomer$outboundSchema))
|
|
565
|
+
.optional(),
|
|
332
566
|
});
|
|
333
567
|
|
|
334
568
|
/**
|
package/src/sdk/partners.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { partnersAnalytics } from "../funcs/partnersAnalytics.js";
|
|
6
6
|
import { partnersCreate } from "../funcs/partnersCreate.js";
|
|
7
7
|
import { partnersCreateLink } from "../funcs/partnersCreateLink.js";
|
|
8
|
+
import { partnersList } from "../funcs/partnersList.js";
|
|
8
9
|
import { partnersRetrieveLinks } from "../funcs/partnersRetrieveLinks.js";
|
|
9
10
|
import { partnersUpsertLink } from "../funcs/partnersUpsertLink.js";
|
|
10
11
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -30,6 +31,23 @@ export class Partners extends ClientSDK {
|
|
|
30
31
|
));
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* List all partners
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* List all partners for a partner program.
|
|
39
|
+
*/
|
|
40
|
+
async list(
|
|
41
|
+
request?: operations.ListPartnersRequest | undefined,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): Promise<Array<operations.ListPartnersResponseBody>> {
|
|
44
|
+
return unwrapAsync(partnersList(
|
|
45
|
+
this,
|
|
46
|
+
request,
|
|
47
|
+
options,
|
|
48
|
+
));
|
|
49
|
+
}
|
|
50
|
+
|
|
33
51
|
/**
|
|
34
52
|
* Create a link for a partner
|
|
35
53
|
*
|