@cavuno/board 1.19.1 → 1.21.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.js CHANGED
@@ -149,7 +149,7 @@ async function clearSession(storage) {
149
149
  }
150
150
 
151
151
  // src/version.ts
152
- var SDK_VERSION = "1.19.1";
152
+ var SDK_VERSION = "1.21.0";
153
153
 
154
154
  // src/client.ts
155
155
  function isRawBody(body) {
@@ -910,6 +910,604 @@ function meNamespace(client) {
910
910
  retrieve(query, options) {
911
911
  return client.fetch("/me", { ...options, query });
912
912
  },
913
+ /**
914
+ * Permanently delete my account and all dependent data (profile,
915
+ * collections, saved jobs, alerts, avatar/resume files). Synchronous and
916
+ * irreversible — resolves void once the cascade completes (204).
917
+ *
918
+ * @example
919
+ * await board.me.delete();
920
+ */
921
+ delete(options) {
922
+ return client.fetch("/me", { ...options, method: "DELETE" });
923
+ },
924
+ /**
925
+ * The authenticated candidate's own account self-service (doc 32).
926
+ * `profile.*` is the lean profile singleton + (commit 2+) its
927
+ * experience / education / skills / languages collections + avatar.
928
+ */
929
+ profile: {
930
+ /**
931
+ * Retrieve my lean candidate profile.
932
+ *
933
+ * @example
934
+ * const profile = await board.me.profile.retrieve();
935
+ */
936
+ retrieve(query, options) {
937
+ return client.fetch("/me/profile", {
938
+ ...options,
939
+ query
940
+ });
941
+ },
942
+ /**
943
+ * Update my candidate profile. Optional-field merge-patch — omitted
944
+ * fields stay unchanged.
945
+ *
946
+ * @example
947
+ * await board.me.profile.update({ headline: 'Staff Engineer' });
948
+ */
949
+ update(body, query, options) {
950
+ return client.fetch("/me/profile", {
951
+ ...options,
952
+ method: "PATCH",
953
+ body,
954
+ query
955
+ });
956
+ },
957
+ /**
958
+ * Check whether a handle is available for me on this board (my own
959
+ * current handle counts as available). Advisory — `update` re-checks.
960
+ *
961
+ * @example
962
+ * const { available } = await board.me.profile.handleAvailable('jane');
963
+ */
964
+ handleAvailable(handle, options) {
965
+ return client.fetch(
966
+ "/me/profile/handle-available",
967
+ { ...options, query: { handle } }
968
+ );
969
+ },
970
+ /** List my experience entries. */
971
+ listExperience(options) {
972
+ return client.fetch(
973
+ "/me/profile/experience",
974
+ options
975
+ );
976
+ },
977
+ /** Add an experience entry. */
978
+ createExperience(body, options) {
979
+ return client.fetch("/me/profile/experience", {
980
+ ...options,
981
+ method: "POST",
982
+ body
983
+ });
984
+ },
985
+ /** Update an experience entry (merge-patch). */
986
+ updateExperience(id, body, options) {
987
+ return client.fetch(
988
+ `/me/profile/experience/${encodeURIComponent(id)}`,
989
+ { ...options, method: "PATCH", body }
990
+ );
991
+ },
992
+ /** Delete an experience entry. */
993
+ deleteExperience(id, options) {
994
+ return client.fetch(
995
+ `/me/profile/experience/${encodeURIComponent(id)}`,
996
+ { ...options, method: "DELETE" }
997
+ );
998
+ },
999
+ /** List my education entries. */
1000
+ listEducation(options) {
1001
+ return client.fetch(
1002
+ "/me/profile/education",
1003
+ options
1004
+ );
1005
+ },
1006
+ /** Add an education entry. */
1007
+ createEducation(body, options) {
1008
+ return client.fetch("/me/profile/education", {
1009
+ ...options,
1010
+ method: "POST",
1011
+ body
1012
+ });
1013
+ },
1014
+ /** Update an education entry (merge-patch). */
1015
+ updateEducation(id, body, options) {
1016
+ return client.fetch(
1017
+ `/me/profile/education/${encodeURIComponent(id)}`,
1018
+ { ...options, method: "PATCH", body }
1019
+ );
1020
+ },
1021
+ /** Delete an education entry. */
1022
+ deleteEducation(id, options) {
1023
+ return client.fetch(
1024
+ `/me/profile/education/${encodeURIComponent(id)}`,
1025
+ { ...options, method: "DELETE" }
1026
+ );
1027
+ },
1028
+ /** List my skills. */
1029
+ listSkills(options) {
1030
+ return client.fetch(
1031
+ "/me/profile/skills",
1032
+ options
1033
+ );
1034
+ },
1035
+ /** Replace my skills with the provided ordered names. */
1036
+ updateSkills(body, options) {
1037
+ return client.fetch(
1038
+ "/me/profile/skills",
1039
+ { ...options, method: "PUT", body }
1040
+ );
1041
+ },
1042
+ /** List my languages. */
1043
+ listLanguages(options) {
1044
+ return client.fetch(
1045
+ "/me/profile/languages",
1046
+ options
1047
+ );
1048
+ },
1049
+ /** Replace my languages with the provided ordered set. */
1050
+ updateLanguages(body, options) {
1051
+ return client.fetch(
1052
+ "/me/profile/languages",
1053
+ { ...options, method: "PUT", body }
1054
+ );
1055
+ },
1056
+ /**
1057
+ * Upload my avatar (JPEG/PNG/WebP, ≤5 MB) via a single multipart POST.
1058
+ *
1059
+ * @example
1060
+ * await board.me.profile.uploadAvatar(file);
1061
+ */
1062
+ uploadAvatar(file, options) {
1063
+ const form = new FormData();
1064
+ form.append("file", file);
1065
+ return client.fetch("/me/profile/avatar", {
1066
+ ...options,
1067
+ method: "POST",
1068
+ body: form
1069
+ });
1070
+ }
1071
+ },
1072
+ /**
1073
+ * Signed-in notification preferences + the anonymous email-link
1074
+ * unsubscribe branch (doc 32).
1075
+ */
1076
+ notificationPreferences: {
1077
+ /** List every notification channel + its subscribed state. */
1078
+ retrieve(options) {
1079
+ return client.fetch(
1080
+ "/me/notification-preferences",
1081
+ options
1082
+ );
1083
+ },
1084
+ /** Toggle one channel; returns the full updated set. */
1085
+ update(body, options) {
1086
+ return client.fetch(
1087
+ "/me/notification-preferences",
1088
+ { ...options, method: "PUT", body }
1089
+ );
1090
+ },
1091
+ /**
1092
+ * Anonymous one-click unsubscribe via an HMAC email-link token — no
1093
+ * session. Resolves void on success (204).
1094
+ */
1095
+ unsubscribeWithToken(body, options) {
1096
+ return client.fetch("/me/notification-preferences/unsubscribe", {
1097
+ ...options,
1098
+ method: "POST",
1099
+ body
1100
+ });
1101
+ }
1102
+ },
1103
+ /**
1104
+ * The authenticated board user's employer facet (doc 35 / ADR-0052):
1105
+ * claiming/creating a company, the work-email verification state machine,
1106
+ * and editing the company profile. A board user becomes an employer by
1107
+ * claiming a company — the same identity can also be a candidate.
1108
+ */
1109
+ companies: {
1110
+ /**
1111
+ * Search companies on this board to claim.
1112
+ *
1113
+ * @example
1114
+ * const { data } = await board.me.companies.search({ q: 'acme' });
1115
+ */
1116
+ search(query, options) {
1117
+ return client.fetch(
1118
+ "/me/companies/search",
1119
+ { ...options, query }
1120
+ );
1121
+ },
1122
+ /**
1123
+ * List my company memberships, each with its computed claim `status`.
1124
+ *
1125
+ * @example
1126
+ * const { data } = await board.me.companies.list();
1127
+ */
1128
+ list(options) {
1129
+ return client.fetch(
1130
+ "/me/companies",
1131
+ options
1132
+ );
1133
+ },
1134
+ /**
1135
+ * Create (or adopt an existing same-domain) company and open a
1136
+ * membership. Returns the membership.
1137
+ *
1138
+ * @example
1139
+ * await board.me.companies.create({ name: 'Acme', website: 'acme.com' });
1140
+ */
1141
+ create(body, options) {
1142
+ return client.fetch("/me/companies", {
1143
+ ...options,
1144
+ method: "POST",
1145
+ body
1146
+ });
1147
+ },
1148
+ /**
1149
+ * Claim an existing company by slug. Returns the membership with its
1150
+ * computed status (`approved` on email-domain match, else pending).
1151
+ *
1152
+ * @example
1153
+ * await board.me.companies.claim('acme');
1154
+ */
1155
+ claim(slug, options) {
1156
+ return client.fetch(
1157
+ `/me/companies/${encodeURIComponent(slug)}/claim`,
1158
+ { ...options, method: "POST" }
1159
+ );
1160
+ },
1161
+ /**
1162
+ * Cancel my pending claim on a company. Resolves void on success (204).
1163
+ *
1164
+ * @example
1165
+ * await board.me.companies.cancelClaim('acme');
1166
+ */
1167
+ cancelClaim(slug, options) {
1168
+ return client.fetch(
1169
+ `/me/companies/${encodeURIComponent(slug)}/claim`,
1170
+ { ...options, method: "DELETE" }
1171
+ );
1172
+ },
1173
+ /**
1174
+ * Edit my company profile (merge-patch — omitted fields stay
1175
+ * unchanged). Requires an approved membership. Returns the company.
1176
+ *
1177
+ * @example
1178
+ * await board.me.companies.update('acme', { website: 'acme.io' });
1179
+ */
1180
+ update(slug, body, options) {
1181
+ return client.fetch(
1182
+ `/me/companies/${encodeURIComponent(slug)}`,
1183
+ { ...options, method: "PATCH", body }
1184
+ );
1185
+ },
1186
+ /** The work-email verification state machine for a pending claim. */
1187
+ workEmail: {
1188
+ /**
1189
+ * Email a 24h verification link to a work email for my pending claim.
1190
+ * Returns the membership with the work email recorded.
1191
+ *
1192
+ * @example
1193
+ * await board.me.companies.workEmail.verify('acme', {
1194
+ * workEmail: 'me@acme.com',
1195
+ * });
1196
+ */
1197
+ verify(slug, body, options) {
1198
+ return client.fetch(
1199
+ `/me/companies/${encodeURIComponent(slug)}/work-email/verify`,
1200
+ { ...options, method: "POST", body }
1201
+ );
1202
+ },
1203
+ /**
1204
+ * Confirm a verification token (from the email link) — no session
1205
+ * required, the token IS the authorization. Returns the membership in
1206
+ * its new state.
1207
+ *
1208
+ * @example
1209
+ * await board.me.companies.workEmail.confirm('acme', { token });
1210
+ */
1211
+ confirm(slug, body, options) {
1212
+ return client.fetch(
1213
+ `/me/companies/${encodeURIComponent(slug)}/work-email/confirm`,
1214
+ { ...options, method: "POST", body }
1215
+ );
1216
+ }
1217
+ },
1218
+ /**
1219
+ * Manage the jobs of a company I am an approved member of (doc 35 /
1220
+ * ADR-0052). Every method is scoped to the company `slug`. New jobs are
1221
+ * created as held drafts — publishing is `publish` (within a live paid
1222
+ * window) or the paid-post checkout flow.
1223
+ */
1224
+ jobs: {
1225
+ /**
1226
+ * List a company's jobs (all statuses), newest first.
1227
+ *
1228
+ * @example
1229
+ * const { data } = await board.me.companies.jobs.list('acme');
1230
+ */
1231
+ list(slug, query, options) {
1232
+ return client.fetch(
1233
+ `/me/companies/${encodeURIComponent(slug)}/jobs`,
1234
+ { ...options, query }
1235
+ );
1236
+ },
1237
+ /**
1238
+ * Retrieve one of my company's jobs (any status), fully enriched.
1239
+ *
1240
+ * @example
1241
+ * const job = await board.me.companies.jobs.retrieve('acme', jobId);
1242
+ */
1243
+ retrieve(slug, id, options) {
1244
+ return client.fetch(
1245
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}`,
1246
+ options
1247
+ );
1248
+ },
1249
+ /**
1250
+ * Create a job as a held draft. Returns the created job.
1251
+ *
1252
+ * @example
1253
+ * await board.me.companies.jobs.create('acme', {
1254
+ * title: 'Staff Engineer',
1255
+ * description: '…',
1256
+ * applicationUrl: 'https://acme.com/apply',
1257
+ * });
1258
+ */
1259
+ create(slug, body, options) {
1260
+ return client.fetch(
1261
+ `/me/companies/${encodeURIComponent(slug)}/jobs`,
1262
+ { ...options, method: "POST", body }
1263
+ );
1264
+ },
1265
+ /**
1266
+ * Edit a job (merge-patch — omitted fields stay unchanged). Returns the
1267
+ * updated job.
1268
+ *
1269
+ * @example
1270
+ * await board.me.companies.jobs.update('acme', jobId, {
1271
+ * salaryMax: 220000,
1272
+ * });
1273
+ */
1274
+ update(slug, id, body, options) {
1275
+ return client.fetch(
1276
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}`,
1277
+ { ...options, method: "PATCH", body }
1278
+ );
1279
+ },
1280
+ /**
1281
+ * Delete a job (cascade). Resolves void on success (204).
1282
+ *
1283
+ * @example
1284
+ * await board.me.companies.jobs.delete('acme', jobId);
1285
+ */
1286
+ delete(slug, id, options) {
1287
+ return client.fetch(
1288
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}`,
1289
+ { ...options, method: "DELETE" }
1290
+ );
1291
+ },
1292
+ /**
1293
+ * Publish a job that is still inside its paid window (republish — a held
1294
+ * draft or expired job must instead pay via checkout). Returns the
1295
+ * updated job.
1296
+ *
1297
+ * @example
1298
+ * await board.me.companies.jobs.publish('acme', jobId);
1299
+ */
1300
+ publish(slug, id, options) {
1301
+ return client.fetch(
1302
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}/publish`,
1303
+ { ...options, method: "POST" }
1304
+ );
1305
+ },
1306
+ /**
1307
+ * Unpublish a job (back to draft; the paid window is preserved). Returns
1308
+ * the updated job.
1309
+ *
1310
+ * @example
1311
+ * await board.me.companies.jobs.unpublish('acme', jobId);
1312
+ */
1313
+ unpublish(slug, id, options) {
1314
+ return client.fetch(
1315
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}/unpublish`,
1316
+ { ...options, method: "POST" }
1317
+ );
1318
+ },
1319
+ /**
1320
+ * Pay for / publish a held draft (ADR-0031). Select billing: a paid plan
1321
+ * returns `{ status: 'checkout', checkoutUrl }` (send the buyer there;
1322
+ * the webhook publishes on payment); a free / bundle / subscription plan
1323
+ * publishes immediately (`status: 'published'`); an invoice plan emails a
1324
+ * Stripe invoice (`status: 'invoice_sent'`).
1325
+ *
1326
+ * @example
1327
+ * const r = await board.me.companies.jobs.checkout('acme', jobId, {
1328
+ * billing: { type: 'new', planId },
1329
+ * });
1330
+ * if (r.status === 'checkout') location.href = r.checkoutUrl!;
1331
+ */
1332
+ checkout(slug, id, body, options) {
1333
+ return client.fetch(
1334
+ `/me/companies/${encodeURIComponent(slug)}/jobs/${encodeURIComponent(id)}/checkout`,
1335
+ { ...options, method: "POST", body }
1336
+ );
1337
+ }
1338
+ },
1339
+ /**
1340
+ * My reusable billing options for a company — active subscription slots +
1341
+ * remaining pre-purchased (bundle) order slots, the options a held draft
1342
+ * can be published with at no new charge (the checkout `billing.type:
1343
+ * 'order' | 'subscription'`).
1344
+ */
1345
+ billingOptions: {
1346
+ /**
1347
+ * List my reusable billing options for the company.
1348
+ *
1349
+ * @example
1350
+ * const { data } = await board.me.companies.billingOptions.list('acme');
1351
+ */
1352
+ list(slug, options) {
1353
+ return client.fetch(
1354
+ `/me/companies/${encodeURIComponent(slug)}/billing-options`,
1355
+ options
1356
+ );
1357
+ }
1358
+ },
1359
+ /**
1360
+ * The applicant pipeline (ATS) for a company I am an approved member of
1361
+ * (doc 35 / ADR-0052 / ADR-0004). Reads return the full pipeline (job
1362
+ * header + stage rail + applicants with timelines); the move/reject/note
1363
+ * writes resolve void — re-read the pipeline for fresh state, mirroring
1364
+ * the hosted portal's single reactive query.
1365
+ */
1366
+ applicants: {
1367
+ /**
1368
+ * Read a job's applicant pipeline: its header, stage rail, and every
1369
+ * applicant (candidate snapshot, signed resume URL, activity timeline).
1370
+ * `query.job` is required; `query.stage` filters to one stage.
1371
+ *
1372
+ * @example
1373
+ * const pipeline = await board.me.companies.applicants.list('acme', {
1374
+ * job: jobId,
1375
+ * });
1376
+ */
1377
+ list(slug, query, options) {
1378
+ return client.fetch(
1379
+ `/me/companies/${encodeURIComponent(slug)}/applicants`,
1380
+ { ...options, query }
1381
+ );
1382
+ },
1383
+ /**
1384
+ * Move one applicant to a visible stage of its job's pipeline. Resolves
1385
+ * void on success (204).
1386
+ *
1387
+ * @example
1388
+ * await board.me.companies.applicants.move('acme', applicationId, {
1389
+ * stageId,
1390
+ * });
1391
+ */
1392
+ move(slug, applicationId, body, options) {
1393
+ return client.fetch(
1394
+ `/me/companies/${encodeURIComponent(slug)}/applicants/${encodeURIComponent(applicationId)}/stage`,
1395
+ { ...options, method: "PATCH", body }
1396
+ );
1397
+ },
1398
+ /**
1399
+ * Move many applicants of one job to a visible stage atomically.
1400
+ * Resolves void on success (204).
1401
+ *
1402
+ * @example
1403
+ * await board.me.companies.applicants.bulkMove('acme', {
1404
+ * applicationIds, stageId,
1405
+ * });
1406
+ */
1407
+ bulkMove(slug, body, options) {
1408
+ return client.fetch(
1409
+ `/me/companies/${encodeURIComponent(slug)}/applicants/bulk/move`,
1410
+ { ...options, method: "POST", body }
1411
+ );
1412
+ },
1413
+ /**
1414
+ * Reject many applicants of one job atomically (move to the rejected
1415
+ * stage). Resolves void on success (204).
1416
+ *
1417
+ * @example
1418
+ * await board.me.companies.applicants.bulkReject('acme', {
1419
+ * applicationIds,
1420
+ * });
1421
+ */
1422
+ bulkReject(slug, body, options) {
1423
+ return client.fetch(
1424
+ `/me/companies/${encodeURIComponent(slug)}/applicants/bulk/reject`,
1425
+ { ...options, method: "POST", body }
1426
+ );
1427
+ },
1428
+ /**
1429
+ * Append a company-private note to an applicant (it surfaces in the
1430
+ * applicant timeline). Resolves void on success (204).
1431
+ *
1432
+ * @example
1433
+ * await board.me.companies.applicants.addNote('acme', applicationId, {
1434
+ * body: 'Strong candidate.',
1435
+ * });
1436
+ */
1437
+ addNote(slug, applicationId, body, options) {
1438
+ return client.fetch(
1439
+ `/me/companies/${encodeURIComponent(slug)}/applicants/${encodeURIComponent(applicationId)}/notes`,
1440
+ { ...options, method: "POST", body }
1441
+ );
1442
+ }
1443
+ },
1444
+ /**
1445
+ * The pipeline stage rail (ATS) for a company I am an approved member of.
1446
+ * Every write resolves void (the backing portal mutations return void) —
1447
+ * re-read the pipeline via `applicants.list` for the fresh stage rail.
1448
+ */
1449
+ pipelineStages: {
1450
+ /**
1451
+ * Add a custom stage to a job pipeline (before the terminal
1452
+ * Hired/Rejected stages; up to 10 custom per job). Resolves void (204).
1453
+ *
1454
+ * @example
1455
+ * await board.me.companies.pipelineStages.create('acme', {
1456
+ * jobId, label: 'Phone screen',
1457
+ * });
1458
+ */
1459
+ create(slug, body, options) {
1460
+ return client.fetch(
1461
+ `/me/companies/${encodeURIComponent(slug)}/pipeline-stages`,
1462
+ { ...options, method: "POST", body }
1463
+ );
1464
+ },
1465
+ /**
1466
+ * Rename a stage (`{ label }`) or show/hide it (`{ hidden }`) — exactly
1467
+ * one. Resolves void on success (204).
1468
+ *
1469
+ * @example
1470
+ * await board.me.companies.pipelineStages.update('acme', stageId, {
1471
+ * label: 'Tech screen',
1472
+ * });
1473
+ */
1474
+ update(slug, stageId, body, options) {
1475
+ return client.fetch(
1476
+ `/me/companies/${encodeURIComponent(slug)}/pipeline-stages/${encodeURIComponent(stageId)}`,
1477
+ { ...options, method: "PATCH", body }
1478
+ );
1479
+ },
1480
+ /**
1481
+ * Remove a custom stage (protected stages cannot be removed). Resolves
1482
+ * void on success (204).
1483
+ *
1484
+ * @example
1485
+ * await board.me.companies.pipelineStages.remove('acme', stageId);
1486
+ */
1487
+ remove(slug, stageId, options) {
1488
+ return client.fetch(
1489
+ `/me/companies/${encodeURIComponent(slug)}/pipeline-stages/${encodeURIComponent(stageId)}`,
1490
+ { ...options, method: "DELETE" }
1491
+ );
1492
+ },
1493
+ /**
1494
+ * Set the full stage order for a job (list every stage exactly once,
1495
+ * keeping Review first and Hired immediately before Rejected). Resolves
1496
+ * void on success (204).
1497
+ *
1498
+ * @example
1499
+ * await board.me.companies.pipelineStages.reorder('acme', {
1500
+ * jobId, orderedStageIds,
1501
+ * });
1502
+ */
1503
+ reorder(slug, body, options) {
1504
+ return client.fetch(
1505
+ `/me/companies/${encodeURIComponent(slug)}/pipeline-stages/reorder`,
1506
+ { ...options, method: "PUT", body }
1507
+ );
1508
+ }
1509
+ }
1510
+ },
913
1511
  savedJobs: {
914
1512
  /**
915
1513
  * List the authenticated user's saved jobs (each embeds the full