@roketus/loyalty-js-sdk 4.40.2 → 5.0.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 (95) hide show
  1. package/dist/cjs/api/campaign/v2/actions/addAction.d.ts +2 -0
  2. package/dist/cjs/api/campaign/v2/actions/removeAction.d.ts +2 -0
  3. package/dist/cjs/api/campaign/v2/actions/updateAction.d.ts +2 -0
  4. package/dist/cjs/api/campaign/v2/campaignResultSerializer.d.ts +1 -0
  5. package/dist/cjs/api/campaign/v2/createCampaign.d.ts +2 -0
  6. package/dist/cjs/api/campaign/v2/deleteCampaign.d.ts +2 -0
  7. package/dist/cjs/api/campaign/v2/getCampaignById.d.ts +2 -0
  8. package/dist/cjs/api/campaign/v2/getCampaignStatistics.d.ts +2 -0
  9. package/dist/cjs/api/campaign/v2/lifecycle/activateCampaign.d.ts +2 -0
  10. package/dist/cjs/api/campaign/v2/lifecycle/cancelCampaign.d.ts +2 -0
  11. package/dist/cjs/api/campaign/v2/lifecycle/completeCampaign.d.ts +2 -0
  12. package/dist/cjs/api/campaign/v2/lifecycle/executeCampaign.d.ts +2 -0
  13. package/dist/cjs/api/campaign/v2/lifecycle/pauseCampaign.d.ts +2 -0
  14. package/dist/cjs/api/campaign/v2/lifecycle/resumeCampaign.d.ts +2 -0
  15. package/dist/cjs/api/campaign/v2/listCampaigns.d.ts +2 -0
  16. package/dist/cjs/api/campaign/v2/updateCampaignDates.d.ts +2 -0
  17. package/dist/cjs/api/campaign/v2/updateCampaignInfo.d.ts +2 -0
  18. package/dist/cjs/api/campaign/v2/updateCampaignLocations.d.ts +2 -0
  19. package/dist/cjs/index.d.ts +9 -32
  20. package/dist/cjs/index.js +1 -1
  21. package/dist/cjs/interfaces/IPOSTRequestPayloadDTO.d.ts +6 -0
  22. package/dist/cjs/interfaces/ISDK.d.ts +20 -0
  23. package/dist/cjs/interfaces/campaignsV2/ENotificationChannel.d.ts +7 -0
  24. package/dist/cjs/interfaces/campaignsV2/ICampaign.d.ts +37 -0
  25. package/dist/cjs/interfaces/campaignsV2/ICampaignAction.d.ts +73 -0
  26. package/dist/cjs/interfaces/campaignsV2/ICampaignCohort.d.ts +7 -0
  27. package/dist/cjs/interfaces/campaignsV2/ICampaignLocation.d.ts +4 -0
  28. package/dist/cjs/interfaces/campaignsV2/ICampaignRun.d.ts +12 -0
  29. package/dist/cjs/interfaces/campaignsV2/ICampaignStatistics.d.ts +41 -0
  30. package/dist/cjs/interfaces/campaignsV2/IExecuteCampaignResult.d.ts +24 -0
  31. package/dist/cjs/interfaces/campaignsV2/INotificationMedia.d.ts +10 -0
  32. package/dist/cjs/interfaces/campaignsV2/campaignInterfaces.d.ts +69 -0
  33. package/dist/cjs/interfaces/campaignsV2/campaignPayloads.d.ts +35 -0
  34. package/dist/cjs/interfaces/campaignsV2/index.d.ts +10 -0
  35. package/dist/cjs/interfaces/cardManagement/index.d.ts +2 -0
  36. package/dist/cjs/interfaces/cohortsV2/ICohort.d.ts +21 -9
  37. package/dist/cjs/interfaces/cohortsV2/ICreateCohortPayload.d.ts +2 -1
  38. package/dist/cjs/interfaces/cohortsV2/IUpdateCohortPayload.d.ts +2 -1
  39. package/dist/cjs/interfaces/cohortsV2/index.d.ts +4 -0
  40. package/dist/cjs/interfaces/excludes/index.d.ts +2 -0
  41. package/dist/cjs/interfaces/products/index.d.ts +5 -0
  42. package/dist/cjs/interfaces/promoCodes/ICreatePromocodePayload.d.ts +2 -1
  43. package/dist/cjs/interfaces/promoCodes/IPromocode.d.ts +7 -1
  44. package/dist/cjs/interfaces/promoCodes/index.d.ts +4 -0
  45. package/dist/cjs/interfaces/referralProgram/index.d.ts +6 -0
  46. package/dist/cjs/interfaces/tiers/index.d.ts +3 -0
  47. package/dist/cjs/interfaces/user/index.d.ts +5 -0
  48. package/dist/esm5/api/campaign/v2/actions/addAction.d.ts +2 -0
  49. package/dist/esm5/api/campaign/v2/actions/removeAction.d.ts +2 -0
  50. package/dist/esm5/api/campaign/v2/actions/updateAction.d.ts +2 -0
  51. package/dist/esm5/api/campaign/v2/campaignResultSerializer.d.ts +1 -0
  52. package/dist/esm5/api/campaign/v2/createCampaign.d.ts +2 -0
  53. package/dist/esm5/api/campaign/v2/deleteCampaign.d.ts +2 -0
  54. package/dist/esm5/api/campaign/v2/getCampaignById.d.ts +2 -0
  55. package/dist/esm5/api/campaign/v2/getCampaignStatistics.d.ts +2 -0
  56. package/dist/esm5/api/campaign/v2/lifecycle/activateCampaign.d.ts +2 -0
  57. package/dist/esm5/api/campaign/v2/lifecycle/cancelCampaign.d.ts +2 -0
  58. package/dist/esm5/api/campaign/v2/lifecycle/completeCampaign.d.ts +2 -0
  59. package/dist/esm5/api/campaign/v2/lifecycle/executeCampaign.d.ts +2 -0
  60. package/dist/esm5/api/campaign/v2/lifecycle/pauseCampaign.d.ts +2 -0
  61. package/dist/esm5/api/campaign/v2/lifecycle/resumeCampaign.d.ts +2 -0
  62. package/dist/esm5/api/campaign/v2/listCampaigns.d.ts +2 -0
  63. package/dist/esm5/api/campaign/v2/updateCampaignDates.d.ts +2 -0
  64. package/dist/esm5/api/campaign/v2/updateCampaignInfo.d.ts +2 -0
  65. package/dist/esm5/api/campaign/v2/updateCampaignLocations.d.ts +2 -0
  66. package/dist/esm5/index.d.ts +9 -32
  67. package/dist/esm5/index.js +1 -1
  68. package/dist/esm5/interfaces/IPOSTRequestPayloadDTO.d.ts +6 -0
  69. package/dist/esm5/interfaces/ISDK.d.ts +20 -0
  70. package/dist/esm5/interfaces/campaignsV2/ENotificationChannel.d.ts +7 -0
  71. package/dist/esm5/interfaces/campaignsV2/ICampaign.d.ts +37 -0
  72. package/dist/esm5/interfaces/campaignsV2/ICampaignAction.d.ts +73 -0
  73. package/dist/esm5/interfaces/campaignsV2/ICampaignCohort.d.ts +7 -0
  74. package/dist/esm5/interfaces/campaignsV2/ICampaignLocation.d.ts +4 -0
  75. package/dist/esm5/interfaces/campaignsV2/ICampaignRun.d.ts +12 -0
  76. package/dist/esm5/interfaces/campaignsV2/ICampaignStatistics.d.ts +41 -0
  77. package/dist/esm5/interfaces/campaignsV2/IExecuteCampaignResult.d.ts +24 -0
  78. package/dist/esm5/interfaces/campaignsV2/INotificationMedia.d.ts +10 -0
  79. package/dist/esm5/interfaces/campaignsV2/campaignInterfaces.d.ts +69 -0
  80. package/dist/esm5/interfaces/campaignsV2/campaignPayloads.d.ts +35 -0
  81. package/dist/esm5/interfaces/campaignsV2/index.d.ts +10 -0
  82. package/dist/esm5/interfaces/cardManagement/index.d.ts +2 -0
  83. package/dist/esm5/interfaces/cohortsV2/ICohort.d.ts +21 -9
  84. package/dist/esm5/interfaces/cohortsV2/ICreateCohortPayload.d.ts +2 -1
  85. package/dist/esm5/interfaces/cohortsV2/IUpdateCohortPayload.d.ts +2 -1
  86. package/dist/esm5/interfaces/cohortsV2/index.d.ts +4 -0
  87. package/dist/esm5/interfaces/excludes/index.d.ts +2 -0
  88. package/dist/esm5/interfaces/products/index.d.ts +5 -0
  89. package/dist/esm5/interfaces/promoCodes/ICreatePromocodePayload.d.ts +2 -1
  90. package/dist/esm5/interfaces/promoCodes/IPromocode.d.ts +7 -1
  91. package/dist/esm5/interfaces/promoCodes/index.d.ts +4 -0
  92. package/dist/esm5/interfaces/referralProgram/index.d.ts +6 -0
  93. package/dist/esm5/interfaces/tiers/index.d.ts +3 -0
  94. package/dist/esm5/interfaces/user/index.d.ts +5 -0
  95. package/package.json +6 -2
