@playaos/api-client 0.12.0 → 0.14.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/dist/index.d.ts CHANGED
@@ -1,26 +1,28 @@
1
+ //#region src/error.d.ts
1
2
  declare class ApiClientError extends Error {
2
- readonly status: number;
3
- readonly code: string;
4
- /**
5
- * Seconds to wait before retrying, parsed from a numeric `Retry-After`
6
- * response header when the server sends one (commonly on 429 and 503).
7
- * Undefined when the header is absent or in HTTP-date form.
8
- */
9
- readonly retryAfter?: number | undefined;
10
- constructor(status: number, code: string, message: string,
11
- /**
12
- * Seconds to wait before retrying, parsed from a numeric `Retry-After`
13
- * response header when the server sends one (commonly on 429 and 503).
14
- * Undefined when the header is absent or in HTTP-date form.
15
- */
16
- retryAfter?: number | undefined);
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);
17
18
  }
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
- data: T[];
22
- /** Opaque cursor for the next page, or null when this is the last page. */
23
- nextCursor: string | null;
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,1132 @@ interface Paginated<T> {
28
30
  * stay assignable to `Record<string, …>` when serialized into a query string.
29
31
  */
30
32
  type PaginationParams = {
31
- /** Max rows to return (1-100, default 50). */
32
- limit?: number;
33
- /** Opaque cursor from a previous response's nextCursor. */
34
- cursor?: string;
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
- id: string;
38
- firstName: string;
39
- lastName: string;
40
- name: string | null;
41
- email: string;
42
- phone?: string | null;
43
- role: string | null;
44
- status: string | null;
45
- orgId: string;
46
- createdAt: string | null;
47
- bio?: string | null;
48
- playaName?: string | null;
49
- socialMedia?: Record<string, unknown> | null;
50
- showSocialsInDirectory?: boolean;
51
- profilePhotoPath?: string | null;
52
- emergencyContactName?: string | null;
53
- emergencyContactRelationship?: string | null;
54
- emergencyContactPhone?: string | null;
55
- yearJoined?: number | null;
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
- id: string;
59
- userId: string;
60
- orgId: string;
61
- status: string | null;
62
- year: number;
63
- createdAt: string | null;
64
- updatedAt: string | null;
65
- email?: string | null;
66
- firstName?: string | null;
67
- lastName?: string | null;
68
- submittedAt?: string | null;
69
- whyJoin?: string | null;
70
- howHeard?: string | null;
71
- shelterType?: string | null;
72
- burningManBefore?: boolean | null;
73
- customFields?: Record<string, unknown> | null;
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
- userId: string | null;
77
- year: number | null;
78
- paymentStatus: string | null;
79
- amountOwed: string | null;
80
- amountPaid: string | null;
81
- balance: string | null;
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
- id: string;
85
- userId: string;
86
- status: string | null;
87
- role: string | null;
86
+ id: string;
87
+ userId: string;
88
+ status: string | null;
89
+ role: string | null;
88
90
  }
89
91
  interface ShiftType {
90
- id: string;
91
- name: string;
92
- description: string | null;
92
+ id: string;
93
+ name: string;
94
+ description: string | null;
93
95
  }
94
96
  interface Shift {
95
- id: string;
96
- orgId: string;
97
- shiftDate: string;
98
- year: number;
99
- startTime: string | null;
100
- endTime: string | null;
101
- maxSlots: number | null;
102
- isPublished: boolean | null;
103
- shiftType: ShiftType | null;
104
- shiftSignups: ShiftSignup[];
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
- id: string;
108
- name: string;
109
- slug: string;
110
- preset: string | null;
111
- customDomain: string | null;
112
- settings: Record<string, unknown> | null;
113
- features: Record<string, unknown> | null;
114
- plan: string | null;
115
- logoUrl: string | null;
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
- id: string;
122
- name: string;
123
- displayName: string;
124
- description: string | null;
125
- dataType: CommitmentDataType;
126
- minValue: number | null;
127
- maxValue: number | null;
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
- commitments: Commitment[];
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
- provider: "givebutter" | "crowded";
136
- url: string;
137
- modalSupported: boolean;
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
- acknowledged_expectations?: true;
141
- first_name: string;
142
- last_name: string;
143
- email: string;
144
- phone?: string;
145
- referral_code?: string;
146
- socials?: string;
147
- birthday?: string;
148
- hometown?: string;
149
- how_heard?: string;
150
- burning_man_before?: "yes" | "no";
151
- burning_man_years?: string;
152
- shelter_type?: "joining_rv" | "bringing_rv" | "shiftpod_tent" | "car" | "truck" | "van" | "unsure";
153
- shelter_mates?: string;
154
- ticket_status?: "looking" | "have_ticket" | "unsure";
155
- build_available?: boolean;
156
- build_skills?: string;
157
- strike_available?: boolean;
158
- strike_help?: string;
159
- about_yourself?: string;
160
- agrees_to_principles?: true;
161
- /** commitmentId → value (integer or boolean per the commitment dataType), collected at apply (PLA-682). */
162
- commitments?: Record<string, number | boolean>;
163
- custom_fields?: Record<string, unknown>;
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
- applicationId: string;
167
- status: string;
251
+ applicationId: string;
252
+ status: string;
168
253
  }
169
254
  interface ApplicationTransitionPayload {
170
- to: ApplicationStatus;
171
- rejectionReason?: string;
172
- /** When true, sends a templated email to the applicant (PLA-710). */
173
- notify?: boolean;
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
- applicationId: string;
177
- status: ApplicationStatus;
261
+ applicationId: string;
262
+ status: ApplicationStatus;
178
263
  }
179
264
  interface MemberCreatePayload {
180
- firstName: string;
181
- lastName: string;
182
- email: string;
183
- phone?: string | null;
184
- role?: "member" | "admin" | "super_admin";
185
- status?: string;
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
- profileId: string;
273
+ profileId: string;
189
274
  }
190
275
  interface MemberUpdatePayload {
191
- firstName?: string;
192
- lastName?: string;
193
- phone?: string | null;
276
+ firstName?: string;
277
+ lastName?: string;
278
+ phone?: string | null;
194
279
  }
195
280
  interface MemberUpdateResponse {
196
- profileId: string;
281
+ profileId: string;
197
282
  }
198
283
  interface MemberDeactivateResponse {
199
- profileId: string;
200
- status: "inactive";
284
+ profileId: string;
285
+ status: "inactive";
201
286
  }
202
287
  interface WaiverSection {
203
- id: string;
204
- heading: string;
205
- body: string;
206
- required: boolean;
288
+ id: string;
289
+ heading: string;
290
+ body: string;
291
+ required: boolean;
207
292
  }
208
293
  interface WaiverContent {
209
- title: string;
210
- sections: WaiverSection[];
211
- effectiveDate?: string;
212
- orgFields?: {
213
- campName?: string;
214
- eventYear?: number;
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
- id: string;
219
- version: number;
220
- name: string;
221
- year: number;
222
- content: WaiverContent;
303
+ id: string;
304
+ version: number;
305
+ name: string;
306
+ year: number;
307
+ content: WaiverContent;
223
308
  }
224
309
  interface WaiverStatus {
225
- waiverId: string;
226
- version: number;
227
- signed: boolean;
228
- signedAt: string | null;
229
- signatureId: string | null;
310
+ waiverId: string;
311
+ version: number;
312
+ signed: boolean;
313
+ signedAt: string | null;
314
+ signatureId: string | null;
230
315
  }
231
316
  interface WaiverSignPayload {
232
- waiverId: string;
233
- applicationId: string;
234
- signerName: string;
235
- /** base64 PNG data URL — required (drawn-canvas signature). */
236
- signatureImageData: string;
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
- signatureId: string;
324
+ signatureId: string;
240
325
  }
241
326
  interface ApplicationNote {
242
- id: string;
243
- authorId: string;
244
- authorName: string | null;
245
- body: string;
246
- createdAt: string;
327
+ id: string;
328
+ authorId: string;
329
+ authorName: string | null;
330
+ body: string;
331
+ createdAt: string;
247
332
  }
248
333
  interface ApplicationScore {
249
- adminId: string;
250
- adminName: string | null;
251
- value: number;
252
- updatedAt: string;
334
+ adminId: string;
335
+ adminName: string | null;
336
+ value: number;
337
+ updatedAt: string;
253
338
  }
254
339
  interface ApplicationAnnotations {
255
- notes: ApplicationNote[];
256
- tags: string[];
257
- scores: ApplicationScore[];
340
+ notes: ApplicationNote[];
341
+ tags: string[];
342
+ scores: ApplicationScore[];
258
343
  }
259
344
  interface AnnouncementSendPayload {
260
- subject: string;
261
- body: string;
262
- filters?: {
263
- role?: string;
264
- status?: string;
265
- shiftTypeId?: string;
266
- };
267
- dryRun?: boolean;
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
- sent: number;
271
- recipients: {
272
- name: string | null;
273
- email: string;
274
- }[];
355
+ sent: number;
356
+ recipients: {
357
+ name: string | null;
358
+ email: string;
359
+ }[];
275
360
  }
276
361
  interface DuesCreatePayload {
277
- userId: string;
278
- amount: number;
279
- paymentMethod?: string;
280
- duesCollectionId?: string;
362
+ userId: string;
363
+ amount: number;
364
+ paymentMethod?: string;
365
+ duesCollectionId?: string;
281
366
  }
282
367
  interface DuesCreateResponse {
283
- paymentId: string;
368
+ paymentId: string;
284
369
  }
285
370
  interface DuesUpdatePayload {
286
- amount?: number;
287
- paymentStatus?: string;
288
- paymentMethod?: string;
371
+ amount?: number;
372
+ paymentStatus?: string;
373
+ paymentMethod?: string;
289
374
  }
290
375
  interface DuesUpdateResponse {
291
- paymentId: string;
376
+ paymentId: string;
292
377
  }
293
378
  interface OrgUpdatePayload {
294
- name?: string;
295
- logoUrl?: string | null;
296
- tagline?: string | null;
297
- description?: string | null;
298
- settings?: Record<string, unknown> | null;
299
- features?: Record<string, unknown> | null;
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
- orgId: string;
387
+ orgId: string;
303
388
  }
304
389
  interface ApplicationEvent {
305
- id: string;
306
- applicationId: string;
307
- actorId: string | null;
308
- actorName: string | null;
309
- type: "status_change" | "note_added" | "tags_updated" | "score_set";
310
- timestamp: string;
311
- fromStatus?: string | null;
312
- toStatus?: string;
313
- metadata?: Record<string, unknown>;
390
+ id: string;
391
+ applicationId: string;
392
+ actorId: string | null;
393
+ actorName: string | null;
394
+ /**
395
+ * Mirrors `APPLICATION_AUDIT_ACTIONS` in `@playa-os/portal-data`, except that
396
+ * the server's `status_changed` is surfaced as `status_change` for backwards
397
+ * compatibility with the original embed shape. `tags_updated` and `score_set`
398
+ * predate that vocabulary and are kept so existing consumers still compile.
399
+ *
400
+ * Widening the server list without widening this union lets a value escape
401
+ * the declared type through the cast in `client.ts` — see PLA-1199.
402
+ */
403
+ type: "status_change" | "note_added" | "tags_updated" | "score_set" | "message_sent" | "message_received" | "approved" | "rejected" | "waitlisted" | "interview_invite_sent" | "interview_scheduled_manually" | "interview_completed" | "interviewer_assigned" | "red_flag_added";
404
+ timestamp: string;
405
+ fromStatus?: string | null;
406
+ toStatus?: string;
407
+ metadata?: Record<string, unknown>;
314
408
  }
315
409
  interface ApplicationHistoryResponse {
316
- events: ApplicationEvent[];
410
+ events: ApplicationEvent[];
317
411
  }
318
412
  interface AvailabilityWindow {
319
- dayOfWeek: number;
320
- startTime: string;
321
- endTime: string;
413
+ dayOfWeek: number;
414
+ startTime: string;
415
+ endTime: string;
322
416
  }
323
417
  interface SetAvailabilityInput {
324
- windows: AvailabilityWindow[];
418
+ windows: AvailabilityWindow[];
325
419
  }
326
420
  interface SetAvailabilityResponse {
327
- windows: {
328
- count: number;
329
- };
421
+ windows: {
422
+ count: number;
423
+ };
330
424
  }
331
425
  interface CreateBookingTokenInput {
332
- applicationId: string;
333
- bookingLinkId: string;
334
- expiresAt?: string;
426
+ applicationId: string;
427
+ bookingLinkId: string;
428
+ expiresAt?: string;
335
429
  }
336
430
  interface BookingToken {
337
- id: string;
338
- applicationId: string;
339
- token: string;
340
- url: string;
341
- expiresAt: string | null;
342
- createdAt: string | null;
431
+ id: string;
432
+ applicationId: string;
433
+ token: string;
434
+ url: string;
435
+ expiresAt: string | null;
436
+ createdAt: string | null;
343
437
  }
344
438
  interface BookSlotInput {
345
- slotUtcStart: string;
346
- name: string;
347
- email: string;
348
- interviewerId?: string;
349
- timezone?: string;
439
+ slotUtcStart: string;
440
+ name: string;
441
+ email: string;
442
+ interviewerId?: string;
443
+ timezone?: string;
350
444
  }
351
445
  interface BookSlotResponse {
352
- bookingId: string;
353
- applicationStatus: string;
446
+ bookingId: string;
447
+ applicationStatus: string;
354
448
  }
355
449
  interface RescheduleInput {
356
- slotUtcStart: string;
357
- interviewerId?: string;
358
- timezone?: string;
450
+ slotUtcStart: string;
451
+ interviewerId?: string;
452
+ timezone?: string;
359
453
  }
360
454
  interface CalendarStatus {
361
- connected: boolean;
362
- provider: string;
363
- calendarId: string | null;
364
- calendarName?: string | null;
455
+ connected: boolean;
456
+ provider: string;
457
+ calendarId: string | null;
458
+ calendarName?: string | null;
365
459
  }
366
460
  interface GoogleCalendar {
367
- id: string;
368
- summary: string;
369
- primary?: boolean;
461
+ id: string;
462
+ summary: string;
463
+ primary?: boolean;
370
464
  }
371
465
  interface SelectCalendarInput {
372
- calendarId: string;
373
- calendarName?: string;
466
+ calendarId: string;
467
+ calendarName?: string;
468
+ }
469
+ /** Per-member status for one packing item. Mirrors `PACKING_ITEM_STATUSES`. */
470
+ type PackingItemStatus = "have" | "need" | "nope" | "packed" | "camp_has";
471
+ /** Which layer a resolved row came from (ADR-071). */
472
+ type PackingLayer = "global" | "camp" | "personal";
473
+ /**
474
+ * One row of the resolved list. Identity is `slug`, never a row uuid — the
475
+ * curated base is regenerated wholesale and uuids do not survive it (ADR-071).
476
+ */
477
+ interface PackingItem {
478
+ slug: string;
479
+ category: string;
480
+ name: string;
481
+ notes: string | null;
482
+ shelters: string[];
483
+ qty: number | null;
484
+ unit: string | null;
485
+ source: string | null;
486
+ contested: string | null;
487
+ sortOrder: number;
488
+ /** Base-layer rows only — which packing-template source this came from. */
489
+ sourceList?: string;
490
+ layer: PackingLayer;
491
+ status: string | null;
492
+ /** The member's own annotation. Distinct from the item's `notes`. */
493
+ memberNotes: string | null;
494
+ containerId: string | null;
495
+ containerName: string | null;
496
+ }
497
+ interface PackingListResponse {
498
+ items: PackingItem[];
499
+ year: number;
500
+ }
501
+ /** A row in the member's personal layer. These are user-owned, so keyed by uuid. */
502
+ interface PackingPersonalItem {
503
+ id: string;
504
+ catalogItemId: string | null;
505
+ name: string;
506
+ category: string;
507
+ tags: string[];
508
+ qty: number;
509
+ unit: string | null;
510
+ status: string;
511
+ containerId: string | null;
512
+ notes: string | null;
513
+ }
514
+ /** How the rental reaches the member. The server defaults to `camp_delivery`. */
515
+ type BikeRentalDeliveryMode = "individual_pickup" | "camp_delivery";
516
+ type BikeRentalFramePreference = "standard" | "step-through";
517
+ interface BikeRentalCatalogItem {
518
+ /** Customer-facing option label. Send it back as `model` when requesting a bike. */
519
+ model: string;
520
+ /** DustJunkie bike_type behind the option. */
521
+ bikeType: string;
522
+ framePreference: BikeRentalFramePreference;
523
+ /** Per-rental price. */
524
+ price: number;
525
+ /** Refundable security deposit for this bike type. */
526
+ deposit: number;
527
+ /** Transport fee for the requested delivery mode; 0 for pickup. */
528
+ transportFee: number;
529
+ /** Display estimate: price + deposit + transportFee. DustJunkie sets the amount it actually charges. */
530
+ estimatedTotal: number;
531
+ /** Bikes of this type tracked in the delivery pool, in any status. */
532
+ totalCount: number;
533
+ /** Bikes of this type ready to ride; 0 means sold out. */
534
+ ready: number;
535
+ }
536
+ interface BikeRentalCatalogResponse {
537
+ items: BikeRentalCatalogItem[];
538
+ }
539
+ interface BikeRentalWaiver {
540
+ /** Waiver version recorded with every request. */
541
+ version: string;
542
+ /** Full rental agreement and liability waiver. */
543
+ text: string;
544
+ /** Every box must be accepted to submit a request. */
545
+ checkboxes: string[];
374
546
  }
375
-
547
+ /** Body of `POST /bike-rentals/requests`. The request is always for the acting member. */
548
+ interface BikeRentalRequestInput {
549
+ /** A `model` from `bikeRentals.catalog()`. */
550
+ model: string;
551
+ firstName: string;
552
+ lastName: string;
553
+ /** Must contain at least 10 digits. */
554
+ phone: string;
555
+ billingStreet: string;
556
+ billingCity: string;
557
+ billingState: string;
558
+ billingPostalCode: string;
559
+ billingCountry: string;
560
+ /** The member accepted the waiver and all of its checkboxes. */
561
+ agreementConfirmed: true;
562
+ }
563
+ interface BikeRentalRequestResult {
564
+ /** DustJunkie's id for the pending request. */
565
+ requestId: string | null;
566
+ status: string | null;
567
+ }
568
+ interface BikeRentalReservation {
569
+ id: string;
570
+ name: string;
571
+ email: string | null;
572
+ reservationType: string | null;
573
+ /** Bike description parsed from DustJunkie's notes. */
574
+ bikeSummary: string | null;
575
+ paymentAmount: number | null;
576
+ paymentStatus: string | null;
577
+ rentalStatus: string | null;
578
+ waiverStatus: string | null;
579
+ depositStatus: string | null;
580
+ deliveryType: string | null;
581
+ reservedAt: string | null;
582
+ }
583
+ interface BikeRentalReservationListResponse {
584
+ items: BikeRentalReservation[];
585
+ }
586
+ interface BikeRentalInterestedMember {
587
+ userId: string;
588
+ name: string | null;
589
+ email: string | null;
590
+ bikeTypePreference: string | null;
591
+ arrivalDate: string | null;
592
+ /** No email on file, so no reservation can ever match. */
593
+ unmatchable: boolean;
594
+ }
595
+ interface BikeRentalInterestedNotReservedResponse {
596
+ /** Active camp year; the calendar year when no camp year is active. */
597
+ year: number;
598
+ items: BikeRentalInterestedMember[];
599
+ }
600
+ //#endregion
601
+ //#region src/client.d.ts
376
602
  interface ClientOptions {
377
- /** Base URL for authenticated /api/v1 routes, e.g. https://api.playaos.app */
378
- baseUrl: string;
379
- /** Optional base URL for /api/embed/v1 routes when they live on a different host. */
380
- embedBaseUrl?: string;
381
- /** API key in the format pk_live_* */
382
- apiKey: string;
603
+ /** Base URL for authenticated /api/v1 routes, e.g. https://api.playaos.app */
604
+ baseUrl: string;
605
+ /** Optional base URL for /api/embed/v1 routes when they live on a different host. */
606
+ embedBaseUrl?: string;
607
+ /** API key in the format pk_live_* */
608
+ apiKey: string;
609
+ /**
610
+ * Supabase session JWT of the acting member, sent as `X-PlayaOS-Member-Token`
611
+ * on every /api/v1 call (PLA-1195). Member-scoped endpoints (a member's own
612
+ * dues, payments, application, shelter, shifts signup, …) require it and
613
+ * return 401 without it. Org-level endpoints do not require it, but a token
614
+ * that is sent must still verify — an expired or invalid one is a 401 on any
615
+ * /api/v1 route that installs the member middleware. Prefer
616
+ * `client.withMember(token)` to derive a per-request client from a shared
617
+ * server-side one rather than constructing a client per user.
618
+ */
619
+ memberToken?: string;
383
620
  }
384
621
  declare class PlayaOSClient {
385
- private readonly baseUrl;
386
- private readonly embedBaseUrl;
387
- private readonly apiKey;
388
- constructor(opts: ClientOptions);
389
- readonly members: {
390
- list: (params?: {
391
- role?: MemberRole;
392
- status?: string;
393
- } & PaginationParams, opts?: {
394
- signal?: AbortSignal;
395
- }) => Promise<Paginated<Member>>;
396
- get: (id: string, opts?: {
397
- signal?: AbortSignal;
398
- }) => Promise<Member>;
399
- /** Member-self profile update (PLA-700). Requires camp key + member Bearer token. */
400
- selfUpdate: (payload: {
401
- bio?: string | null;
402
- playaName?: string | null;
403
- socialMedia?: Record<string, unknown> | null;
404
- showSocialsInDirectory?: boolean;
405
- phone?: string | null;
406
- emergencyContactName?: string | null;
407
- emergencyContactRelationship?: string | null;
408
- emergencyContactPhone?: string | null;
409
- profilePhotoPath?: string | null;
410
- yearJoined?: number | null;
411
- }, opts: {
412
- accessToken: string;
413
- signal?: AbortSignal;
414
- }) => Promise<{
415
- profileId: string;
416
- }>;
417
- /** Member-self shift signup + cancel (PLA-705). Requires camp key + member Bearer. */
418
- shifts: {
419
- signup: (payload: {
420
- shiftId: string;
421
- role?: string;
422
- }, opts: {
423
- accessToken: string;
424
- signal?: AbortSignal;
425
- }) => Promise<{
426
- signupId: string;
427
- waitlisted: boolean;
428
- }>;
429
- cancel: (signupId: string, opts: {
430
- accessToken: string;
431
- signal?: AbortSignal;
432
- }) => Promise<{
433
- canceled: boolean;
434
- promotedSignupId: string | null;
435
- }>;
436
- };
622
+ private readonly baseUrl;
623
+ private readonly embedBaseUrl;
624
+ private readonly apiKey;
625
+ private readonly memberToken;
626
+ constructor(opts: ClientOptions);
627
+ /** Credentials for /api/v1 calls; the embed surface uses `apiKey` alone as the camp key. */
628
+ private get auth();
629
+ /**
630
+ * Derive a client that acts as one member (PLA-1195): same host and org key,
631
+ * plus the member's Supabase session JWT on every /api/v1 call. Use this in a
632
+ * server that holds one org key and serves many signed-in members.
633
+ */
634
+ withMember(memberToken: string): PlayaOSClient;
635
+ readonly members: {
636
+ list: (params?: {
637
+ role?: MemberRole;
638
+ status?: string;
639
+ } & PaginationParams, opts?: {
640
+ signal?: AbortSignal;
641
+ }) => Promise<Paginated<Member>>;
642
+ /**
643
+ * Full profile (phone, emergency contact). Requires a member token; pass
644
+ * `"me"` for the acting member — non-admins may fetch only themselves.
645
+ */
646
+ get: (id: string, opts?: {
647
+ signal?: AbortSignal;
648
+ }) => Promise<Member>;
649
+ /** Member-self profile update (PLA-700). Requires camp key + member Bearer token. */
650
+ selfUpdate: (payload: {
651
+ bio?: string | null;
652
+ playaName?: string | null;
653
+ socialMedia?: Record<string, unknown> | null;
654
+ showSocialsInDirectory?: boolean;
655
+ phone?: string | null;
656
+ emergencyContactName?: string | null;
657
+ emergencyContactRelationship?: string | null;
658
+ emergencyContactPhone?: string | null;
659
+ profilePhotoPath?: string | null;
660
+ yearJoined?: number | null;
661
+ }, opts: {
662
+ accessToken: string;
663
+ signal?: AbortSignal;
664
+ }) => Promise<{
665
+ profileId: string;
666
+ }>;
667
+ /** Member-self shift signup + cancel (PLA-705). Requires camp key + member Bearer. */
668
+ shifts: {
669
+ signup: (payload: {
670
+ shiftId: string;
671
+ role?: string;
672
+ }, opts: {
673
+ accessToken: string;
674
+ signal?: AbortSignal;
675
+ }) => Promise<{
676
+ signupId: string;
677
+ waitlisted: boolean;
678
+ }>;
679
+ cancel: (signupId: string, opts: {
680
+ accessToken: string;
681
+ signal?: AbortSignal;
682
+ }) => Promise<{
683
+ canceled: boolean;
684
+ promotedSignupId: string | null;
685
+ }>;
437
686
  };
438
- readonly applications: {
439
- list: (params?: {
440
- status?: ApplicationStatus;
441
- year?: number;
442
- } & PaginationParams, opts?: {
443
- signal?: AbortSignal;
444
- }) => Promise<Paginated<Application>>;
445
- create: (payload: ApplicationCreatePayload, opts?: {
446
- accessToken?: string;
447
- signal?: AbortSignal;
448
- }) => Promise<ApplicationCreateResponse>;
687
+ };
688
+ readonly applications: {
689
+ list: (params?: {
690
+ status?: ApplicationStatus;
691
+ year?: number;
692
+ } & PaginationParams, opts?: {
693
+ signal?: AbortSignal;
694
+ }) => Promise<Paginated<Application>>;
695
+ create: (payload: ApplicationCreatePayload, opts?: {
696
+ accessToken?: string;
697
+ signal?: AbortSignal;
698
+ }) => Promise<ApplicationCreateResponse>;
699
+ };
700
+ readonly waivers: {
701
+ /** Get the active waiver for an org for the current year. */
702
+ active: (orgId: string, opts?: {
703
+ signal?: AbortSignal;
704
+ }) => Promise<Waiver>;
705
+ /** Sign a waiver. Requires X-Camp-Key; optional accessToken for Bearer path. */
706
+ sign: (payload: WaiverSignPayload, opts?: {
707
+ accessToken?: string;
708
+ signal?: AbortSignal;
709
+ }) => Promise<WaiverSignResponse>;
710
+ /** Has this applicant/member signed the active waiver? Anchor: applicationId query or Bearer accessToken. */
711
+ status: (orgId: string, opts?: {
712
+ applicationId?: string;
713
+ accessToken?: string;
714
+ signal?: AbortSignal;
715
+ }) => Promise<WaiverStatus>;
716
+ /** Get a short-lived download URL for a completed signature's PDF. Anchor: applicationId query or Bearer. */
717
+ signedPdf: (orgId: string, signatureId: string, opts?: {
718
+ applicationId?: string;
719
+ accessToken?: string;
720
+ signal?: AbortSignal;
721
+ }) => Promise<{
722
+ url: string;
723
+ }>;
724
+ };
725
+ readonly dues: {
726
+ list: (params?: {
727
+ userId?: string;
728
+ year?: number;
729
+ paymentStatus?: "unpaid" | "partial" | "paid";
730
+ } & PaginationParams, opts?: {
731
+ signal?: AbortSignal;
732
+ }) => Promise<Paginated<DuesStatus>>;
733
+ };
734
+ readonly shifts: {
735
+ list: (params?: {
736
+ year?: number;
737
+ fromDate?: string;
738
+ toDate?: string;
739
+ publishedOnly?: boolean;
740
+ openOnly?: boolean;
741
+ } & PaginationParams, opts?: {
742
+ signal?: AbortSignal;
743
+ }) => Promise<Paginated<Shift>>;
744
+ };
745
+ readonly org: {
746
+ get: (opts?: {
747
+ signal?: AbortSignal;
748
+ }) => Promise<OrgConfig>;
749
+ };
750
+ readonly commitments: {
751
+ list: (opts?: {
752
+ signal?: AbortSignal;
753
+ }) => Promise<CommitmentsListResponse>;
754
+ };
755
+ readonly payments: {
756
+ list: (params?: {
757
+ type?: "dues" | "payment";
758
+ memberId?: string;
759
+ from?: string;
760
+ to?: string;
761
+ limit?: number;
762
+ offset?: number;
763
+ }, opts?: {
764
+ signal?: AbortSignal;
765
+ }) => Promise<PaymentLedgerRow[]>;
766
+ /** Requires a member token. `memberId` may be omitted by a non-admin (defaults to themselves); admins must pass it. */
767
+ page: (memberId?: string, duesCollectionId?: string, opts?: {
768
+ signal?: AbortSignal;
769
+ }) => Promise<PaymentPageResponse>;
770
+ };
771
+ readonly accounts: {
772
+ list: (params?: {
773
+ limit?: number;
774
+ offset?: number;
775
+ }, opts?: {
776
+ signal?: AbortSignal;
777
+ }) => Promise<Account[]>;
778
+ };
779
+ readonly contacts: {
780
+ list: (params?: {
781
+ role?: MemberRole;
782
+ status?: string;
783
+ search?: string;
784
+ sort?: "name" | "email";
785
+ limit?: number;
786
+ offset?: number;
787
+ }, opts?: {
788
+ signal?: AbortSignal;
789
+ }) => Promise<Contact[]>;
790
+ };
791
+ readonly notifications: {
792
+ list: (params?: {
793
+ category?: string;
794
+ status?: string;
795
+ recipientId?: string;
796
+ limit?: number;
797
+ }, opts?: {
798
+ signal?: AbortSignal;
799
+ }) => Promise<NotificationLog[]>;
800
+ };
801
+ readonly documents: {
802
+ list: (params?: {
803
+ type?: string;
804
+ year?: number;
805
+ }, opts?: {
806
+ signal?: AbortSignal;
807
+ }) => Promise<CampDocument[]>;
808
+ get: (id: string, opts?: {
809
+ signal?: AbortSignal;
810
+ }) => Promise<CampDocument>;
811
+ };
812
+ readonly shelters: {
813
+ list: (params?: {
814
+ ownerId?: string;
815
+ shelterType?: string;
816
+ year?: number;
817
+ }, opts?: {
818
+ signal?: AbortSignal;
819
+ }) => Promise<Shelter[]>;
820
+ get: (id: string, opts?: {
821
+ signal?: AbortSignal;
822
+ }) => Promise<Shelter>;
823
+ };
824
+ readonly bikes: {
825
+ list: (params?: {
826
+ status?: string;
827
+ }, opts?: {
828
+ signal?: AbortSignal;
829
+ }) => Promise<Bike[]>;
830
+ get: (id: string, opts?: {
831
+ signal?: AbortSignal;
832
+ }) => Promise<Bike>;
833
+ };
834
+ /**
835
+ * DustJunkie bike rentals (PLA-1180), passed through to the vendor. A camp
836
+ * without the integration gets 403; a DustJunkie failure is a 502.
837
+ */
838
+ readonly bikeRentals: {
839
+ /** Bookable options with estimated totals for `delivery` (server default `camp_delivery`). Org key only. */
840
+ catalog: (params?: {
841
+ delivery?: BikeRentalDeliveryMode;
842
+ }, opts?: {
843
+ signal?: AbortSignal;
844
+ }) => Promise<BikeRentalCatalogResponse>;
845
+ /** The rental agreement the member must accept before `requestReservation`. Org key only. */
846
+ waiver: (opts?: {
847
+ signal?: AbortSignal;
848
+ }) => Promise<BikeRentalWaiver>;
849
+ /**
850
+ * Requires a member token. Admins get the whole camp when `memberId` is
851
+ * omitted; any other role gets their own reservations and 403 naming someone else.
852
+ */
853
+ reservations: (params?: {
854
+ memberId?: string;
855
+ }, opts?: {
856
+ signal?: AbortSignal;
857
+ }) => Promise<BikeRentalReservationListResponse>;
858
+ /**
859
+ * Requires a member token; always requests for the acting member. 409 when
860
+ * the model is sold out, 400 when it is unknown or no longer bookable.
861
+ */
862
+ requestReservation: (payload: BikeRentalRequestInput, opts?: {
863
+ signal?: AbortSignal;
864
+ }) => Promise<BikeRentalRequestResult>;
865
+ /** Members who said they want a bike but have no reservation, for the active camp year. Org key only. */
866
+ interestedNotReserved: (opts?: {
867
+ signal?: AbortSignal;
868
+ }) => Promise<BikeRentalInterestedNotReservedResponse>;
869
+ };
870
+ readonly tags: {
871
+ list: (opts?: {
872
+ signal?: AbortSignal;
873
+ }) => Promise<MemberTag[]>;
874
+ };
875
+ readonly groups: {
876
+ list: (opts?: {
877
+ signal?: AbortSignal;
878
+ }) => Promise<MemberGroup[]>;
879
+ get: (id: string, opts?: {
880
+ signal?: AbortSignal;
881
+ }) => Promise<MemberGroupRosterRow[]>;
882
+ create: (payload: {
883
+ name: string;
884
+ leaderProfileId: string;
885
+ }, opts?: {
886
+ signal?: AbortSignal;
887
+ }) => Promise<{
888
+ id: string;
889
+ }>;
890
+ };
891
+ /**
892
+ * Camp-scoped packing (PLA-1197). Every method is the acting member's own
893
+ * list — packing has no `memberId` to widen, so these require `memberToken`
894
+ * and 401 on an org key alone.
895
+ */
896
+ readonly packing: {
897
+ /** The resolved list: curated base + camp layer + personal layer (ADR-071). */
898
+ list: (params?: {
899
+ year?: number;
900
+ shelter?: string;
901
+ }, opts?: {
902
+ signal?: AbortSignal;
903
+ }) => Promise<PackingListResponse>;
904
+ /**
905
+ * Set the member's status for one item. The slug goes in the body, not the
906
+ * path: slugs are `${category}/${name}` and contain a `/`.
907
+ *
908
+ * Pass the same `shelter` the list was read under — validation filters by
909
+ * shelter, so an override omitted here rejects shelter-specific items.
910
+ */
911
+ setStatus: (payload: {
912
+ slug: string;
913
+ status: PackingItemStatus;
914
+ year?: number;
915
+ shelter?: string;
916
+ }, opts?: {
917
+ signal?: AbortSignal;
918
+ }) => Promise<{
919
+ ok: true;
920
+ }>;
921
+ personalItems: {
922
+ list: (params?: {
923
+ containerId?: string;
924
+ }, opts?: {
925
+ signal?: AbortSignal;
926
+ }) => Promise<{
927
+ items: PackingPersonalItem[];
928
+ }>;
929
+ create: (payload: {
930
+ name: string;
931
+ category: string;
932
+ qty?: number;
933
+ unit?: string | null;
934
+ notes?: string | null;
935
+ }, opts?: {
936
+ signal?: AbortSignal;
937
+ }) => Promise<{
938
+ id: string;
939
+ }>;
940
+ /**
941
+ * Flip the item between `need` and `have`. It does **not** set `packed` —
942
+ * use `setStatus` for the full vocabulary. 404 if the item is not the
943
+ * acting member's.
944
+ */
945
+ toggle: (id: string, opts?: {
946
+ signal?: AbortSignal;
947
+ }) => Promise<{
948
+ ok: true;
949
+ }>;
950
+ /** 404 if the item is not the acting member's. */
951
+ remove: (id: string, opts?: {
952
+ signal?: AbortSignal;
953
+ }) => Promise<{
954
+ ok: true;
955
+ }>;
449
956
  };
450
- readonly waivers: {
451
- /** Get the active waiver for an org for the current year. */
452
- active: (orgId: string, opts?: {
453
- signal?: AbortSignal;
454
- }) => Promise<Waiver>;
455
- /** Sign a waiver. Requires X-Camp-Key; optional accessToken for Bearer path. */
456
- sign: (payload: WaiverSignPayload, opts?: {
457
- accessToken?: string;
458
- signal?: AbortSignal;
459
- }) => Promise<WaiverSignResponse>;
460
- /** Has this applicant/member signed the active waiver? Anchor: applicationId query or Bearer accessToken. */
461
- status: (orgId: string, opts?: {
462
- applicationId?: string;
463
- accessToken?: string;
464
- signal?: AbortSignal;
465
- }) => Promise<WaiverStatus>;
466
- /** Get a short-lived download URL for a completed signature's PDF. Anchor: applicationId query or Bearer. */
467
- signedPdf: (orgId: string, signatureId: string, opts?: {
468
- applicationId?: string;
469
- accessToken?: string;
470
- signal?: AbortSignal;
471
- }) => Promise<{
472
- url: string;
473
- }>;
957
+ };
958
+ readonly admin: {
959
+ applications: {
960
+ /**
961
+ * Get application audit timeline (PLA-712). Requires admin Bearer token.
962
+ *
963
+ * @deprecated The embed handler for this method never existed — calls
964
+ * always 404'd (see PLA-1199). Retained as a compile-time compatibility
965
+ * surface for published-consumer code; delegates to the canonical
966
+ * `GET /api/v1/audit/application-logs?applicationId=` (ADR-054), which
967
+ * reads the same `application_audit_logs` table. The `accessToken`
968
+ * argument is accepted but unused — the v1 surface authenticates with
969
+ * the org API key (`audit:read` scope) instead of an admin JWT. Remove
970
+ * in the next major version.
971
+ */
972
+ history: (id: string, opts: {
973
+ accessToken: string;
974
+ signal?: AbortSignal;
975
+ }) => Promise<ApplicationHistoryResponse>;
976
+ transition: (id: string, payload: ApplicationTransitionPayload, opts: {
977
+ accessToken: string;
978
+ signal?: AbortSignal;
979
+ }) => Promise<ApplicationTransitionResponse>;
980
+ getAnnotations: (id: string, opts: {
981
+ accessToken: string;
982
+ signal?: AbortSignal;
983
+ }) => Promise<ApplicationAnnotations>;
984
+ addNote: (id: string, payload: {
985
+ body: string;
986
+ }, opts: {
987
+ accessToken: string;
988
+ signal?: AbortSignal;
989
+ }) => Promise<ApplicationNote>;
990
+ setTags: (id: string, payload: {
991
+ tags: string[];
992
+ }, opts: {
993
+ accessToken: string;
994
+ signal?: AbortSignal;
995
+ }) => Promise<string[]>;
996
+ setScore: (id: string, payload: {
997
+ value: number;
998
+ }, opts: {
999
+ accessToken: string;
1000
+ signal?: AbortSignal;
1001
+ }) => Promise<ApplicationScore>;
474
1002
  };
475
- readonly dues: {
476
- list: (params?: {
477
- userId?: string;
478
- year?: number;
479
- paymentStatus?: "unpaid" | "partial" | "paid";
480
- } & PaginationParams, opts?: {
1003
+ givebutter: {
1004
+ campaigns: {
1005
+ list: (opts: {
1006
+ accessToken: string;
1007
+ signal?: AbortSignal;
1008
+ }) => Promise<unknown[]>;
1009
+ discountCodes: {
1010
+ list: (campaignId: number, opts: {
1011
+ accessToken: string;
481
1012
  signal?: AbortSignal;
482
- }) => Promise<Paginated<DuesStatus>>;
483
- };
484
- readonly shifts: {
485
- list: (params?: {
486
- year?: number;
487
- fromDate?: string;
488
- toDate?: string;
489
- publishedOnly?: boolean;
490
- openOnly?: boolean;
491
- } & PaginationParams, opts?: {
1013
+ }) => Promise<unknown[]>;
1014
+ create: (campaignId: number, payload: {
1015
+ code: string;
1016
+ value: number;
1017
+ type: "percent" | "fixed";
1018
+ expirationDate?: string;
1019
+ }, opts: {
1020
+ accessToken: string;
492
1021
  signal?: AbortSignal;
493
- }) => Promise<Paginated<Shift>>;
494
- };
495
- readonly org: {
496
- get: (opts?: {
1022
+ }) => Promise<unknown>;
1023
+ };
1024
+ tickets: {
1025
+ create: (campaignId: number, payload: {
1026
+ name: string;
1027
+ price: number;
1028
+ totalQuantity?: number;
1029
+ }, opts: {
1030
+ accessToken: string;
497
1031
  signal?: AbortSignal;
498
- }) => Promise<OrgConfig>;
1032
+ }) => Promise<unknown>;
1033
+ };
1034
+ };
499
1035
  };
500
- readonly commitments: {
501
- list: (opts?: {
502
- signal?: AbortSignal;
503
- }) => Promise<CommitmentsListResponse>;
1036
+ members: {
1037
+ create: (payload: MemberCreatePayload, opts: {
1038
+ accessToken: string;
1039
+ signal?: AbortSignal;
1040
+ }) => Promise<MemberCreateResponse>;
1041
+ update: (id: string, patch: MemberUpdatePayload, opts: {
1042
+ accessToken: string;
1043
+ signal?: AbortSignal;
1044
+ }) => Promise<MemberUpdateResponse>;
1045
+ deactivate: (id: string, opts: {
1046
+ accessToken: string;
1047
+ signal?: AbortSignal;
1048
+ }) => Promise<MemberDeactivateResponse>;
504
1049
  };
505
- readonly payments: {
506
- page: (memberId: string, duesCollectionId?: string, opts?: {
507
- signal?: AbortSignal;
508
- }) => Promise<PaymentPageResponse>;
1050
+ announcements: {
1051
+ /** Send an email blast to camp members (PLA-706). Requires admin Bearer token. */
1052
+ send: (payload: AnnouncementSendPayload, opts: {
1053
+ accessToken: string;
1054
+ signal?: AbortSignal;
1055
+ }) => Promise<AnnouncementSendResponse>;
509
1056
  };
510
- readonly admin: {
511
- applications: {
512
- /** Get application audit timeline (PLA-712). Requires admin Bearer token. */
513
- history: (id: string, opts: {
514
- accessToken: string;
515
- signal?: AbortSignal;
516
- }) => Promise<ApplicationHistoryResponse>;
517
- transition: (id: string, payload: ApplicationTransitionPayload, opts: {
518
- accessToken: string;
519
- signal?: AbortSignal;
520
- }) => Promise<ApplicationTransitionResponse>;
521
- getAnnotations: (id: string, opts: {
522
- accessToken: string;
523
- signal?: AbortSignal;
524
- }) => Promise<ApplicationAnnotations>;
525
- addNote: (id: string, payload: {
526
- body: string;
527
- }, opts: {
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
- };
1057
+ dues: {
1058
+ /** Create a manual dues/payment record (PLA-708). Requires admin Bearer token. */
1059
+ create: (payload: DuesCreatePayload, opts: {
1060
+ accessToken: string;
1061
+ signal?: AbortSignal;
1062
+ }) => Promise<DuesCreateResponse>;
1063
+ /** Update a dues/payment record (PLA-708). Requires admin Bearer token. */
1064
+ update: (id: string, payload: DuesUpdatePayload, opts: {
1065
+ accessToken: string;
1066
+ signal?: AbortSignal;
1067
+ }) => Promise<DuesUpdateResponse>;
671
1068
  };
672
- readonly schedule: {
673
- /** List available interview slots for a booking token (PLA-714). Public. */
674
- getSlots: (token: string, opts?: {
675
- signal?: AbortSignal;
1069
+ org: {
1070
+ /** Update camp configuration settings (PLA-709). Requires admin Bearer token. */
1071
+ update: (payload: OrgUpdatePayload, opts: {
1072
+ accessToken: string;
1073
+ signal?: AbortSignal;
1074
+ }) => Promise<OrgUpdateResponse>;
1075
+ };
1076
+ scheduling: {
1077
+ availability: {
1078
+ /** Get interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
1079
+ get: (interviewerId: string, opts: {
1080
+ accessToken: string;
1081
+ signal?: AbortSignal;
1082
+ }) => Promise<SetAvailabilityResponse>;
1083
+ /** Set interview availability for an interviewer (PLA-713). Requires admin Bearer token. */
1084
+ set: (interviewerId: string, payload: SetAvailabilityInput, opts: {
1085
+ accessToken: string;
1086
+ signal?: AbortSignal;
1087
+ }) => Promise<SetAvailabilityResponse>;
1088
+ };
1089
+ calendar: {
1090
+ /** Get Google Calendar connection status for an interviewer (PLA-726). Requires admin Bearer. */
1091
+ status: (interviewerId: string, opts: {
1092
+ accessToken: string;
1093
+ signal?: AbortSignal;
1094
+ }) => Promise<CalendarStatus>;
1095
+ /** List available Google Calendars (PLA-726). Requires admin Bearer. */
1096
+ listCalendars: (interviewerId: string, opts: {
1097
+ accessToken: string;
1098
+ signal?: AbortSignal;
676
1099
  }) => Promise<{
677
- slots: {
678
- startsAt: string;
679
- endsAt: string;
680
- }[];
1100
+ calendars: GoogleCalendar[];
681
1101
  }>;
682
- /** Book an interview slot (PLA-714). Public. */
683
- book: (token: string, payload: BookSlotInput, opts?: {
684
- signal?: AbortSignal;
685
- }) => Promise<BookSlotResponse>;
686
- /** Cancel an interview booking (PLA-714). Public. */
687
- cancel: (token: string, opts?: {
688
- signal?: AbortSignal;
689
- }) => Promise<BookSlotResponse>;
690
- /** Reschedule an interview booking (PLA-714). Public. */
691
- reschedule: (token: string, payload: RescheduleInput, opts?: {
692
- signal?: AbortSignal;
693
- }) => Promise<BookSlotResponse>;
1102
+ /** Select which Google Calendar to use (PLA-726). Requires admin Bearer. */
1103
+ select: (interviewerId: string, payload: SelectCalendarInput, opts: {
1104
+ accessToken: string;
1105
+ signal?: AbortSignal;
1106
+ }) => Promise<{
1107
+ calendarId: string;
1108
+ }>;
1109
+ /** Disconnect Google Calendar from interviewer (PLA-726). Requires admin Bearer. */
1110
+ disconnect: (interviewerId: string, opts: {
1111
+ accessToken: string;
1112
+ signal?: AbortSignal;
1113
+ }) => Promise<{
1114
+ disconnected: boolean;
1115
+ }>;
1116
+ };
1117
+ bookingTokens: {
1118
+ /** Create a booking token for an application's interview link (PLA-714). Requires admin Bearer token. */
1119
+ create: (payload: CreateBookingTokenInput, opts: {
1120
+ accessToken: string;
1121
+ signal?: AbortSignal;
1122
+ }) => Promise<BookingToken>;
1123
+ /** Get an existing booking token for an application (PLA-714). Requires admin Bearer token. */
1124
+ get: (applicationId: string, opts: {
1125
+ accessToken: string;
1126
+ signal?: AbortSignal;
1127
+ }) => Promise<BookingToken>;
1128
+ };
694
1129
  };
1130
+ };
1131
+ readonly schedule: {
1132
+ /** List available interview slots for a booking token (PLA-714). Public. */
1133
+ getSlots: (token: string, opts?: {
1134
+ signal?: AbortSignal;
1135
+ }) => Promise<{
1136
+ slots: {
1137
+ startsAt: string;
1138
+ endsAt: string;
1139
+ }[];
1140
+ }>;
1141
+ /** Book an interview slot (PLA-714). Public. */
1142
+ book: (token: string, payload: BookSlotInput, opts?: {
1143
+ signal?: AbortSignal;
1144
+ }) => Promise<BookSlotResponse>;
1145
+ /** Cancel an interview booking (PLA-714). Public. */
1146
+ cancel: (token: string, opts?: {
1147
+ signal?: AbortSignal;
1148
+ }) => Promise<BookSlotResponse>;
1149
+ /** Reschedule an interview booking (PLA-714). Public. */
1150
+ reschedule: (token: string, payload: RescheduleInput, opts?: {
1151
+ signal?: AbortSignal;
1152
+ }) => Promise<BookSlotResponse>;
1153
+ };
695
1154
  }
696
1155
  /** Convenience factory — equivalent to `new PlayaOSClient(opts)`. */
697
1156
  declare function createClient(opts: ClientOptions): PlayaOSClient;
698
-
1157
+ //#endregion
1158
+ //#region src/exchange.d.ts
699
1159
  /**
700
1160
  * Server-side OAuth-code → ID-token exchange.
701
1161
  *
@@ -707,22 +1167,23 @@ declare function createClient(opts: ClientOptions): PlayaOSClient;
707
1167
  * in `@playaos/react`.
708
1168
  */
709
1169
  interface ExchangeParams {
710
- authBaseUrl?: string;
711
- code: string;
712
- codeVerifier: string;
713
- clientId: string;
714
- /** Confidential clients only. Omit for public/PKCE-only clients. */
715
- clientSecret?: string;
716
- redirectUri: string;
1170
+ authBaseUrl?: string;
1171
+ code: string;
1172
+ codeVerifier: string;
1173
+ clientId: string;
1174
+ /** Confidential clients only. Omit for public/PKCE-only clients. */
1175
+ clientSecret?: string;
1176
+ redirectUri: string;
717
1177
  }
718
1178
  interface ExchangeResult {
719
- idToken: string;
720
- expiresAt: string;
721
- /** Confidential clients only. Undefined for public clients. */
722
- refreshToken?: string;
1179
+ idToken: string;
1180
+ expiresAt: string;
1181
+ /** Confidential clients only. Undefined for public clients. */
1182
+ refreshToken?: string;
723
1183
  }
724
1184
  declare function exchangeCode(params: ExchangeParams): Promise<ExchangeResult>;
725
-
1185
+ //#endregion
1186
+ //#region src/public-marketplace.d.ts
726
1187
  /** A listing holds at most this many images (matches the DB's position 1–6 check). */
727
1188
  declare const MAX_IMAGE_POSITION = 6;
728
1189
  /**
@@ -736,68 +1197,69 @@ declare const MAX_IMAGE_POSITION = 6;
736
1197
  * public API as the single write contract — the UI is just another consumer.
737
1198
  */
738
1199
  interface PublicMarketplaceClientOptions {
739
- /** API base, e.g. `https://api.playaos.app`. */
740
- baseUrl: string;
741
- /** Supplies the Supabase access token (Bearer) for authenticated calls; null/undefined when signed out. */
742
- getToken: () => Promise<string | null | undefined> | string | null | undefined;
1200
+ /** API base, e.g. `https://api.playaos.app`. */
1201
+ baseUrl: string;
1202
+ /** Supplies the Supabase access token (Bearer) for authenticated calls; null/undefined when signed out. */
1203
+ getToken: () => Promise<string | null | undefined> | string | null | undefined;
743
1204
  }
744
1205
  interface NewListingInput {
745
- category: string;
746
- subcategory?: string;
747
- title: string;
748
- body: string;
749
- price?: number;
750
- location?: string;
751
- replyEmail: string;
1206
+ category: string;
1207
+ subcategory?: string;
1208
+ title: string;
1209
+ body: string;
1210
+ price?: number;
1211
+ location?: string;
1212
+ replyEmail: string;
752
1213
  }
753
1214
  interface ImageUploadTarget {
754
- /** Supabase signed upload URL — PUT the file bytes here. */
755
- uploadUrl: string;
756
- /** Storage path to pass back to `attachImage` once the PUT succeeds. */
757
- storagePath: string;
1215
+ /** Supabase signed upload URL — PUT the file bytes here. */
1216
+ uploadUrl: string;
1217
+ /** Storage path to pass back to `attachImage` once the PUT succeeds. */
1218
+ storagePath: string;
758
1219
  }
759
1220
  /** Moderation flag reasons accepted by the API (mirrors the DB enum). */
760
1221
  type MarketplaceFlagReason = "spam" | "prohibited" | "other";
761
1222
  interface ListingImage {
762
- /** Short-lived signed download URL for the image. */
763
- url: string;
764
- /** 1-based display order. */
765
- position: number;
1223
+ /** Short-lived signed download URL for the image. */
1224
+ url: string;
1225
+ /** 1-based display order. */
1226
+ position: number;
766
1227
  }
767
1228
  interface PublicMarketplaceClient {
768
- /**
769
- * Create a listing as the signed-in account. Throws a plain `Error` when there
770
- * is no token (signed out), or `ApiClientError` on a non-2xx response.
771
- */
772
- createListing(input: NewListingInput, signal?: AbortSignal): Promise<{
773
- id: string;
774
- }>;
775
- /** Request a signed upload URL for an image on a listing the caller owns. */
776
- getImageUploadUrl(listingId: string, signal?: AbortSignal): Promise<ImageUploadTarget>;
777
- /** Attach an already-uploaded image (by storage path) to a listing at a 1–6 position. */
778
- attachImage(listingId: string, input: {
779
- storagePath: string;
780
- position: number;
781
- }, signal?: AbortSignal): Promise<{
782
- id: string;
783
- }>;
784
- /** Anonymous: list an active listing's images as short-lived signed URLs (for public display). */
785
- listListingImages(listingId: string, signal?: AbortSignal): Promise<{
786
- images: ListingImage[];
787
- }>;
788
- /** Anonymous: batch-fetch first-image signed thumbnail URLs (listingId -> url) for browse cards. */
789
- listThumbnails(listingIds: string[], signal?: AbortSignal): Promise<{
790
- thumbnails: Record<string, string>;
791
- }>;
792
- /** Flag a listing for moderation (signed-in). Idempotent per (listing, user). */
793
- flagListing(listingId: string, reason: MarketplaceFlagReason, signal?: AbortSignal): Promise<{
794
- ok: boolean;
795
- }>;
796
- /** Contact a listing's owner (signed-in); records the reply + queues a notification email. */
797
- replyToListing(listingId: string, message: string | undefined, signal?: AbortSignal): Promise<{
798
- ok: boolean;
799
- }>;
1229
+ /**
1230
+ * Create a listing as the signed-in account. Throws a plain `Error` when there
1231
+ * is no token (signed out), or `ApiClientError` on a non-2xx response.
1232
+ */
1233
+ createListing(input: NewListingInput, signal?: AbortSignal): Promise<{
1234
+ id: string;
1235
+ }>;
1236
+ /** Request a signed upload URL for an image on a listing the caller owns. */
1237
+ getImageUploadUrl(listingId: string, signal?: AbortSignal): Promise<ImageUploadTarget>;
1238
+ /** Attach an already-uploaded image (by storage path) to a listing at a 1–6 position. */
1239
+ attachImage(listingId: string, input: {
1240
+ storagePath: string;
1241
+ position: number;
1242
+ }, signal?: AbortSignal): Promise<{
1243
+ id: string;
1244
+ }>;
1245
+ /** Anonymous: list an active listing's images as short-lived signed URLs (for public display). */
1246
+ listListingImages(listingId: string, signal?: AbortSignal): Promise<{
1247
+ images: ListingImage[];
1248
+ }>;
1249
+ /** Anonymous: batch-fetch first-image signed thumbnail URLs (listingId -> url) for browse cards. */
1250
+ listThumbnails(listingIds: string[], signal?: AbortSignal): Promise<{
1251
+ thumbnails: Record<string, string>;
1252
+ }>;
1253
+ /** Flag a listing for moderation (signed-in). Idempotent per (listing, user). */
1254
+ flagListing(listingId: string, reason: MarketplaceFlagReason, signal?: AbortSignal): Promise<{
1255
+ ok: boolean;
1256
+ }>;
1257
+ /** Contact a listing's owner (signed-in); records the reply + queues a notification email. */
1258
+ replyToListing(listingId: string, message: string | undefined, signal?: AbortSignal): Promise<{
1259
+ ok: boolean;
1260
+ }>;
800
1261
  }
801
1262
  declare function createPublicMarketplaceClient(opts: PublicMarketplaceClientOptions): PublicMarketplaceClient;
802
-
803
- 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 };
1263
+ //#endregion
1264
+ export { ApiClientError, type Application, type ApplicationAnnotations, type ApplicationCreatePayload, type ApplicationCreateResponse, type ApplicationNote, type ApplicationScore, type ApplicationStatus, type ApplicationTransitionPayload, type ApplicationTransitionResponse, type BikeRentalCatalogItem, type BikeRentalCatalogResponse, type BikeRentalDeliveryMode, type BikeRentalFramePreference, type BikeRentalInterestedMember, type BikeRentalInterestedNotReservedResponse, type BikeRentalRequestInput, type BikeRentalRequestResult, type BikeRentalReservation, type BikeRentalReservationListResponse, type BikeRentalWaiver, 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 PackingItem, type PackingItemStatus, type PackingLayer, type PackingListResponse, type PackingPersonalItem, 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 };
1265
+ //# sourceMappingURL=index.d.ts.map