@blazeo.com/calendar-client 1.0.22 → 1.0.24
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/README.md +45 -0
- package/dist/index.d.ts +353 -258
- package/dist/index.js +305 -144
- package/dist/index.mjs +301 -144
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,258 +1,353 @@
|
|
|
1
|
-
/** @blazeo.com/calendar-client - type declarations */
|
|
2
|
-
|
|
3
|
-
export function configure(env: { baseUrl?: string; consumer?: string; fetch?: typeof fetch; getDefaultOffset?: () => number }): void;
|
|
4
|
-
export function getConfig(): { baseUrl?: string; consumer?: string; fetch?: typeof fetch; getDefaultOffset?: () => number } | null;
|
|
5
|
-
export function setBaseUrl(baseUrl: string): void;
|
|
6
|
-
export function setConsumer(consumer: string): void;
|
|
7
|
-
export function getConfigStore(): unknown;
|
|
8
|
-
|
|
9
|
-
export const ConfigModel: unknown;
|
|
10
|
-
|
|
11
|
-
export const CalendarModel: {
|
|
12
|
-
get(calendarId: string): Promise<unknown>;
|
|
13
|
-
getRaw(calendarId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
14
|
-
getByCompany(
|
|
15
|
-
companyKey: string,
|
|
16
|
-
opts?: {
|
|
17
|
-
skip?: number;
|
|
18
|
-
take?: number;
|
|
19
|
-
/** Maps to API query `sort`. */
|
|
20
|
-
sortBy?: string;
|
|
21
|
-
/** Maps to API query `sort_dir` (`asc` / `desc`). */
|
|
22
|
-
sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
23
|
-
/** Same as `sortBy` (sent as `sort` on the wire). */
|
|
24
|
-
sort?: string;
|
|
25
|
-
sort_column?: string;
|
|
26
|
-
/** Same as `sortOrder` (sent as `sort_dir` on the wire). */
|
|
27
|
-
sort_dir?: 'asc' | 'desc' | string;
|
|
28
|
-
page?: number;
|
|
29
|
-
page_size?: number;
|
|
30
|
-
}
|
|
31
|
-
): Promise<{ calendars: unknown[]; totalCount: number } | null>;
|
|
32
|
-
getTimeZones(): Promise<unknown>;
|
|
33
|
-
getTimeZone(timezoneId: string): Promise<unknown>;
|
|
34
|
-
getParticipants(calendarId: string): Promise<unknown>;
|
|
35
|
-
getAllParticipantOpeningHours(calendarId: string): Promise<unknown[] | null>;
|
|
36
|
-
getCalendarParticipant(calendarId: string): Promise<unknown>;
|
|
37
|
-
getParticipantsInfo(calendarId: string): Promise<unknown>;
|
|
38
|
-
getMonth(calendarId: string, year: number, month: number): Promise<unknown>;
|
|
39
|
-
getEvents(calendarId: string): Promise<unknown>;
|
|
40
|
-
createWithParticipants(name: string, companyKey: string, participantIds: string[], description: string, calendarId?: string): Promise<unknown>;
|
|
41
|
-
editWithParticipants(calendarId: string, name: string, participantIds: string[], description: string): Promise<unknown>;
|
|
42
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const EventModel: {
|
|
46
|
-
get(eventId: string): Promise<unknown>;
|
|
47
|
-
getByExternalId(externalEventId: string): Promise<unknown>;
|
|
48
|
-
getRoundRobinParticipant(calendarId: string): Promise<unknown>;
|
|
49
|
-
getEarliestAvailableDays(calendarId: string, count: number, opts?: { year?: number; month?: number; day?: number; offset?: number }): Promise<string[] | null>;
|
|
50
|
-
getDaySelectable(calendarId: string, year: number, month: number, day: number, opts?: { participantId?: string; offset?: number }): Promise<boolean>;
|
|
51
|
-
getByVisitorEmail(email: string, opts: { companyKey?: string; calendarId?: string; offset?: number }): Promise<unknown[] | null>;
|
|
52
|
-
getByVisitorPhone(phone: string, opts: { companyKey?: string; calendarId?: string; offset?: number }): Promise<unknown[] | null>;
|
|
53
|
-
getAvailability(calendarId: string, year: number, month: number, day: number, opts?: { participantId?: string; offset?: number }): Promise<unknown[]>;
|
|
54
|
-
getExternalUnavailability(
|
|
55
|
-
participantId: string,
|
|
56
|
-
opts?:
|
|
57
|
-
| { startUtc: string; endUtc: string; offset?: number }
|
|
58
|
-
| { year: number; month: number; day: number; days?: number; offset?: number }
|
|
59
|
-
): Promise<unknown[]>;
|
|
60
|
-
cancel(eventId: string): Promise<unknown>;
|
|
61
|
-
getCancellable(eventId: string): Promise<boolean>;
|
|
62
|
-
createEvent(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
63
|
-
reschedule(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
64
|
-
updateEvent(payload: object): Promise<unknown>;
|
|
65
|
-
createTest(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
66
|
-
getCustomData(calendarId: string, eventId?: string): Promise<unknown>;
|
|
67
|
-
setReminder(eventId: string): Promise<unknown>;
|
|
68
|
-
setAttendeeStatus(eventId: string, attendeeStatus: number | string): Promise<unknown>;
|
|
69
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const AvailabilityModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
73
|
-
export const AvailabilityDetailModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
74
|
-
export const CalendarParticipantModel: {
|
|
75
|
-
getByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
76
|
-
getInfoByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
77
|
-
getByParticipant(participantId: string): Promise<unknown[] | null>;
|
|
78
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
79
|
-
};
|
|
80
|
-
export const ParticipantModel: {
|
|
81
|
-
get(participantId: string): Promise<unknown>;
|
|
82
|
-
getByIds(participantIds: string[] | string): Promise<unknown[] | null>;
|
|
83
|
-
getAll(companyKey: string): Promise<unknown[] | null>;
|
|
84
|
-
add(payload: object, calendarId?: string): Promise<unknown>;
|
|
85
|
-
remove(participantId: string): Promise<unknown>;
|
|
86
|
-
update(payload: object): Promise<unknown>;
|
|
87
|
-
save(payload: object): Promise<unknown>;
|
|
88
|
-
sendEmail(participantId: string): Promise<unknown>;
|
|
89
|
-
migrate(participantId: string, userId: string): Promise<unknown>;
|
|
90
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
91
|
-
};
|
|
92
|
-
export const OpeningHourModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
93
|
-
export const TimeSlotModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
94
|
-
export const TimeFrameModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
95
|
-
export const SettingModel: {
|
|
96
|
-
get(calendarId: string): Promise<unknown>;
|
|
97
|
-
save(payload: object): Promise<unknown>;
|
|
98
|
-
uploadLogo(calendarId: string, file: File | Blob): Promise<unknown>;
|
|
99
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
100
|
-
};
|
|
101
|
-
export const CompanyModel: {
|
|
102
|
-
get(companyKey: string): Promise<unknown>;
|
|
103
|
-
getAll(): Promise<unknown[] | null>;
|
|
104
|
-
save(payload: object): Promise<unknown>;
|
|
105
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
106
|
-
};
|
|
107
|
-
export const AssetModel: {
|
|
108
|
-
upload(
|
|
109
|
-
file: File | Blob,
|
|
110
|
-
opts: {
|
|
111
|
-
category: string;
|
|
112
|
-
companyKey?: string;
|
|
113
|
-
calendarId?: string;
|
|
114
|
-
consumer?: string;
|
|
115
|
-
}
|
|
116
|
-
): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
117
|
-
create(
|
|
118
|
-
snapshot?: {
|
|
119
|
-
url?: string | null;
|
|
120
|
-
blobPath?: string | null;
|
|
121
|
-
category?: string | null;
|
|
122
|
-
contentType?: string | null;
|
|
123
|
-
size?: number | null;
|
|
124
|
-
},
|
|
125
|
-
options?: { env?: object }
|
|
126
|
-
): unknown;
|
|
127
|
-
};
|
|
128
|
-
export const CalendarDayModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
129
|
-
export const ParticipantInfoModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
130
|
-
export const CalendarLocationModel: {
|
|
131
|
-
getByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
132
|
-
save(payload: object): Promise<unknown>;
|
|
133
|
-
remove(calendarLocationId: string): Promise<unknown>;
|
|
134
|
-
setDefault(calendarId: string, calendarLocationId: string): Promise<unknown>;
|
|
135
|
-
create(
|
|
136
|
-
snapshot?: {
|
|
137
|
-
id?: number | null;
|
|
138
|
-
calendarLocationId?: string | null;
|
|
139
|
-
calendarId?: string | null;
|
|
140
|
-
locationType?: number;
|
|
141
|
-
name?: string;
|
|
142
|
-
value?: string;
|
|
143
|
-
isDefault?: boolean;
|
|
144
|
-
sortOrder?: number;
|
|
145
|
-
createdOn?: string | null;
|
|
146
|
-
modifiedOn?: string | null;
|
|
147
|
-
},
|
|
148
|
-
options?: { env?: object }
|
|
149
|
-
): unknown;
|
|
150
|
-
};
|
|
151
|
-
export const PreferenceModel: {
|
|
152
|
-
getScopes(): Promise<string[] | null>;
|
|
153
|
-
getOptions(): Promise<string[] | null>;
|
|
154
|
-
getOptionTemplate(option: string): Promise<unknown>;
|
|
155
|
-
get(option: string, keys: string | string[]): Promise<unknown>;
|
|
156
|
-
set(scope: string, key: string, option: string, body: string | object): Promise<unknown>;
|
|
157
|
-
delete(preferenceId: string): Promise<unknown>;
|
|
158
|
-
create(snapshot: object, options?: { env?: object }): unknown;
|
|
159
|
-
};
|
|
160
|
-
export const PreferenceScope: Record<string, number>;
|
|
161
|
-
|
|
162
|
-
export
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
1
|
+
/** @blazeo.com/calendar-client - type declarations */
|
|
2
|
+
|
|
3
|
+
export function configure(env: { baseUrl?: string; consumer?: string; fetch?: typeof fetch; getDefaultOffset?: () => number }): void;
|
|
4
|
+
export function getConfig(): { baseUrl?: string; consumer?: string; fetch?: typeof fetch; getDefaultOffset?: () => number } | null;
|
|
5
|
+
export function setBaseUrl(baseUrl: string): void;
|
|
6
|
+
export function setConsumer(consumer: string): void;
|
|
7
|
+
export function getConfigStore(): unknown;
|
|
8
|
+
|
|
9
|
+
export const ConfigModel: unknown;
|
|
10
|
+
|
|
11
|
+
export const CalendarModel: {
|
|
12
|
+
get(calendarId: string): Promise<unknown>;
|
|
13
|
+
getRaw(calendarId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
14
|
+
getByCompany(
|
|
15
|
+
companyKey: string,
|
|
16
|
+
opts?: {
|
|
17
|
+
skip?: number;
|
|
18
|
+
take?: number;
|
|
19
|
+
/** Maps to API query `sort`. */
|
|
20
|
+
sortBy?: string;
|
|
21
|
+
/** Maps to API query `sort_dir` (`asc` / `desc`). */
|
|
22
|
+
sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
23
|
+
/** Same as `sortBy` (sent as `sort` on the wire). */
|
|
24
|
+
sort?: string;
|
|
25
|
+
sort_column?: string;
|
|
26
|
+
/** Same as `sortOrder` (sent as `sort_dir` on the wire). */
|
|
27
|
+
sort_dir?: 'asc' | 'desc' | string;
|
|
28
|
+
page?: number;
|
|
29
|
+
page_size?: number;
|
|
30
|
+
}
|
|
31
|
+
): Promise<{ calendars: unknown[]; totalCount: number } | null>;
|
|
32
|
+
getTimeZones(): Promise<unknown>;
|
|
33
|
+
getTimeZone(timezoneId: string): Promise<unknown>;
|
|
34
|
+
getParticipants(calendarId: string): Promise<unknown>;
|
|
35
|
+
getAllParticipantOpeningHours(calendarId: string): Promise<unknown[] | null>;
|
|
36
|
+
getCalendarParticipant(calendarId: string): Promise<unknown>;
|
|
37
|
+
getParticipantsInfo(calendarId: string): Promise<unknown>;
|
|
38
|
+
getMonth(calendarId: string, year: number, month: number): Promise<unknown>;
|
|
39
|
+
getEvents(calendarId: string): Promise<unknown>;
|
|
40
|
+
createWithParticipants(name: string, companyKey: string, participantIds: string[], description: string, calendarId?: string): Promise<unknown>;
|
|
41
|
+
editWithParticipants(calendarId: string, name: string, participantIds: string[], description: string): Promise<unknown>;
|
|
42
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const EventModel: {
|
|
46
|
+
get(eventId: string): Promise<unknown>;
|
|
47
|
+
getByExternalId(externalEventId: string): Promise<unknown>;
|
|
48
|
+
getRoundRobinParticipant(calendarId: string): Promise<unknown>;
|
|
49
|
+
getEarliestAvailableDays(calendarId: string, count: number, opts?: { year?: number; month?: number; day?: number; offset?: number }): Promise<string[] | null>;
|
|
50
|
+
getDaySelectable(calendarId: string, year: number, month: number, day: number, opts?: { participantId?: string; offset?: number }): Promise<boolean>;
|
|
51
|
+
getByVisitorEmail(email: string, opts: { companyKey?: string; calendarId?: string; offset?: number }): Promise<unknown[] | null>;
|
|
52
|
+
getByVisitorPhone(phone: string, opts: { companyKey?: string; calendarId?: string; offset?: number }): Promise<unknown[] | null>;
|
|
53
|
+
getAvailability(calendarId: string, year: number, month: number, day: number, opts?: { participantId?: string; offset?: number }): Promise<unknown[]>;
|
|
54
|
+
getExternalUnavailability(
|
|
55
|
+
participantId: string,
|
|
56
|
+
opts?:
|
|
57
|
+
| { startUtc: string; endUtc: string; offset?: number }
|
|
58
|
+
| { year: number; month: number; day: number; days?: number; offset?: number }
|
|
59
|
+
): Promise<unknown[]>;
|
|
60
|
+
cancel(eventId: string): Promise<unknown>;
|
|
61
|
+
getCancellable(eventId: string): Promise<boolean>;
|
|
62
|
+
createEvent(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
63
|
+
reschedule(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
64
|
+
updateEvent(payload: object): Promise<unknown>;
|
|
65
|
+
createTest(payload: object, offsetMinutes?: number): Promise<unknown>;
|
|
66
|
+
getCustomData(calendarId: string, eventId?: string): Promise<unknown>;
|
|
67
|
+
setReminder(eventId: string): Promise<unknown>;
|
|
68
|
+
setAttendeeStatus(eventId: string, attendeeStatus: number | string): Promise<unknown>;
|
|
69
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const AvailabilityModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
73
|
+
export const AvailabilityDetailModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
74
|
+
export const CalendarParticipantModel: {
|
|
75
|
+
getByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
76
|
+
getInfoByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
77
|
+
getByParticipant(participantId: string): Promise<unknown[] | null>;
|
|
78
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
79
|
+
};
|
|
80
|
+
export const ParticipantModel: {
|
|
81
|
+
get(participantId: string): Promise<unknown>;
|
|
82
|
+
getByIds(participantIds: string[] | string): Promise<unknown[] | null>;
|
|
83
|
+
getAll(companyKey: string): Promise<unknown[] | null>;
|
|
84
|
+
add(payload: object, calendarId?: string): Promise<unknown>;
|
|
85
|
+
remove(participantId: string): Promise<unknown>;
|
|
86
|
+
update(payload: object): Promise<unknown>;
|
|
87
|
+
save(payload: object): Promise<unknown>;
|
|
88
|
+
sendEmail(participantId: string): Promise<unknown>;
|
|
89
|
+
migrate(participantId: string, userId: string): Promise<unknown>;
|
|
90
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
91
|
+
};
|
|
92
|
+
export const OpeningHourModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
93
|
+
export const TimeSlotModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
94
|
+
export const TimeFrameModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
95
|
+
export const SettingModel: {
|
|
96
|
+
get(calendarId: string): Promise<unknown>;
|
|
97
|
+
save(payload: object): Promise<unknown>;
|
|
98
|
+
uploadLogo(calendarId: string, file: File | Blob): Promise<unknown>;
|
|
99
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
100
|
+
};
|
|
101
|
+
export const CompanyModel: {
|
|
102
|
+
get(companyKey: string): Promise<unknown>;
|
|
103
|
+
getAll(): Promise<unknown[] | null>;
|
|
104
|
+
save(payload: object): Promise<unknown>;
|
|
105
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
106
|
+
};
|
|
107
|
+
export const AssetModel: {
|
|
108
|
+
upload(
|
|
109
|
+
file: File | Blob,
|
|
110
|
+
opts: {
|
|
111
|
+
category: string;
|
|
112
|
+
companyKey?: string;
|
|
113
|
+
calendarId?: string;
|
|
114
|
+
consumer?: string;
|
|
115
|
+
}
|
|
116
|
+
): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
117
|
+
create(
|
|
118
|
+
snapshot?: {
|
|
119
|
+
url?: string | null;
|
|
120
|
+
blobPath?: string | null;
|
|
121
|
+
category?: string | null;
|
|
122
|
+
contentType?: string | null;
|
|
123
|
+
size?: number | null;
|
|
124
|
+
},
|
|
125
|
+
options?: { env?: object }
|
|
126
|
+
): unknown;
|
|
127
|
+
};
|
|
128
|
+
export const CalendarDayModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
129
|
+
export const ParticipantInfoModel: { create(snapshot: object, options?: { env?: object }): unknown };
|
|
130
|
+
export const CalendarLocationModel: {
|
|
131
|
+
getByCalendar(calendarId: string): Promise<unknown[] | null>;
|
|
132
|
+
save(payload: object): Promise<unknown>;
|
|
133
|
+
remove(calendarLocationId: string): Promise<unknown>;
|
|
134
|
+
setDefault(calendarId: string, calendarLocationId: string): Promise<unknown>;
|
|
135
|
+
create(
|
|
136
|
+
snapshot?: {
|
|
137
|
+
id?: number | null;
|
|
138
|
+
calendarLocationId?: string | null;
|
|
139
|
+
calendarId?: string | null;
|
|
140
|
+
locationType?: number;
|
|
141
|
+
name?: string;
|
|
142
|
+
value?: string;
|
|
143
|
+
isDefault?: boolean;
|
|
144
|
+
sortOrder?: number;
|
|
145
|
+
createdOn?: string | null;
|
|
146
|
+
modifiedOn?: string | null;
|
|
147
|
+
},
|
|
148
|
+
options?: { env?: object }
|
|
149
|
+
): unknown;
|
|
150
|
+
};
|
|
151
|
+
export const PreferenceModel: {
|
|
152
|
+
getScopes(): Promise<string[] | null>;
|
|
153
|
+
getOptions(): Promise<string[] | null>;
|
|
154
|
+
getOptionTemplate(option: string): Promise<unknown>;
|
|
155
|
+
get(option: string, keys: string | string[]): Promise<unknown>;
|
|
156
|
+
set(scope: string, key: string, option: string, body: string | object): Promise<unknown>;
|
|
157
|
+
delete(preferenceId: string): Promise<unknown>;
|
|
158
|
+
create(snapshot: object, options?: { env?: object }): unknown;
|
|
159
|
+
};
|
|
160
|
+
export const PreferenceScope: Record<string, number>;
|
|
161
|
+
|
|
162
|
+
export type FlowSnapshot = {
|
|
163
|
+
id?: number | null;
|
|
164
|
+
flowId?: string;
|
|
165
|
+
companyKey?: string;
|
|
166
|
+
calendarId?: string | null;
|
|
167
|
+
name?: string | null;
|
|
168
|
+
description?: string | null;
|
|
169
|
+
flowJson?: string;
|
|
170
|
+
isActive?: boolean;
|
|
171
|
+
isDeleted?: boolean;
|
|
172
|
+
createdOn?: string | null;
|
|
173
|
+
modifiedOn?: string | null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const FlowModel: {
|
|
177
|
+
getRaw(flowId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
178
|
+
list(companyKey: string, includeDeleted?: boolean): Promise<unknown[] | null>;
|
|
179
|
+
get(flowId: string): Promise<unknown>;
|
|
180
|
+
createFlow(payload: FlowSnapshot): Promise<unknown>;
|
|
181
|
+
updateFlow(payload: FlowSnapshot): Promise<unknown>;
|
|
182
|
+
delete(flowId: string): Promise<unknown>;
|
|
183
|
+
duplicate(flowId: string, newName?: string): Promise<unknown>;
|
|
184
|
+
getAppearance(flowId: string): Promise<unknown>;
|
|
185
|
+
saveAppearance(payload: object): Promise<unknown>;
|
|
186
|
+
getEmbed(flowId: string): Promise<unknown>;
|
|
187
|
+
saveEmbed(payload: object): Promise<unknown>;
|
|
188
|
+
getPublic(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
|
|
189
|
+
getPreview(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
|
|
190
|
+
/** Empty snapshot is valid: `FlowModel.create({}, { env })` after configure() */
|
|
191
|
+
create(snapshot?: FlowSnapshot, options?: { env?: object }): unknown;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export const LeadModel: {
|
|
195
|
+
getRaw(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
196
|
+
get(leadId: string): Promise<unknown>;
|
|
197
|
+
getByEmail(email: string, companyKey: string): Promise<unknown>;
|
|
198
|
+
createLead(payload: {
|
|
199
|
+
email: string;
|
|
200
|
+
companyKey: string;
|
|
201
|
+
name?: string;
|
|
202
|
+
phone?: string;
|
|
203
|
+
source?: string;
|
|
204
|
+
leadType?: 'sales' | 'service' | 'others' | number;
|
|
205
|
+
referrerLink?: string;
|
|
206
|
+
}): Promise<unknown>;
|
|
207
|
+
updateLead(payload: {
|
|
208
|
+
leadId: string;
|
|
209
|
+
email?: string;
|
|
210
|
+
companyKey?: string;
|
|
211
|
+
name?: string;
|
|
212
|
+
phone?: string;
|
|
213
|
+
source?: string;
|
|
214
|
+
leadType?: 'sales' | 'service' | 'others' | number;
|
|
215
|
+
referrerLink?: string;
|
|
216
|
+
}): Promise<unknown>;
|
|
217
|
+
deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
218
|
+
requestExport(
|
|
219
|
+
companyKey: string,
|
|
220
|
+
opts?: {
|
|
221
|
+
notifyPath?: string;
|
|
222
|
+
notify_path?: string;
|
|
223
|
+
consumer?: string;
|
|
224
|
+
Consumer?: string;
|
|
225
|
+
}
|
|
226
|
+
): Promise<{ status: string; data?: unknown; message?: string }>;
|
|
227
|
+
getByCompany(
|
|
228
|
+
companyKey: string,
|
|
229
|
+
opts?: {
|
|
230
|
+
skip?: number;
|
|
231
|
+
take?: number;
|
|
232
|
+
/** Maps to API query `sort`. */
|
|
233
|
+
sortBy?: string;
|
|
234
|
+
/** Maps to API query `sort_dir` (`asc` / `desc`). */
|
|
235
|
+
sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
236
|
+
/** Same as `sortBy` (sent as `sort` on the wire). */
|
|
237
|
+
sort?: string;
|
|
238
|
+
sort_column?: string;
|
|
239
|
+
/** Same as `sortOrder` (sent as `sort_dir` on the wire). */
|
|
240
|
+
sort_dir?: 'asc' | 'desc' | string;
|
|
241
|
+
page?: number;
|
|
242
|
+
page_size?: number;
|
|
243
|
+
}
|
|
244
|
+
): Promise<unknown[] | null>;
|
|
245
|
+
/** Empty snapshot is valid: `LeadModel.create({}, { env })` after configure() */
|
|
246
|
+
create(snapshot?: object, options?: { env?: object }): unknown;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export type CalendarProviderOption = {
|
|
250
|
+
emailProvider: number;
|
|
251
|
+
key: string;
|
|
252
|
+
name: string;
|
|
253
|
+
displayName: string;
|
|
254
|
+
description: string;
|
|
255
|
+
scope: string;
|
|
256
|
+
redirectUrl: string;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export type ParticipantAuthorizationUrl = {
|
|
260
|
+
participantId: string;
|
|
261
|
+
emailProvider: number;
|
|
262
|
+
providerKey: string;
|
|
263
|
+
authorizationUrl: string;
|
|
264
|
+
redirectUrl: string;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export type CalendarProviderAuthorizationState = {
|
|
268
|
+
emailProvider: number;
|
|
269
|
+
key: string;
|
|
270
|
+
name: string;
|
|
271
|
+
hasCredentials: boolean;
|
|
272
|
+
isAuthorized: boolean;
|
|
273
|
+
isSelected: boolean;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export type ParticipantAuthorizationStatus = {
|
|
277
|
+
participantId: string;
|
|
278
|
+
email: string;
|
|
279
|
+
emailProvider: number;
|
|
280
|
+
providerKey: string;
|
|
281
|
+
hasCredentials: boolean;
|
|
282
|
+
isAuthorized: boolean;
|
|
283
|
+
providers: CalendarProviderAuthorizationState[];
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export const CALENDAR_AUTH_MESSAGE_TYPE: 'calendar-authorization';
|
|
287
|
+
|
|
288
|
+
export const CalendarEmailProvider: {
|
|
289
|
+
Google: 1;
|
|
290
|
+
Microsoft: 2;
|
|
291
|
+
Default: 3;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export const AuthModel: {
|
|
295
|
+
CALENDAR_AUTH_MESSAGE_TYPE: typeof CALENDAR_AUTH_MESSAGE_TYPE;
|
|
296
|
+
EmailProvider: typeof CalendarEmailProvider;
|
|
297
|
+
getCalendarProviders(opts?: { host?: string }): Promise<{
|
|
298
|
+
status: string;
|
|
299
|
+
data?: CalendarProviderOption[];
|
|
300
|
+
message?: string;
|
|
301
|
+
}>;
|
|
302
|
+
getAuthorizationUrl(
|
|
303
|
+
participantId: string,
|
|
304
|
+
emailProvider: string | number,
|
|
305
|
+
opts?: { host?: string }
|
|
306
|
+
): Promise<{
|
|
307
|
+
status: string;
|
|
308
|
+
data?: ParticipantAuthorizationUrl;
|
|
309
|
+
message?: string;
|
|
310
|
+
}>;
|
|
311
|
+
getAuthorizationStatus(participantId: string): Promise<{
|
|
312
|
+
status: string;
|
|
313
|
+
data?: ParticipantAuthorizationStatus;
|
|
314
|
+
message?: string;
|
|
315
|
+
}>;
|
|
316
|
+
openOAuthPopup(
|
|
317
|
+
authorizationUrl: string,
|
|
318
|
+
opts?: { width?: number; height?: number }
|
|
319
|
+
): Window | null;
|
|
320
|
+
onCalendarAuthMessage(
|
|
321
|
+
handler: (payload: {
|
|
322
|
+
type: string;
|
|
323
|
+
status: 'success' | 'error';
|
|
324
|
+
message?: string;
|
|
325
|
+
}) => void
|
|
326
|
+
): () => void;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export const CustomFieldModel: {
|
|
330
|
+
getAll(calendarId: string): Promise<unknown[] | null>;
|
|
331
|
+
getFieldType(fieldType: string): Promise<unknown>;
|
|
332
|
+
getFieldTypes(): Promise<unknown>;
|
|
333
|
+
add(payload: object): Promise<unknown>;
|
|
334
|
+
removeField(customFieldId: string): Promise<unknown>;
|
|
335
|
+
removeAllFields(calendarId: string): Promise<unknown>;
|
|
336
|
+
getForm(calendarId: string, dataId?: string): Promise<unknown>;
|
|
337
|
+
saveForm(calendarId: string, fields: unknown[]): Promise<unknown>;
|
|
338
|
+
getFormData(calendarId: string, dataId?: string): Promise<unknown>;
|
|
339
|
+
saveFormData(dataId: string, fields: unknown[]): Promise<unknown>;
|
|
340
|
+
saveFormFieldData(fieldPayload: object): Promise<unknown>;
|
|
341
|
+
create(snapshot?: object, options?: { env?: object }): unknown;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export const RootStore: unknown;
|
|
345
|
+
export function createRootStore(initialState?: object): unknown;
|
|
346
|
+
|
|
347
|
+
export const Unit: Record<string, number>;
|
|
348
|
+
export const AssignmentMethod: Record<string, number>;
|
|
349
|
+
export const AttendeeStatus: Record<string, number>;
|
|
350
|
+
export const RecurringFrequency: Record<string, number>;
|
|
351
|
+
export const DayOfWeek: Record<string, number>;
|
|
352
|
+
export const LocationType: Record<string, number>;
|
|
353
|
+
export const EmailProvider: Record<string, number>;
|