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