@@ -0,0 +1,73 @@
1
+ import { ENotificationChannel } from './ENotificationChannel';
2
+ import { INotificationMediaAsset } from './INotificationMedia';
3
+ export declare enum ECampaignActionType {
4
+ PROMOCODE = "PROMOCODE",
5
+ NOTIFICATION = "NOTIFICATION",
6
+ BONUS_ACCRUAL = "BONUS_ACCRUAL"
7
+ }
8
+ export declare type TCampaignAction = IPromoCodeAction | INotificationAction | IBonusAccrualAction;
9
+ export interface INotificationChannelSetting {
10
+ enabled: boolean;
11
+ priority?: number;
12
+ }
13
+ export interface INotificationTemplate {
14
+ header: string;
15
+ text: string;
16
+ short_text: string;
17
+ html_content?: string;
18
+ media_assets: INotificationMediaAsset[];
19
+ tags?: string[];
20
+ }
21
+ export interface INotificationRetryPolicy {
22
+ max_attempts: number;
23
+ backoff_ms: number;
24
+ }
25
+ export declare enum ENotificationDeliveryGuarantee {
26
+ AtLeastOnce = "AT_LEAST_ONCE",
27
+ AtMostOnce = "AT_MOST_ONCE",
28
+ ExactlyOnce = "EXACTLY_ONCE"
29
+ }
30
+ export interface INotificationConfig {
31
+ channels?: ENotificationChannel[];
32
+ channel_settings: Record<ENotificationChannel, INotificationChannelSetting>;
33
+ template: INotificationTemplate;
34
+ }
35
+ export interface INotificationAction {
36
+ id: string;
37
+ type: ECampaignActionType.NOTIFICATION;
38
+ name: string;
39
+ description?: string;
40
+ order?: number;
41
+ scheduled_at: string;
42
+ config: INotificationConfig;
43
+ retry_policy?: INotificationRetryPolicy;
44
+ delivery_guarantee?: ENotificationDeliveryGuarantee;
45
+ processing_timeout?: number;
46
+ version: number;
47
+ created_at: string;
48
+ }
49
+ export interface IPromoCodeAction {
50
+ id: string;
51
+ type: ECampaignActionType.PROMOCODE;
52
+ name: string;
53
+ description?: string;
54
+ order?: number;
55
+ version: number;
56
+ scheduled_at?: string;
57
+ created_at: string;
58
+ }
59
+ export interface IBonusAccrualAction {
60
+ id: string;
61
+ type: ECampaignActionType.BONUS_ACCRUAL;
62
+ name: string;
63
+ description: string;
64
+ order?: number;
65
+ version: number;
66
+ scheduled_at: string;
67
+ created_at: string;
68
+ config: {
69
+ multiplier: number;
70
+ max_bonus: number;
71
+ categories: string[];
72
+ };
73
+ }
@@ -0,0 +1,7 @@
1
+ import { ECohortType } from '../cohortsV2';
2
+ export interface ICampaignCohort {
3
+ id: string;
4
+ name: string;
5
+ cohort_type: ECohortType;
6
+ count_of_users: number;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface ICampaignLocation {
2
+ id: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,12 @@
1
+ export interface ICampaignRun {
2
+ id: string;
3
+ count_of_users_to_send: number;
4
+ os: string[];
5
+ cohort_id: string;
6
+ state: string;
7
+ success: number;
8
+ failed: number;
9
+ planned: number;
10
+ run_at: string;
11
+ created_at: string;
12
+ }
@@ -0,0 +1,41 @@
1
+ export interface ICampaignActionStats {
2
+ total_executed: number;
3
+ success_count: number;
4
+ failed_count: number;
5
+ metrics: Record<string, number>;
6
+ }
7
+ export interface ICampaignPromoCodeStats extends ICampaignActionStats {
8
+ metrics: {
9
+ promocodes_used: number;
10
+ conversion_rate: number;
11
+ total_discount_amount: number;
12
+ };
13
+ }
14
+ export interface ICampaignNotificationStats extends ICampaignActionStats {
15
+ metrics: {
16
+ delivered: number;
17
+ opened: number;
18
+ clicked: number;
19
+ open_rate: number;
20
+ click_rate: number;
21
+ };
22
+ }
23
+ export interface ICampaignDailyStats {
24
+ date: string;
25
+ users_reached: number;
26
+ actions_executed: number;
27
+ success_rate: number;
28
+ }
29
+ export interface ICampaignStatistics {
30
+ campaign_id: string;
31
+ total_runs: number;
32
+ total_users_reached: number;
33
+ success_rate: number;
34
+ actions_statistics: {
35
+ PROMOCODE?: ICampaignPromoCodeStats;
36
+ NOTIFICATION?: ICampaignNotificationStats;
37
+ [key: string]: ICampaignActionStats | undefined;
38
+ };
39
+ daily_statistics: ICampaignDailyStats[];
40
+ last_updated: string;
41
+ }
@@ -0,0 +1,24 @@
1
+ export interface IExecuteCampaignResult {
2
+ id: string;
3
+ total_targets: number;
4
+ success_count: number;
5
+ failed_count: number;
6
+ in_progress_count: number;
7
+ custom_metrics: {
8
+ promocodes_assigned?: number;
9
+ avg_processing_time_ms?: number;
10
+ total_notifications_sent?: number;
11
+ push_sent?: number;
12
+ email_sent?: number;
13
+ sms_sent?: number;
14
+ };
15
+ }
16
+ export interface ICampaignActionResult {
17
+ status: "COMPLETED" | "FAILED" | "IN_PROGRESS" | string;
18
+ started_at: string;
19
+ ended_at: string;
20
+ metrics: IExecuteCampaignResult;
21
+ }
22
+ export interface IExecuteCampaignResponse extends IExecuteCampaignResult {
23
+ action_result: ICampaignActionResult[];
24
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum EMediaType {
2
+ Image = "IMAGE",
3
+ Video = "VIDEO"
4
+ }
5
+ export interface INotificationMediaAsset {
6
+ id: string;
7
+ media_type: EMediaType;
8
+ purpose: string;
9
+ url: string;
10
+ }
@@ -0,0 +1,69 @@
1
+ import { IHTTPClientResponse } from '@roketus/web-toolkit';
2
+ import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
3
+ import { IListFiltersPayload, IPaginationData } from '../requestFilterInterfaces';
4
+ import { ICampaign } from './ICampaign';
5
+ import { TCampaignAction } from './ICampaignAction';
6
+ import { ICampaignCohort } from './ICampaignCohort';
7
+ import { ICampaignLocation } from './ICampaignLocation';
8
+ import { ICampaignRun } from './ICampaignRun';
9
+ import { ICreateCampaignPayload, IUpdateCampaignDatesPayload, IUpdateCampaignLocationsPayload, IUpdateCampaignPayload, IUpdateCampaignActionPayload, TCampaignActionPayload, IExecuteCampaignPayload } from './campaignPayloads';
10
+ import { ICampaignActionResult, IExecuteCampaignResponse } from './IExecuteCampaignResult';
11
+ import { ICampaignStatistics } from './ICampaignStatistics';
12
+ export declare type CampaignResponseDTO = I_JSON_API_Response_Many<ICampaign, ICampaignCohort | TCampaignAction | ICampaignRun | ICampaignLocation>;
13
+ export interface IListCampaignsResponse {
14
+ data: ICampaign[];
15
+ meta: IPaginationData;
16
+ }
17
+ export interface ICreateCampaign {
18
+ (payload: ICreateCampaignPayload): Promise<ICampaign>;
19
+ }
20
+ export interface IUpdateCampaign {
21
+ (id: string, payload: IUpdateCampaignPayload): Promise<ICampaign>;
22
+ }
23
+ export interface IUpdateCampaignDates {
24
+ (id: string, payload: IUpdateCampaignDatesPayload): Promise<ICampaign>;
25
+ }
26
+ export interface IUpdateCampaignLocations {
27
+ (id: string, payload: IUpdateCampaignLocationsPayload): Promise<ICampaign>;
28
+ }
29
+ export interface IGetCampaignById {
30
+ (id: string): Promise<ICampaign>;
31
+ }
32
+ export interface IListCampaigns {
33
+ (params: IListFiltersPayload): Promise<IListCampaignsResponse>;
34
+ }
35
+ export interface IDeleteCampaign {
36
+ (id: string): Promise<IHTTPClientResponse<void>>;
37
+ }
38
+ export interface IAddActionToCampaign {
39
+ (id: string, payload: TCampaignActionPayload): Promise<void>;
40
+ }
41
+ export interface IUpdateCampaignAction {
42
+ (id: string, actionId: string, payload: IUpdateCampaignActionPayload): Promise<void>;
43
+ }
44
+ export interface IDeleteActionFromCampaign {
45
+ (id: string, actionId: string): Promise<IHTTPClientResponse<void>>;
46
+ }
47
+ export interface IActivateCampaign {
48
+ (id: string): Promise<IHTTPClientResponse<void>>;
49
+ }
50
+ export interface IPauseCampaign {
51
+ (id: string): Promise<IHTTPClientResponse<void>>;
52
+ }
53
+ export interface IResumeCampaign {
54
+ (id: string): Promise<IHTTPClientResponse<void>>;
55
+ }
56
+ export interface ICompleteCampaign {
57
+ (id: string): Promise<IHTTPClientResponse<void>>;
58
+ }
59
+ export interface ICancelCampaign {
60
+ (id: string): Promise<IHTTPClientResponse<void>>;
61
+ }
62
+ export declare type IExecuteCampaignResponseDTO = I_JSON_API_Response_Many<IExecuteCampaignResponse, ICampaignActionResult>;
63
+ export interface IExecuteCampaign {
64
+ (id: string, payload: IExecuteCampaignPayload): Promise<IExecuteCampaignResponse>;
65
+ }
66
+ export declare type IGetCampaignStatisticsResponseDTO = I_JSON_API_Response_Many<ICampaignStatistics>;
67
+ export interface IGetCampaignStatistics {
68
+ (id: string): Promise<ICampaignStatistics>;
69
+ }
@@ -0,0 +1,35 @@
1
+ import { ENotificationChannel } from './ENotificationChannel';
2
+ import { ECampaignExecutionMode, ECampaignType } from './ICampaign';
3
+ import type { IBonusAccrualAction, INotificationAction, IPromoCodeAction } from './ICampaignAction';
4
+ export declare type IPromoCodeActionPayload = Omit<IPromoCodeAction, 'name' | 'version' | 'created_at'>;
5
+ export declare type INotificationActionPayload = Omit<INotificationAction, 'id' | 'version' | 'created_at'>;
6
+ export declare type IBonusAccrualActionPayload = Omit<IBonusAccrualAction, 'id' | 'version' | 'created_at'>;
7
+ export declare type TCampaignActionPayload = IPromoCodeActionPayload | INotificationActionPayload | IBonusAccrualActionPayload;
8
+ export interface ICreateCampaignPayload {
9
+ name: string;
10
+ description?: string;
11
+ campaign_type: ECampaignType;
12
+ execution_mode: ECampaignExecutionMode;
13
+ cohort_id: string;
14
+ actions: TCampaignActionPayload[];
15
+ locations?: string[];
16
+ start_date: string;
17
+ end_date: string;
18
+ metadata?: {
19
+ department: string;
20
+ budget: number;
21
+ [key: string]: unknown;
22
+ };
23
+ }
24
+ export interface IUpdateCampaignPayload extends Pick<ICreateCampaignPayload, 'name' | 'description' | 'metadata'> {
25
+ }
26
+ export interface IUpdateCampaignDatesPayload extends Pick<ICreateCampaignPayload, 'start_date' | 'end_date'> {
27
+ }
28
+ export interface IUpdateCampaignLocationsPayload extends Pick<ICreateCampaignPayload, 'locations'> {
29
+ }
30
+ export interface IUpdateCampaignActionPayload extends Omit<TCampaignActionPayload, 'type'> {
31
+ }
32
+ export interface IExecuteCampaignPayload {
33
+ execution_mode?: string;
34
+ notification_channels: ENotificationChannel[];
35
+ }
@@ -0,0 +1,10 @@
1
+ export { ICampaign as ICampaignV2, ECampaignType, ECampaignExecutionMode, ECampaignStatus } from './ICampaign';
2
+ export * from './ICampaignAction';
3
+ export { ICampaignCohort as ICampaignCohortV2 } from './ICampaignCohort';
4
+ export * from './ICampaignLocation';
5
+ export { ICampaignRun as ICampaignRunV2 } from './ICampaignRun';
6
+ export * from './ENotificationChannel';
7
+ export { ICreateCampaignPayload as ICreateCampaignPayloadV2, IUpdateCampaignPayload, IUpdateCampaignDatesPayload, IUpdateCampaignLocationsPayload, TCampaignActionPayload, IUpdateCampaignActionPayload, IBonusAccrualActionPayload, INotificationActionPayload, IPromoCodeActionPayload, IExecuteCampaignPayload, } from './campaignPayloads';
8
+ export * from './ICampaignStatistics';
9
+ export * from './IExecuteCampaignResult';
10
+ export * from './INotificationMedia';
@@ -0,0 +1,2 @@
1
+ export * from './ICard';
2
+ export * from './cardManagementInterfaces';
@@ -28,9 +28,9 @@ export declare enum ECohortAction {
28
28
  }
29
29
  export declare enum ECohortConditionsType {
30
30
  LESS = "LESS",
31
- MORE = "GREATER",
32
- LESS_OR_EQUAL = "LESS_EQUAL",
33
- MORE_OR_EQUAL = "GREATER_EQUAL",
31
+ GREATER = "GREATER",
32
+ LESS_EQUAL = "LESS_EQUAL",
33
+ GREATER_EQUAL = "GREATER_EQUAL",
34
34
  EQUAL = "EQUAL",
35
35
  NOT_EQUAL = "NOT_EQUAL"
36
36
  }
@@ -39,21 +39,32 @@ export declare enum ECohortTimePeriod {
39
39
  LAST_WEEK = "LAST_WEEK",
40
40
  MONTH = "MONTH",
41
41
  QUARTER = "QUARTER",
42
- IN_EACH = "IN_EACH",
43
- DURING = "DURING",
44
42
  SINCE = "SINCE",
43
+ CUSTOM = "CUSTOM",
45
44
  WITHIN = "WITHIN",
46
- CUSTOM = "CUSTOM"
45
+ IN_EACH = "IN_EACH",
46
+ DURING = "DURING"
47
+ }
48
+ export declare enum ECohortDuration {
49
+ DAYS = "DAYS",
50
+ WEEKS = "WEEKS",
51
+ MONTHS = "MONTHS"
52
+ }
53
+ export declare enum ECohortDurationPeriodicity {
54
+ DAILY = "DAILY",
55
+ WEEKLY = "WEEKLY",
56
+ MONTHLY = "MONTHLY"
47
57
  }
48
58
  export declare type CohortCondition = {
49
59
  action: ECohortAction;
50
60
  is_positive: boolean;
51
61
  time_range: {
52
- period: string;
62
+ period: ECohortTimePeriod;
63
+ since_date?: string;
53
64
  custom: {
54
65
  start_date: string;
55
66
  end_date: string;
56
- };
67
+ } | null;
57
68
  };
58
69
  frequency?: {
59
70
  operator: ECohortConditionsType;
@@ -69,10 +80,11 @@ export interface ICohort {
69
80
  criteria: {
70
81
  new_user_time_range: {
71
82
  period: string;
83
+ since_date?: string;
72
84
  custom: {
73
85
  start_date: string;
74
86
  end_date: string;
75
- };
87
+ } | null;
76
88
  } | null;
77
89
  conditions: CohortCondition[];
78
90
  };
@@ -7,10 +7,11 @@ export interface ICreateCohortPayload {
7
7
  criteria: {
8
8
  new_user_time_range: {
9
9
  period: string;
10
+ since_date?: string;
10
11
  custom: {
11
12
  start_date: string;
12
13
  end_date: string;
13
- };
14
+ } | null;
14
15
  } | null;
15
16
  conditions: CohortCondition[];
16
17
  };
@@ -7,10 +7,11 @@ export interface IUpdateCohortPayload {
7
7
  criteria: {
8
8
  new_user_time_range: {
9
9
  period: string;
10
+ since_date?: string;
10
11
  custom: {
11
12
  start_date: string;
12
13
  end_date: string;
13
- };
14
+ } | null;
14
15
  } | null;
15
16
  conditions: CohortCondition[];
16
17
  };
@@ -0,0 +1,4 @@
1
+ export * from './ICohort';
2
+ export * from './ICreateCohortPayload';
3
+ export * from './IUpdateCohortPayload';
4
+ export * from './cohortsInterfaces';
@@ -0,0 +1,2 @@
1
+ export * from './excludeInterfaces';
2
+ export * from './listExcludesInterfaces';
@@ -0,0 +1,5 @@
1
+ export * from './productInterfaces';
2
+ export * from './listProductsInterfaces';
3
+ export * from './categoryInterfaces';
4
+ export * from './listCategoriesInterfaces';
5
+ export * from './productSearchInterfaces';
@@ -1,7 +1,8 @@
1
- import { EPromocodeDiscountType } from './IPromocode';
1
+ import { EPromocodeDiscountType, EPromocodeType } from './IPromocode';
2
2
  export interface ICreatePromocodePayload {
3
3
  name: string;
4
4
  description: string;
5
+ promocodeType: EPromocodeType;
5
6
  startAt: string;
6
7
  stopAt: string;
7
8
  activationLimit: number;
@@ -8,11 +8,17 @@ export declare enum EPromocodeStatus {
8
8
  export declare enum EPromocodeDiscountType {
9
9
  PERCENT = "percent",
10
10
  PRODUCT_PRICE = "product_price",
11
- N_PLUS_1 = "buy_n_get_one_free"
11
+ N_PLUS_1 = "buy_n_get_one_free",
12
+ BONUS = "bonus"
13
+ }
14
+ export declare enum EPromocodeType {
15
+ GENERAL = "general",
16
+ PERSONAL = "personal"
12
17
  }
13
18
  export interface IPromocode {
14
19
  id: string;
15
20
  name: string;
21
+ promocodeType: EPromocodeType;
16
22
  description: string;
17
23
  discountType: EPromocodeDiscountType;
18
24
  discountValue: number;
@@ -0,0 +1,4 @@
1
+ export * from './IPromocode';
2
+ export * from './ICreatePromocodePayload';
3
+ export * from './IUpdatePromocodePayload';
4
+ export * from './promocodeInterfaces';
@@ -0,0 +1,6 @@
1
+ export * from './IReferralProgram';
2
+ export * from './IRefProgramInfluencer';
3
+ export * from './IRefProgramStats';
4
+ export * from './ICreateRefProgramPayload';
5
+ export * from './IUpdateRefProgramPayload';
6
+ export * from './IInfluencerPayload';
@@ -0,0 +1,3 @@
1
+ export * from './IGetAllTiers';
2
+ export * from './ISetTierByCard';
3
+ export * from './IGetTiersByCard';
@@ -0,0 +1,5 @@
1
+ export * from './IUser';
2
+ export * from './IUserCreate';
3
+ export * from './IUserUpdate';
4
+ export * from './userInterfaces';
5
+ export * from './userNotificationsInterfaces';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roketus/loyalty-js-sdk",
3
- "version": "4.40.2",
3
+ "version": "5.0.0",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm5/index.js",
6
6
  "author": "Skoch <st.ixidor@gmail.com>",
@@ -56,5 +56,9 @@
56
56
  "ts-jest": "^27.1.4"
57
57
  },
58
58
  "description": "",
59
- "types": "./dist/cjs/index.d.ts"
59
+ "types": "./dist/cjs/index.d.ts",
60
+ "publishConfig": {
61
+ "access": "public",
62
+ "registry": "https://registry.npmjs.org"
63
+ }
60
64
  }