@blazeo.com/calendar-client 1.0.22 → 1.0.23

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,258 +1,272 @@
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 const FlowModel: {
163
- getRaw(flowId: string): Promise<{ status: string; data?: unknown; message?: string }>;
164
- list(companyKey: string, includeDeleted?: boolean): Promise<unknown[] | null>;
165
- get(flowId: string): Promise<unknown>;
166
- createFlow(payload: object): Promise<unknown>;
167
- updateFlow(payload: object): Promise<unknown>;
168
- delete(flowId: string): Promise<unknown>;
169
- duplicate(flowId: string, newName?: string): Promise<unknown>;
170
- getAppearance(flowId: string): Promise<unknown>;
171
- saveAppearance(payload: object): Promise<unknown>;
172
- getEmbed(flowId: string): Promise<unknown>;
173
- saveEmbed(payload: object): Promise<unknown>;
174
- getPublic(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
175
- getPreview(flowId: string): Promise<{ flow: unknown; appearance: unknown; embed: unknown } | null>;
176
- /** Empty snapshot is valid: `FlowModel.create({}, { env })` after configure() */
177
- create(snapshot?: object, options?: { env?: object }): unknown;
178
- };
179
-
180
- export const LeadModel: {
181
- getRaw(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
182
- get(leadId: string): Promise<unknown>;
183
- getByEmail(email: string, companyKey: string): Promise<unknown>;
184
- createLead(payload: {
185
- email: string;
186
- companyKey: string;
187
- name?: string;
188
- phone?: string;
189
- source?: string;
190
- leadType?: 'sales' | 'service' | 'others' | number;
191
- referrerLink?: string;
192
- }): Promise<unknown>;
193
- updateLead(payload: {
194
- leadId: string;
195
- email?: string;
196
- companyKey?: string;
197
- name?: string;
198
- phone?: string;
199
- source?: string;
200
- leadType?: 'sales' | 'service' | 'others' | number;
201
- referrerLink?: string;
202
- }): Promise<unknown>;
203
- deleteLead(leadId: string): Promise<{ status: string; data?: unknown; message?: string }>;
204
- requestExport(
205
- companyKey: string,
206
- opts?: {
207
- notifyPath?: string;
208
- notify_path?: string;
209
- consumer?: string;
210
- Consumer?: string;
211
- }
212
- ): Promise<{ status: string; data?: unknown; message?: string }>;
213
- getByCompany(
214
- companyKey: string,
215
- opts?: {
216
- skip?: number;
217
- take?: number;
218
- /** Maps to API query `sort`. */
219
- sortBy?: string;
220
- /** Maps to API query `sort_dir` (`asc` / `desc`). */
221
- sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
222
- /** Same as `sortBy` (sent as `sort` on the wire). */
223
- sort?: string;
224
- sort_column?: string;
225
- /** Same as `sortOrder` (sent as `sort_dir` on the wire). */
226
- sort_dir?: 'asc' | 'desc' | string;
227
- page?: number;
228
- page_size?: number;
229
- }
230
- ): Promise<unknown[] | null>;
231
- /** Empty snapshot is valid: `LeadModel.create({}, { env })` after configure() */
232
- create(snapshot?: object, options?: { env?: object }): unknown;
233
- };
234
-
235
- export const CustomFieldModel: {
236
- getAll(calendarId: string): Promise<unknown[] | null>;
237
- getFieldType(fieldType: string): Promise<unknown>;
238
- getFieldTypes(): Promise<unknown>;
239
- add(payload: object): Promise<unknown>;
240
- removeField(customFieldId: string): Promise<unknown>;
241
- removeAllFields(calendarId: string): Promise<unknown>;
242
- getForm(calendarId: string, dataId?: string): Promise<unknown>;
243
- saveForm(calendarId: string, fields: unknown[]): Promise<unknown>;
244
- getFormData(calendarId: string, dataId?: string): Promise<unknown>;
245
- saveFormData(dataId: string, fields: unknown[]): Promise<unknown>;
246
- saveFormFieldData(fieldPayload: object): Promise<unknown>;
247
- create(snapshot?: object, options?: { env?: object }): unknown;
248
- };
249
-
250
- export const RootStore: unknown;
251
- export function createRootStore(initialState?: object): unknown;
252
-
253
- export const Unit: Record<string, number>;
254
- export const AssignmentMethod: Record<string, number>;
255
- export const AttendeeStatus: Record<string, number>;
256
- export const RecurringFrequency: Record<string, number>;
257
- export const DayOfWeek: Record<string, number>;
258
- export const LocationType: 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 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 const CustomFieldModel: {
250
+ getAll(calendarId: string): Promise<unknown[] | null>;
251
+ getFieldType(fieldType: string): Promise<unknown>;
252
+ getFieldTypes(): Promise<unknown>;
253
+ add(payload: object): Promise<unknown>;
254
+ removeField(customFieldId: string): Promise<unknown>;
255
+ removeAllFields(calendarId: string): Promise<unknown>;
256
+ getForm(calendarId: string, dataId?: string): Promise<unknown>;
257
+ saveForm(calendarId: string, fields: unknown[]): Promise<unknown>;
258
+ getFormData(calendarId: string, dataId?: string): Promise<unknown>;
259
+ saveFormData(dataId: string, fields: unknown[]): Promise<unknown>;
260
+ saveFormFieldData(fieldPayload: object): Promise<unknown>;
261
+ create(snapshot?: object, options?: { env?: object }): unknown;
262
+ };
263
+
264
+ export const RootStore: unknown;
265
+ export function createRootStore(initialState?: object): unknown;
266
+
267
+ export const Unit: Record<string, number>;
268
+ export const AssignmentMethod: Record<string, number>;
269
+ export const AttendeeStatus: Record<string, number>;
270
+ export const RecurringFrequency: Record<string, number>;
271
+ export const DayOfWeek: Record<string, number>;
272
+ export const LocationType: Record<string, number>;
package/dist/index.js CHANGED
@@ -1939,6 +1939,7 @@ function mapFlowFromApi(d) {
1939
1939
  id: pick("id", "Id") ?? null,
1940
1940
  flowId: pick("flowId", "FlowId", "flow_id") ?? "",
1941
1941
  companyKey: pick("companyKey", "CompanyKey", "company_key") ?? "",
1942
+ calendarId: pick("calendarId", "CalendarId", "calendar_id") ?? null,
1942
1943
  name: pick("name", "Name") ?? "",
1943
1944
  description: pick("description", "Description") ?? null,
1944
1945
  flowJson: pick("flowJson", "FlowJson", "flow_json") ?? "",
@@ -1952,6 +1953,7 @@ var FlowModel = import_mobx_state_tree18.types.model("Flow", {
1952
1953
  id: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.maybeNull(import_mobx_state_tree18.types.number), null),
1953
1954
  flowId: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.identifier, "new"),
1954
1955
  companyKey: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.maybeNull(import_mobx_state_tree18.types.string), null),
1956
+ calendarId: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.maybeNull(import_mobx_state_tree18.types.string), null),
1955
1957
  name: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.maybeNull(import_mobx_state_tree18.types.string), null),
