@roketus/loyalty-js-sdk 5.2.2 → 5.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.
Files changed (47) hide show
  1. package/dist/cjs/api/issuer/authByPassToken.d.ts +1 -1
  2. package/dist/cjs/api/issuer/authByToken.d.ts +1 -1
  3. package/dist/cjs/api/issuer/createIssuer.d.ts +1 -1
  4. package/dist/cjs/api/issuer/dispatchCustomEvent.d.ts +1 -1
  5. package/dist/cjs/api/issuer/getCardById.d.ts +1 -1
  6. package/dist/cjs/api/issuer/getCardByPhone.d.ts +1 -1
  7. package/dist/cjs/api/issuer/getIssuer.d.ts +1 -1
  8. package/dist/cjs/api/issuer/getSettings.d.ts +2 -0
  9. package/dist/cjs/api/issuer/refreshApiKey.d.ts +1 -1
  10. package/dist/cjs/api/issuer/resultSerializer.d.ts +1 -0
  11. package/dist/cjs/api/issuer/sendNotificationToCards.d.ts +1 -1
  12. package/dist/cjs/api/issuer/sendPushNotification.d.ts +1 -1
  13. package/dist/cjs/api/issuer/sendToAllIssuerCards.d.ts +1 -1
  14. package/dist/cjs/api/issuer/setCardName.d.ts +1 -1
  15. package/dist/cjs/api/issuer/setSettings.d.ts +1 -1
  16. package/dist/cjs/clients/setIssuerToken.d.ts +1 -1
  17. package/dist/cjs/index.d.ts +1 -3
  18. package/dist/cjs/index.js +1 -1
  19. package/dist/cjs/interfaces/ISDK.d.ts +2 -2
  20. package/dist/cjs/interfaces/issuer/IIssuerSettings.d.ts +45 -0
  21. package/dist/cjs/interfaces/issuer/ISetIssuerSettingsPayload.d.ts +23 -0
  22. package/dist/cjs/interfaces/issuer/index.d.ts +5 -0
  23. package/dist/cjs/interfaces/{issuerInterface.d.ts → issuer/issuerInterface.d.ts} +9 -16
  24. package/dist/esm5/api/issuer/authByPassToken.d.ts +1 -1
  25. package/dist/esm5/api/issuer/authByToken.d.ts +1 -1
  26. package/dist/esm5/api/issuer/createIssuer.d.ts +1 -1
  27. package/dist/esm5/api/issuer/dispatchCustomEvent.d.ts +1 -1
  28. package/dist/esm5/api/issuer/getCardById.d.ts +1 -1
  29. package/dist/esm5/api/issuer/getCardByPhone.d.ts +1 -1
  30. package/dist/esm5/api/issuer/getIssuer.d.ts +1 -1
  31. package/dist/esm5/api/issuer/getSettings.d.ts +2 -0
  32. package/dist/esm5/api/issuer/refreshApiKey.d.ts +1 -1
  33. package/dist/esm5/api/issuer/resultSerializer.d.ts +1 -0
  34. package/dist/esm5/api/issuer/sendNotificationToCards.d.ts +1 -1
  35. package/dist/esm5/api/issuer/sendPushNotification.d.ts +1 -1
  36. package/dist/esm5/api/issuer/sendToAllIssuerCards.d.ts +1 -1
  37. package/dist/esm5/api/issuer/setCardName.d.ts +1 -1
  38. package/dist/esm5/api/issuer/setSettings.d.ts +1 -1
  39. package/dist/esm5/clients/setIssuerToken.d.ts +1 -1
  40. package/dist/esm5/index.d.ts +1 -3
  41. package/dist/esm5/index.js +1 -1
  42. package/dist/esm5/interfaces/ISDK.d.ts +2 -2
  43. package/dist/esm5/interfaces/issuer/IIssuerSettings.d.ts +45 -0
  44. package/dist/esm5/interfaces/issuer/ISetIssuerSettingsPayload.d.ts +23 -0
  45. package/dist/esm5/interfaces/issuer/index.d.ts +5 -0
  46. package/dist/esm5/interfaces/{issuerInterface.d.ts → issuer/issuerInterface.d.ts} +9 -16
  47. package/package.json +1 -1
