@suprsend/web-sdk 4.3.0 → 4.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.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.js +368 -232
- package/dist/es/index.js.map +1 -1
- package/dist/types/interface.d.ts +93 -0
- package/dist/types/preferences.d.ts +9 -1
- package/package.json +1 -1
|
@@ -65,6 +65,99 @@ export interface Category {
|
|
|
65
65
|
preference: PreferenceOptions;
|
|
66
66
|
is_editable: boolean;
|
|
67
67
|
channels?: CategoryChannel[] | null;
|
|
68
|
+
digest_schedule?: CategoryDigestSchedule | null;
|
|
69
|
+
properties?: CategoryProperties | null;
|
|
70
|
+
}
|
|
71
|
+
export interface CategoryDigestSchedule {
|
|
72
|
+
id: string;
|
|
73
|
+
label: string;
|
|
74
|
+
frequency: FrequencyEnum;
|
|
75
|
+
interval: number;
|
|
76
|
+
weekdays?: IWeekDays;
|
|
77
|
+
monthdays?: IMonthDays;
|
|
78
|
+
time?: ITime;
|
|
79
|
+
dtstart?: IDateStart;
|
|
80
|
+
is_default: boolean;
|
|
81
|
+
is_user_selected: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface IDateStart {
|
|
84
|
+
edit_policy?: EditPolicy;
|
|
85
|
+
default_value: string;
|
|
86
|
+
value?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface ITime {
|
|
89
|
+
edit_policy?: EditPolicy;
|
|
90
|
+
default_value: string;
|
|
91
|
+
value?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface IMonthDays {
|
|
94
|
+
edit_policy?: EditPolicy;
|
|
95
|
+
default_value: MonthDays[];
|
|
96
|
+
value?: MonthDays[];
|
|
97
|
+
}
|
|
98
|
+
export interface IWeekDays {
|
|
99
|
+
edit_policy?: EditPolicy;
|
|
100
|
+
default_value: WeekDaysEnum[];
|
|
101
|
+
value?: WeekDaysEnum[];
|
|
102
|
+
}
|
|
103
|
+
export declare enum FrequencyEnum {
|
|
104
|
+
INSTANTLY = "instantly",
|
|
105
|
+
MINUTELY = "minutely",
|
|
106
|
+
HOURLY = "hourly",
|
|
107
|
+
DAILY = "daily",
|
|
108
|
+
WEEKLY = "weekly",
|
|
109
|
+
WEEKLY_MO2FR = "weekly_mo2fr",
|
|
110
|
+
MONTHLY = "monthly"
|
|
111
|
+
}
|
|
112
|
+
export interface CategoryProperties extends UpdateCategoryPropertyPayload {
|
|
113
|
+
label: string;
|
|
114
|
+
edit_policy: EditPolicy;
|
|
115
|
+
is_optional: boolean;
|
|
116
|
+
is_overridden: boolean;
|
|
117
|
+
value_type: PropertyValueTypeEnum;
|
|
118
|
+
dynamic_choices_key?: string;
|
|
119
|
+
default_value: string | number | string[];
|
|
120
|
+
choices?: ChoiceItem[];
|
|
121
|
+
}
|
|
122
|
+
export declare enum PropertyValueTypeEnum {
|
|
123
|
+
INTEGER = "integer",
|
|
124
|
+
STRING = "string",
|
|
125
|
+
STRING_CHOICE = "string_choice",
|
|
126
|
+
LIST_CHOICE = "list_choice",
|
|
127
|
+
STRING_DYNAMIC = "string_dynamic",
|
|
128
|
+
LIST_DYNAMIC = "list_dynamic"
|
|
129
|
+
}
|
|
130
|
+
export declare enum EditPolicy {
|
|
131
|
+
LOCKED = "locked",
|
|
132
|
+
EDITABLE = "editable"
|
|
133
|
+
}
|
|
134
|
+
export interface ChoiceItem {
|
|
135
|
+
label: string;
|
|
136
|
+
value: any;
|
|
137
|
+
}
|
|
138
|
+
export interface UpdateCategoryDigestSchedulePayload {
|
|
139
|
+
id: string;
|
|
140
|
+
time?: string;
|
|
141
|
+
dtstart?: string;
|
|
142
|
+
weekdays?: WeekDaysEnum[];
|
|
143
|
+
monthdays?: MonthDays[];
|
|
144
|
+
}
|
|
145
|
+
export interface UpdateCategoryPropertyPayload {
|
|
146
|
+
key: string;
|
|
147
|
+
value: string | number | string[];
|
|
148
|
+
}
|
|
149
|
+
export interface MonthDays {
|
|
150
|
+
pos: number;
|
|
151
|
+
day?: WeekDaysEnum[];
|
|
152
|
+
}
|
|
153
|
+
export declare enum WeekDaysEnum {
|
|
154
|
+
SUNDAY = "su",
|
|
155
|
+
MONDAY = "mo",
|
|
156
|
+
TUESDAY = "tu",
|
|
157
|
+
WEDNESDAY = "we",
|
|
158
|
+
THURSDAY = "th",
|
|
159
|
+
FRIDAY = "fr",
|
|
160
|
+
SATURDAY = "sa"
|
|
68
161
|
}
|
|
69
162
|
export interface Section {
|
|
70
163
|
name?: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as SuprSend } from './main';
|
|
2
|
-
import { Dictionary, PreferenceData, PreferenceOptions, ChannelLevelPreferenceOptions, IPreferenceConfig } from './interface';
|
|
2
|
+
import { Dictionary, PreferenceData, PreferenceOptions, ChannelLevelPreferenceOptions, IPreferenceConfig, UpdateCategoryDigestSchedulePayload, UpdateCategoryPropertyPayload } from './interface';
|
|
3
3
|
export default class Preferences {
|
|
4
4
|
private config;
|
|
5
5
|
private preferenceData;
|
|
@@ -51,6 +51,14 @@ export default class Preferences {
|
|
|
51
51
|
* Used to update user's category level channel preference.
|
|
52
52
|
*/
|
|
53
53
|
updateChannelPreferenceInCategory(channel: string, preference: PreferenceOptions, category: string, args?: IPreferenceConfig): Promise<import('./interface').ApiResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Used to update user's category level digest configuration.
|
|
56
|
+
*/
|
|
57
|
+
updateDigestScheduleInCategory(category: string, digestSchedule: UpdateCategoryDigestSchedulePayload, args?: IPreferenceConfig): Promise<import('./interface').ApiResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* Used to update user's category level condition configuration.
|
|
60
|
+
*/
|
|
61
|
+
updatePropertiesInCategory(category: string, properties: UpdateCategoryPropertyPayload[], args?: IPreferenceConfig): Promise<import('./interface').ApiResponse>;
|
|
54
62
|
/**
|
|
55
63
|
* Used to update user's channel level preference.
|
|
56
64
|
*/
|