@cavuno/board 1.20.0 → 1.21.1

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.20.0";
112
+ var SDK_VERSION = "1.21.1";
113
113
 
114
114
  // src/client.ts
115
115
  function isRawBody(body) {
@@ -1060,6 +1060,414 @@ function meNamespace(client) {
1060
1060
  });
1061
1061
  }
1062
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
+ },
1063
1471
  savedJobs: {
1064
1472
  /**
1065
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.20.0",
3
+ "version": "1.21.1",
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.20.0",
2
+ "version": "1.21.1",
3
3
  "skills": [
4
4
  {
5
5
  "name": "cavuno-board-auth",