@fuul/sdk 7.2.1 → 7.3.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.
- package/dist/core.d.ts +62 -35
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +835 -824
- package/dist/index.umd.js +6 -6
- package/dist/referral-codes/ReferralCodeService.d.ts +18 -0
- package/dist/referral-codes/ReferralCodeService.d.ts.map +1 -0
- package/dist/release.json.d.ts +1 -1
- package/dist/types/api.d.ts +19 -15
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/invite-codes/InviteCodeService.d.ts +0 -17
- package/dist/invite-codes/InviteCodeService.d.ts.map +0 -1
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserIdentifierType } from '.';
|
|
2
|
-
import {
|
|
2
|
+
import { Conversion, GenerateReferralCodesParams, GenerateReferralCodesResponse, GetConversionsParams, GetPayoutsLeaderboardParams, GetPointsLeaderboardParams, GetReferralCodeParams, GetReferralCodeResponse, GetReferralStatusParams, GetReferralStatusResponse, GetReferredUsersLeaderboardParams, GetUserAudiencesParams, GetUserAudiencesResponse, GetUserPayoutMovementsParams, GetUserPayoutsByConversionParams, GetUserPointsByConversionParams, GetUserPointsMovementsParams, GetVolumeLeaderboardParams, LeaderboardResponse, ListUserReferralCodesParams, ListUserReferralCodesResponse, PayoutsLeaderboard, PointsLeaderboard, ReferredUsersLeaderboard, UpdateReferralCodeParams, UseReferralCodeParams, UserPayoutMovementsResponse, UserPayoutsByConversionResponse, UserPointsByConversionResponse, UserPointsMovementsResponse, VolumeLeaderboard } from './types/api';
|
|
3
3
|
import { AffiliateCodeParams, AffiliateLinkParams, EventArgs, FuulSettings, IdentifyUserParams } from './types/sdk';
|
|
4
4
|
import { GetUserReferrerParams, GetUserReferrerResponse } from './user/types';
|
|
5
5
|
export declare function init(settings: FuulSettings): void;
|
|
@@ -246,12 +246,12 @@ export declare function getUserReferrer(params: GetUserReferrerParams): Promise<
|
|
|
246
246
|
*/
|
|
247
247
|
export declare function getUserAudiences(params: GetUserAudiencesParams): Promise<GetUserAudiencesResponse>;
|
|
248
248
|
/**
|
|
249
|
-
* Lists
|
|
250
|
-
* @param {
|
|
251
|
-
* @returns {Promise<
|
|
249
|
+
* Lists referral codes for a user
|
|
250
|
+
* @param {ListUserReferralCodesParams} params List user referral codes parameters
|
|
251
|
+
* @returns {Promise<ListUserReferralCodesResponse>} List of user referral codes with pagination
|
|
252
252
|
* @example
|
|
253
253
|
* ```typescript
|
|
254
|
-
* const result = await Fuul.
|
|
254
|
+
* const result = await Fuul.listUserReferralCodes({
|
|
255
255
|
* user_identifier: '0x12345',
|
|
256
256
|
* user_identifier_type: UserIdentifierType.EvmAddress,
|
|
257
257
|
* page: 1,
|
|
@@ -259,14 +259,14 @@ export declare function getUserAudiences(params: GetUserAudiencesParams): Promis
|
|
|
259
259
|
* });
|
|
260
260
|
* ```
|
|
261
261
|
*/
|
|
262
|
-
export declare function
|
|
262
|
+
export declare function listUserReferralCodes(params: ListUserReferralCodesParams): Promise<ListUserReferralCodesResponse>;
|
|
263
263
|
/**
|
|
264
|
-
* Generates
|
|
265
|
-
* @param {
|
|
266
|
-
* @returns {Promise<
|
|
264
|
+
* Generates referral codes for a user
|
|
265
|
+
* @param {GenerateReferralCodesParams} params Generate referral codes parameters
|
|
266
|
+
* @returns {Promise<GenerateReferralCodesResponse[]>} Generated referral codes
|
|
267
267
|
* @example
|
|
268
268
|
* ```typescript
|
|
269
|
-
* const codes = await Fuul.
|
|
269
|
+
* const codes = await Fuul.generateReferralCodes({
|
|
270
270
|
* user_identifier: '0x12345',
|
|
271
271
|
* user_identifier_type: UserIdentifierType.EvmAddress,
|
|
272
272
|
* quantity: 5,
|
|
@@ -274,52 +274,78 @@ export declare function listUserInviteCodes(params: ListUserInviteCodesParams):
|
|
|
274
274
|
* });
|
|
275
275
|
* ```
|
|
276
276
|
*/
|
|
277
|
-
export declare function
|
|
277
|
+
export declare function generateReferralCodes(params: GenerateReferralCodesParams): Promise<GenerateReferralCodesResponse[]>;
|
|
278
278
|
/**
|
|
279
|
-
* Gets the
|
|
280
|
-
* @param {
|
|
281
|
-
* @returns {Promise<
|
|
279
|
+
* Gets the referral status for a user
|
|
280
|
+
* @param {GetReferralStatusParams} params Get referral status parameters
|
|
281
|
+
* @returns {Promise<GetReferralStatusResponse>} referral status
|
|
282
282
|
* @example
|
|
283
283
|
* ```typescript
|
|
284
|
-
* const status = await Fuul.
|
|
284
|
+
* const status = await Fuul.getReferralStatus({
|
|
285
285
|
* user_identifier: '0x12345',
|
|
286
286
|
* user_identifier_type: UserIdentifierType.EvmAddress
|
|
287
287
|
* });
|
|
288
|
-
* if (status.
|
|
289
|
-
* console.log('User was
|
|
288
|
+
* if (status.referred) {
|
|
289
|
+
* console.log('User was referred with code:', status.code);
|
|
290
290
|
* }
|
|
291
291
|
* ```
|
|
292
292
|
*/
|
|
293
|
-
export declare function
|
|
293
|
+
export declare function getReferralStatus(params: GetReferralStatusParams): Promise<GetReferralStatusResponse>;
|
|
294
294
|
/**
|
|
295
|
-
* Checks if an
|
|
296
|
-
* @param {
|
|
297
|
-
* @returns {Promise<
|
|
295
|
+
* Checks if an referral code is free to use
|
|
296
|
+
* @param {GetReferralCodeParams} params Check referral code parameters
|
|
297
|
+
* @returns {Promise<GetReferralCodeResponse>} Check result
|
|
298
298
|
* @example
|
|
299
299
|
* ```typescript
|
|
300
|
-
* const result = await Fuul.
|
|
301
|
-
* if (result.
|
|
302
|
-
* console.log('
|
|
300
|
+
* const result = await Fuul.getReferralCode({ code: 'abc1234' });
|
|
301
|
+
* if (result.available) {
|
|
302
|
+
* console.log('Referral code is available!');
|
|
303
303
|
* }
|
|
304
304
|
* ```
|
|
305
305
|
*/
|
|
306
|
-
export declare function
|
|
306
|
+
export declare function getReferralCode(params: GetReferralCodeParams): Promise<GetReferralCodeResponse>;
|
|
307
307
|
/**
|
|
308
|
-
* Uses an
|
|
309
|
-
* @param {
|
|
308
|
+
* Uses an referral code
|
|
309
|
+
* @param {UseReferralCodeParams} params Use referral code parameters
|
|
310
310
|
* @returns {Promise<void>}
|
|
311
311
|
* @example
|
|
312
312
|
* ```typescript
|
|
313
|
-
* await Fuul.
|
|
313
|
+
* await Fuul.useReferralCode({
|
|
314
314
|
* code: 'abc1234',
|
|
315
315
|
* user_identifier: '0x12345',
|
|
316
316
|
* user_identifier_type: UserIdentifierType.EvmAddress,
|
|
317
317
|
* signature: '0xaad9a0b62f87c15a248cb99ca926785b828b5',
|
|
318
|
-
* signature_message: 'I am using
|
|
318
|
+
* signature_message: 'I am using referral code abc1234',
|
|
319
319
|
* });
|
|
320
320
|
* ```
|
|
321
321
|
*/
|
|
322
|
-
export declare function
|
|
322
|
+
export declare function useReferralCode(params: UseReferralCodeParams): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Updates the properties of an existing referral code
|
|
325
|
+
* @param {UpdateReferralCodeParams} params Update referral code parameters
|
|
326
|
+
* @returns {Promise<void>}
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* // Set maximum uses to 10
|
|
330
|
+
* await Fuul.updateReferralCode({
|
|
331
|
+
* code: 'ABC1234',
|
|
332
|
+
* max_uses: 10
|
|
333
|
+
* });
|
|
334
|
+
*
|
|
335
|
+
* // Set unlimited uses
|
|
336
|
+
* await Fuul.updateReferralCode({
|
|
337
|
+
* code: 'ABC1234',
|
|
338
|
+
* max_uses: null
|
|
339
|
+
* });
|
|
340
|
+
*
|
|
341
|
+
* // Disable code (set to 0 uses)
|
|
342
|
+
* await Fuul.updateReferralCode({
|
|
343
|
+
* code: 'ABC1234',
|
|
344
|
+
* max_uses: 0
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
export declare function updateReferralCode(params: UpdateReferralCodeParams): Promise<void>;
|
|
323
349
|
declare const _default: {
|
|
324
350
|
init: typeof init;
|
|
325
351
|
sendEvent: typeof sendEvent;
|
|
@@ -341,11 +367,12 @@ declare const _default: {
|
|
|
341
367
|
getUserPayoutMovements: typeof getUserPayoutMovements;
|
|
342
368
|
getUserReferrer: typeof getUserReferrer;
|
|
343
369
|
getVolumeLeaderboard: typeof getVolumeLeaderboard;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
370
|
+
listUserReferralCodes: typeof listUserReferralCodes;
|
|
371
|
+
generateReferralCodes: typeof generateReferralCodes;
|
|
372
|
+
getReferralStatus: typeof getReferralStatus;
|
|
373
|
+
getReferralCode: typeof getReferralCode;
|
|
374
|
+
useReferralCode: typeof useReferralCode;
|
|
375
|
+
updateReferralCode: typeof updateReferralCode;
|
|
349
376
|
};
|
|
350
377
|
export default _default;
|
|
351
378
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAUvC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAUvC,OAAO,EACL,UAAU,EAEV,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,iCAAiC,EACjC,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EAC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cAAc,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAGzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAGrG;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGxG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAGvH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,EAAE,CAAC,CAGzH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAG3G;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAGrG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,wBA2BE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as Fuul } from './core';
|
|
2
2
|
export * from './affiliates/errors';
|
|
3
|
-
export type {
|
|
3
|
+
export type { GetReferralCodeParams, GetReferralCodeResponse, Conversion, GenerateReferralCodesParams, GenerateReferralCodesResponse, GetReferralStatusParams, GetReferralStatusResponse, ListUserReferralCodesParams, ListUserReferralCodesResponse, UpdateReferralCodeParams, UseReferralCodeParams, UserReferralCode, } from './types/api';
|
|
4
4
|
export type { EventArgs, FuulSettings, IdentifyUserParams } from './types/sdk';
|
|
5
5
|
export { UserIdentifierType } from './types/user';
|
|
6
6
|
export type { GetUserReferrerParams, GetUserReferrerResponse } from './user/types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|