growsurf-typescript 0.0.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/CHANGELOG.md +12 -0
- package/LICENSE +201 -0
- package/README.md +358 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +181 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +181 -0
- package/client.d.ts.map +1 -0
- package/client.js +476 -0
- package/client.js.map +1 -0
- package/client.mjs +472 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +87 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +81 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +143 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/campaign/campaign.d.mts +398 -0
- package/resources/campaign/campaign.d.mts.map +1 -0
- package/resources/campaign/campaign.d.ts +398 -0
- package/resources/campaign/campaign.d.ts.map +1 -0
- package/resources/campaign/campaign.js +123 -0
- package/resources/campaign/campaign.js.map +1 -0
- package/resources/campaign/campaign.mjs +118 -0
- package/resources/campaign/campaign.mjs.map +1 -0
- package/resources/campaign/commission.d.mts +54 -0
- package/resources/campaign/commission.d.mts.map +1 -0
- package/resources/campaign/commission.d.ts +54 -0
- package/resources/campaign/commission.d.ts.map +1 -0
- package/resources/campaign/commission.js +43 -0
- package/resources/campaign/commission.js.map +1 -0
- package/resources/campaign/commission.mjs +39 -0
- package/resources/campaign/commission.mjs.map +1 -0
- package/resources/campaign/index.d.mts +5 -0
- package/resources/campaign/index.d.mts.map +1 -0
- package/resources/campaign/index.d.ts +5 -0
- package/resources/campaign/index.d.ts.map +1 -0
- package/resources/campaign/index.js +13 -0
- package/resources/campaign/index.js.map +1 -0
- package/resources/campaign/index.mjs +6 -0
- package/resources/campaign/index.mjs.map +1 -0
- package/resources/campaign/participant.d.mts +611 -0
- package/resources/campaign/participant.d.mts.map +1 -0
- package/resources/campaign/participant.d.ts +611 -0
- package/resources/campaign/participant.d.ts.map +1 -0
- package/resources/campaign/participant.js +234 -0
- package/resources/campaign/participant.js.map +1 -0
- package/resources/campaign/participant.mjs +230 -0
- package/resources/campaign/participant.mjs.map +1 -0
- package/resources/campaign/reward.d.mts +80 -0
- package/resources/campaign/reward.d.mts.map +1 -0
- package/resources/campaign/reward.d.ts +80 -0
- package/resources/campaign/reward.d.ts.map +1 -0
- package/resources/campaign/reward.js +59 -0
- package/resources/campaign/reward.js.map +1 -0
- package/resources/campaign/reward.mjs +55 -0
- package/resources/campaign/reward.mjs.map +1 -0
- package/resources/campaign.d.mts +2 -0
- package/resources/campaign.d.mts.map +1 -0
- package/resources/campaign.d.ts +2 -0
- package/resources/campaign.d.ts.map +1 -0
- package/resources/campaign.js +6 -0
- package/resources/campaign.js.map +1 -0
- package/resources/campaign.mjs +3 -0
- package/resources/campaign.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +7 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +774 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +93 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +128 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/campaign/campaign.ts +718 -0
- package/src/resources/campaign/commission.ts +82 -0
- package/src/resources/campaign/index.ts +59 -0
- package/src/resources/campaign/participant.ts +897 -0
- package/src/resources/campaign/reward.ts +121 -0
- package/src/resources/campaign.ts +3 -0
- package/src/resources/index.ts +19 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as CampaignAPI from "./campaign.js";
|
|
3
|
+
import * as CommissionAPI from "./commission.js";
|
|
4
|
+
import { Commission as CommissionAPICommission, CommissionApproveParams, CommissionApproveResponse, CommissionDeleteParams, CommissionDeleteResponse } from "./commission.js";
|
|
5
|
+
import * as ParticipantAPI from "./participant.js";
|
|
6
|
+
import { FraudRiskLevel, Participant, ParticipantAddParams, ParticipantDeleteParams, ParticipantDeleteResponse, ParticipantListCommissionsParams, ParticipantListPayoutsParams, ParticipantListReferralsParams, ParticipantListRewardsParams, ParticipantListRewardsResponse, ParticipantRecordTransactionParams, ParticipantRecordTransactionResponse, ParticipantResource, ParticipantRetrieveParams, ParticipantReward, ParticipantSendInvitesParams, ParticipantSendInvitesResponse, ParticipantTriggerReferralParams, ParticipantTriggerReferralResponse, ParticipantUpdateParams, ReferralSource, ReferralStatus } from "./participant.js";
|
|
7
|
+
import * as RewardAPI from "./reward.js";
|
|
8
|
+
import { Reward as RewardAPIReward, RewardApproveParams, RewardApproveResponse, RewardDeleteParams, RewardDeleteResponse, RewardFulfillParams, RewardFulfillResponse } from "./reward.js";
|
|
9
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
10
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
11
|
+
export declare class CampaignResource extends APIResource {
|
|
12
|
+
participant: ParticipantAPI.ParticipantResource;
|
|
13
|
+
reward: RewardAPI.Reward;
|
|
14
|
+
commission: CommissionAPI.Commission;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a program for the given program ID.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const campaign = await client.campaign.retrieve('id');
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Campaign>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves a list of your programs. Deleted programs are not returned.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const campaigns = await client.campaign.list();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(options?: RequestOptions): APIPromise<CampaignListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves a paged list of all participant commissions in an affiliate program.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const participantCommissionList =
|
|
39
|
+
* await client.campaign.listCommissions('id');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
listCommissions(id: string, query?: CampaignListCommissionsParams | null | undefined, options?: RequestOptions): APIPromise<ParticipantCommissionList>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves participants in leaderboard order for the specified leaderboard type.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const participantList =
|
|
49
|
+
* await client.campaign.listLeaderboard('id');
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
listLeaderboard(id: string, query?: CampaignListLeaderboardParams | null | undefined, options?: RequestOptions): APIPromise<ParticipantList>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a paged list of participants in a program.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const participantList =
|
|
59
|
+
* await client.campaign.listParticipants('id');
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
listParticipants(id: string, query?: CampaignListParticipantsParams | null | undefined, options?: RequestOptions): APIPromise<ParticipantList>;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves a paged list of all participant payouts in an affiliate program.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const participantPayoutList =
|
|
69
|
+
* await client.campaign.listPayouts('id');
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
listPayouts(id: string, query?: CampaignListPayoutsParams | null | undefined, options?: RequestOptions): APIPromise<ParticipantPayoutList>;
|
|
73
|
+
/**
|
|
74
|
+
* Retrieves a list of all referrals and email invites made by participants in a
|
|
75
|
+
* program.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const referralList = await client.campaign.listReferrals(
|
|
80
|
+
* 'id',
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
listReferrals(id: string, query?: CampaignListReferralsParams | null | undefined, options?: RequestOptions): APIPromise<ReferralList>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves analytics for a program.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const response = await client.campaign.retrieveAnalytics(
|
|
91
|
+
* 'id',
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
retrieveAnalytics(id: string, query?: CampaignRetrieveAnalyticsParams | null | undefined, options?: RequestOptions): APIPromise<CampaignRetrieveAnalyticsResponse>;
|
|
96
|
+
}
|
|
97
|
+
export interface Campaign {
|
|
98
|
+
id: string;
|
|
99
|
+
impressionCount: number;
|
|
100
|
+
inviteCount: number;
|
|
101
|
+
name: string;
|
|
102
|
+
participantCount: number;
|
|
103
|
+
referralCount: number;
|
|
104
|
+
rewards: Array<Campaign.Reward>;
|
|
105
|
+
status: 'DRAFT' | 'IN_PROGRESS' | 'COMPLETE' | 'DELETED';
|
|
106
|
+
type: 'REFERRAL' | 'AFFILIATE';
|
|
107
|
+
winnerCount: number;
|
|
108
|
+
currencyISO?: string;
|
|
109
|
+
}
|
|
110
|
+
export declare namespace Campaign {
|
|
111
|
+
interface Reward {
|
|
112
|
+
id: string;
|
|
113
|
+
isUnlimited: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Shallow custom metadata object.
|
|
116
|
+
*/
|
|
117
|
+
metadata: {
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
};
|
|
120
|
+
type: 'SINGLE_SIDED' | 'DOUBLE_SIDED' | 'MILESTONE' | 'LEADERBOARD' | 'AFFILIATE';
|
|
121
|
+
commissionStructure?: CampaignAPI.CommissionStructure | null;
|
|
122
|
+
conversionsRequired?: number | null;
|
|
123
|
+
couponCode?: string | null;
|
|
124
|
+
description?: string | null;
|
|
125
|
+
imageUrl?: string | null;
|
|
126
|
+
/**
|
|
127
|
+
* `-1` represents an unlimited reward in REST responses.
|
|
128
|
+
*/
|
|
129
|
+
limit?: number | null;
|
|
130
|
+
limitDuration?: 'IN_TOTAL' | 'PER_MONTH' | null;
|
|
131
|
+
nextMilestonePrefix?: string | null;
|
|
132
|
+
nextMilestoneSuffix?: string | null;
|
|
133
|
+
numberOfWinners?: number | null;
|
|
134
|
+
order?: number | null;
|
|
135
|
+
referralDescription?: string | null;
|
|
136
|
+
referredRewardUpfront?: boolean;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export interface CommissionStructure {
|
|
140
|
+
amount?: number | null;
|
|
141
|
+
approvalRequired?: boolean | null;
|
|
142
|
+
duration?: string | null;
|
|
143
|
+
durationInMonths?: number | null;
|
|
144
|
+
event?: string | null;
|
|
145
|
+
hasIntro?: boolean | null;
|
|
146
|
+
hasMaxAmount?: boolean | null;
|
|
147
|
+
holdDuration?: number | null;
|
|
148
|
+
introAmount?: number | null;
|
|
149
|
+
introAmountISO?: string | null;
|
|
150
|
+
introDuration?: string | null;
|
|
151
|
+
introDurationInMonths?: number | null;
|
|
152
|
+
introPercent?: number | null;
|
|
153
|
+
introType?: string | null;
|
|
154
|
+
maxAmount?: number | null;
|
|
155
|
+
maxAmountISO?: string | null;
|
|
156
|
+
minPaidReferrals?: number | null;
|
|
157
|
+
percent?: number | null;
|
|
158
|
+
type?: 'PERCENT' | 'AMOUNT' | null;
|
|
159
|
+
[k: string]: unknown;
|
|
160
|
+
}
|
|
161
|
+
export interface ParticipantCommissionList {
|
|
162
|
+
commissions: Array<ParticipantCommissionList.Commission>;
|
|
163
|
+
limit: number;
|
|
164
|
+
nextId: string | null;
|
|
165
|
+
}
|
|
166
|
+
export declare namespace ParticipantCommissionList {
|
|
167
|
+
interface Commission {
|
|
168
|
+
id: string;
|
|
169
|
+
amount: number;
|
|
170
|
+
createdAt: number;
|
|
171
|
+
currencyISO: string;
|
|
172
|
+
referredId: string;
|
|
173
|
+
referrerId: string;
|
|
174
|
+
saleAmount: number;
|
|
175
|
+
status: 'PENDING' | 'APPROVED' | 'PAID' | 'REVERSED' | 'DELETED';
|
|
176
|
+
amountInCampaignCurrency?: number | null;
|
|
177
|
+
approvedAt?: number;
|
|
178
|
+
campaignCurrencyISO?: string | null;
|
|
179
|
+
exchangeRate?: number | null;
|
|
180
|
+
exchangeRateAt?: number;
|
|
181
|
+
fxError?: string | null;
|
|
182
|
+
holdDuration?: number | null;
|
|
183
|
+
paidAt?: number;
|
|
184
|
+
payoutQueuedAt?: number;
|
|
185
|
+
provider?: string | null;
|
|
186
|
+
reversedAt?: number;
|
|
187
|
+
saleAmountAmountInCampaignCurrency?: number | null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export interface ParticipantList {
|
|
191
|
+
limit: number;
|
|
192
|
+
nextId: string | null;
|
|
193
|
+
participants: Array<ParticipantAPI.Participant>;
|
|
194
|
+
}
|
|
195
|
+
export interface ParticipantPayoutList {
|
|
196
|
+
limit: number;
|
|
197
|
+
nextId: string | null;
|
|
198
|
+
payouts: Array<ParticipantPayoutList.Payout>;
|
|
199
|
+
}
|
|
200
|
+
export declare namespace ParticipantPayoutList {
|
|
201
|
+
interface Payout {
|
|
202
|
+
id: string;
|
|
203
|
+
amount: number;
|
|
204
|
+
commissionIds: Array<string>;
|
|
205
|
+
createdAt: number;
|
|
206
|
+
currencyISO: string;
|
|
207
|
+
participantId: string;
|
|
208
|
+
status: 'UPCOMING' | 'QUEUED' | 'ISSUED' | 'FAILED';
|
|
209
|
+
amountInCampaignCurrency?: number | null;
|
|
210
|
+
campaignCurrencyISO?: string | null;
|
|
211
|
+
exchangeRate?: number | null;
|
|
212
|
+
exchangeRateAt?: number;
|
|
213
|
+
failedAt?: number;
|
|
214
|
+
fxError?: string | null;
|
|
215
|
+
issuedAt?: number;
|
|
216
|
+
provider?: string | null;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
export interface ReferralList {
|
|
220
|
+
limit: number;
|
|
221
|
+
more: boolean;
|
|
222
|
+
referrals: Array<ReferralList.Referral>;
|
|
223
|
+
nextId?: string | null;
|
|
224
|
+
nextOffset?: number | null;
|
|
225
|
+
}
|
|
226
|
+
export declare namespace ReferralList {
|
|
227
|
+
interface Referral {
|
|
228
|
+
id: string;
|
|
229
|
+
createdAt: number;
|
|
230
|
+
email: string;
|
|
231
|
+
referralStatus: ParticipantAPI.ReferralStatus;
|
|
232
|
+
referredBy: string;
|
|
233
|
+
updatedAt: number;
|
|
234
|
+
firstName?: string | null;
|
|
235
|
+
lastName?: string | null;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
export interface CampaignListResponse {
|
|
239
|
+
campaigns: Array<Campaign>;
|
|
240
|
+
}
|
|
241
|
+
export interface CampaignRetrieveAnalyticsResponse {
|
|
242
|
+
analytics: CampaignRetrieveAnalyticsResponse.Analytics;
|
|
243
|
+
endDate: number;
|
|
244
|
+
startDate: number;
|
|
245
|
+
}
|
|
246
|
+
export declare namespace CampaignRetrieveAnalyticsResponse {
|
|
247
|
+
interface Analytics {
|
|
248
|
+
blueskyShares?: number;
|
|
249
|
+
emailShares?: number;
|
|
250
|
+
facebookShares?: number;
|
|
251
|
+
impressions?: number;
|
|
252
|
+
invites?: number;
|
|
253
|
+
linkedInShares?: number;
|
|
254
|
+
messengerShares?: number;
|
|
255
|
+
participants?: number;
|
|
256
|
+
pinterestShares?: number;
|
|
257
|
+
qrcodeShares?: number;
|
|
258
|
+
redditShares?: number;
|
|
259
|
+
referralCreditExpireds?: number;
|
|
260
|
+
referralCreditPendings?: number;
|
|
261
|
+
referrals?: number;
|
|
262
|
+
smsShares?: number;
|
|
263
|
+
telegramShares?: number;
|
|
264
|
+
threadsShares?: number;
|
|
265
|
+
/**
|
|
266
|
+
* Affiliate programs only. Number of commission records.
|
|
267
|
+
*/
|
|
268
|
+
totalCommissionCount?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Affiliate programs only. Commissions in the smallest unit of the program
|
|
271
|
+
* currency.
|
|
272
|
+
*/
|
|
273
|
+
totalCommissions?: number;
|
|
274
|
+
/**
|
|
275
|
+
* Affiliate programs only. Revenue in the smallest unit of the program currency.
|
|
276
|
+
*/
|
|
277
|
+
totalRevenue?: number;
|
|
278
|
+
tumblrShares?: number;
|
|
279
|
+
twitterShares?: number;
|
|
280
|
+
uniqueImpressions?: number;
|
|
281
|
+
wechatShares?: number;
|
|
282
|
+
whatsAppShares?: number;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
export interface CampaignListCommissionsParams {
|
|
286
|
+
/**
|
|
287
|
+
* Number of results to return. Maximum 100.
|
|
288
|
+
*/
|
|
289
|
+
limit?: number;
|
|
290
|
+
/**
|
|
291
|
+
* ID to start the next paged result set with.
|
|
292
|
+
*/
|
|
293
|
+
nextId?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Participant commission status.
|
|
296
|
+
*/
|
|
297
|
+
status?: 'PENDING' | 'APPROVED' | 'PAID' | 'REVERSED' | 'DELETED';
|
|
298
|
+
}
|
|
299
|
+
export interface CampaignListLeaderboardParams {
|
|
300
|
+
/**
|
|
301
|
+
* Deprecated. Use `leaderboardType=CURRENT_MONTH` instead.
|
|
302
|
+
*/
|
|
303
|
+
isMonthly?: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Leaderboard ordering mode.
|
|
306
|
+
*/
|
|
307
|
+
leaderboardType?: 'ALL_TIME' | 'CURRENT_MONTH' | 'PREV_MONTH' | 'TOTAL_IMPRESSION_COUNT' | 'UNIQUE_IMPRESSION_COUNT' | 'BY_COMMISSIONS' | 'BY_REVENUE' | 'BY_REFERRALS' | 'BY_LEADS';
|
|
308
|
+
/**
|
|
309
|
+
* Number of results to return. Maximum 100.
|
|
310
|
+
*/
|
|
311
|
+
limit?: number;
|
|
312
|
+
/**
|
|
313
|
+
* ID to start the next paged result set with.
|
|
314
|
+
*/
|
|
315
|
+
nextId?: string;
|
|
316
|
+
}
|
|
317
|
+
export interface CampaignListParticipantsParams {
|
|
318
|
+
/**
|
|
319
|
+
* Number of results to return. Maximum 100.
|
|
320
|
+
*/
|
|
321
|
+
limit?: number;
|
|
322
|
+
/**
|
|
323
|
+
* ID to start the next paged result set with.
|
|
324
|
+
*/
|
|
325
|
+
nextId?: string;
|
|
326
|
+
}
|
|
327
|
+
export interface CampaignListPayoutsParams {
|
|
328
|
+
/**
|
|
329
|
+
* Number of results to return. Maximum 100.
|
|
330
|
+
*/
|
|
331
|
+
limit?: number;
|
|
332
|
+
/**
|
|
333
|
+
* ID to start the next paged result set with.
|
|
334
|
+
*/
|
|
335
|
+
nextId?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Participant payout status.
|
|
338
|
+
*/
|
|
339
|
+
status?: 'UPCOMING' | 'QUEUED' | 'ISSUED' | 'FAILED';
|
|
340
|
+
}
|
|
341
|
+
export interface CampaignListReferralsParams {
|
|
342
|
+
/**
|
|
343
|
+
* Return results in descending order when true.
|
|
344
|
+
*/
|
|
345
|
+
desc?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* URL-encoded email value to filter referral results.
|
|
348
|
+
*/
|
|
349
|
+
email?: string;
|
|
350
|
+
/**
|
|
351
|
+
* First name value to filter results.
|
|
352
|
+
*/
|
|
353
|
+
firstName?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Last name value to filter results.
|
|
356
|
+
*/
|
|
357
|
+
lastName?: string;
|
|
358
|
+
/**
|
|
359
|
+
* Number of results to return. Maximum 100.
|
|
360
|
+
*/
|
|
361
|
+
limit?: number;
|
|
362
|
+
/**
|
|
363
|
+
* ID to start the next paged result set with.
|
|
364
|
+
*/
|
|
365
|
+
nextId?: string;
|
|
366
|
+
/**
|
|
367
|
+
* Offset number used to skip through a result set.
|
|
368
|
+
*/
|
|
369
|
+
offset?: number;
|
|
370
|
+
referralStatus?: ParticipantAPI.ReferralStatus;
|
|
371
|
+
/**
|
|
372
|
+
* Field used to sort referral results.
|
|
373
|
+
*/
|
|
374
|
+
sortBy?: 'updatedAt' | 'createdAt' | 'email' | 'firstName' | 'lastName' | 'referralStatus' | 'referralTriggeredAt';
|
|
375
|
+
}
|
|
376
|
+
export interface CampaignRetrieveAnalyticsParams {
|
|
377
|
+
/**
|
|
378
|
+
* Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
|
|
379
|
+
*/
|
|
380
|
+
days?: number;
|
|
381
|
+
/**
|
|
382
|
+
* End date of the analytics timeframe as a Unix timestamp in milliseconds.
|
|
383
|
+
* Required if `days` is not set.
|
|
384
|
+
*/
|
|
385
|
+
endDate?: number;
|
|
386
|
+
/**
|
|
387
|
+
* Start date of the analytics timeframe as a Unix timestamp in milliseconds.
|
|
388
|
+
* Required if `days` is not set.
|
|
389
|
+
*/
|
|
390
|
+
startDate?: number;
|
|
391
|
+
}
|
|
392
|
+
export declare namespace CampaignResource {
|
|
393
|
+
export { type Campaign as Campaign, type CommissionStructure as CommissionStructure, type ParticipantCommissionList as ParticipantCommissionList, type ParticipantList as ParticipantList, type ParticipantPayoutList as ParticipantPayoutList, type ReferralList as ReferralList, type CampaignListResponse as CampaignListResponse, type CampaignRetrieveAnalyticsResponse as CampaignRetrieveAnalyticsResponse, type CampaignListCommissionsParams as CampaignListCommissionsParams, type CampaignListLeaderboardParams as CampaignListLeaderboardParams, type CampaignListParticipantsParams as CampaignListParticipantsParams, type CampaignListPayoutsParams as CampaignListPayoutsParams, type CampaignListReferralsParams as CampaignListReferralsParams, type CampaignRetrieveAnalyticsParams as CampaignRetrieveAnalyticsParams, };
|
|
394
|
+
export { ParticipantResource as ParticipantResource, type FraudRiskLevel as FraudRiskLevel, type Participant as Participant, type ParticipantReward as ParticipantReward, type ReferralSource as ReferralSource, type ReferralStatus as ReferralStatus, type ParticipantDeleteResponse as ParticipantDeleteResponse, type ParticipantListRewardsResponse as ParticipantListRewardsResponse, type ParticipantRecordTransactionResponse as ParticipantRecordTransactionResponse, type ParticipantSendInvitesResponse as ParticipantSendInvitesResponse, type ParticipantTriggerReferralResponse as ParticipantTriggerReferralResponse, type ParticipantRetrieveParams as ParticipantRetrieveParams, type ParticipantUpdateParams as ParticipantUpdateParams, type ParticipantDeleteParams as ParticipantDeleteParams, type ParticipantAddParams as ParticipantAddParams, type ParticipantListCommissionsParams as ParticipantListCommissionsParams, type ParticipantListPayoutsParams as ParticipantListPayoutsParams, type ParticipantListReferralsParams as ParticipantListReferralsParams, type ParticipantListRewardsParams as ParticipantListRewardsParams, type ParticipantRecordTransactionParams as ParticipantRecordTransactionParams, type ParticipantSendInvitesParams as ParticipantSendInvitesParams, type ParticipantTriggerReferralParams as ParticipantTriggerReferralParams, };
|
|
395
|
+
export { RewardAPIReward as Reward, type RewardDeleteResponse as RewardDeleteResponse, type RewardApproveResponse as RewardApproveResponse, type RewardFulfillResponse as RewardFulfillResponse, type RewardDeleteParams as RewardDeleteParams, type RewardApproveParams as RewardApproveParams, type RewardFulfillParams as RewardFulfillParams, };
|
|
396
|
+
export { CommissionAPICommission as Commission, type CommissionDeleteResponse as CommissionDeleteResponse, type CommissionApproveResponse as CommissionApproveResponse, type CommissionDeleteParams as CommissionDeleteParams, type CommissionApproveParams as CommissionApproveParams, };
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=campaign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.d.ts","sourceRoot":"","sources":["../../src/resources/campaign/campaign.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,aAAa;OAClB,EACL,UAAU,IAAI,uBAAuB,EACrC,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACzB;OACM,KAAK,cAAc;OACnB,EACL,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,4BAA4B,EAC5B,8BAA8B,EAC9B,4BAA4B,EAC5B,8BAA8B,EAC9B,kCAAkC,EAClC,oCAAoC,EACpC,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,uBAAuB,EACvB,cAAc,EACd,cAAc,EACf;OACM,KAAK,SAAS;OACd,EACL,MAAM,IAAI,eAAe,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACtB;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,WAAW,EAAE,cAAc,CAAC,mBAAmB,CAAwD;IACvG,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAC9D,UAAU,EAAE,aAAa,CAAC,UAAU,CAA8C;IAElF;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAIpE;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIhE;;;;;;;;OAQG;IACH,eAAe,CACb,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,6BAA6B,GAAG,IAAI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IAAI,kCAAkC,EAC7E,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;IAEF,OAAO,EACL,eAAe,IAAI,MAAM,EACzB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,uBAAuB,IAAI,UAAU,EACrC,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CampaignResource = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const CommissionAPI = tslib_1.__importStar(require("./commission.js"));
|
|
8
|
+
const commission_1 = require("./commission.js");
|
|
9
|
+
const ParticipantAPI = tslib_1.__importStar(require("./participant.js"));
|
|
10
|
+
const participant_1 = require("./participant.js");
|
|
11
|
+
const RewardAPI = tslib_1.__importStar(require("./reward.js"));
|
|
12
|
+
const reward_1 = require("./reward.js");
|
|
13
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
14
|
+
class CampaignResource extends resource_1.APIResource {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.participant = new ParticipantAPI.ParticipantResource(this._client);
|
|
18
|
+
this.reward = new RewardAPI.Reward(this._client);
|
|
19
|
+
this.commission = new CommissionAPI.Commission(this._client);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a program for the given program ID.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const campaign = await client.campaign.retrieve('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
retrieve(id, options) {
|
|
30
|
+
return this._client.get((0, path_1.path) `/campaign/${id}`, options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves a list of your programs. Deleted programs are not returned.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const campaigns = await client.campaign.list();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
list(options) {
|
|
41
|
+
return this._client.get('/campaigns', options);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves a paged list of all participant commissions in an affiliate program.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const participantCommissionList =
|
|
49
|
+
* await client.campaign.listCommissions('id');
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
listCommissions(id, query = {}, options) {
|
|
53
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/commissions`, { query, ...options });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves participants in leaderboard order for the specified leaderboard type.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const participantList =
|
|
61
|
+
* await client.campaign.listLeaderboard('id');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
listLeaderboard(id, query = {}, options) {
|
|
65
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/leaderboard`, { query, ...options });
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves a paged list of participants in a program.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const participantList =
|
|
73
|
+
* await client.campaign.listParticipants('id');
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
listParticipants(id, query = {}, options) {
|
|
77
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participants`, { query, ...options });
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Retrieves a paged list of all participant payouts in an affiliate program.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const participantPayoutList =
|
|
85
|
+
* await client.campaign.listPayouts('id');
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
listPayouts(id, query = {}, options) {
|
|
89
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/payouts`, { query, ...options });
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves a list of all referrals and email invites made by participants in a
|
|
93
|
+
* program.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const referralList = await client.campaign.listReferrals(
|
|
98
|
+
* 'id',
|
|
99
|
+
* );
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
listReferrals(id, query = {}, options) {
|
|
103
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/referrals`, { query, ...options });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves analytics for a program.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const response = await client.campaign.retrieveAnalytics(
|
|
111
|
+
* 'id',
|
|
112
|
+
* );
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
retrieveAnalytics(id, query = {}, options) {
|
|
116
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/analytics`, { query, ...options });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.CampaignResource = CampaignResource;
|
|
120
|
+
CampaignResource.ParticipantResource = participant_1.ParticipantResource;
|
|
121
|
+
CampaignResource.Reward = reward_1.Reward;
|
|
122
|
+
CampaignResource.Commission = commission_1.Commission;
|
|
123
|
+
//# sourceMappingURL=campaign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.js","sourceRoot":"","sources":["../../src/resources/campaign/campaign.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,uEAA8C;AAC9C,gDAMsB;AACtB,yEAAgD;AAChD,kDAuBuB;AACvB,+DAAsC;AACtC,wCAQkB;AAGlB,uDAAiD;AAEjD,MAAa,gBAAiB,SAAQ,sBAAW;IAAjD;;QACE,gBAAW,GAAuC,IAAI,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvG,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,eAAU,GAA6B,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkIpF,CAAC;IAhIC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,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BAAiB,CACf,EAAU,EACV,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AArID,4CAqIC;AAqdD,gBAAgB,CAAC,mBAAmB,GAAG,iCAAmB,CAAC;AAC3D,gBAAgB,CAAC,MAAM,GAAG,eAAe,CAAC;AAC1C,gBAAgB,CAAC,UAAU,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as CommissionAPI from "./commission.mjs";
|
|
4
|
+
import { Commission as CommissionAPICommission, } from "./commission.mjs";
|
|
5
|
+
import * as ParticipantAPI from "./participant.mjs";
|
|
6
|
+
import { ParticipantResource, } from "./participant.mjs";
|
|
7
|
+
import * as RewardAPI from "./reward.mjs";
|
|
8
|
+
import { Reward as RewardAPIReward, } from "./reward.mjs";
|
|
9
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
10
|
+
export class CampaignResource extends APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.participant = new ParticipantAPI.ParticipantResource(this._client);
|
|
14
|
+
this.reward = new RewardAPI.Reward(this._client);
|
|
15
|
+
this.commission = new CommissionAPI.Commission(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a program for the given program ID.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const campaign = await client.campaign.retrieve('id');
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
retrieve(id, options) {
|
|
26
|
+
return this._client.get(path `/campaign/${id}`, options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a list of your programs. Deleted programs are not returned.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const campaigns = await client.campaign.list();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
list(options) {
|
|
37
|
+
return this._client.get('/campaigns', options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a paged list of all participant commissions in an affiliate program.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const participantCommissionList =
|
|
45
|
+
* await client.campaign.listCommissions('id');
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
listCommissions(id, query = {}, options) {
|
|
49
|
+
return this._client.get(path `/campaign/${id}/commissions`, { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves participants in leaderboard order for the specified leaderboard type.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const participantList =
|
|
57
|
+
* await client.campaign.listLeaderboard('id');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
listLeaderboard(id, query = {}, options) {
|
|
61
|
+
return this._client.get(path `/campaign/${id}/leaderboard`, { query, ...options });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves a paged list of participants in a program.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const participantList =
|
|
69
|
+
* await client.campaign.listParticipants('id');
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
listParticipants(id, query = {}, options) {
|
|
73
|
+
return this._client.get(path `/campaign/${id}/participants`, { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves a paged list of all participant payouts in an affiliate program.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const participantPayoutList =
|
|
81
|
+
* await client.campaign.listPayouts('id');
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
listPayouts(id, query = {}, options) {
|
|
85
|
+
return this._client.get(path `/campaign/${id}/payouts`, { query, ...options });
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves a list of all referrals and email invites made by participants in a
|
|
89
|
+
* program.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const referralList = await client.campaign.listReferrals(
|
|
94
|
+
* 'id',
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
listReferrals(id, query = {}, options) {
|
|
99
|
+
return this._client.get(path `/campaign/${id}/referrals`, { query, ...options });
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Retrieves analytics for a program.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const response = await client.campaign.retrieveAnalytics(
|
|
107
|
+
* 'id',
|
|
108
|
+
* );
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
retrieveAnalytics(id, query = {}, options) {
|
|
112
|
+
return this._client.get(path `/campaign/${id}/analytics`, { query, ...options });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
CampaignResource.ParticipantResource = ParticipantResource;
|
|
116
|
+
CampaignResource.Reward = RewardAPIReward;
|
|
117
|
+
CampaignResource.Commission = CommissionAPICommission;
|
|
118
|
+
//# sourceMappingURL=campaign.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign.mjs","sourceRoot":"","sources":["../../src/resources/campaign/campaign.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,aAAa;OAClB,EACL,UAAU,IAAI,uBAAuB,GAKtC;OACM,KAAK,cAAc;OACnB,EAaL,mBAAmB,GAUpB;OACM,KAAK,SAAS;OACd,E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