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,234 @@
|
|
|
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.ParticipantResource = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class ParticipantResource extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves a single participant by GrowSurf participant ID or email address.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const participant =
|
|
14
|
+
* await client.campaign.participant.retrieve(
|
|
15
|
+
* 'participantIdOrEmail',
|
|
16
|
+
* { id: 'id' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(participantIDOrEmail, params, options) {
|
|
21
|
+
const { id } = params;
|
|
22
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Updates a participant by GrowSurf participant ID or email address.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const participant =
|
|
30
|
+
* await client.campaign.participant.update(
|
|
31
|
+
* 'participantIdOrEmail',
|
|
32
|
+
* {
|
|
33
|
+
* id: 'id',
|
|
34
|
+
* firstName: 'Gavin',
|
|
35
|
+
* lastName: 'Belson',
|
|
36
|
+
* metadata: { company: 'Hooli, Inc' },
|
|
37
|
+
* },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
update(participantIDOrEmail, params, options) {
|
|
42
|
+
const { id, ...body } = params;
|
|
43
|
+
return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, { body, ...options });
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Removes a participant by GrowSurf participant ID or email address.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const participant =
|
|
51
|
+
* await client.campaign.participant.delete(
|
|
52
|
+
* 'participantIdOrEmail',
|
|
53
|
+
* { id: 'id' },
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
delete(participantIDOrEmail, params, options) {
|
|
58
|
+
const { id } = params;
|
|
59
|
+
return this._client.delete((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, options);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Adds a new participant to the program. If the email already exists, the existing
|
|
63
|
+
* participant is returned.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const participant = await client.campaign.participant.add(
|
|
68
|
+
* 'id',
|
|
69
|
+
* {
|
|
70
|
+
* email: 'gavin@hooli.com',
|
|
71
|
+
* firstName: 'Gavin',
|
|
72
|
+
* ipAddress: '203.0.113.10',
|
|
73
|
+
* lastName: 'Belson',
|
|
74
|
+
* metadata: {
|
|
75
|
+
* companyName: 'Hooli',
|
|
76
|
+
* industry: 'Software',
|
|
77
|
+
* },
|
|
78
|
+
* referredBy: 'richard-h8kp6l',
|
|
79
|
+
* },
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
add(id, body, options) {
|
|
84
|
+
return this._client.post((0, path_1.path) `/campaign/${id}/participant`, { body, ...options });
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Retrieves a paged list of commissions earned by a participant.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const participantCommissionList =
|
|
92
|
+
* await client.campaign.participant.listCommissions(
|
|
93
|
+
* 'participantIdOrEmail',
|
|
94
|
+
* { id: 'id' },
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
listCommissions(participantIDOrEmail, params, options) {
|
|
99
|
+
const { id, ...query } = params;
|
|
100
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/commissions`, {
|
|
101
|
+
query,
|
|
102
|
+
...options,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves a paged list of payouts that belong to a participant.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const participantPayoutList =
|
|
111
|
+
* await client.campaign.participant.listPayouts(
|
|
112
|
+
* 'participantIdOrEmail',
|
|
113
|
+
* { id: 'id' },
|
|
114
|
+
* );
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
listPayouts(participantIDOrEmail, params, options) {
|
|
118
|
+
const { id, ...query } = params;
|
|
119
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/payouts`, {
|
|
120
|
+
query,
|
|
121
|
+
...options,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Retrieves referrals and email invites made by a participant.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* const referralList =
|
|
130
|
+
* await client.campaign.participant.listReferrals(
|
|
131
|
+
* 'participantIdOrEmail',
|
|
132
|
+
* { id: 'id' },
|
|
133
|
+
* );
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
listReferrals(participantIDOrEmail, params, options) {
|
|
137
|
+
const { id, ...query } = params;
|
|
138
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/referrals`, {
|
|
139
|
+
query,
|
|
140
|
+
...options,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Retrieves a paged list of rewards earned by a participant.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* const response =
|
|
149
|
+
* await client.campaign.participant.listRewards(
|
|
150
|
+
* 'participantIdOrEmail',
|
|
151
|
+
* { id: 'id' },
|
|
152
|
+
* );
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
listRewards(participantIDOrEmail, params, options) {
|
|
156
|
+
const { id, ...query } = params;
|
|
157
|
+
return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/rewards`, {
|
|
158
|
+
query,
|
|
159
|
+
...options,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Records a sale made by a referred customer and generates affiliate commissions
|
|
164
|
+
* for their referrer when applicable.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const response =
|
|
169
|
+
* await client.campaign.participant.recordTransaction(
|
|
170
|
+
* 'participantIdOrEmail',
|
|
171
|
+
* {
|
|
172
|
+
* id: 'id',
|
|
173
|
+
* currency: 'USD',
|
|
174
|
+
* grossAmount: 9900,
|
|
175
|
+
* amountCashNet: 7900,
|
|
176
|
+
* description: 'Renewal for Pro subscription',
|
|
177
|
+
* invoiceId: 'invoice_54',
|
|
178
|
+
* paidAt: 1733702400000,
|
|
179
|
+
* },
|
|
180
|
+
* );
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
recordTransaction(participantIDOrEmail, params, options) {
|
|
184
|
+
const { id, ...body } = params;
|
|
185
|
+
return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/transaction`, {
|
|
186
|
+
body,
|
|
187
|
+
...options,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Sends email invites on behalf of a participant to a list of email addresses.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* const response =
|
|
196
|
+
* await client.campaign.participant.sendInvites(
|
|
197
|
+
* 'participantIdOrEmail',
|
|
198
|
+
* {
|
|
199
|
+
* id: 'id',
|
|
200
|
+
* emailAddresses: ['erlich@aviato.com'],
|
|
201
|
+
* messageText:
|
|
202
|
+
* '{{referrerFirstName}} invited you with {{referrerShareUrl}}.',
|
|
203
|
+
* subjectText: 'Join me on Pied Piper',
|
|
204
|
+
* },
|
|
205
|
+
* );
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
sendInvites(participantIDOrEmail, params, options) {
|
|
209
|
+
const { id, ...body } = params;
|
|
210
|
+
return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/invites`, {
|
|
211
|
+
body,
|
|
212
|
+
...options,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Triggers referral credit for an existing referred participant by GrowSurf
|
|
217
|
+
* participant ID or email address.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* const response =
|
|
222
|
+
* await client.campaign.participant.triggerReferral(
|
|
223
|
+
* 'participantIdOrEmail',
|
|
224
|
+
* { id: 'id' },
|
|
225
|
+
* );
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
triggerReferral(participantIDOrEmail, params, options) {
|
|
229
|
+
const { id } = params;
|
|
230
|
+
return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/ref`, options);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
exports.ParticipantResource = ParticipantResource;
|
|
234
|
+
//# sourceMappingURL=participant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"participant.js","sourceRoot":"","sources":["../../src/resources/campaign/participant.ts"],"names":[],"mappings":";AAAA,sFAAs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QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,gBAAgB,oBAAoB,cAAc,EAAE;YAC9F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CACT,oBAA4B,EAC5B,MAAoC,EACpC,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,gBAAgB,oBAAoB,UAAU,EAAE;YAC1F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,eAAe,CACb,oBAA4B,EAC5B,MAAwC,EACxC,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,gBAAgB,oBAAoB,MAAM,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;CACF;AAnRD,kDAmRC"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class ParticipantResource extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves a single participant by GrowSurf participant ID or email address.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const participant =
|
|
11
|
+
* await client.campaign.participant.retrieve(
|
|
12
|
+
* 'participantIdOrEmail',
|
|
13
|
+
* { id: 'id' },
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(participantIDOrEmail, params, options) {
|
|
18
|
+
const { id } = params;
|
|
19
|
+
return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}`, options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Updates a participant by GrowSurf participant ID or email address.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const participant =
|
|
27
|
+
* await client.campaign.participant.update(
|
|
28
|
+
* 'participantIdOrEmail',
|
|
29
|
+
* {
|
|
30
|
+
* id: 'id',
|
|
31
|
+
* firstName: 'Gavin',
|
|
32
|
+
* lastName: 'Belson',
|
|
33
|
+
* metadata: { company: 'Hooli, Inc' },
|
|
34
|
+
* },
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
update(participantIDOrEmail, params, options) {
|
|
39
|
+
const { id, ...body } = params;
|
|
40
|
+
return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Removes a participant by GrowSurf participant ID or email address.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const participant =
|
|
48
|
+
* await client.campaign.participant.delete(
|
|
49
|
+
* 'participantIdOrEmail',
|
|
50
|
+
* { id: 'id' },
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
delete(participantIDOrEmail, params, options) {
|
|
55
|
+
const { id } = params;
|
|
56
|
+
return this._client.delete(path `/campaign/${id}/participant/${participantIDOrEmail}`, options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Adds a new participant to the program. If the email already exists, the existing
|
|
60
|
+
* participant is returned.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const participant = await client.campaign.participant.add(
|
|
65
|
+
* 'id',
|
|
66
|
+
* {
|
|
67
|
+
* email: 'gavin@hooli.com',
|
|
68
|
+
* firstName: 'Gavin',
|
|
69
|
+
* ipAddress: '203.0.113.10',
|
|
70
|
+
* lastName: 'Belson',
|
|
71
|
+
* metadata: {
|
|
72
|
+
* companyName: 'Hooli',
|
|
73
|
+
* industry: 'Software',
|
|
74
|
+
* },
|
|
75
|
+
* referredBy: 'richard-h8kp6l',
|
|
76
|
+
* },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
add(id, body, options) {
|
|
81
|
+
return this._client.post(path `/campaign/${id}/participant`, { body, ...options });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves a paged list of commissions earned by a participant.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const participantCommissionList =
|
|
89
|
+
* await client.campaign.participant.listCommissions(
|
|
90
|
+
* 'participantIdOrEmail',
|
|
91
|
+
* { id: 'id' },
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
listCommissions(participantIDOrEmail, params, options) {
|
|
96
|
+
const { id, ...query } = params;
|
|
97
|
+
return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/commissions`, {
|
|
98
|
+
query,
|
|
99
|
+
...options,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Retrieves a paged list of payouts that belong to a participant.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const participantPayoutList =
|
|
108
|
+
* await client.campaign.participant.listPayouts(
|
|
109
|
+
* 'participantIdOrEmail',
|
|
110
|
+
* { id: 'id' },
|
|
111
|
+
* );
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
listPayouts(participantIDOrEmail, params, options) {
|
|
115
|
+
const { id, ...query } = params;
|
|
116
|
+
return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/payouts`, {
|
|
117
|
+
query,
|
|
118
|
+
...options,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Retrieves referrals and email invites made by a participant.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const referralList =
|
|
127
|
+
* await client.campaign.participant.listReferrals(
|
|
128
|
+
* 'participantIdOrEmail',
|
|
129
|
+
* { id: 'id' },
|
|
130
|
+
* );
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
listReferrals(participantIDOrEmail, params, options) {
|
|
134
|
+
const { id, ...query } = params;
|
|
135
|
+
return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/referrals`, {
|
|
136
|
+
query,
|
|
137
|
+
...options,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Retrieves a paged list of rewards earned by a participant.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const response =
|
|
146
|
+
* await client.campaign.participant.listRewards(
|
|
147
|
+
* 'participantIdOrEmail',
|
|
148
|
+
* { id: 'id' },
|
|
149
|
+
* );
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
listRewards(participantIDOrEmail, params, options) {
|
|
153
|
+
const { id, ...query } = params;
|
|
154
|
+
return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/rewards`, {
|
|
155
|
+
query,
|
|
156
|
+
...options,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Records a sale made by a referred customer and generates affiliate commissions
|
|
161
|
+
* for their referrer when applicable.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const response =
|
|
166
|
+
* await client.campaign.participant.recordTransaction(
|
|
167
|
+
* 'participantIdOrEmail',
|
|
168
|
+
* {
|
|
169
|
+
* id: 'id',
|
|
170
|
+
* currency: 'USD',
|
|
171
|
+
* grossAmount: 9900,
|
|
172
|
+
* amountCashNet: 7900,
|
|
173
|
+
* description: 'Renewal for Pro subscription',
|
|
174
|
+
* invoiceId: 'invoice_54',
|
|
175
|
+
* paidAt: 1733702400000,
|
|
176
|
+
* },
|
|
177
|
+
* );
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
recordTransaction(participantIDOrEmail, params, options) {
|
|
181
|
+
const { id, ...body } = params;
|
|
182
|
+
return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/transaction`, {
|
|
183
|
+
body,
|
|
184
|
+
...options,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Sends email invites on behalf of a participant to a list of email addresses.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* const response =
|
|
193
|
+
* await client.campaign.participant.sendInvites(
|
|
194
|
+
* 'participantIdOrEmail',
|
|
195
|
+
* {
|
|
196
|
+
* id: 'id',
|
|
197
|
+
* emailAddresses: ['erlich@aviato.com'],
|
|
198
|
+
* messageText:
|
|
199
|
+
* '{{referrerFirstName}} invited you with {{referrerShareUrl}}.',
|
|
200
|
+
* subjectText: 'Join me on Pied Piper',
|
|
201
|
+
* },
|
|
202
|
+
* );
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
sendInvites(participantIDOrEmail, params, options) {
|
|
206
|
+
const { id, ...body } = params;
|
|
207
|
+
return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/invites`, {
|
|
208
|
+
body,
|
|
209
|
+
...options,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Triggers referral credit for an existing referred participant by GrowSurf
|
|
214
|
+
* participant ID or email address.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const response =
|
|
219
|
+
* await client.campaign.participant.triggerReferral(
|
|
220
|
+
* 'participantIdOrEmail',
|
|
221
|
+
* { id: 'id' },
|
|
222
|
+
* );
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
triggerReferral(participantIDOrEmail, params, options) {
|
|
226
|
+
const { id } = params;
|
|
227
|
+
return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/ref`, options);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=participant.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"participant.mjs","sourceRoot":"","sources":["../../src/resources/campaign/participant.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,oBAA4B,EAC5B,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAA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ource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Participant reward retrieval and manual reward operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Reward extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Removes a manually approved participant reward that has not already been
|
|
10
|
+
* approved.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const reward = await client.campaign.reward.delete(
|
|
15
|
+
* 'rewardId',
|
|
16
|
+
* { id: 'id' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
delete(rewardID: string, params: RewardDeleteParams, options?: RequestOptions): APIPromise<RewardDeleteResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Approves a manually approved reward earned by a participant.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const response = await client.campaign.reward.approve(
|
|
27
|
+
* 'rewardId',
|
|
28
|
+
* { id: 'id' },
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
approve(rewardID: string, params: RewardApproveParams, options?: RequestOptions): APIPromise<RewardApproveResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Marks an approved participant reward as fulfilled.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const response = await client.campaign.reward.fulfill(
|
|
39
|
+
* 'rewardId',
|
|
40
|
+
* { id: 'id' },
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
fulfill(rewardID: string, params: RewardFulfillParams, options?: RequestOptions): APIPromise<RewardFulfillResponse>;
|
|
45
|
+
}
|
|
46
|
+
export interface RewardDeleteResponse {
|
|
47
|
+
success: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface RewardApproveResponse {
|
|
50
|
+
success: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface RewardFulfillResponse {
|
|
53
|
+
success: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RewardDeleteParams {
|
|
56
|
+
/**
|
|
57
|
+
* GrowSurf program ID.
|
|
58
|
+
*/
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RewardApproveParams {
|
|
62
|
+
/**
|
|
63
|
+
* Path param: GrowSurf program ID.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Body param: Set true to mark the reward as fulfilled after approval.
|
|
68
|
+
*/
|
|
69
|
+
fulfill?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface RewardFulfillParams {
|
|
72
|
+
/**
|
|
73
|
+
* GrowSurf program ID.
|
|
74
|
+
*/
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace Reward {
|
|
78
|
+
export { type RewardDeleteResponse as RewardDeleteResponse, type RewardApproveResponse as RewardApproveResponse, type RewardFulfillResponse as RewardFulfillResponse, type RewardDeleteParams as RewardDeleteParams, type RewardApproveParams as RewardApproveParams, type RewardFulfillParams as RewardFulfillParams, };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=reward.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.d.mts","sourceRoot":"","sources":["../../src/resources/campaign/reward.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;CAIrC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,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;CACH"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Participant reward retrieval and manual reward operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Reward extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Removes a manually approved participant reward that has not already been
|
|
10
|
+
* approved.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const reward = await client.campaign.reward.delete(
|
|
15
|
+
* 'rewardId',
|
|
16
|
+
* { id: 'id' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
delete(rewardID: string, params: RewardDeleteParams, options?: RequestOptions): APIPromise<RewardDeleteResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Approves a manually approved reward earned by a participant.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const response = await client.campaign.reward.approve(
|
|
27
|
+
* 'rewardId',
|
|
28
|
+
* { id: 'id' },
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
approve(rewardID: string, params: RewardApproveParams, options?: RequestOptions): APIPromise<RewardApproveResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Marks an approved participant reward as fulfilled.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const response = await client.campaign.reward.fulfill(
|
|
39
|
+
* 'rewardId',
|
|
40
|
+
* { id: 'id' },
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
fulfill(rewardID: string, params: RewardFulfillParams, options?: RequestOptions): APIPromise<RewardFulfillResponse>;
|
|
45
|
+
}
|
|
46
|
+
export interface RewardDeleteResponse {
|
|
47
|
+
success: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface RewardApproveResponse {
|
|
50
|
+
success: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface RewardFulfillResponse {
|
|
53
|
+
success: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RewardDeleteParams {
|
|
56
|
+
/**
|
|
57
|
+
* GrowSurf program ID.
|
|
58
|
+
*/
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RewardApproveParams {
|
|
62
|
+
/**
|
|
63
|
+
* Path param: GrowSurf program ID.
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Body param: Set true to mark the reward as fulfilled after approval.
|
|
68
|
+
*/
|
|
69
|
+
fulfill?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface RewardFulfillParams {
|
|
72
|
+
/**
|
|
73
|
+
* GrowSurf program ID.
|
|
74
|
+
*/
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace Reward {
|
|
78
|
+
export { type RewardDeleteResponse as RewardDeleteResponse, type RewardApproveResponse as RewardApproveResponse, type RewardFulfillResponse as RewardFulfillResponse, type RewardDeleteParams as RewardDeleteParams, type RewardApproveParams as RewardApproveParams, type RewardFulfillParams as RewardFulfillParams, };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=reward.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward.d.ts","sourceRoot":"","sources":["../../src/resources/campaign/reward.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,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