recal-sdk 1.0.1 → 1.2.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/README.md +102 -21
- package/dist/client/sdk.gen.d.ts +41 -41
- package/dist/client/sdk.gen.d.ts.map +1 -1
- package/dist/client/sdk.gen.js +131 -131
- package/dist/client/sdk.gen.js.map +1 -1
- package/dist/client/transformers.gen.d.ts +25 -25
- package/dist/client/transformers.gen.d.ts.map +1 -1
- package/dist/client/transformers.gen.js +51 -26
- package/dist/client/transformers.gen.js.map +1 -1
- package/dist/client/types.gen.d.ts +830 -238
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/client/zod.gen.d.ts +357 -118
- package/dist/client/zod.gen.d.ts.map +1 -1
- package/dist/client/zod.gen.js +235 -180
- package/dist/client/zod.gen.js.map +1 -1
- package/dist/services/calendar.service.d.ts +12 -5
- package/dist/services/calendar.service.d.ts.map +1 -1
- package/dist/services/calendar.service.js +10 -6
- package/dist/services/calendar.service.js.map +1 -1
- package/dist/services/events.service.d.ts +2 -2
- package/dist/services/events.service.d.ts.map +1 -1
- package/dist/services/events.service.js +8 -8
- package/dist/services/events.service.js.map +1 -1
- package/dist/services/oauth.service.d.ts +7 -7
- package/dist/services/oauth.service.d.ts.map +1 -1
- package/dist/services/oauth.service.js +8 -8
- package/dist/services/oauth.service.js.map +1 -1
- package/dist/services/organizations.service.d.ts +35 -17
- package/dist/services/organizations.service.d.ts.map +1 -1
- package/dist/services/organizations.service.js +23 -11
- package/dist/services/organizations.service.js.map +1 -1
- package/dist/services/scheduling.service.d.ts +15 -7
- package/dist/services/scheduling.service.d.ts.map +1 -1
- package/dist/services/scheduling.service.js +34 -3
- package/dist/services/scheduling.service.js.map +1 -1
- package/dist/services/users.service.d.ts +2 -2
- package/dist/services/users.service.d.ts.map +1 -1
- package/dist/services/users.service.js +4 -4
- package/dist/services/users.service.js.map +1 -1
- package/dist/types.d.ts +27 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/response.d.ts +10 -0
- package/dist/utils/response.d.ts.map +1 -1
- package/dist/utils/response.js +20 -0
- package/dist/utils/response.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from '../client/client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GetV1OrganizationsByOrgSlugCalendarBusyData, GetV1OrganizationsByOrgSlugMembersData, GetV1OrganizationsByOrgSlugSchedulingData } from '../client/types.gen';
|
|
3
3
|
/**
|
|
4
4
|
* Organizations Service
|
|
5
5
|
*
|
|
@@ -82,7 +82,7 @@ export declare class OrganizationsService {
|
|
|
82
82
|
* })
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
|
-
getMembers(slug: string, options?:
|
|
85
|
+
getMembers(slug: string, options?: GetV1OrganizationsByOrgSlugMembersData['query']): Promise<{
|
|
86
86
|
createdAt: Date;
|
|
87
87
|
id: string;
|
|
88
88
|
oauthConnections?: Array<import("..").AuthConnection>;
|
|
@@ -126,8 +126,17 @@ export declare class OrganizationsService {
|
|
|
126
126
|
* provider: 'google'
|
|
127
127
|
* })
|
|
128
128
|
* ```
|
|
129
|
+
*
|
|
130
|
+
* A non-empty `failedUsers` means `data` is a partial answer. Each entry's
|
|
131
|
+
* `failedCalendars` says how partial: **empty** means that user could not be read at
|
|
132
|
+
* all and contributed nothing, **non-empty** means their busy time *is* in `data` but
|
|
133
|
+
* has gaps, and names the calendars missing from it. Re-querying a partial user would
|
|
134
|
+
* double-count the busy time already merged into `data`.
|
|
129
135
|
*/
|
|
130
|
-
getBusyTimes(slug: string, options:
|
|
136
|
+
getBusyTimes(slug: string, options: GetV1OrganizationsByOrgSlugCalendarBusyData['query']): Promise<{
|
|
137
|
+
data: Array<import("..").TimeRange>;
|
|
138
|
+
failedUsers: Array<import("..").FailedFreeBusyUser>;
|
|
139
|
+
}>;
|
|
131
140
|
/**
|
|
132
141
|
* Get available time slots for all users in an organization
|
|
133
142
|
*
|
|
@@ -143,22 +152,31 @@ export declare class OrganizationsService {
|
|
|
143
152
|
* padding: '15'
|
|
144
153
|
* })
|
|
145
154
|
* ```
|
|
155
|
+
*
|
|
156
|
+
* A non-empty `failedUsers` means `data` is a partial answer. Each entry's
|
|
157
|
+
* `failedCalendars` says how partial: **empty** means that user could not be read at
|
|
158
|
+
* all and contributed nothing, **non-empty** means their busy time *is* in `data` but
|
|
159
|
+
* has gaps, and names the calendars missing from it. Re-querying a partial user would
|
|
160
|
+
* double-count the busy time already merged into `data`.
|
|
146
161
|
*/
|
|
147
|
-
getScheduling(slug: string, options:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
getScheduling(slug: string, options: GetV1OrganizationsByOrgSlugSchedulingData['query']): Promise<{
|
|
163
|
+
data: {
|
|
164
|
+
availableSlots: Array<{
|
|
165
|
+
end: Date;
|
|
166
|
+
start: Date;
|
|
167
|
+
userId: string;
|
|
168
|
+
}>;
|
|
169
|
+
options: {
|
|
170
|
+
end: Date;
|
|
171
|
+
maxOverlaps: number;
|
|
172
|
+
padding: number;
|
|
173
|
+
slotDuration: number;
|
|
174
|
+
start: Date;
|
|
175
|
+
earliestTimeEachDay?: string;
|
|
176
|
+
latestTimeEachDay?: string;
|
|
177
|
+
};
|
|
161
178
|
};
|
|
179
|
+
failedUsers: Array<import("..").FailedFreeBusyUser>;
|
|
162
180
|
}>;
|
|
163
181
|
}
|
|
164
182
|
//# sourceMappingURL=organizations.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.service.d.ts","sourceRoot":"","sources":["../../src/services/organizations.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"organizations.service.d.ts","sourceRoot":"","sources":["../../src/services/organizations.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EACR,2CAA2C,EAE3C,sCAAsC,EACtC,yCAAyC,EAE5C,MAAM,qBAAqB,CAAA;AAG5B;;;;GAIG;AACH,qBAAa,oBAAoB;IACjB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;;OAOG;IACG,IAAI;IAKV;;;;;;;;;OASG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM;IAQtB;;;;;;;;;;OAUG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQ9C;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;IAStE;;;;;;;;;OASG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM;IAQzB;;;;;;;;;;;;OAYG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sCAAsC,CAAC,OAAO,CAAC;;;;;;IASxF;;;;;;;;;;OAUG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;IAShD;;;;;;;;;;OAUG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE;IASnD;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,2CAA2C,CAAC,OAAO,CAAC;;;;IAS9F;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,yCAAyC,CAAC,OAAO,CAAC;;;;;;;;;;;;;mCASivQ,CAAC;iCAA0K,CAAC;;;;;CAD7/Q"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as sdk from '../client/sdk.gen';
|
|
2
|
-
import { unwrapResponse } from '../utils/response';
|
|
2
|
+
import { unwrapEnvelope, unwrapResponse } from '../utils/response';
|
|
3
3
|
/**
|
|
4
4
|
* Organizations Service
|
|
5
5
|
*
|
|
@@ -33,7 +33,7 @@ export class OrganizationsService {
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
async get(slug) {
|
|
36
|
-
const response = await sdk.
|
|
36
|
+
const response = await sdk.getV1OrganizationsByOrgSlug({
|
|
37
37
|
path: { orgSlug: slug },
|
|
38
38
|
client: this.client,
|
|
39
39
|
});
|
|
@@ -72,7 +72,7 @@ export class OrganizationsService {
|
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
74
|
async update(slug, data) {
|
|
75
|
-
const response = await sdk.
|
|
75
|
+
const response = await sdk.putV1OrganizationsByOrgSlug({
|
|
76
76
|
path: { orgSlug: slug },
|
|
77
77
|
body: data,
|
|
78
78
|
client: this.client,
|
|
@@ -90,7 +90,7 @@ export class OrganizationsService {
|
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
92
|
async delete(slug) {
|
|
93
|
-
const response = await sdk.
|
|
93
|
+
const response = await sdk.deleteV1OrganizationsByOrgSlug({
|
|
94
94
|
path: { orgSlug: slug },
|
|
95
95
|
client: this.client,
|
|
96
96
|
});
|
|
@@ -110,7 +110,7 @@ export class OrganizationsService {
|
|
|
110
110
|
* ```
|
|
111
111
|
*/
|
|
112
112
|
async getMembers(slug, options) {
|
|
113
|
-
const response = await sdk.
|
|
113
|
+
const response = await sdk.getV1OrganizationsByOrgSlugMembers({
|
|
114
114
|
path: { orgSlug: slug },
|
|
115
115
|
query: options,
|
|
116
116
|
client: this.client,
|
|
@@ -129,7 +129,7 @@ export class OrganizationsService {
|
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
131
|
async addMembers(slug, userIds) {
|
|
132
|
-
const response = await sdk.
|
|
132
|
+
const response = await sdk.postV1OrganizationsByOrgSlugMembers({
|
|
133
133
|
path: { orgSlug: slug },
|
|
134
134
|
body: { userIds },
|
|
135
135
|
client: this.client,
|
|
@@ -148,7 +148,7 @@ export class OrganizationsService {
|
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
150
|
async removeMembers(slug, userIds) {
|
|
151
|
-
const response = await sdk.
|
|
151
|
+
const response = await sdk.deleteV1OrganizationsByOrgSlugMembers({
|
|
152
152
|
path: { orgSlug: slug },
|
|
153
153
|
body: { userIds },
|
|
154
154
|
client: this.client,
|
|
@@ -169,14 +169,20 @@ export class OrganizationsService {
|
|
|
169
169
|
* provider: 'google'
|
|
170
170
|
* })
|
|
171
171
|
* ```
|
|
172
|
+
*
|
|
173
|
+
* A non-empty `failedUsers` means `data` is a partial answer. Each entry's
|
|
174
|
+
* `failedCalendars` says how partial: **empty** means that user could not be read at
|
|
175
|
+
* all and contributed nothing, **non-empty** means their busy time *is* in `data` but
|
|
176
|
+
* has gaps, and names the calendars missing from it. Re-querying a partial user would
|
|
177
|
+
* double-count the busy time already merged into `data`.
|
|
172
178
|
*/
|
|
173
179
|
async getBusyTimes(slug, options) {
|
|
174
|
-
const response = await sdk.
|
|
180
|
+
const response = await sdk.getV1OrganizationsByOrgSlugCalendarBusy({
|
|
175
181
|
path: { orgSlug: slug },
|
|
176
182
|
query: options,
|
|
177
183
|
client: this.client,
|
|
178
184
|
});
|
|
179
|
-
return
|
|
185
|
+
return unwrapEnvelope(response);
|
|
180
186
|
}
|
|
181
187
|
/**
|
|
182
188
|
* Get available time slots for all users in an organization
|
|
@@ -193,14 +199,20 @@ export class OrganizationsService {
|
|
|
193
199
|
* padding: '15'
|
|
194
200
|
* })
|
|
195
201
|
* ```
|
|
202
|
+
*
|
|
203
|
+
* A non-empty `failedUsers` means `data` is a partial answer. Each entry's
|
|
204
|
+
* `failedCalendars` says how partial: **empty** means that user could not be read at
|
|
205
|
+
* all and contributed nothing, **non-empty** means their busy time *is* in `data` but
|
|
206
|
+
* has gaps, and names the calendars missing from it. Re-querying a partial user would
|
|
207
|
+
* double-count the busy time already merged into `data`.
|
|
196
208
|
*/
|
|
197
209
|
async getScheduling(slug, options) {
|
|
198
|
-
const response = await sdk.
|
|
210
|
+
const response = await sdk.getV1OrganizationsByOrgSlugScheduling({
|
|
199
211
|
path: { orgSlug: slug },
|
|
200
212
|
query: options,
|
|
201
213
|
client: this.client,
|
|
202
214
|
});
|
|
203
|
-
return
|
|
215
|
+
return unwrapEnvelope(response);
|
|
204
216
|
}
|
|
205
217
|
}
|
|
206
218
|
//# sourceMappingURL=organizations.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.service.js","sourceRoot":"","sources":["../../src/services/organizations.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"organizations.service.js","sourceRoot":"","sources":["../../src/services/organizations.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AAQxC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElE;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IACT;IAApB,YAAoB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEtC;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACN,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QACtE,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,GAAG,CAAC,IAAY;QAClB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,2BAA2B,CAAC;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AAE,OAAO,EAAE,IAAI,EAAE;YACvB,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAA;QACF,OAAO,cAAc,CAAsD,QAAQ,CAAC,CAAA;IACxF,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from '../client/client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GetV1UsersByUserIdSchedulingData, PostV1UsersByUserIdSchedulingData, PostV1UsersSchedulingData } from '../client/types.gen';
|
|
3
3
|
/**
|
|
4
4
|
* Scheduling Service
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ export declare class SchedulingService {
|
|
|
25
25
|
* })
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
getSlots(userId: string, options:
|
|
28
|
+
getSlots(userId: string, options: GetV1UsersByUserIdSchedulingData['query']): Promise<{
|
|
29
29
|
availableSlots: Array<import("..").TimeRange>;
|
|
30
30
|
options: {
|
|
31
31
|
end: Date;
|
|
@@ -66,7 +66,7 @@ export declare class SchedulingService {
|
|
|
66
66
|
* )
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
|
-
getAdvancedSlots(userId: string, options:
|
|
69
|
+
getAdvancedSlots(userId: string, options: PostV1UsersByUserIdSchedulingData['query'], body: PostV1UsersByUserIdSchedulingData['body']): Promise<{
|
|
70
70
|
availableSlots: Array<import("..").TimeRange>;
|
|
71
71
|
options: {
|
|
72
72
|
end: Date;
|
|
@@ -82,7 +82,7 @@ export declare class SchedulingService {
|
|
|
82
82
|
* Get available time slots for multiple users
|
|
83
83
|
*
|
|
84
84
|
* @param options - Query scheduling options
|
|
85
|
-
* @param
|
|
85
|
+
* @param body - Array of users with optional schedules
|
|
86
86
|
*
|
|
87
87
|
* @example
|
|
88
88
|
* ```typescript
|
|
@@ -105,8 +105,9 @@ export declare class SchedulingService {
|
|
|
105
105
|
* )
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
|
-
getMultiUserSlots(options: PostV1UsersSchedulingData['query'], body
|
|
108
|
+
getMultiUserSlots(options: PostV1UsersSchedulingData['query'], body: PostV1UsersSchedulingData['body']): Promise<({
|
|
109
109
|
availableSlots: Array<import("..").TimeRange>;
|
|
110
|
+
failedCalendars: Array<import("..").FailedCalendar>;
|
|
110
111
|
options: {
|
|
111
112
|
end: Date;
|
|
112
113
|
maxOverlaps: number;
|
|
@@ -116,16 +117,23 @@ export declare class SchedulingService {
|
|
|
116
117
|
earliestTimeEachDay?: string;
|
|
117
118
|
latestTimeEachDay?: string;
|
|
118
119
|
};
|
|
120
|
+
status: "ok";
|
|
119
121
|
userId: string;
|
|
120
|
-
calendarIds?: Array<string>;
|
|
121
|
-
schedules?:
|
|
122
|
+
calendarIds?: string | Array<string>;
|
|
123
|
+
schedules?: {
|
|
124
|
+
days: Array<"friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday">;
|
|
125
|
+
end: string;
|
|
126
|
+
start: string;
|
|
127
|
+
} | Array<{
|
|
122
128
|
days: Array<"friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday">;
|
|
123
129
|
end: string;
|
|
124
130
|
start: string;
|
|
125
131
|
}>;
|
|
126
132
|
} | {
|
|
127
133
|
error: string;
|
|
134
|
+
status: "error";
|
|
128
135
|
userId: string;
|
|
136
|
+
reason?: import("..").FreeBusyFailureReason;
|
|
129
137
|
})[]>;
|
|
130
138
|
}
|
|
131
139
|
//# sourceMappingURL=scheduling.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.service.d.ts","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EACR,
|
|
1
|
+
{"version":3,"file":"scheduling.service.d.ts","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EACR,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,EAC5B,MAAM,qBAAqB,CAAA;AAmC5B;;;;GAIG;AACH,qBAAa,iBAAiB;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;;;;;;;;;;;OAgBG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gCAAgC,CAAC,OAAO,CAAC;;;;;;;;+BAyF2yjD,CAAC;6BAA0K,CAAC;;;IAhFxikD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,gBAAgB,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iCAAiC,CAAC,OAAO,CAAC,EACnD,IAAI,EAAE,iCAAiC,CAAC,MAAM,CAAC;;;;;;;;+BAgDquqD,CAAC;6BAA0K,CAAC;;;IArCp8qD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,iBAAiB,CAAC,OAAO,EAAE,yBAAyB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC;;;;;;;;;+BAUw9wD,CAAC;6BAA0K,CAAC;;;;;;;;;;;;;;;;;;;;CADnvxD"}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import * as sdk from '../client/sdk.gen';
|
|
2
2
|
import { unwrapResponse } from '../utils/response';
|
|
3
|
+
/**
|
|
4
|
+
* Coerces date strings on a multi-user slots response, skipping per-user error entries.
|
|
5
|
+
*
|
|
6
|
+
* `POST /v1/users/scheduling` answers 200 with one entry per user, discriminated by
|
|
7
|
+
* `status`: slots when `'ok'`, `{ error }` when `'error'`. HeyAPI flattens that union
|
|
8
|
+
* and generates a transformer that dereferences `availableSlots` unconditionally, so an
|
|
9
|
+
* error entry crashes it before the caller can read the message. Overrides the generated
|
|
10
|
+
* transformer, which `sdk.gen.ts` spreads `options` over.
|
|
11
|
+
*
|
|
12
|
+
* Keys off the presence of `availableSlots` rather than `status`, so it behaves correctly
|
|
13
|
+
* against API versions from either side of the `status` rollout.
|
|
14
|
+
*/
|
|
15
|
+
const multiUserSlotsResponseTransformer = async (data) => {
|
|
16
|
+
const payload = data;
|
|
17
|
+
if (!Array.isArray(payload?.data))
|
|
18
|
+
return data;
|
|
19
|
+
for (const item of payload.data) {
|
|
20
|
+
if (!Array.isArray(item?.availableSlots))
|
|
21
|
+
continue;
|
|
22
|
+
item.availableSlots = item.availableSlots.map((slot) => {
|
|
23
|
+
const range = slot;
|
|
24
|
+
return { ...range, start: new Date(range.start), end: new Date(range.end) };
|
|
25
|
+
});
|
|
26
|
+
if (item.options) {
|
|
27
|
+
item.options.start = new Date(item.options.start);
|
|
28
|
+
item.options.end = new Date(item.options.end);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
3
33
|
/**
|
|
4
34
|
* Scheduling Service
|
|
5
35
|
*
|
|
@@ -28,7 +58,7 @@ export class SchedulingService {
|
|
|
28
58
|
* ```
|
|
29
59
|
*/
|
|
30
60
|
async getSlots(userId, options) {
|
|
31
|
-
const response = await sdk.
|
|
61
|
+
const response = await sdk.getV1UsersByUserIdScheduling({
|
|
32
62
|
path: { userId },
|
|
33
63
|
query: options,
|
|
34
64
|
client: this.client,
|
|
@@ -65,7 +95,7 @@ export class SchedulingService {
|
|
|
65
95
|
* ```
|
|
66
96
|
*/
|
|
67
97
|
async getAdvancedSlots(userId, options, body) {
|
|
68
|
-
const response = await sdk.
|
|
98
|
+
const response = await sdk.postV1UsersByUserIdScheduling({
|
|
69
99
|
path: { userId },
|
|
70
100
|
query: options,
|
|
71
101
|
body,
|
|
@@ -77,7 +107,7 @@ export class SchedulingService {
|
|
|
77
107
|
* Get available time slots for multiple users
|
|
78
108
|
*
|
|
79
109
|
* @param options - Query scheduling options
|
|
80
|
-
* @param
|
|
110
|
+
* @param body - Array of users with optional schedules
|
|
81
111
|
*
|
|
82
112
|
* @example
|
|
83
113
|
* ```typescript
|
|
@@ -105,6 +135,7 @@ export class SchedulingService {
|
|
|
105
135
|
query: options,
|
|
106
136
|
body,
|
|
107
137
|
client: this.client,
|
|
138
|
+
responseTransformer: multiUserSlotsResponseTransformer,
|
|
108
139
|
});
|
|
109
140
|
return unwrapResponse(response);
|
|
110
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduling.service.js","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"scheduling.service.js","sourceRoot":"","sources":["../../src/services/scheduling.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIlD;;;;;;;;;;;GAWG;AACH,MAAM,iCAAiC,GAAG,KAAK,EAAE,IAAa,EAAoB,EAAE;IAChF,MAAM,OAAO,GAAG,IAAuC,CAAA;IACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAE9C,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC;YAAE,SAAQ;QAClD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnD,MAAM,KAAK,GAAG,IAA0C,CAAA;YACxD,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,EAAE,GAAG,EAAE,IAAI,IAAI,C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G,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC;YAC7C,KAAK,EAAE,OAAO;YACd,IAAI;YACJ,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,iCAAiC;SACzD,CAAC,CAAA;QACF,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAA;IACnC,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from '../client/client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GetV1UsersByUserIdData } from '../client/types.gen';
|
|
3
3
|
/**
|
|
4
4
|
* Users Service
|
|
5
5
|
*
|
|
@@ -35,7 +35,7 @@ export declare class UsersService {
|
|
|
35
35
|
* })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
get(userId: string, options?:
|
|
38
|
+
get(userId: string, options?: GetV1UsersByUserIdData['query']): Promise<{
|
|
39
39
|
createdAt: Date;
|
|
40
40
|
id: string;
|
|
41
41
|
oauthConnections?: Array<import("..").AuthConnection>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../src/services/users.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../src/services/users.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAGjE;;;;GAIG;AACH,qBAAa,YAAY;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;;OAOG;IACG,IAAI;;;;;;IAKV;;;;;;;;;;;;OAYG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC;;;;;;IASnE;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE;;;;;;IAQzD;;;;;;;;;;OAUG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;IAS9C;;;;;;;;;OASG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM;;;;;;IAQ3B;;;;;;;;;OASG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM;CAOxC"}
|
|
@@ -36,7 +36,7 @@ export class UsersService {
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
async get(userId, options) {
|
|
39
|
-
const response = await sdk.
|
|
39
|
+
const response = await sdk.getV1UsersByUserId({
|
|
40
40
|
path: { userId },
|
|
41
41
|
query: options,
|
|
42
42
|
client: this.client,
|
|
@@ -73,7 +73,7 @@ export class UsersService {
|
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
75
|
async update(userId, newUserId) {
|
|
76
|
-
const response = await sdk.
|
|
76
|
+
const response = await sdk.putV1UsersByUserId({
|
|
77
77
|
path: { userId },
|
|
78
78
|
body: { userId: newUserId },
|
|
79
79
|
client: this.client,
|
|
@@ -91,7 +91,7 @@ export class UsersService {
|
|
|
91
91
|
* ```
|
|
92
92
|
*/
|
|
93
93
|
async delete(userId) {
|
|
94
|
-
const response = await sdk.
|
|
94
|
+
const response = await sdk.deleteV1UsersByUserId({
|
|
95
95
|
path: { userId },
|
|
96
96
|
client: this.client,
|
|
97
97
|
});
|
|
@@ -108,7 +108,7 @@ export class UsersService {
|
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
110
|
async getOrganizations(userId) {
|
|
111
|
-
const response = await sdk.
|
|
111
|
+
const response = await sdk.getV1UsersByUserIdOrganizations({
|
|
112
112
|
path: { userId },
|
|
113
113
|
client: this.client,
|
|
114
114
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/services/users.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACD;IAApB,YAAoB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEtC;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACN,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9D,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,GAAG,CAAC,MAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/services/users.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACD;IAApB,YAAoB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEtC;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI;QACN,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QAC9D,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,GAAG,CAAC,MAAc,EAAE,OAAyC;QAC/D,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC;YAC1C,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,KAAK,EAAE,OA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AA;IACnC,CAAC;CACJ"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,15 +20,29 @@ CreateEvent,
|
|
|
20
20
|
/**
|
|
21
21
|
* Create event across calendars payload
|
|
22
22
|
*/
|
|
23
|
-
CreateMetaEvent,
|
|
23
|
+
CreateMetaEvent, DeleteV1OrganizationsByOrgSlugData, DeleteV1OrganizationsByOrgSlugResponse, DeleteV1UsersByUserIdCalendarEventsMetaByMetaIdData, DeleteV1UsersByUserIdCalendarEventsMetaByMetaIdResponses, DeleteV1UsersByUserIdData, DeleteV1UsersByUserIdResponse,
|
|
24
24
|
/**
|
|
25
25
|
* Event entity
|
|
26
26
|
*/
|
|
27
|
-
Event,
|
|
27
|
+
Event,
|
|
28
|
+
/**
|
|
29
|
+
* A calendar that could not be read, with the reason and a message for the end user
|
|
30
|
+
*/
|
|
31
|
+
FailedCalendar,
|
|
32
|
+
/**
|
|
33
|
+
* A user whose busy times are missing (`failedCalendars` empty) or incomplete
|
|
34
|
+
* (`failedCalendars` names the gaps)
|
|
35
|
+
*/
|
|
36
|
+
FailedFreeBusyUser,
|
|
37
|
+
/**
|
|
38
|
+
* Why a calendar or a user could not be read. A closed union — a code is never
|
|
39
|
+
* renamed or removed once shipped: https://docs.recal.dev/core/troubleshooting
|
|
40
|
+
*/
|
|
41
|
+
FreeBusyFailureReason, GetV1OrganizationsByOrgSlugData, GetV1OrganizationsByOrgSlugResponse, GetV1OrganizationsByOrgSlugSchedulingData, GetV1OrganizationsByOrgSlugSchedulingResponse, GetV1OrganizationsResponse, GetV1UsersByUserIdCalendarBusyData, GetV1UsersByUserIdCalendarBusyResponse, GetV1UsersByUserIdCalendarData, GetV1UsersByUserIdCalendarEventsData, GetV1UsersByUserIdCalendarEventsMetaByMetaIdData, GetV1UsersByUserIdCalendarEventsMetaByMetaIdResponse, GetV1UsersByUserIdCalendarEventsResponse, GetV1UsersByUserIdCalendarResponse, GetV1UsersByUserIdData, GetV1UsersByUserIdOauthByProviderLinkData, GetV1UsersByUserIdOauthByProviderLinkResponse, GetV1UsersByUserIdOauthByProviderTokenData, GetV1UsersByUserIdOauthByProviderTokenResponse, GetV1UsersByUserIdOauthData, GetV1UsersByUserIdOauthLinksData, GetV1UsersByUserIdOauthLinksResponse, GetV1UsersByUserIdOauthResponse, GetV1UsersByUserIdResponse, GetV1UsersByUserIdSchedulingData, GetV1UsersByUserIdSchedulingResponse, GetV1UsersResponse,
|
|
28
42
|
/**
|
|
29
43
|
* Organization entity
|
|
30
44
|
*/
|
|
31
|
-
Organization, PostV1OrganizationsData, PostV1OrganizationsResponse,
|
|
45
|
+
Organization, PostV1OrganizationsData, PostV1OrganizationsResponse, PostV1UsersByUserIdCalendarEventsMetaData, PostV1UsersByUserIdCalendarEventsMetaResponse, PostV1UsersByUserIdOauthByProviderData, PostV1UsersByUserIdOauthByProviderResponse, PostV1UsersByUserIdSchedulingData, PostV1UsersByUserIdSchedulingResponse, PostV1UsersData, PostV1UsersOauthByProviderVerifyData, PostV1UsersResponse, PostV1UsersSchedulingData, PostV1UsersSchedulingResponse, PutV1OrganizationsByOrgSlugData, PutV1OrganizationsByOrgSlugResponse, PutV1UsersByUserIdCalendarEventsMetaByMetaIdData, PutV1UsersByUserIdCalendarEventsMetaByMetaIdResponse, PutV1UsersByUserIdData, PutV1UsersByUserIdResponse,
|
|
32
46
|
/**
|
|
33
47
|
* Time range with start and end dates
|
|
34
48
|
*/
|
|
@@ -58,9 +72,17 @@ export type DayOfWeek = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'frida
|
|
|
58
72
|
*/
|
|
59
73
|
export type OAuthAccessType = 'online' | 'offline';
|
|
60
74
|
/**
|
|
61
|
-
* OAuth scope presets
|
|
75
|
+
* OAuth scope presets, each expanded by the provider into its own scope list.
|
|
76
|
+
*
|
|
77
|
+
* `read` and `write` were added in v1.1.0 and this type never caught up, so
|
|
78
|
+
* `scope: 'write'` — valid against the API, and what the docs recommend — would not
|
|
79
|
+
* assign to it.
|
|
80
|
+
*
|
|
81
|
+
* @remarks `edit` is deprecated: still accepted as a synonym for `write`, and no longer
|
|
82
|
+
* the default. Passing an array instead of one of these presets skips the expansion and
|
|
83
|
+
* forwards the members verbatim as raw provider scopes.
|
|
62
84
|
*/
|
|
63
|
-
export type OAuthScope = 'edit' | 'free-busy';
|
|
85
|
+
export type OAuthScope = 'edit' | 'free-busy' | 'read' | 'write';
|
|
64
86
|
/**
|
|
65
87
|
* Attendee response status
|
|
66
88
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY;AACR;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,QAAQ;AACR;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY;AACR;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,QAAQ;AACR;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,eAAe,EACf,kCAAkC,EAClC,sCAAsC,EACtC,mDAAmD,EACnD,wDAAwD,EACxD,yBAAyB,EACzB,6BAA6B;AAC7B;;GAEG;AACH,KAAK;AACL;;GAEG;AACH,cAAc;AACd;;;GAGG;AACH,kBAAkB;AAClB;;;GAGG;AACH,qBAAqB,EACrB,+BAA+B,EAC/B,mCAAmC,EACnC,yCAAyC,EACzC,6CAA6C,EAC7C,0BAA0B,EAC1B,kCAAkC,EAClC,sCAAsC,EACtC,8BAA8B,EAC9B,oCAAoC,EACpC,gDAAgD,EAChD,oDAAoD,EACpD,wCAAwC,EACxC,kCAAkC,EAClC,sBAAsB,EACtB,yCAAyC,EACzC,6CAA6C,EAC7C,0CAA0C,EAC1C,8CAA8C,EAC9C,2BAA2B,EAC3B,gCAAgC,EAChC,oCAAoC,EACpC,+BAA+B,EAC/B,0BAA0B,EAC1B,gCAAgC,EAChC,oCAAoC,EACpC,kBAAkB;AAClB;;GAEG;AACH,YAAY,EACZ,uBAAuB,EACvB,2BAA2B,EAC3B,yCAAyC,EACzC,6CAA6C,EAC7C,sCAAsC,EACtC,0CAA0C,EAC1C,iCAAiC,EACjC,qCAAqC,EACrC,eAAe,EACf,oCAAoC,EACpC,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,+BAA+B,EAC/B,mCAAmC,EACnC,gDAAgD,EAChD,oDAAoD,EACpD,sBAAsB,EACtB,0BAA0B;AAC1B;;GAEG;AACH,SAAS;AACT;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,IAAI,GACP,MAAM,oBAAoB,CAAA;AAE3B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAA;AAE7C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEjF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAA;AAE1G;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAA;AAElD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAA;AAEhE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,CAAA"}
|
package/dist/utils/response.d.ts
CHANGED
|
@@ -30,4 +30,14 @@ export declare class RecalError extends Error {
|
|
|
30
30
|
* @throws RecalError if response contains an error or no data
|
|
31
31
|
*/
|
|
32
32
|
export declare function unwrapResponse<T>(response: HeyApiResponse<T>): T;
|
|
33
|
+
/**
|
|
34
|
+
* Unwraps a HeyAPI response to the API's whole envelope rather than its `data` field.
|
|
35
|
+
*
|
|
36
|
+
* For the responses that carry a sibling of `data`, where dropping it would let a partial
|
|
37
|
+
* answer read as a complete one: the organization free/busy routes report `failedUsers`
|
|
38
|
+
* there, and the user busy route reports `failedCalendars`. Error handling is identical to {@link unwrapResponse}: the error branch
|
|
39
|
+
* below delegates to it, which re-tests the same condition and always throws there —
|
|
40
|
+
* it never returns.
|
|
41
|
+
*/
|
|
42
|
+
export declare function unwrapEnvelope<T>(response: HeyApiResponse<unknown>): T;
|
|
33
43
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/utils/response.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnC,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAA;gBAErB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAQtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CA6BhE"}
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/utils/response.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACjC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnC,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAA;gBAErB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAQtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CA6BhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAYtE"}
|
package/dist/utils/response.js
CHANGED
|
@@ -51,4 +51,24 @@ export function unwrapResponse(response) {
|
|
|
51
51
|
// Return direct data
|
|
52
52
|
return response.data;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Unwraps a HeyAPI response to the API's whole envelope rather than its `data` field.
|
|
56
|
+
*
|
|
57
|
+
* For the responses that carry a sibling of `data`, where dropping it would let a partial
|
|
58
|
+
* answer read as a complete one: the organization free/busy routes report `failedUsers`
|
|
59
|
+
* there, and the user busy route reports `failedCalendars`. Error handling is identical to {@link unwrapResponse}: the error branch
|
|
60
|
+
* below delegates to it, which re-tests the same condition and always throws there —
|
|
61
|
+
* it never returns.
|
|
62
|
+
*/
|
|
63
|
+
export function unwrapEnvelope(response) {
|
|
64
|
+
if (response.error && typeof response.error === 'object' && Object.keys(response.error).length > 0) {
|
|
65
|
+
return unwrapResponse(response);
|
|
66
|
+
}
|
|
67
|
+
if (!response.data) {
|
|
68
|
+
throw new RecalError('No data in response', response.response?.status, response);
|
|
69
|
+
}
|
|
70
|
+
// The generated response types describe the envelope; HeyAPI's `data` is typed loosely
|
|
71
|
+
// as the union `{ data: T } | T`, so this narrowing can't be expressed without a cast.
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
54
74
|
//# sourceMappingURL=response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/utils/response.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACjB,UAAU,CAAS;IACnB,OAAO,CAAU;IAEjC,YAAY,OAAe,EAAE,UAAmB,EAAE,OAAiB;QAC/D,0CAA0C;QAC1C,MAAM,gBAAgB,GAAG,0BAA0B,OAAO,EAAE,CAAA;QAC5D,KAAK,CAAC,gBAAgB,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAI,QAA2B;IACzD,+DAA+D;IAC/D,IAAI,QAAQ,CAAC,KAAK,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjG,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QAE5C,iDAAiD;QACjD,IAAI,YAAY,GAAG,mBAAmB,CAAA;QACtC,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACrC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAA;QACjC,CAAC;aAAM,IAAI,QAAQ,CAAC,KAAK,IAAI,OAAO,QAAQ,CAAC,KAAK,KAA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AC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IACpF,CAAC;IAED,sDAAsD;IACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,qBAAqB;IACrB,OAAO,QAAQ,CAAC,IAAI,CAAA;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAI,QAAiC;IAC/D,IAAI,QAAQ,CAAC,KAAK,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjG,OAAO,cAAc,CAAC,QAA6B,CAAC,CAAA;IACxD,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,UAAU,CAAC,qBAAqB,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IACpF,CAAC;IAED,uFAAuF;IACvF,uFAAuF;IACvF,OAAO,QAAQ,CAAC,IAAS,CAAA;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recal-sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Recal SDK",
|
|
5
5
|
"author": "Recal <team@recal.dev>",
|
|
6
6
|
"contributors": ["tkoehlerlg", "jschwxrz"],
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"files": ["dist"],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
20
|
-
"test": "bun test tests",
|
|
21
|
-
"generate": "bun run openapi-ts.ts",
|
|
20
|
+
"test": "bun test tests --timeout 30000",
|
|
21
|
+
"generate": "bun run openapi-ts.ts && biome check --write src/client",
|
|
22
22
|
"typecheck": "tsc --noEmit",
|
|
23
23
|
"format": "biome format --fix",
|
|
24
24
|
"lint": "biome lint",
|