growsurf-typescript 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts +2 -2
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts +2 -2
  11. package/client.d.ts.map +1 -1
  12. package/client.js.map +1 -1
  13. package/client.mjs.map +1 -1
  14. package/core/api-promise.d.mts.map +1 -1
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.mjs.map +1 -1
  17. package/core/error.mjs.map +1 -1
  18. package/core/resource.d.mts.map +1 -1
  19. package/core/resource.d.ts.map +1 -1
  20. package/core/uploads.d.mts.map +1 -1
  21. package/core/uploads.d.ts.map +1 -1
  22. package/core/uploads.mjs.map +1 -1
  23. package/error.d.mts +1 -0
  24. package/error.d.mts.map +1 -1
  25. package/error.d.ts +1 -0
  26. package/error.d.ts.map +1 -1
  27. package/error.mjs +1 -0
  28. package/error.mjs.map +1 -1
  29. package/index.d.mts.map +1 -1
  30. package/index.d.ts.map +1 -1
  31. package/index.mjs.map +1 -1
  32. package/internal/detect-platform.mjs.map +1 -1
  33. package/internal/headers.mjs.map +1 -1
  34. package/internal/parse.d.mts.map +1 -1
  35. package/internal/parse.d.ts.map +1 -1
  36. package/internal/parse.mjs.map +1 -1
  37. package/internal/request-options.d.mts.map +1 -1
  38. package/internal/request-options.d.ts.map +1 -1
  39. package/internal/shims.d.mts +6 -0
  40. package/internal/shims.d.mts.map +1 -1
  41. package/internal/shims.d.ts +6 -0
  42. package/internal/shims.d.ts.map +1 -1
  43. package/internal/to-file.d.mts.map +1 -1
  44. package/internal/to-file.d.ts.map +1 -1
  45. package/internal/to-file.mjs.map +1 -1
  46. package/internal/types.d.mts +4 -4
  47. package/internal/types.d.mts.map +1 -1
  48. package/internal/types.d.ts +4 -4
  49. package/internal/types.d.ts.map +1 -1
  50. package/internal/uploads.d.mts.map +1 -1
  51. package/internal/uploads.d.ts.map +1 -1
  52. package/internal/uploads.mjs.map +1 -1
  53. package/internal/utils/base64.mjs.map +1 -1
  54. package/internal/utils/log.d.mts.map +1 -1
  55. package/internal/utils/log.d.ts.map +1 -1
  56. package/internal/utils/log.mjs.map +1 -1
  57. package/internal/utils/path.mjs.map +1 -1
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/internal/utils/values.mjs.map +1 -1
  60. package/internal/utils.d.mts.map +1 -1
  61. package/internal/utils.d.ts.map +1 -1
  62. package/internal/utils.mjs.map +1 -1
  63. package/package.json +1 -1
  64. package/resource.d.mts +1 -0
  65. package/resource.d.mts.map +1 -1
  66. package/resource.d.ts +1 -0
  67. package/resource.d.ts.map +1 -1
  68. package/resource.mjs +1 -0
  69. package/resource.mjs.map +1 -1
  70. package/resources/campaign/campaign.d.mts +67 -3
  71. package/resources/campaign/campaign.d.mts.map +1 -1
  72. package/resources/campaign/campaign.d.ts +67 -3
  73. package/resources/campaign/campaign.d.ts.map +1 -1
  74. package/resources/campaign/campaign.js +27 -0
  75. package/resources/campaign/campaign.js.map +1 -1
  76. package/resources/campaign/campaign.mjs +27 -0
  77. package/resources/campaign/campaign.mjs.map +1 -1
  78. package/resources/campaign/commission.d.mts.map +1 -1
  79. package/resources/campaign/commission.d.ts.map +1 -1
  80. package/resources/campaign/commission.mjs.map +1 -1
  81. package/resources/campaign/index.d.mts +2 -2
  82. package/resources/campaign/index.d.mts.map +1 -1
  83. package/resources/campaign/index.d.ts +2 -2
  84. package/resources/campaign/index.d.ts.map +1 -1
  85. package/resources/campaign/index.js.map +1 -1
  86. package/resources/campaign/index.mjs.map +1 -1
  87. package/resources/campaign/participant.d.mts +36 -31
  88. package/resources/campaign/participant.d.mts.map +1 -1
  89. package/resources/campaign/participant.d.ts +36 -31
  90. package/resources/campaign/participant.d.ts.map +1 -1
  91. package/resources/campaign/participant.js +2 -17
  92. package/resources/campaign/participant.js.map +1 -1
  93. package/resources/campaign/participant.mjs +2 -17
  94. package/resources/campaign/participant.mjs.map +1 -1
  95. package/resources/campaign/reward.d.mts.map +1 -1
  96. package/resources/campaign/reward.d.ts.map +1 -1
  97. package/resources/campaign/reward.mjs.map +1 -1
  98. package/resources/campaign.d.mts.map +1 -1
  99. package/resources/campaign.d.ts.map +1 -1
  100. package/resources/campaign.mjs.map +1 -1
  101. package/resources/index.d.mts +1 -1
  102. package/resources/index.d.mts.map +1 -1
  103. package/resources/index.d.ts +1 -1
  104. package/resources/index.d.ts.map +1 -1
  105. package/resources/index.js.map +1 -1
  106. package/resources/index.mjs.map +1 -1
  107. package/resources.d.mts.map +1 -1
  108. package/resources.d.ts.map +1 -1
  109. package/resources.mjs.map +1 -1
  110. package/src/client.ts +4 -0
  111. package/src/resources/campaign/campaign.ts +86 -4
  112. package/src/resources/campaign/index.ts +3 -2
  113. package/src/resources/campaign/participant.ts +45 -43
  114. package/src/resources/index.ts +2 -0
  115. package/src/version.ts +1 -1
  116. package/uploads.d.mts +1 -0
  117. package/uploads.d.mts.map +1 -1
  118. package/uploads.d.ts +1 -0
  119. package/uploads.d.ts.map +1 -1
  120. package/uploads.mjs +1 -0
  121. package/uploads.mjs.map +1 -1
  122. package/version.d.mts +1 -1
  123. package/version.d.ts +1 -1
  124. package/version.js +1 -1
  125. package/version.mjs +1 -1
