@playaos/api-client 0.12.0 → 0.13.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 +19 -0
- package/dist/applications-schema.d.ts +80 -79
- package/dist/applications-schema.js +83 -76
- package/dist/applications-schema.js.map +1 -1
- package/dist/index.d.ts +837 -629
- package/dist/index.js +415 -510
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
+
//#region src/error.d.ts
|
|
1
2
|
declare class ApiClientError extends Error {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly code: string;
|
|
5
|
+
/**
|
|
6
|
+
* Seconds to wait before retrying, parsed from a numeric `Retry-After`
|
|
7
|
+
* response header when the server sends one (commonly on 429 and 503).
|
|
8
|
+
* Undefined when the header is absent or in HTTP-date form.
|
|
9
|
+
*/
|
|
10
|
+
readonly retryAfter?: number | undefined;
|
|
11
|
+
constructor(status: number, code: string, message: string,
|
|
12
|
+
/**
|
|
13
|
+
* Seconds to wait before retrying, parsed from a numeric `Retry-After`
|
|
14
|
+
* response header when the server sends one (commonly on 429 and 503).
|
|
15
|
+
* Undefined when the header is absent or in HTTP-date form.
|
|
16
|
+
*/
|
|
17
|
+
retryAfter?: number | undefined);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/types.d.ts
|
|
19
21
|
/** Cursor-paginated list envelope returned by v1 list endpoints (PLA-779). */
|
|
20
22
|
interface Paginated<T> {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
data: T[];
|
|
24
|
+
/** Opaque cursor for the next page, or null when this is the last page. */
|
|
25
|
+
nextCursor: string | null;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Shared cursor-pagination request params for list methods. Declared as a `type`
|
|
@@ -28,674 +30,878 @@ interface Paginated<T> {
|
|
|
28
30
|
* stay assignable to `Record<string, …>` when serialized into a query string.
|
|
29
31
|
*/
|
|
30
32
|
type PaginationParams = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/** Max rows to return (1-100, default 50). */
|
|
34
|
+
limit?: number;
|
|
35
|
+
/** Opaque cursor from a previous response's nextCursor. */
|
|
36
|
+
cursor?: string;
|
|
35
37
|
};
|
|
36
38
|
interface Member {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
id: string;
|
|
40
|
+
firstName: string;
|
|
41
|
+
lastName: string;
|
|
42
|
+
name: string | null;
|
|
43
|
+
email: string;
|
|
44
|
+
phone?: string | null;
|
|
45
|
+
role: string | null;
|
|
46
|
+
status: string | null;
|
|
47
|
+
orgId: string;
|
|
48
|
+
createdAt: string | null;
|
|
49
|
+
bio?: string | null;
|
|
50
|
+
playaName?: string | null;
|
|
51
|
+
socialMedia?: Record<string, unknown> | null;
|
|
52
|
+
showSocialsInDirectory?: boolean;
|
|
53
|
+
profilePhotoPath?: string | null;
|
|
54
|
+
emergencyContactName?: string | null;
|
|
55
|
+
emergencyContactRelationship?: string | null;
|
|
56
|
+
emergencyContactPhone?: string | null;
|
|
57
|
+
yearJoined?: number | null;
|
|
56
58
|
}
|
|
57
59
|
interface Application {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
id: string;
|
|
61
|
+
userId: string;
|
|
62
|
+
orgId: string;
|
|
63
|
+
status: string | null;
|
|
64
|
+
year: number;
|
|
65
|
+
createdAt: string | null;
|
|
66
|
+
updatedAt: string | null;
|
|
67
|
+
email?: string | null;
|
|
68
|
+
firstName?: string | null;
|
|
69
|
+
lastName?: string | null;
|
|
70
|
+
submittedAt?: string | null;
|
|
71
|
+
whyJoin?: string | null;
|
|
72
|
+
howHeard?: string | null;
|
|
73
|
+
shelterType?: string | null;
|
|
74
|
+
burningManBefore?: boolean | null;
|
|
75
|
+
customFields?: Record<string, unknown> | null;
|
|
74
76
|
}
|
|
75
77
|
interface DuesStatus {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
userId: string | null;
|
|
79
|
+
year: number | null;
|
|
80
|
+
paymentStatus: string | null;
|
|
81
|
+
amountOwed: string | null;
|
|
82
|
+
amountPaid: string | null;
|
|
83
|
+
balance: string | null;
|
|
82
84
|
}
|
|
83
85
|
interface ShiftSignup {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
id: string;
|
|
87
|
+
userId: string;
|
|
88
|
+
status: string | null;
|
|
89
|
+
role: string | null;
|
|
88
90
|
}
|
|
89
91
|
interface ShiftType {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description: string | null;
|
|
93
95
|
}
|
|
94
96
|
interface Shift {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
id: string;
|
|
98
|
+
orgId: string;
|
|
99
|
+
shiftDate: string;
|
|
100
|
+
year: number;
|
|
101
|
+
startTime: string | null;
|
|
102
|
+
endTime: string | null;
|
|
103
|
+
maxSlots: number | null;
|
|
104
|
+
isPublished: boolean | null;
|
|
105
|
+
shiftType: ShiftType | null;
|
|
106
|
+
shiftSignups: ShiftSignup[];
|
|
105
107
|
}
|
|
106
108
|
interface OrgConfig {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
slug: string;
|
|
112
|
+
preset: string | null;
|
|
113
|
+
customDomain: string | null;
|
|
114
|
+
settings: Record<string, unknown> | null;
|
|
115
|
+
features: Record<string, unknown> | null;
|
|
116
|
+
plan: string | null;
|
|
117
|
+
logoUrl: string | null;
|
|
116
118
|
}
|
|
117
119
|
type CommitmentDataType = "integer" | "boolean";
|
|
118
120
|
type CommitmentValue = number | boolean;
|
|
119
121
|
/** An admin-configured commitment definition (per org + year) the apply form renders. */
|
|
120
122
|
interface Commitment {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
displayName: string;
|
|
126
|
+
description: string | null;
|
|
127
|
+
dataType: CommitmentDataType;
|
|
128
|
+
minValue: number | null;
|
|
129
|
+
maxValue: number | null;
|
|
128
130
|
}
|
|
129
131
|
interface CommitmentsListResponse {
|
|
130
|
-
|
|
132
|
+
commitments: Commitment[];
|
|
131
133
|
}
|
|
132
134
|
type ApplicationStatus = "draft" | "pending" | "invite_sent" | "interview_scheduled" | "interviewed" | "approved" | "waitlisted" | "rejected" | "spam";
|
|
133
135
|
type MemberRole = "member" | "admin" | "applicant" | "super_admin";
|
|
134
136
|
interface PaymentPageResponse {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
provider: "givebutter" | "crowded";
|
|
138
|
+
url: string;
|
|
139
|
+
modalSupported: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface Contact {
|
|
142
|
+
id: string;
|
|
143
|
+
name: string | null;
|
|
144
|
+
email: string | null;
|
|
145
|
+
phone: string | null;
|
|
146
|
+
role: string | null;
|
|
147
|
+
status: string | null;
|
|
148
|
+
}
|
|
149
|
+
interface NotificationLog {
|
|
150
|
+
id: string;
|
|
151
|
+
orgId: string;
|
|
152
|
+
userIds: string[];
|
|
153
|
+
category: string;
|
|
154
|
+
title: string;
|
|
155
|
+
body: string;
|
|
156
|
+
data: Record<string, unknown> | null;
|
|
157
|
+
status: string | null;
|
|
158
|
+
sentAt: string | null;
|
|
159
|
+
error: string | null;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
}
|
|
162
|
+
interface PaymentLedgerRow {
|
|
163
|
+
id: string;
|
|
164
|
+
memberId: string | null;
|
|
165
|
+
amount: string;
|
|
166
|
+
type: "dues" | "payment";
|
|
167
|
+
provider: "givebutter" | "crowded" | null;
|
|
168
|
+
status: string | null;
|
|
169
|
+
timestamp: string | null;
|
|
170
|
+
}
|
|
171
|
+
interface Account {
|
|
172
|
+
id: string;
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
}
|
|
175
|
+
interface CampDocument {
|
|
176
|
+
id: string;
|
|
177
|
+
orgId: string;
|
|
178
|
+
name: string;
|
|
179
|
+
description: string | null;
|
|
180
|
+
documentType: string;
|
|
181
|
+
year: number;
|
|
182
|
+
publishedAt: string | null;
|
|
183
|
+
}
|
|
184
|
+
interface Shelter {
|
|
185
|
+
id: string;
|
|
186
|
+
name: string | null;
|
|
187
|
+
shelterType: string;
|
|
188
|
+
year: number;
|
|
189
|
+
orgId: string;
|
|
190
|
+
}
|
|
191
|
+
interface Bike {
|
|
192
|
+
id: string;
|
|
193
|
+
bikeId: string;
|
|
194
|
+
status: string;
|
|
195
|
+
orgId: string;
|
|
196
|
+
}
|
|
197
|
+
interface MemberTag {
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
description: string | null;
|
|
201
|
+
color: string | null;
|
|
202
|
+
orgId: string;
|
|
203
|
+
}
|
|
204
|
+
interface MemberGroup {
|
|
205
|
+
id: string;
|
|
206
|
+
name: string | null;
|
|
207
|
+
leaderProfileId: string | null;
|
|
208
|
+
leaderName: string | null;
|
|
209
|
+
leaderEmail: string | null;
|
|
210
|
+
memberCount: number;
|
|
211
|
+
createdAt: string | null;
|
|
212
|
+
}
|
|
213
|
+
interface MemberGroupRosterRow {
|
|
214
|
+
membershipId: string;
|
|
215
|
+
profileId: string;
|
|
216
|
+
role: string;
|
|
217
|
+
status: string;
|
|
218
|
+
name: string | null;
|
|
219
|
+
firstName: string | null;
|
|
220
|
+
lastName: string | null;
|
|
221
|
+
email: string | null;
|
|
222
|
+
profileStatus: string | null;
|
|
138
223
|
}
|
|
139
224
|
interface ApplicationCreatePayload {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
225
|
+
acknowledged_expectations?: true;
|
|
226
|
+
first_name: string;
|
|
227
|
+
last_name: string;
|
|
228
|
+
email: string;
|
|
229
|
+
phone?: string;
|
|
230
|
+
referral_code?: string;
|
|
231
|
+
socials?: string;
|
|
232
|
+
birthday?: string;
|
|
233
|
+
hometown?: string;
|
|
234
|
+
how_heard?: string;
|
|
235
|
+
burning_man_before?: "yes" | "no";
|
|
236
|
+
burning_man_years?: string;
|
|
237
|
+
shelter_type?: "joining_rv" | "bringing_rv" | "shiftpod_tent" | "car" | "truck" | "van" | "unsure";
|
|
238
|
+
shelter_mates?: string;
|
|
239
|
+
ticket_status?: "looking" | "have_ticket" | "unsure";
|
|
240
|
+
build_available?: boolean;
|
|
241
|
+
build_skills?: string;
|
|
242
|
+
strike_available?: boolean;
|
|
243
|
+
strike_help?: string;
|
|
244
|
+
about_yourself?: string;
|
|
245
|
+
agrees_to_principles?: true;
|
|
246
|
+
/** commitmentId → value (integer or boolean per the commitment dataType), collected at apply (PLA-682). */
|
|
247
|
+
commitments?: Record<string, number | boolean>;
|
|
248
|
+
custom_fields?: Record<string, unknown>;
|
|
164
249
|
}
|
|
165
250
|
interface ApplicationCreateResponse {
|
|
166
|
-
|
|
167
|
-
|
|
251
|
+
applicationId: string;
|
|
252
|
+
status: string;
|
|
168
253
|
}
|
|
169
254
|
interface ApplicationTransitionPayload {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
255
|
+
to: ApplicationStatus;
|
|
256
|
+
rejectionReason?: string;
|
|
257
|
+
/** When true, sends a templated email to the applicant (PLA-710). */
|
|
258
|
+
notify?: boolean;
|
|
174
259
|
}
|
|
175
260
|
interface ApplicationTransitionResponse {
|
|
176
|
-
|
|
177
|
-
|
|
261
|
+
applicationId: string;
|
|
262
|
+
status: ApplicationStatus;
|
|
178
263
|
}
|
|
179
264
|
interface MemberCreatePayload {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
265
|
+
firstName: string;
|
|
266
|
+
lastName: string;
|
|
267
|
+
email: string;
|
|
268
|
+
phone?: string | null;
|
|
269
|
+
role?: "member" | "admin" | "super_admin";
|
|
270
|
+
status?: string;
|
|
186
271
|
}
|
|
187
272
|
interface MemberCreateResponse {
|
|
188
|
-
|
|
273
|
+
profileId: string;
|
|
189
274
|
}
|
|
190
275
|
interface MemberUpdatePayload {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
276
|
+
firstName?: string;
|
|
277
|
+
lastName?: string;
|
|
278
|
+
phone?: string | null;
|
|
194
279
|
}
|
|
195
280
|
interface MemberUpdateResponse {
|
|
196
|
-
|
|
281
|
+
profileId: string;
|
|
197
282
|
}
|
|
198
283
|
interface MemberDeactivateResponse {
|
|
199
|
-
|
|
200
|
-
|
|
284
|
+
profileId: string;
|
|
285
|
+
status: "inactive";
|
|
201
286
|
}
|
|
202
287
|
interface WaiverSection {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
288
|
+
id: string;
|
|
289
|
+
heading: string;
|
|
290
|
+
body: string;
|
|
291
|
+
required: boolean;
|
|
207
292
|
}
|
|
208
293
|
interface WaiverContent {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
294
|
+
title: string;
|
|
295
|
+
sections: WaiverSection[];
|
|
296
|
+
effectiveDate?: string;
|
|
297
|
+
orgFields?: {
|
|
298
|
+
campName?: string;
|
|
299
|
+
eventYear?: number;
|
|
300
|
+
};
|
|
216
301
|
}
|
|
217
302
|
interface Waiver {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
303
|
+
id: string;
|
|
304
|
+
version: number;
|
|
305
|
+
name: string;
|
|
306
|
+
year: number;
|
|
307
|
+
content: WaiverContent;
|
|
223
308
|
}
|
|
224
309
|
interface WaiverStatus {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
310
|
+
waiverId: string;
|
|
311
|
+
version: number;
|
|
312
|
+
signed: boolean;
|
|
313
|
+
signedAt: string | null;
|
|
314
|
+
signatureId: string | null;
|
|
230
315
|
}
|
|
231
316
|
interface WaiverSignPayload {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
317
|
+
waiverId: string;
|
|
318
|
+
applicationId: string;
|
|
319
|
+
signerName: string;
|
|
320
|
+
/** base64 PNG data URL — required (drawn-canvas signature). */
|
|
321
|
+
signatureImageData: string;
|
|
237
322
|
}
|
|
238
323
|
interface WaiverSignResponse {
|
|
239
|
-
|
|
324
|
+
signatureId: string;
|
|
240
325
|
}
|
|
241
326
|
interface ApplicationNote {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
327
|
+
id: string;
|
|
328
|
+
authorId: string;
|
|
329
|
+
authorName: string | null;
|
|
330
|
+
body: string;
|
|
331
|
+
createdAt: string;
|
|
247
332
|
}
|
|
248
333
|
interface ApplicationScore {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
334
|
+
adminId: string;
|
|
335
|
+
adminName: string | null;
|
|
336
|
+
value: number;
|
|
337
|
+
updatedAt: string;
|
|
253
338
|
}
|
|
254
339
|
interface ApplicationAnnotations {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
340
|
+
notes: ApplicationNote[];
|
|
341
|
+
tags: string[];
|
|
342
|
+
scores: ApplicationScore[];
|
|
258
343
|
}
|
|
259
344
|
interface AnnouncementSendPayload {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
345
|
+
subject: string;
|
|
346
|
+
body: string;
|
|
347
|
+
filters?: {
|
|
348
|
+
role?: string;
|
|
349
|
+
status?: string;
|
|
350
|
+
shiftTypeId?: string;
|
|
351
|
+
};
|
|
352
|
+
dryRun?: boolean;
|
|
268
353
|
}
|
|
269
354
|
interface AnnouncementSendResponse {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
355
|
+
sent: number;
|
|
356
|
+
recipients: {
|
|
357
|
+
name: string | null;
|
|
358
|
+
email: string;
|
|
359
|
+
}[];
|
|
275
360
|
}
|
|
276
361
|
interface DuesCreatePayload {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
362
|
+
userId: string;
|
|
363
|
+
amount: number;
|
|
364
|
+
paymentMethod?: string;
|
|
365
|
+
duesCollectionId?: string;
|
|
281
366
|
}
|
|
282
367
|
interface DuesCreateResponse {
|
|
283
|
-
|
|
368
|
+
paymentId: string;
|
|
284
369
|
}
|
|
285
370
|
interface DuesUpdatePayload {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
371
|
+
amount?: number;
|
|
372
|
+
paymentStatus?: string;
|
|
373
|
+
paymentMethod?: string;
|
|
289
374
|
}
|
|
290
375
|
interface DuesUpdateResponse {
|
|
291
|
-
|
|
376
|
+
paymentId: string;
|
|
292
377
|
}
|
|
293
378
|
interface OrgUpdatePayload {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
379
|
+
name?: string;
|
|
380
|
+
logoUrl?: string | null;
|
|
381
|
+
tagline?: string | null;
|
|
382
|
+
description?: string | null;
|
|
383
|
+
settings?: Record<string, unknown> | null;
|
|
384
|
+
features?: Record<string, unknown> | null;
|
|
300
385
|
}
|
|
301
386
|
interface OrgUpdateResponse {
|
|
302
|
-
|
|
387
|
+
orgId: string;
|
|
303
388
|
}
|
|
304
389
|
interface ApplicationEvent {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
390
|
+
id: string;
|
|
391
|
+
applicationId: string;
|
|
392
|
+
actorId: string | null;
|
|
393
|
+
actorName: string | null;
|
|
394
|
+
type: "status_change" | "note_added" | "tags_updated" | "score_set";
|
|
395
|
+
timestamp: string;
|
|
396
|
+
fromStatus?: string | null;
|
|
397
|
+
toStatus?: string;
|
|
398
|
+
metadata?: Record<string, unknown>;
|
|
314
399
|
}
|
|
315
400
|
interface ApplicationHistoryResponse {
|
|
316
|
-
|
|
401
|
+
events: ApplicationEvent[];
|
|
317
402
|
}
|
|
318
403
|
interface AvailabilityWindow {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
404
|
+
dayOfWeek: number;
|
|
405
|
+
startTime: string;
|
|
406
|
+
endTime: string;
|
|
322
407
|
}
|
|
323
408
|
interface SetAvailabilityInput {
|
|
324
|
-
|
|
409
|
+
windows: AvailabilityWindow[];
|
|
325
410
|
}
|
|
326
411
|
interface SetAvailabilityResponse {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
412
|
+
windows: {
|
|
413
|
+
count: number;
|
|
414
|
+
};
|
|
330
415
|
}
|
|
331
416
|
interface CreateBookingTokenInput {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
417
|
+
applicationId: string;
|
|
418
|
+
bookingLinkId: string;
|
|
419
|
+
expiresAt?: string;
|
|
335
420
|
}
|
|
336
421
|
interface BookingToken {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
422
|
+
id: string;
|
|
423
|
+
applicationId: string;
|
|
424
|
+
token: string;
|
|
425
|
+
url: string;
|
|
426
|
+
expiresAt: string | null;
|
|
427
|
+
createdAt: string | null;
|
|
343
428
|
}
|
|
344
429
|
interface BookSlotInput {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
430
|
+
slotUtcStart: string;
|
|
431
|
+
name: string;
|
|
432
|
+
email: string;
|
|
433
|
+
interviewerId?: string;
|
|
434
|
+
timezone?: string;
|
|
350
435
|
}
|
|
351
436
|
interface BookSlotResponse {
|
|
352
|
-
|
|
353
|
-
|
|
437
|
+
bookingId: string;
|
|
438
|
+
applicationStatus: string;
|
|
354
439
|
}
|
|
355
440
|
interface RescheduleInput {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
441
|
+
slotUtcStart: string;
|
|
442
|
+
interviewerId?: string;
|
|
443
|
+
timezone?: string;
|
|
359
444
|
}
|
|
360
445
|
interface CalendarStatus {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
446
|
+
connected: boolean;
|
|
447
|
+
provider: string;
|
|
448
|
+
calendarId: string | null;
|
|
449
|
+
calendarName?: string | null;
|
|
365
450
|
}
|
|
366
451
|
interface GoogleCalendar {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
452
|
+
id: string;
|
|
453
|
+
summary: string;
|
|
454
|
+
primary?: boolean;
|
|
370
455
|
}
|
|
371
456
|
interface SelectCalendarInput {
|
|
372
|
-
|
|
373
|
-
|
|
457
|
+
calendarId: string;
|
|
458
|
+
calendarName?: string;
|
|
374
459
|
}
|
|
375
|
-
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/client.d.ts
|
|
376
462
|
interface ClientOptions {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
463
|
+
/** Base URL for authenticated /api/v1 routes, e.g. https://api.playaos.app */
|
|
464
|
+
baseUrl: string;
|
|
465
|
+
/** Optional base URL for /api/embed/v1 routes when they live on a different host. */
|
|
466
|
+
embedBaseUrl?: string;
|
|
467
|
+
/** API key in the format pk_live_* */
|
|
468
|
+
apiKey: string;
|
|
469
|
+
/**
|
|
470
|
+
* Supabase session JWT of the acting member, sent as `X-PlayaOS-Member-Token`
|
|
471
|
+
* on every /api/v1 call (PLA-1195). Member-scoped endpoints (a member's own
|
|
472
|
+
* dues, payments, application, shelter, shifts signup, …) require it and
|
|
473
|
+
* return 401 without it. Org-level endpoints do not require it, but a token
|
|
474
|
+
* that is sent must still verify — an expired or invalid one is a 401 on any
|
|
475
|
+
* /api/v1 route that installs the member middleware. Prefer
|
|
476
|
+
* `client.withMember(token)` to derive a per-request client from a shared
|
|
477
|
+
* server-side one rather than constructing a client per user.
|
|
478
|
+
*/
|
|
479
|
+
memberToken?: string;
|
|
383
480
|
}
|
|
384
481
|
declare class PlayaOSClient {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
482
|
+
private readonly baseUrl;
|
|
483
|
+
private readonly embedBaseUrl;
|
|
484
|
+
private readonly apiKey;
|
|
485
|
+
private readonly memberToken;
|
|
486
|
+
constructor(opts: ClientOptions);
|
|
487
|
+
/** Credentials for /api/v1 calls; the embed surface uses `apiKey` alone as the camp key. */
|
|
488
|
+
private get auth();
|
|
489
|
+
/**
|
|
490
|
+
* Derive a client that acts as one member (PLA-1195): same host and org key,
|
|
491
|
+
* plus the member's Supabase session JWT on every /api/v1 call. Use this in a
|
|
492
|
+
* server that holds one org key and serves many signed-in members.
|
|
493
|
+
*/
|
|
494
|
+
withMember(memberToken: string): PlayaOSClient;
|
|
495
|
+
readonly members: {
|
|
496
|
+
list: (params?: {
|
|
497
|
+
role?: MemberRole;
|
|
498
|
+
status?: string;
|
|
499
|
+
} & PaginationParams, opts?: {
|
|
500
|
+
signal?: AbortSignal;
|
|
501
|
+
}) => Promise<Paginated<Member>>;
|
|
502
|
+
/**
|
|
503
|
+
* Full profile (phone, emergency contact). Requires a member token; pass
|
|
504
|
+
* `"me"` for the acting member — non-admins may fetch only themselves.
|
|
505
|
+
*/
|
|
506
|
+
get: (id: string, opts?: {
|
|
507
|
+
signal?: AbortSignal;
|
|
508
|
+
}) => Promise<Member>;
|
|
509
|
+
/** Member-self profile update (PLA-700). Requires camp key + member Bearer token. */
|
|
510
|
+
selfUpdate: (payload: {
|
|
511
|
+
bio?: string | null;
|
|
512
|
+
playaName?: string | null;
|
|
513
|
+
socialMedia?: Record<string, unknown> | null;
|
|
514
|
+
showSocialsInDirectory?: boolean;
|
|
515
|
+
phone?: string | null;
|
|
516
|
+
emergencyContactName?: string | null;
|
|
517
|
+
emergencyContactRelationship?: string | null;
|
|
518
|
+
emergencyContactPhone?: string | null;
|
|
519
|
+
profilePhotoPath?: string | null;
|
|
520
|
+
yearJoined?: number | null;
|
|
521
|
+
}, opts: {
|
|
522
|
+
accessToken: string;
|
|
523
|
+
signal?: AbortSignal;
|
|
524
|
+
}) => Promise<{
|
|
525
|
+
profileId: string;
|
|
526
|
+
}>;
|
|
527
|
+
/** Member-self shift signup + cancel (PLA-705). Requires camp key + member Bearer. */
|
|
528
|
+
shifts: {
|
|
529
|
+
signup: (payload: {
|
|
530
|
+
shiftId: string;
|
|
531
|
+
role?: string;
|
|
532
|
+
}, opts: {
|
|
533
|
+
accessToken: string;
|
|
534
|
+
signal?: AbortSignal;
|
|
535
|
+
}) => Promise<{
|
|
536
|
+
signupId: string;
|
|
537
|
+
waitlisted: boolean;
|
|
538
|
+
}>;
|
|
539
|
+
cancel: (signupId: string, opts: {
|
|
540
|
+
accessToken: string;
|
|
541
|
+
signal?: AbortSignal;
|
|
542
|
+
}) => Promise<{
|
|
543
|
+
canceled: boolean;
|
|
544
|
+
promotedSignupId: string | null;
|
|
545
|
+
}>;
|
|
437
546
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
547
|
+
};
|
|
548
|
+
readonly applications: {
|
|
549
|
+
list: (params?: {
|
|
550
|
+
status?: ApplicationStatus;
|
|
551
|
+
year?: number;
|
|
552
|
+
} & PaginationParams, opts?: {
|
|
553
|
+
signal?: AbortSignal;
|
|
554
|
+
}) => Promise<Paginated<Application>>;
|
|
555
|
+
create: (payload: ApplicationCreatePayload, opts?: {
|
|
556
|
+
accessToken?: string;
|
|
557
|
+
signal?: AbortSignal;
|
|
558
|
+
}) => Promise<ApplicationCreateResponse>;
|
|
559
|
+
};
|
|
560
|
+
readonly waivers: {
|
|
561
|
+
/** Get the active waiver for an org for the current year. */
|
|
562
|
+
active: (orgId: string, opts?: {
|
|
563
|
+
signal?: AbortSignal;
|
|
564
|
+
}) => Promise<Waiver>;
|
|
565
|
+
/** Sign a waiver. Requires X-Camp-Key; optional accessToken for Bearer path. */
|
|
566
|
+
sign: (payload: WaiverSignPayload, opts?: {
|
|
567
|
+
accessToken?: string;
|
|
568
|
+
signal?: AbortSignal;
|
|
569
|
+
}) => Promise<WaiverSignResponse>;
|
|
570
|
+
/** Has this applicant/member signed the active waiver? Anchor: applicationId query or Bearer accessToken. */
|
|
571
|
+
status: (orgId: string, opts?: {
|
|
572
|
+
applicationId?: string;
|
|
573
|
+
accessToken?: string;
|
|
574
|
+
signal?: AbortSignal;
|
|
575
|
+
}) => Promise<WaiverStatus>;
|
|
576
|
+
/** Get a short-lived download URL for a completed signature's PDF. Anchor: applicationId query or Bearer. */
|
|
577
|
+
signedPdf: (orgId: string, signatureId: string, opts?: {
|
|
578
|
+
applicationId?: string;
|
|
579
|
+
accessToken?: string;
|
|
580
|
+
signal?: AbortSignal;
|
|
581
|
+
}) => Promise<{
|
|
582
|
+
url: string;
|
|
583
|
+
}>;
|
|
584
|
+
};
|
|
585
|
+
readonly dues: {
|
|
586
|
+
list: (params?: {
|
|
587
|
+
userId?: string;
|
|
588
|
+
year?: number;
|
|
589
|
+
paymentStatus?: "unpaid" | "partial" | "paid";
|
|
590
|
+
} & PaginationParams, opts?: {
|
|
591
|
+
signal?: AbortSignal;
|
|
592
|
+
}) => Promise<Paginated<DuesStatus>>;
|
|
593
|
+
};
|
|
594
|
+
readonly shifts: {
|
|
595
|
+
list: (params?: {
|
|
596
|
+
year?: number;
|
|
597
|
+
fromDate?: string;
|
|
598
|
+
toDate?: string;
|
|
599
|
+
publishedOnly?: boolean;
|
|
600
|
+
openOnly?: boolean;
|
|
601
|
+
} & PaginationParams, opts?: {
|
|
602
|
+
signal?: AbortSignal;
|
|
603
|
+
}) => Promise<Paginated<Shift>>;
|
|
604
|
+
};
|
|
605
|
+
readonly org: {
|
|
606
|
+
get: (opts?: {
|
|
607
|
+
signal?: AbortSignal;
|
|
608
|
+
}) => Promise<OrgConfig>;
|
|
609
|
+
};
|
|
610
|
+
readonly commitments: {
|
|
611
|
+
list: (opts?: {
|
|
612
|
+
signal?: AbortSignal;
|
|
613
|
+
}) => Promise<CommitmentsListResponse>;
|
|
614
|
+
};
|
|
615
|
+
readonly payments: {
|
|
616
|
+
list: (params?: {
|
|
617
|
+
type?: "dues" | "payment";
|
|
618
|
+
memberId?: string;
|
|
619
|
+
from?: string;
|
|
620
|
+
to?: string;
|
|
621
|
+
limit?: number;
|
|
622
|
+
offset?: number;
|
|
623
|
+
}, opts?: {
|
|
624
|
+
signal?: AbortSignal;
|
|
625
|
+
}) => Promise<PaymentLedgerRow[]>;
|
|
626
|
+
/** Requires a member token. `memberId` may be omitted by a non-admin (defaults to themselves); admins must pass it. */
|
|
627
|
+
page: (memberId?: string, duesCollectionId?: string, opts?: {
|
|
628
|
+
signal?: AbortSignal;
|
|
629
|
+
}) => Promise<PaymentPageResponse>;
|
|
630
|
+
};
|
|
631
|
+
readonly accounts: {
|
|
632
|
+
list: (params?: {
|
|
633
|
+
limit?: number;
|
|
634
|
+
offset?: number;
|
|
635
|
+
}, opts?: {
|
|
636
|
+
signal?: AbortSignal;
|
|
637
|
+
}) => Promise<Account[]>;
|
|
638
|
+
};
|
|
639
|
+
readonly contacts: {
|
|
640
|
+
list: (params?: {
|
|
641
|
+
role?: MemberRole;
|
|
642
|
+
status?: string;
|
|
643
|
+
search?: string;
|
|
644
|
+
sort?: "name" | "email";
|
|
645
|
+
limit?: number;
|
|
646
|
+
offset?: number;
|
|
647
|
+
}, opts?: {
|
|
648
|
+
signal?: AbortSignal;
|
|
649
|
+
}) => Promise<Contact[]>;
|
|
650
|
+
};
|
|
651
|
+
readonly notifications: {
|
|
652
|
+
list: (params?: {
|
|
653
|
+
category?: string;
|
|
654
|
+
status?: string;
|
|
655
|
+
recipientId?: string;
|
|
656
|
+
limit?: number;
|
|
657
|
+
}, opts?: {
|
|
658
|
+
signal?: AbortSignal;
|
|
659
|
+
}) => Promise<NotificationLog[]>;
|
|
660
|
+
};
|
|
661
|
+
readonly documents: {
|
|
662
|
+
list: (params?: {
|
|
663
|
+
type?: string;
|
|
664
|
+
year?: number;
|
|
665
|
+
}, opts?: {
|
|
666
|
+
signal?: AbortSignal;
|
|
667
|
+
}) => Promise<CampDocument[]>;
|
|
668
|
+
get: (id: string, opts?: {
|
|
669
|
+
signal?: AbortSignal;
|
|
670
|
+
}) => Promise<CampDocument>;
|
|
671
|
+
};
|
|
672
|
+
readonly shelters: {
|
|
673
|
+
list: (params?: {
|
|
674
|
+
ownerId?: string;
|
|
675
|
+
shelterType?: string;
|
|
676
|
+
year?: number;
|
|
677
|
+
}, opts?: {
|
|
678
|
+
signal?: AbortSignal;
|
|
679
|
+
}) => Promise<Shelter[]>;
|
|
680
|
+
get: (id: string, opts?: {
|
|
681
|
+
signal?: AbortSignal;
|
|
682
|
+
}) => Promise<Shelter>;
|
|
683
|
+
};
|
|
684
|
+
readonly bikes: {
|
|
685
|
+
list: (params?: {
|
|
686
|
+
status?: string;
|
|
687
|
+
}, opts?: {
|
|
688
|
+
signal?: AbortSignal;
|
|
689
|
+
}) => Promise<Bike[]>;
|
|
690
|
+
get: (id: string, opts?: {
|
|
691
|
+
signal?: AbortSignal;
|
|
692
|
+
}) => Promise<Bike>;
|
|
693
|
+
};
|
|
694
|
+
readonly tags: {
|
|
695
|
+
list: (opts?: {
|
|
696
|
+
signal?: AbortSignal;
|
|
697
|
+
}) => Promise<MemberTag[]>;
|
|
698
|
+
};
|
|
699
|
+
readonly groups: {
|
|
700
|
+
list: (opts?: {
|
|
701
|
+
signal?: AbortSignal;
|
|
702
|
+
}) => Promise<MemberGroup[]>;
|
|
703
|
+
get: (id: string, opts?: {
|
|
704
|
+
signal?: AbortSignal;
|
|
705
|
+
}) => Promise<MemberGroupRosterRow[]>;
|
|
706
|
+
create: (payload: {
|
|
707
|
+
name: string;
|
|
708
|
+
leaderProfileId: string;
|
|
709
|
+
}, opts?: {
|
|
710
|
+
signal?: AbortSignal;
|
|
711
|
+
}) => Promise<{
|
|
712
|
+
id: string;
|
|
713
|
+
}>;
|
|
714
|
+
};
|
|
715
|
+
readonly admin: {
|
|
716
|
+
applications: {
|
|
717
|
+
/** Get application audit timeline (PLA-712). Requires admin Bearer token. */
|
|
718
|
+
history: (id: string, opts: {
|
|
719
|
+
accessToken: string;
|
|
720
|
+
signal?: AbortSignal;
|
|
721
|
+
}) => Promise<ApplicationHistoryResponse>;
|
|
722
|
+
transition: (id: string, payload: ApplicationTransitionPayload, opts: {
|
|
723
|
+
accessToken: string;
|
|
724
|
+
signal?: AbortSignal;
|
|
725
|
+
}) => Promise<ApplicationTransitionResponse>;
|
|
726
|
+
getAnnotations: (id: string, opts: {
|
|
727
|
+
accessToken: string;
|
|
728
|
+
signal?: AbortSignal;
|
|
729
|
+
}) => Promise<ApplicationAnnotations>;
|
|
730
|
+
addNote: (id: string, payload: {
|
|
731
|
+
body: string;
|
|
732
|
+
}, opts: {
|
|
733
|
+
accessToken: string;
|
|
734
|
+
signal?: AbortSignal;
|
|
735
|
+
}) => Promise<ApplicationNote>;
|
|
736
|
+
setTags: (id: string, payload: {
|
|
737
|
+
tags: string[];
|
|
738
|
+
}, opts: {
|
|
739
|
+
accessToken: string;
|
|
740
|
+
signal?: AbortSignal;
|
|
741
|
+
}) => Promise<string[]>;
|
|
742
|
+
setScore: (id: string, payload: {
|
|
743
|
+
value: number;
|
|
744
|
+
}, opts: {
|
|
745
|
+
accessToken: string;
|
|
746
|
+
signal?: AbortSignal;
|
|
747
|
+
}) => Promise<ApplicationScore>;
|
|
449
748
|
};
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
749
|
+
givebutter: {
|
|
750
|
+
campaigns: {
|
|
751
|
+
list: (opts: {
|
|
752
|
+
accessToken: string;
|
|
753
|
+
signal?: AbortSignal;
|
|
754
|
+
}) => Promise<unknown[]>;
|
|
755
|
+
discountCodes: {
|
|
756
|
+
list: (campaignId: number, opts: {
|
|
757
|
+
accessToken: string;
|
|
458
758
|
signal?: AbortSignal;
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
759
|
+
}) => Promise<unknown[]>;
|
|
760
|
+
create: (campaignId: number, payload: {
|
|
761
|
+
code: string;
|
|
762
|
+
value: number;
|
|
763
|
+
type: "percent" | "fixed";
|
|
764
|
+
expirationDate?: string;
|
|
765
|
+
}, opts: {
|
|
766
|
+
accessToken: string;
|
|
464
767
|
signal?: AbortSignal;
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
768
|
+
}) => Promise<unknown>;
|
|
769
|
+
};
|
|
770
|
+
tickets: {
|
|
771
|
+
create: (campaignId: number, payload: {
|
|
772
|
+
name: string;
|
|
773
|
+
price: number;
|
|
774
|
+
totalQuantity?: number;
|
|
775
|
+
}, opts: {
|
|
776
|
+
accessToken: string;
|
|
470
777
|
signal?: AbortSignal;
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
778
|
+
}) => Promise<unknown>;
|
|
779
|
+
};
|
|
780
|
+
};
|
|
474
781
|
};
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
782
|
+
members: {
|
|
783
|
+
create: (payload: MemberCreatePayload, opts: {
|
|
784
|
+
accessToken: string;
|
|
785
|
+
signal?: AbortSignal;
|
|
786
|
+
}) => Promise<MemberCreateResponse>;
|
|
787
|
+
update: (id: string, patch: MemberUpdatePayload, opts: {
|
|
788
|
+
accessToken: string;
|
|
789
|
+
signal?: AbortSignal;
|
|
790
|
+
}) => Promise<MemberUpdateResponse>;
|
|
791
|
+
deactivate: (id: string, opts: {
|
|
792
|
+
accessToken: string;
|
|
793
|
+
signal?: AbortSignal;
|
|
794
|
+
}) => Promise<MemberDeactivateResponse>;
|
|
483
795
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
openOnly?: boolean;
|
|
491
|
-
} & PaginationParams, opts?: {
|
|
492
|
-
signal?: AbortSignal;
|
|
493
|
-
}) => Promise<Paginated<Shift>>;
|
|
796
|
+
announcements: {
|
|
797
|
+
/** Send an email blast to camp members (PLA-706). Requires admin Bearer token. */
|
|
798
|
+
send: (payload: AnnouncementSendPayload, opts: {
|
|
799
|
+
accessToken: string;
|
|
800
|
+
signal?: AbortSignal;
|
|
801
|
+
}) => Promise<AnnouncementSendResponse>;
|
|
494
802
|
};
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
803
|
+
dues: {
|
|
804
|
+
/** Create a manual dues/payment record (PLA-708). Requires admin Bearer token. */
|
|
805
|
+
create: (payload: DuesCreatePayload, opts: {
|
|
806
|
+
accessToken: string;
|
|
807
|
+
signal?: AbortSignal;
|
|
808
|
+
}) => Promise<DuesCreateResponse>;
|
|
809
|
+
/** Update a dues/payment record (PLA-708). Requires admin Bearer token. */
|
|
810
|
+
update: (id: string, payload: DuesUpdatePayload, opts: {
|
|
811
|
+
accessToken: string;
|
|
812
|
+
signal?: AbortSignal;
|
|
813
|
+
}) => Promise<DuesUpdateResponse>;
|
|
499
814
|
};
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
815
|
+
org: {
|
|
816
|
+
/** Update camp configuration settings (PLA-709). Requires admin Bearer token. */
|
|
817
|
+
update: (payload: OrgUpdatePayload, opts: {
|
|
818
|
+
accessToken: string;
|
|
819
|
+
signal?: AbortSignal;
|
|
820
|
+
}) => Promise<OrgUpdateResponse>;
|
|
504
821
|
};
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
accessToken: string;
|
|
529
|
-
signal?: AbortSignal;
|
|
530
|
-
}) => Promise<ApplicationNote>;
|
|
531
|
-
setTags: (id: string, payload: {
|
|
532
|
-
tags: string[];
|
|
533
|
-
}, opts: {
|
|
534
|
-
accessToken: string;
|
|
535
|
-
signal?: AbortSignal;
|
|
536
|
-
}) => Promise<string[]>;
|
|
537
|
-
setScore: (id: string, payload: {
|
|
538
|
-
value: number;
|
|
539
|
-
}, opts: {
|
|
540
|
-
accessToken: string;
|
|
541
|
-
signal?: AbortSignal;
|
|
542
|
-
}) => Promise<ApplicationScore>;
|
|
543
|
-
};
|
|
544
|
-
givebutter: {
|
|
545
|
-
campaigns: {
|
|
546
|
-
list: (opts: {
|
|
547
|
-
accessToken: string;
|
|
548
|
-
signal?: AbortSignal;
|
|
549
|
-
}) => Promise<unknown[]>;
|
|
550
|
-
discountCodes: {
|
|
551
|
-
list: (campaignId: number, opts: {
|
|
552
|
-
accessToken: string;
|
|
553
|
-
signal?: AbortSignal;
|
|
554
|
-
}) => Promise<unknown[]>;
|
|
555
|
-
create: (campaignId: number, payload: {
|
|
556
|
-
code: string;
|
|
557
|
-
value: number;
|
|
558
|
-
type: "percent" | "fixed";
|
|
559
|
-
expirationDate?: string;
|
|
560
|
-
}, opts: {
|
|
561
|
-
accessToken: string;
|
|
562
|
-
signal?: AbortSignal;
|
|
563
|
-
}) => Promise<unknown>;
|
|
564
|
-
};
|
|
565
|
-
tickets: {
|
|
566
|
-
create: (campaignId: number, payload: {
|
|
567
|
-
name: string;
|
|
568
|
-
price: number;
|
|
569
|
-
totalQuantity?: number;
|
|
570
|
-
}, opts: {
|
|
571
|
-
accessToken: string;
|
|
572
|
-
signal?: AbortSignal;
|
|
573
|
-
}) => Promise<unknown>;
|
|
574
|
-
};
|
|
575
|
-
};
|
|
576
|
-
};
|
|
577
|
-
members: {
|
|
578
|
-
create: (payload: MemberCreatePayload, opts: {
|
|
579
|
-
accessToken: string;
|
|
580
|
-
signal?: AbortSignal;
|
|
581
|
-
}) => Promise<MemberCreateResponse>;
|
|
582
|
-
update: (id: string, patch: MemberUpdatePayload, opts: {
|
|
583
|
-
accessToken: string;
|
|
584
|
-
signal?: AbortSignal;
|
|
585
|
-
}) => Promise<MemberUpdateResponse>;
|
|
586
|
-
deactivate: (id: string, opts: {
|
|
587
|
-
accessToken: string;
|
|
588
|
-
signal?: AbortSignal;
|
|
589
|
-
}) => Promise<MemberDeactivateResponse>;
|
|
590
|
-
};
|
|
591
|
-
announcements: {
|
|
592
|
-
/** Send an email blast to camp members (PLA-706). Requires admin Bearer token. */
|
|
593
|
-
send: (payload: AnnouncementSendPayload, opts: {
|
|
594
|
-
accessToken: string;
|
|
595
|
-
signal?: AbortSignal;
|
|
596
|
-
}) => Promise<AnnouncementSendResponse>;
|
|
597
|
-
};
|
|
598
|
-
dues: {
|
|
599
|
-
/** Create a manual dues/payment record (PLA-708). Requires admin Bearer token. */
|
|
600
|
-
create: (payload: DuesCreatePayload, opts: {
|
|
601
|
-
accessToken: string;
|
|
602
|
-
signal?: AbortSignal;
|
|
603
|
-
}) => Promise<DuesCreateResponse>;
|
|
604
|
-
/** Update a dues/payment record (PLA-708). Requires admin Bearer token. */
|
|
605
|
-
update: (id: string, payload: DuesUpdatePayload, opts: {
|
|
606
|
-
accessToken: string;
|
|
607
|
-
signal?: AbortSignal;
|
|
608
|
-
}) => Promise<DuesUpdateResponse>;
|
|
609
|
-
};
|
|
610
|
-
org: {
|
|
611
|
-
/** Update camp configuration settings (PLA-709). Requires admin Bearer token. */
|
|
612
|
-
update: (payload: OrgUpdatePayload, opts: {
|
|
613
|
-
accessToken: string;
|
|
614
|
-
signal?: AbortSignal;
|
|
615
|
-
}) => Promise<OrgUpdateResponse>;
|
|
616
|
-
};
|
|
617
|
-
scheduling: {
|
|
618
|
-
availability: {
|
|
619
|
-
/** Get interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
|
|
620
|
-
get: (interviewerId: string, opts: {
|
|
621
|
-
accessToken: string;
|
|
622
|
-
signal?: AbortSignal;
|
|
623
|
-
}) => Promise<SetAvailabilityResponse>;
|
|
624
|
-
/** Set interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
|
|
625
|
-
set: (interviewerId: string, payload: SetAvailabilityInput, opts: {
|
|
626
|
-
accessToken: string;
|
|
627
|
-
signal?: AbortSignal;
|
|
628
|
-
}) => Promise<SetAvailabilityResponse>;
|
|
629
|
-
};
|
|
630
|
-
calendar: {
|
|
631
|
-
/** Get Google Calendar connection status for an interviewer (PLA-726). Requires admin Bearer. */
|
|
632
|
-
status: (interviewerId: string, opts: {
|
|
633
|
-
accessToken: string;
|
|
634
|
-
signal?: AbortSignal;
|
|
635
|
-
}) => Promise<CalendarStatus>;
|
|
636
|
-
/** List available Google Calendars (PLA-726). Requires admin Bearer. */
|
|
637
|
-
listCalendars: (interviewerId: string, opts: {
|
|
638
|
-
accessToken: string;
|
|
639
|
-
signal?: AbortSignal;
|
|
640
|
-
}) => Promise<{
|
|
641
|
-
calendars: GoogleCalendar[];
|
|
642
|
-
}>;
|
|
643
|
-
/** Select which Google Calendar to use (PLA-726). Requires admin Bearer. */
|
|
644
|
-
select: (interviewerId: string, payload: SelectCalendarInput, opts: {
|
|
645
|
-
accessToken: string;
|
|
646
|
-
signal?: AbortSignal;
|
|
647
|
-
}) => Promise<{
|
|
648
|
-
calendarId: string;
|
|
649
|
-
}>;
|
|
650
|
-
/** Disconnect Google Calendar from interviewer (PLA-726). Requires admin Bearer. */
|
|
651
|
-
disconnect: (interviewerId: string, opts: {
|
|
652
|
-
accessToken: string;
|
|
653
|
-
signal?: AbortSignal;
|
|
654
|
-
}) => Promise<{
|
|
655
|
-
disconnected: boolean;
|
|
656
|
-
}>;
|
|
657
|
-
};
|
|
658
|
-
bookingTokens: {
|
|
659
|
-
/** Create a booking token for an application's interview link (PLA-714). Requires admin Bearer token. */
|
|
660
|
-
create: (payload: CreateBookingTokenInput, opts: {
|
|
661
|
-
accessToken: string;
|
|
662
|
-
signal?: AbortSignal;
|
|
663
|
-
}) => Promise<BookingToken>;
|
|
664
|
-
/** Get an existing booking token for an application (PLA-714). Requires admin Bearer token. */
|
|
665
|
-
get: (applicationId: string, opts: {
|
|
666
|
-
accessToken: string;
|
|
667
|
-
signal?: AbortSignal;
|
|
668
|
-
}) => Promise<BookingToken>;
|
|
669
|
-
};
|
|
670
|
-
};
|
|
671
|
-
};
|
|
672
|
-
readonly schedule: {
|
|
673
|
-
/** List available interview slots for a booking token (PLA-714). Public. */
|
|
674
|
-
getSlots: (token: string, opts?: {
|
|
675
|
-
signal?: AbortSignal;
|
|
822
|
+
scheduling: {
|
|
823
|
+
availability: {
|
|
824
|
+
/** Get interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
|
|
825
|
+
get: (interviewerId: string, opts: {
|
|
826
|
+
accessToken: string;
|
|
827
|
+
signal?: AbortSignal;
|
|
828
|
+
}) => Promise<SetAvailabilityResponse>;
|
|
829
|
+
/** Set interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
|
|
830
|
+
set: (interviewerId: string, payload: SetAvailabilityInput, opts: {
|
|
831
|
+
accessToken: string;
|
|
832
|
+
signal?: AbortSignal;
|
|
833
|
+
}) => Promise<SetAvailabilityResponse>;
|
|
834
|
+
};
|
|
835
|
+
calendar: {
|
|
836
|
+
/** Get Google Calendar connection status for an interviewer (PLA-726). Requires admin Bearer. */
|
|
837
|
+
status: (interviewerId: string, opts: {
|
|
838
|
+
accessToken: string;
|
|
839
|
+
signal?: AbortSignal;
|
|
840
|
+
}) => Promise<CalendarStatus>;
|
|
841
|
+
/** List available Google Calendars (PLA-726). Requires admin Bearer. */
|
|
842
|
+
listCalendars: (interviewerId: string, opts: {
|
|
843
|
+
accessToken: string;
|
|
844
|
+
signal?: AbortSignal;
|
|
676
845
|
}) => Promise<{
|
|
677
|
-
|
|
678
|
-
startsAt: string;
|
|
679
|
-
endsAt: string;
|
|
680
|
-
}[];
|
|
846
|
+
calendars: GoogleCalendar[];
|
|
681
847
|
}>;
|
|
682
|
-
/**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}) => Promise<
|
|
848
|
+
/** Select which Google Calendar to use (PLA-726). Requires admin Bearer. */
|
|
849
|
+
select: (interviewerId: string, payload: SelectCalendarInput, opts: {
|
|
850
|
+
accessToken: string;
|
|
851
|
+
signal?: AbortSignal;
|
|
852
|
+
}) => Promise<{
|
|
853
|
+
calendarId: string;
|
|
854
|
+
}>;
|
|
855
|
+
/** Disconnect Google Calendar from interviewer (PLA-726). Requires admin Bearer. */
|
|
856
|
+
disconnect: (interviewerId: string, opts: {
|
|
857
|
+
accessToken: string;
|
|
858
|
+
signal?: AbortSignal;
|
|
859
|
+
}) => Promise<{
|
|
860
|
+
disconnected: boolean;
|
|
861
|
+
}>;
|
|
862
|
+
};
|
|
863
|
+
bookingTokens: {
|
|
864
|
+
/** Create a booking token for an application's interview link (PLA-714). Requires admin Bearer token. */
|
|
865
|
+
create: (payload: CreateBookingTokenInput, opts: {
|
|
866
|
+
accessToken: string;
|
|
867
|
+
signal?: AbortSignal;
|
|
868
|
+
}) => Promise<BookingToken>;
|
|
869
|
+
/** Get an existing booking token for an application (PLA-714). Requires admin Bearer token. */
|
|
870
|
+
get: (applicationId: string, opts: {
|
|
871
|
+
accessToken: string;
|
|
872
|
+
signal?: AbortSignal;
|
|
873
|
+
}) => Promise<BookingToken>;
|
|
874
|
+
};
|
|
694
875
|
};
|
|
876
|
+
};
|
|
877
|
+
readonly schedule: {
|
|
878
|
+
/** List available interview slots for a booking token (PLA-714). Public. */
|
|
879
|
+
getSlots: (token: string, opts?: {
|
|
880
|
+
signal?: AbortSignal;
|
|
881
|
+
}) => Promise<{
|
|
882
|
+
slots: {
|
|
883
|
+
startsAt: string;
|
|
884
|
+
endsAt: string;
|
|
885
|
+
}[];
|
|
886
|
+
}>;
|
|
887
|
+
/** Book an interview slot (PLA-714). Public. */
|
|
888
|
+
book: (token: string, payload: BookSlotInput, opts?: {
|
|
889
|
+
signal?: AbortSignal;
|
|
890
|
+
}) => Promise<BookSlotResponse>;
|
|
891
|
+
/** Cancel an interview booking (PLA-714). Public. */
|
|
892
|
+
cancel: (token: string, opts?: {
|
|
893
|
+
signal?: AbortSignal;
|
|
894
|
+
}) => Promise<BookSlotResponse>;
|
|
895
|
+
/** Reschedule an interview booking (PLA-714). Public. */
|
|
896
|
+
reschedule: (token: string, payload: RescheduleInput, opts?: {
|
|
897
|
+
signal?: AbortSignal;
|
|
898
|
+
}) => Promise<BookSlotResponse>;
|
|
899
|
+
};
|
|
695
900
|
}
|
|
696
901
|
/** Convenience factory — equivalent to `new PlayaOSClient(opts)`. */
|
|
697
902
|
declare function createClient(opts: ClientOptions): PlayaOSClient;
|
|
698
|
-
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region src/exchange.d.ts
|
|
699
905
|
/**
|
|
700
906
|
* Server-side OAuth-code → ID-token exchange.
|
|
701
907
|
*
|
|
@@ -707,22 +913,23 @@ declare function createClient(opts: ClientOptions): PlayaOSClient;
|
|
|
707
913
|
* in `@playaos/react`.
|
|
708
914
|
*/
|
|
709
915
|
interface ExchangeParams {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
916
|
+
authBaseUrl?: string;
|
|
917
|
+
code: string;
|
|
918
|
+
codeVerifier: string;
|
|
919
|
+
clientId: string;
|
|
920
|
+
/** Confidential clients only. Omit for public/PKCE-only clients. */
|
|
921
|
+
clientSecret?: string;
|
|
922
|
+
redirectUri: string;
|
|
717
923
|
}
|
|
718
924
|
interface ExchangeResult {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
925
|
+
idToken: string;
|
|
926
|
+
expiresAt: string;
|
|
927
|
+
/** Confidential clients only. Undefined for public clients. */
|
|
928
|
+
refreshToken?: string;
|
|
723
929
|
}
|
|
724
930
|
declare function exchangeCode(params: ExchangeParams): Promise<ExchangeResult>;
|
|
725
|
-
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region src/public-marketplace.d.ts
|
|
726
933
|
/** A listing holds at most this many images (matches the DB's position 1–6 check). */
|
|
727
934
|
declare const MAX_IMAGE_POSITION = 6;
|
|
728
935
|
/**
|
|
@@ -736,68 +943,69 @@ declare const MAX_IMAGE_POSITION = 6;
|
|
|
736
943
|
* public API as the single write contract — the UI is just another consumer.
|
|
737
944
|
*/
|
|
738
945
|
interface PublicMarketplaceClientOptions {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
946
|
+
/** API base, e.g. `https://api.playaos.app`. */
|
|
947
|
+
baseUrl: string;
|
|
948
|
+
/** Supplies the Supabase access token (Bearer) for authenticated calls; null/undefined when signed out. */
|
|
949
|
+
getToken: () => Promise<string | null | undefined> | string | null | undefined;
|
|
743
950
|
}
|
|
744
951
|
interface NewListingInput {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
952
|
+
category: string;
|
|
953
|
+
subcategory?: string;
|
|
954
|
+
title: string;
|
|
955
|
+
body: string;
|
|
956
|
+
price?: number;
|
|
957
|
+
location?: string;
|
|
958
|
+
replyEmail: string;
|
|
752
959
|
}
|
|
753
960
|
interface ImageUploadTarget {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
961
|
+
/** Supabase signed upload URL — PUT the file bytes here. */
|
|
962
|
+
uploadUrl: string;
|
|
963
|
+
/** Storage path to pass back to `attachImage` once the PUT succeeds. */
|
|
964
|
+
storagePath: string;
|
|
758
965
|
}
|
|
759
966
|
/** Moderation flag reasons accepted by the API (mirrors the DB enum). */
|
|
760
967
|
type MarketplaceFlagReason = "spam" | "prohibited" | "other";
|
|
761
968
|
interface ListingImage {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
969
|
+
/** Short-lived signed download URL for the image. */
|
|
970
|
+
url: string;
|
|
971
|
+
/** 1-based display order. */
|
|
972
|
+
position: number;
|
|
766
973
|
}
|
|
767
974
|
interface PublicMarketplaceClient {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
975
|
+
/**
|
|
976
|
+
* Create a listing as the signed-in account. Throws a plain `Error` when there
|
|
977
|
+
* is no token (signed out), or `ApiClientError` on a non-2xx response.
|
|
978
|
+
*/
|
|
979
|
+
createListing(input: NewListingInput, signal?: AbortSignal): Promise<{
|
|
980
|
+
id: string;
|
|
981
|
+
}>;
|
|
982
|
+
/** Request a signed upload URL for an image on a listing the caller owns. */
|
|
983
|
+
getImageUploadUrl(listingId: string, signal?: AbortSignal): Promise<ImageUploadTarget>;
|
|
984
|
+
/** Attach an already-uploaded image (by storage path) to a listing at a 1–6 position. */
|
|
985
|
+
attachImage(listingId: string, input: {
|
|
986
|
+
storagePath: string;
|
|
987
|
+
position: number;
|
|
988
|
+
}, signal?: AbortSignal): Promise<{
|
|
989
|
+
id: string;
|
|
990
|
+
}>;
|
|
991
|
+
/** Anonymous: list an active listing's images as short-lived signed URLs (for public display). */
|
|
992
|
+
listListingImages(listingId: string, signal?: AbortSignal): Promise<{
|
|
993
|
+
images: ListingImage[];
|
|
994
|
+
}>;
|
|
995
|
+
/** Anonymous: batch-fetch first-image signed thumbnail URLs (listingId -> url) for browse cards. */
|
|
996
|
+
listThumbnails(listingIds: string[], signal?: AbortSignal): Promise<{
|
|
997
|
+
thumbnails: Record<string, string>;
|
|
998
|
+
}>;
|
|
999
|
+
/** Flag a listing for moderation (signed-in). Idempotent per (listing, user). */
|
|
1000
|
+
flagListing(listingId: string, reason: MarketplaceFlagReason, signal?: AbortSignal): Promise<{
|
|
1001
|
+
ok: boolean;
|
|
1002
|
+
}>;
|
|
1003
|
+
/** Contact a listing's owner (signed-in); records the reply + queues a notification email. */
|
|
1004
|
+
replyToListing(listingId: string, message: string | undefined, signal?: AbortSignal): Promise<{
|
|
1005
|
+
ok: boolean;
|
|
1006
|
+
}>;
|
|
800
1007
|
}
|
|
801
1008
|
declare function createPublicMarketplaceClient(opts: PublicMarketplaceClientOptions): PublicMarketplaceClient;
|
|
802
|
-
|
|
1009
|
+
//#endregion
|
|
803
1010
|
export { ApiClientError, type Application, type ApplicationAnnotations, type ApplicationCreatePayload, type ApplicationCreateResponse, type ApplicationNote, type ApplicationScore, type ApplicationStatus, type ApplicationTransitionPayload, type ApplicationTransitionResponse, type Commitment, type CommitmentDataType, type CommitmentValue, type CommitmentsListResponse, type DuesStatus, type ExchangeParams, type ExchangeResult, type ImageUploadTarget, type ListingImage, MAX_IMAGE_POSITION, type MarketplaceFlagReason, type Member, type MemberCreatePayload, type MemberCreateResponse, type MemberDeactivateResponse, type MemberRole, type MemberUpdatePayload, type MemberUpdateResponse, type NewListingInput, type OrgConfig, type PaymentPageResponse, PlayaOSClient, type PublicMarketplaceClient, type PublicMarketplaceClientOptions, type Shift, type ShiftSignup, type ShiftType, type Waiver, type WaiverContent, type WaiverSection, type WaiverSignPayload, type WaiverSignResponse, type WaiverStatus, createClient, createPublicMarketplaceClient, exchangeCode };
|
|
1011
|
+
//# sourceMappingURL=index.d.ts.map
|