1956
1958
  description: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.maybeNull(import_mobx_state_tree18.types.string), null),
1957
1959
  flowJson: import_mobx_state_tree18.types.optional(import_mobx_state_tree18.types.string, ""),
@@ -1975,6 +1977,7 @@ var FlowModel = import_mobx_state_tree18.types.model("Flow", {
1975
1977
  async create() {
1976
1978
  const payload = {
1977
1979
  companyKey: self.companyKey ?? void 0,
1980
+ calendarId: self.calendarId ?? void 0,
1978
1981
  name: self.name ?? void 0,
1979
1982
  description: self.description ?? void 0,
1980
1983
  flowJson: self.flowJson || void 0,
@@ -1991,6 +1994,7 @@ var FlowModel = import_mobx_state_tree18.types.model("Flow", {
1991
1994
  if (!self.flowId || self.flowId === "new") return { status: "failure", message: "flowId required" };
1992
1995
  const payload = {
1993
1996
  flowId: self.flowId,
1997
+ calendarId: self.calendarId ?? void 0,
1994
1998
  name: self.name ?? void 0,
1995
1999
  description: self.description ?? void 0,
1996
2000
  flowJson: self.flowJson || void 0,
package/dist/index.mjs CHANGED
@@ -1882,6 +1882,7 @@ function mapFlowFromApi(d) {
1882
1882
  id: pick("id", "Id") ?? null,
1883
1883
  flowId: pick("flowId", "FlowId", "flow_id") ?? "",
1884
1884
  companyKey: pick("companyKey", "CompanyKey", "company_key") ?? "",
1885
+ calendarId: pick("calendarId", "CalendarId", "calendar_id") ?? null,
1885
1886
  name: pick("name", "Name") ?? "",
1886
1887
  description: pick("description", "Description") ?? null,
1887
1888
  flowJson: pick("flowJson", "FlowJson", "flow_json") ?? "",
@@ -1895,6 +1896,7 @@ var FlowModel = types18.model("Flow", {
1895
1896
  id: types18.optional(types18.maybeNull(types18.number), null),
1896
1897
  flowId: types18.optional(types18.identifier, "new"),
1897
1898
  companyKey: types18.optional(types18.maybeNull(types18.string), null),
1899
+ calendarId: types18.optional(types18.maybeNull(types18.string), null),
1898
1900
  name: types18.optional(types18.maybeNull(types18.string), null),
1899
1901
  description: types18.optional(types18.maybeNull(types18.string), null),
1900
1902
  flowJson: types18.optional(types18.string, ""),
@@ -1918,6 +1920,7 @@ var FlowModel = types18.model("Flow", {
1918
1920
  async create() {
1919
1921
  const payload = {
1920
1922
  companyKey: self.companyKey ?? void 0,
1923
+ calendarId: self.calendarId ?? void 0,
1921
1924
  name: self.name ?? void 0,
1922
1925
  description: self.description ?? void 0,
1923
1926
  flowJson: self.flowJson || void 0,
@@ -1934,6 +1937,7 @@ var FlowModel = types18.model("Flow", {
1934
1937
  if (!self.flowId || self.flowId === "new") return { status: "failure", message: "flowId required" };
1935
1938
  const payload = {
1936
1939
  flowId: self.flowId,
1940
+ calendarId: self.calendarId ?? void 0,
1937
1941
  name: self.name ?? void 0,
1938
1942
  description: self.description ?? void 0,
1939
1943
  flowJson: self.flowJson || void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazeo.com/calendar-client",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "Blazeo Calendar / Appointment API client with MobX State Tree models",
5
5
  "exports": {
6
6
  ".": {