@@ -93,6 +93,8 @@ export class ParticipantResource extends APIResource {
93
93
  * companyName: 'Hooli',
94
94
  * industry: 'Software',
95
95
  * },
96
+ * mobileInstanceId:
97
+ * '5f7d0f4c-3e7c-4aa9-8c41-d81d998f0bb1',
96
98
  * referredBy: 'richard-h8kp6l',
97
99
  * },
98
100
  * );
@@ -102,28 +104,6 @@ export class ParticipantResource extends APIResource {
102
104
  return this._client.post(path`/campaign/${id}/participant`, { body, ...options });
103
105
  }
104
106
 
105
- /**
106
- * Creates a participant-scoped token for GrowSurf mobile SDK participant
107
- * endpoints. The program must have mobile SDK access enabled.
108
- *
109
- * @example
110
- * ```ts
111
- * const response =
112
- * await client.campaign.participant.createMobileToken(
113
- * 'participantIdOrEmail',
114
- * { id: 'id' },
115
- * );
116
- * ```
117
- */
118
- createMobileToken(
119
- participantIDOrEmail: string,
120
- params: ParticipantCreateMobileTokenParams,
121
- options?: RequestOptions,
122
- ): APIPromise<ParticipantCreateMobileTokenResponse> {
123
- const { id } = params;
124
- return this._client.post(path`/campaign/${id}/participant/${participantIDOrEmail}/mobile-token`, options);
125
- }
126
-
127
107
  /**
128
108
  * Retrieves a paged list of commissions earned by a participant.
129
109
  *
@@ -306,6 +286,36 @@ export class ParticipantResource extends APIResource {
306
286
  }
307
287
  }
308
288
 
289
+ export interface Create {
290
+ email: string;
291
+
292
+ fingerprint?: string;
293
+
294
+ firstName?: string;
295
+
296
+ ipAddress?: string;
297
+
298
+ lastName?: string;
299
+
300
+ /**
301
+ * Shallow custom metadata object.
302
+ */
303
+ metadata?: { [key: string]: unknown };
304
+
305
+ /**
306
+ * Optional app-install scoped identifier for native mobile anti-fraud. Recommended
307
+ * for mobile participant creation and mobile participant token flows.
308
+ */
309
+ mobileInstanceId?: string;
310
+
311
+ referralStatus?: 'CREDIT_PENDING' | 'CREDIT_AWARDED';
312
+
313
+ /**
314
+ * Referrer participant ID or email address.
315
+ */
316
+ referredBy?: string;
317
+ }
318
+
309
319
  export type FraudRiskLevel = 'LOW' | 'MEDIUM' | 'HIGH';
310
320
 