@@ -2,7 +2,7 @@ import type { ICreateEvent, IGetActiveUsersData, IGetCardConversionStats, IGetGe
2
2
  import type { IGetMyNotificationStats } from './notifications/IGetMyNotificationStats';
3
3
  import type { IGetUserTokenByIssuerAPIKey, IGetUserData, ISignInByPhone, IValidatePhoneOtp } from './authInterfaces';
4
4
  import type { IAddPoints, IAddReserve, ICreateAnonymousUserCard, IGetAndroidCardDownloadLink, IDownloadIOSCard, IGetBalanceHistory, IGetCardBalanceHistory, IGetReferral, IGetUserCard, IRestoreCard, ISetTypeCard, ISpendPoints, IUpdateCard, IUpdateDiscountPercent } from './cardInterfaces';
5
- import type { IAuthByPassToken, IAuthByToken, ICreateIssuer, IGetIssuer, IRefreshApiKey, ISendNotificationToCards, ISendPushNotification, ISendToAllIssuerCards, ISetSettings, ISetIssuerToken, IGetCardById } from './issuerInterface';
5
+ import type { IAuthByPassToken, IAuthByToken, ICreateIssuer, IGetIssuer, IRefreshApiKey, ISendNotificationToCards, ISendPushNotification, ISendToAllIssuerCards, ISetSettings, ISetIssuerToken, IGetCardById, IDispatchCustomEvent, IGetCardByPhone, ISetCardName, IGetSettings } from './issuer/issuerInterface';
6
6
  import type { ILogFn } from './loggerInterface';
7
7
  import type { ICreateLink, IDeleteLink, IEditLink, IListLinks, IViewLink } from './shortLinkInterface';
8
8
  import type { IAcceptTerms, IActivateEmail, IActivatePhone, IResendActivationCode, ISetEmail, ISetPhone, ISetProfile, ISkipEmail, ISkipEmailActivation, ISkipProfile } from './signupInterface';
@@ -14,7 +14,6 @@ import { IDownloadAnonymousCard } from './cardInterfaces';
14
14
  import { ISendTelemetry } from './telemetryInterfaces';
15
15
  import { ICreateCampaign, IGetCampaignById, IListCampaigns, IDeleteCampaign, IUpdateCampaign, IUpdateCampaignDates, IUpdateCampaignLocations, IAddActionToCampaign, IUpdateCampaignAction, IDeleteActionFromCampaign, IExecuteCampaign, IActivateCampaign, IPauseCampaign, IResumeCampaign, ICancelCampaign, ICompleteCampaign, IGetCampaignStatistics } from './campaigns/campaignInterfaces';
16
16
  import { TCreateCohort, TGetCohortById, TListCohorts, TUpdateCohort, TDeleteCohort } from './cohorts/cohortsInterfaces';
17
- import { IDispatchCustomEvent, IGetCardByPhone, ISetCardName } from './issuerInterface';
18
17
  import { ISetBirthdate } from './signupInterface';
19
18
  import { IGetTransactionsByCard } from './transactions/IGetTransactionsByCard';
20
19
  import { IGetCardBonuses } from './issuer/IGetCardBonuses';
@@ -97,6 +96,7 @@ export interface ISDK {
97
96
  createIssuer: ICreateIssuer;
98
97
  getIssuer: IGetIssuer;
99
98
  refreshApiKey: IRefreshApiKey;
99
+ getSettings: IGetSettings;
100
100
  setSettings: ISetSettings;
101
101
  sendNotificationToCards: ISendNotificationToCards;
102
102
  sendToAllIssuerCards: ISendToAllIssuerCards;
@@ -0,0 +1,45 @@
1
+ export interface IIssuerSettings {
2
+ name: string;
3
+ systemName: string;
4
+ passKey: string;
5
+ settings: {
6
+ language: string;
7
+ currency: string;
8
+ templateID: number;
9
+ autoApplyPromo: boolean;
10
+ autoApplyUserPromo: boolean;
11
+ bonusRedemptionCriteria: any[];
12
+ bonusViewMultiplication: number;
13
+ cardNumberParams: {
14
+ [key: string]: {
15
+ format_pattern: string;
16
+ length: number;
17
+ number_type: string;
18
+ postfix: string;
19
+ prefix: string;
20
+ version: number;
21
+ };
22
+ };
23
+ cardTypes: {
24
+ bronze: {
25
+ level: string;
26
+ };
27
+ gold: {
28
+ level: string;
29
+ };
30
+ silver: {
31
+ level: string;
32
+ };
33
+ [key: string]: {
34
+ level: string;
35
+ };
36
+ };
37
+ emailTriggersConfig: {
38
+ Triggers: any[];
39
+ };
40
+ registrationFlow: {
41
+ Steps: any[];
42
+ };
43
+ };
44
+ createdAt: number;
45
+ }
@@ -0,0 +1,23 @@
1
+ export interface ISetIssuerSettingsPayload {
2
+ template_id?: number;
3
+ currency_code?: string;
4
+ language?: string;
5
+ email_triggers?: {
6
+ name: string;
7
+ event: string;
8
+ }[];
9
+ bonus_view_multiplication?: number;
10
+ redemption_criterion?: {
11
+ condition_name: string;
12
+ is_mandatory: boolean;
13
+ params?: Record<string, string>;
14
+ }[];
15
+ auto_apply_user_promo?: boolean;
16
+ auto_apply_promo?: boolean;
17
+ card_number_params?: any;
18
+ }
19
+ export interface ISetSettingsRequestDTO {
20
+ data: {
21
+ attributes: ISetIssuerSettingsPayload;
22
+ };
23
+ }
@@ -0,0 +1,5 @@
1
+ export * from './IIssuerSettings';
2
+ export * from './ISetIssuerSettingsPayload';
3
+ export { IDispatchCustomEvent, IGetCardByPhone, ISetCardName, ECardType, ICardPromocode, IGetCardByIdResponseDTO } from './issuerInterface';
4
+ export { IGetCardBonus } from './IGetCardBonuses';
5
+ export { IGetCardSpendsResponseDTO } from './IGetCardSpends';
@@ -1,6 +1,8 @@
1
1
  import { IHTTPClientResponse } from '@roketus/web-toolkit';
2
- import { IRequestWithCancelAndData } from './IRequestWithCancelAndData';
3
- import { I_JSON_API_Response_Many } from './I_JSON_API_ResponseDTO';
2
+ import { IRequestWithCancelAndData } from '../IRequestWithCancelAndData';
3
+ import { I_JSON_API_Response_Many } from '../I_JSON_API_ResponseDTO';
4
+ import { ISetIssuerSettingsPayload } from './ISetIssuerSettingsPayload';
5
+ import { IIssuerSettings } from './IIssuerSettings';
4
6
  export interface IAuthByPassTokenResponseDTO {
5
7
  data: {
6
8
  attributes: {
@@ -48,10 +50,12 @@ export interface ISetCardName {
48
50
  };
49
51
  }): Promise<IHTTPClientResponse<void>>;
50
52
  }
53
+ export interface IGetSettings {
54
+ (): Promise<IIssuerSettings>;
55
+ }
56
+ export declare type TSettingsResponseDTO = I_JSON_API_Response_Many<IIssuerSettings>;
51
57
  export interface ISetSettings {
52
- ({ templateId }: {
53
- templateId: number;
54
- }): Promise<IHTTPClientResponse<SetSettingsResponseDTO>>;
58
+ (payload: ISetIssuerSettingsPayload): Promise<IIssuerSettings>;
55
59
  }
56
60
  export interface ISetIssuerToken {
57
61
  (token: string): void;
@@ -131,17 +135,6 @@ interface ISendToAllIssuerCardsParams {
131
135
  message: string;
132
136
  channels?: GatewayType[];
133
137
  }
134
- interface SetSettingsResponseDTO {
135
- data: [
136
- {
137
- id: string;
138
- attributes: {
139
- template_id: number;
140
- };
141
- }
142
- ];
143
- included: [];
144
- }
145
138
  export interface ICustomEventAction {
146
139
  action_type: string;
147
140
  payload: Record<string, string | number | Record<string, string | number>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roketus/loyalty-js-sdk",
3
- "version": "5.2.2",
3
+ "version": "5.3.0",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm5/index.js",
6
6
  "author": "Skoch <st.ixidor@gmail.com>",