@blazeo.com/calendar-client 1.0.18 → 1.0.19

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/index.d.ts CHANGED
@@ -1,200 +1,236 @@
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 CalendarDayModel: { create(snapshot: object, options?: { env?: object }): unknown };
108
- export const ParticipantInfoModel: { create(snapshot: object, options?: { env?: object }): unknown };
109
- export const PreferenceModel: {
110
- getScopes(): Promise<string[] | null>;
111
- getOptions(): Promise<string[] | null>;
112
- getOptionTemplate(option: string): Promise<unknown>;
113
- get(option: string, keys: string | string[]): Promise<unknown>;
114
- set(scope: string, key: string, option: string, body: string | object): Promise<unknown>;
115
- delete(preferenceId: string): Promise<unknown>;
116
- create(snapshot: object, options?: { env?: object }): unknown;
117
- };
118
- export const PreferenceScope: Record<string, number>;
119
-
120
- export const FlowModel: {
121
- getRaw(flowId: string): Promise<{ status: string; data?: unknown; message?: string }>;
122
- list(companyKey: string, includeDeleted?: boolean): Promise<unknown[] | null>;
123
- get(flowId: string): Promise<unknown>;
124
- createFlow(payload: object): Promise<unknown>;
125
- updateFlow(payload: object): Promise<unknown>;
126
- delete(flowId: string): Promise<unknown>;
127
- duplicate(flowId: string, newName?: string): Promise<unknown>;
128
- getAppearance(flowId: string): Promise<unknown>;
129
- saveAppearance(payload: object): Promise<unknown>;
130
- getEmbed(flowId: string): Promise<unknown>;
131
- saveEmbed(payload: object): Promise<unknown>;
132
- getPublic(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
133
- getPreview(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
134
- /** Empty snapshot is valid: `FlowModel.create({}, { env })` after configure() */
135
- create(snapshot?: object, options?: { env?: object }): unknown;
136
- };
137
-
138
- export const LeadModel: {
139
- getRaw(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
140
- get(leadId: string): Promise<unknown>;
141
- getByEmail(email: string, companyKey: string): Promise<unknown>;
142
- createLead(payload: {
143
- email: string;
144
- companyKey: string;
145
- name?: string;
146
- phone?: string;
147
- source?: string;
148
- leadType?: 'sales' | 'service' | 'others' | number;
149
- referrerLink?: string;
150
- }): Promise<unknown>;
151
- updateLead(payload: {
152
- leadId: string;
153
- email?: string;
154
- companyKey?: string;
155
- name?: string;
156
- phone?: string;
157
- source?: string;
158
- leadType?: 'sales' | 'service' | 'others' | number;
159
- referrerLink?: string;
160
- }): Promise<unknown>;
161
- deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
162
- requestExport(
163
- companyKey: string,
164
- opts?: {
165
- notifyPath?: string;
166
- notify_path?: string;
167
- consumer?: string;
168
- Consumer?: string;
169
- }
170
- ): Promise<{ status: string; data?: unknown; message?: string }>;
171
- getByCompany(
172
- companyKey: string,
173
- opts?: {
174
- skip?: number;
175
- take?: number;
176
- /** Maps to API query `sort`. */
177
- sortBy?: string;
178
- /** Maps to API query `sort_dir` (`asc` / `desc`). */
179
- sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
180
- /** Same as `sortBy` (sent as `sort` on the wire). */
181
- sort?: string;
182
- sort_column?: string;
183
- /** Same as `sortOrder` (sent as `sort_dir` on the wire). */
184
- sort_dir?: 'asc' | 'desc' | string;
185
- page?: number;
186
- page_size?: number;
187
- }
188
- ): Promise<unknown[] | null>;
189
- /** Empty snapshot is valid: `LeadModel.create({}, { env })` after configure() */
190
- create(snapshot?: object, options?: { env?: object }): unknown;
191
- };
192
-
193
- export const RootStore: unknown;
194
- export function createRootStore(initialState?: object): unknown;
195
-
196
- export const Unit: Record<string, number>;
197
- export const AssignmentMethod: Record<string, number>;
198
- export const AttendeeStatus: Record<string, number>;
199
- export const RecurringFrequency: Record<string, number>;
200
- export const DayOfWeek: Record<string, number>;
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 PreferenceModel: {
131
+ getScopes(): Promise<string[] | null>;
132
+ getOptions(): Promise<string[] | null>;
133
+ getOptionTemplate(option: string): Promise<unknown>;
134
+ get(option: string, keys: string | string[]): Promise<unknown>;
135
+ set(scope: string, key: string, option: string, body: string | object): Promise<unknown>;
136
+ delete(preferenceId: string): Promise<unknown>;
137
+ create(snapshot: object, options?: { env?: object }): unknown;
138
+ };
139
+ export const PreferenceScope: Record<string, number>;
140
+
141
+ export const FlowModel: {
142
+ getRaw(flowId: string): Promise<{ status: string; data?: unknown; message?: string }>;
143
+ list(companyKey: string, includeDeleted?: boolean): Promise<unknown[] | null>;
144
+ get(flowId: string): Promise<unknown>;
145
+ createFlow(payload: object): Promise<unknown>;
146
+ updateFlow(payload: object): Promise<unknown>;
147
+ delete(flowId: string): Promise<unknown>;
148
+ duplicate(flowId: string, newName?: string): Promise<unknown>;
149
+ getAppearance(flowId: string): Promise<unknown>;
150
+ saveAppearance(payload: object): Promise<unknown>;
151
+ getEmbed(flowId: string): Promise<unknown>;
152
+ saveEmbed(payload: object): Promise<unknown>;
153
+ getPublic(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
154
+ getPreview(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
155
+ /** Empty snapshot is valid: `FlowModel.create({}, { env })` after configure() */
156
+ create(snapshot?: object, options?: { env?: object }): unknown;
157
+ };
158
+
159
+ export const LeadModel: {
160
+ getRaw(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
161
+ get(leadId: string): Promise<unknown>;
162
+ getByEmail(email: string, companyKey: string): Promise<unknown>;
163
+ createLead(payload: {
164
+ email: string;
165
+ companyKey: string;
166
+ name?: string;
167
+ phone?: string;
168
+ source?: string;
169
+ leadType?: 'sales' | 'service' | 'others' | number;
170
+ referrerLink?: string;
171
+ }): Promise<unknown>;
172
+ updateLead(payload: {
173
+ leadId: string;
174
+ email?: string;
175
+ companyKey?: string;
176
+ name?: string;
177
+ phone?: string;
178
+ source?: string;
179
+ leadType?: 'sales' | 'service' | 'others' | number;
180
+ referrerLink?: string;
181
+ }): Promise<unknown>;
182
+ deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
183
+ requestExport(
184
+ companyKey: string,
185
+ opts?: {
186
+ notifyPath?: string;
187
+ notify_path?: string;
188
+ consumer?: string;
189
+ Consumer?: string;
190
+ }
191
+ ): Promise<{ status: string; data?: unknown; message?: string }>;
192
+ getByCompany(
193
+ companyKey: string,
194
+ opts?: {
195
+ skip?: number;
196
+ take?: number;
197
+ /** Maps to API query `sort`. */
198
+ sortBy?: string;
199
+ /** Maps to API query `sort_dir` (`asc` / `desc`). */
200
+ sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
201
+ /** Same as `sortBy` (sent as `sort` on the wire). */
202
+ sort?: string;
203
+ sort_column?: string;
204
+ /** Same as `sortOrder` (sent as `sort_dir` on the wire). */
205
+ sort_dir?: 'asc' | 'desc' | string;
206
+ page?: number;
207
+ page_size?: number;
208
+ }
209
+ ): Promise<unknown[] | null>;
210
+ /** Empty snapshot is valid: `LeadModel.create({}, { env })` after configure() */
211
+ create(snapshot?: object, options?: { env?: object }): unknown;
212
+ };
213
+
214
+ export const CustomFieldModel: {
215
+ getAll(calendarId: string): Promise<unknown[] | null>;
216
+ getFieldType(fieldType: string): Promise<unknown>;
217
+ getFieldTypes(): Promise<unknown>;
218
+ add(payload: object): Promise<unknown>;
219
+ removeField(customFieldId: string): Promise<unknown>;
220
+ removeAllFields(calendarId: string): Promise<unknown>;
221
+ getForm(calendarId: string, dataId?: string): Promise<unknown>;
222
+ saveForm(calendarId: string, fields: unknown[]): Promise<unknown>;
223
+ getFormData(calendarId: string, dataId?: string): Promise<unknown>;
224
+ saveFormData(dataId: string, fields: unknown[]): Promise<unknown>;
225
+ saveFormFieldData(fieldPayload: object): Promise<unknown>;
226
+ create(snapshot?: object, options?: { env?: object }): unknown;
227
+ };
228
+
229
+ export const RootStore: unknown;
230
+ export function createRootStore(initialState?: object): unknown;
231
+
232
+ export const Unit: Record<string, number>;
233
+ export const AssignmentMethod: Record<string, number>;
234
+ export const AttendeeStatus: Record<string, number>;
235
+ export const RecurringFrequency: Record<string, number>;
236
+ export const DayOfWeek: Record<string, number>;