311
321
  export interface Participant {
@@ -354,6 +364,12 @@ export interface Participant {
354
364
  */
355
365
  metadata?: { [key: string]: unknown };
356
366
 
367
+ /**
368
+ * App-install scoped mobile identifier used for anti-fraud matching when provided
369
+ * by native mobile apps. Not stored when strict GDPR/CCPA mode is enabled.
370
+ */
371
+ mobileInstanceId?: string | null;
372
+
357
373
  monthlyReferrals?: Array<string>;
358
374
 
359
375
  notes?: string | null;
@@ -484,18 +500,6 @@ export interface ParticipantDeleteResponse {
484
500
  success: boolean;
485
501
  }
486
502
 
487
- export interface ParticipantCreateMobileTokenResponse {
488
- /**
489
- * Token lifetime in seconds.
490
- */
491
- expiresIn: number;
492
-
493
- /**
494
- * Participant-scoped bearer token for GrowSurf mobile SDK participant endpoints.
495
- */
496
- participantToken: string;
497
- }
498
-
499
503
  export interface ParticipantListRewardsResponse {
500
504
  limit: number;
501
505
 
@@ -625,6 +629,12 @@ export interface ParticipantAddParams {
625
629
  */
626
630
  metadata?: { [key: string]: unknown };
627
631
 
632
+ /**
633
+ * Optional app-install scoped identifier for native mobile anti-fraud. Recommended
634
+ * for mobile participant creation and mobile participant token flows.
635
+ */
636
+ mobileInstanceId?: string;
637
+
628
638
  referralStatus?: 'CREDIT_PENDING' | 'CREDIT_AWARDED';
629
639
 
630
640
  /**
@@ -633,13 +643,6 @@ export interface ParticipantAddParams {
633
643
  referredBy?: string;
634
644
  }
635
645
 
636
- export interface ParticipantCreateMobileTokenParams {
637
- /**
638
- * GrowSurf program ID.
639
- */
640
- id: string;
641
- }
642
-
643
646
  export interface ParticipantListCommissionsParams {
644
647
  /**
645
648
  * Path param: GrowSurf program ID.
@@ -913,13 +916,13 @@ export interface ParticipantTriggerReferralParams {
913
916
 
914
917
  export declare namespace ParticipantResource {
915
918
  export {
919
+ type Create as Create,
916
920
  type FraudRiskLevel as FraudRiskLevel,
917
921
  type Participant as Participant,
918
922
  type ParticipantReward as ParticipantReward,
919
923
  type ReferralSource as ReferralSource,
920
924
  type ReferralStatus as ReferralStatus,
921
925
  type ParticipantDeleteResponse as ParticipantDeleteResponse,
922
- type ParticipantCreateMobileTokenResponse as ParticipantCreateMobileTokenResponse,
923
926
  type ParticipantListRewardsResponse as ParticipantListRewardsResponse,
924
927
  type ParticipantRecordTransactionResponse as ParticipantRecordTransactionResponse,
925
928
  type ParticipantSendInvitesResponse as ParticipantSendInvitesResponse,
@@ -928,7 +931,6 @@ export declare namespace ParticipantResource {
928
931
  type ParticipantUpdateParams as ParticipantUpdateParams,
929
932
  type ParticipantDeleteParams as ParticipantDeleteParams,
930
933
  type ParticipantAddParams as ParticipantAddParams,
931
- type ParticipantCreateMobileTokenParams as ParticipantCreateMobileTokenParams,
932
934
  type ParticipantListCommissionsParams as ParticipantListCommissionsParams,
933
935
  type ParticipantListPayoutsParams as ParticipantListPayoutsParams,
934
936
  type ParticipantListReferralsParams as ParticipantListReferralsParams,
@@ -9,7 +9,9 @@ export {
9
9
  type ParticipantPayoutList,
10
10
  type ReferralList,
11
11
  type CampaignListResponse,
12
+ type CampaignCreateMobileParticipantTokenResponse,
12
13
  type CampaignRetrieveAnalyticsResponse,
14
+ type CampaignCreateMobileParticipantTokenParams,
13
15
  type CampaignListCommissionsParams,
14
16
  type CampaignListLeaderboardParams,
15
17
  type CampaignListParticipantsParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
package/uploads.d.mts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.d.mts.map
package/uploads.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/uploads.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.js";
2
3
  //# sourceMappingURL=uploads.d.ts.map
package/uploads.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,kCAA+B"}
package/uploads.mjs CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.mjs.map
package/uploads.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.0";
1
+ export declare const VERSION = "0.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.0'; // x-release-please-version
4
+ exports.VERSION = '0.4.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.4.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map