@curviate/sdk 0.9.0 → 0.11.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
@@ -360,6 +360,23 @@ var AccountsResource = class {
360
360
  body
361
361
  });
362
362
  }
363
+ /**
364
+ * Re-send the pending verification challenge notification for an account.
365
+ *
366
+ * Useful when the end user says they never received the code or push
367
+ * notification for a pending checkpoint. `resent` echoes the result
368
+ * honestly: `true` once the notification was actually re-sent, `false`
369
+ * when there was nothing to re-send for that challenge type (this call
370
+ * never throws just because a resend wasn't applicable). Does not reset
371
+ * the checkpoint's expiry.
372
+ */
373
+ resendCheckpoint(body) {
374
+ return this.ctx.request({
375
+ method: "POST",
376
+ path: "/v1/accounts/checkpoints/resend",
377
+ body
378
+ });
379
+ }
363
380
  /**
364
381
  * Generate a one-time hosted connection link the end user opens to authorize a
365
382
  * LinkedIn connection without credentials transiting the API or LLM context.
@@ -371,6 +388,24 @@ var AccountsResource = class {
371
388
  body
372
389
  });
373
390
  }
391
+ /**
392
+ * Poll a hosted connect session minted by {@link createConnectLink} (its
393
+ * `session_id`).
394
+ *
395
+ * A pure status read — it makes no external call and does not itself complete
396
+ * the connection. `status` is `pending` until the end user finishes the
397
+ * hosted flow, then `resolved` (with `account_id`), or `expired` / `failed`.
398
+ * Poll until it leaves `pending`.
399
+ *
400
+ * @param sessionId - the `session_id` returned on the connect-link 201 body.
401
+ * @returns the session's current `status` and, once `resolved`, `account_id`.
402
+ */
403
+ getConnectSession(sessionId) {
404
+ return this.ctx.request({
405
+ method: "GET",
406
+ path: `/v1/accounts/connect-sessions/${sessionId}`
407
+ });
408
+ }
374
409
  /**
375
410
  * Return metadata and current state for one connected account, including the
376
411
  * central `quotas[]` view for all tracked quota families and `seat_id` (the
@@ -1043,6 +1078,21 @@ var SalesNavigatorResource = class {
1043
1078
  }
1044
1079
  };
1045
1080
 
1081
+ // src/internal/job-id.ts
1082
+ var JOB_URL_ID_PATTERN = /\/jobs\/view\/(\d+)/;
1083
+ function resolveJobId(idOrUrl) {
1084
+ const trimmed = idOrUrl.trim();
1085
+ if (/^\d+$/.test(trimmed)) return trimmed;
1086
+ const match = trimmed.match(JOB_URL_ID_PATTERN);
1087
+ if (match) return match[1];
1088
+ throw new CurviateError({
1089
+ code: "INVALID_REQUEST",
1090
+ message: `Could not extract a numeric job id from "${idOrUrl}". Pass a bare numeric id (e.g. "4428113858") or a LinkedIn job URL (e.g. "https://www.linkedin.com/jobs/view/4428113858").`,
1091
+ userFixable: true,
1092
+ retryLikelyToSucceed: false
1093
+ });
1094
+ }
1095
+
1046
1096
  // src/resources/recruiter.ts
1047
1097
  function buildFormData4(scalars, attachments, voice_message, video_message) {
1048
1098
  const form = new FormData();
@@ -1258,6 +1308,24 @@ var RecruiterResource = class {
1258
1308
  accountIdIn: "body"
1259
1309
  });
1260
1310
  }
1311
+ /**
1312
+ * Get a job posting via the Recruiter lens (any public posting, not only
1313
+ * the operator's own). `GET /v1/recruiter/jobs/{job_id}`
1314
+ *
1315
+ * Accepts a bare numeric job id or a full job URL
1316
+ * (`https://www.linkedin.com/jobs/view/{id}`) — the id is extracted
1317
+ * client-side, mirroring `jobs.get()`. Throws
1318
+ * `CurviateError({ code: 'INVALID_REQUEST' })` synchronously if neither
1319
+ * form can be recognized. Returns the same `JobPosting` shape as
1320
+ * `jobs.get()`.
1321
+ */
1322
+ getJob(jobIdOrUrl) {
1323
+ const jobId = resolveJobId(jobIdOrUrl);
1324
+ return this.ctx.request({
1325
+ method: "GET",
1326
+ path: `/v1/recruiter/jobs/${jobId}`
1327
+ });
1328
+ }
1261
1329
  /**
1262
1330
  * List applicants for a job posting.
1263
1331
  * `GET /v1/recruiter/jobs/{job_id}/applicants`
@@ -1292,6 +1360,32 @@ var RecruiterResource = class {
1292
1360
  }
1293
1361
  };
1294
1362
 
1363
+ // src/resources/jobs.ts
1364
+ var JobsResource = class {
1365
+ constructor(ctx) {
1366
+ this.ctx = ctx;
1367
+ }
1368
+ /**
1369
+ * Retrieve one public LinkedIn job posting's full detail.
1370
+ * `GET /v1/jobs/{job_id}`
1371
+ *
1372
+ * Accepts a bare numeric job id or a full job URL
1373
+ * (`https://www.linkedin.com/jobs/view/{id}`) — the id is extracted
1374
+ * client-side; the wire request always carries the numeric id. Throws
1375
+ * `CurviateError({ code: 'INVALID_REQUEST' })` synchronously if neither
1376
+ * form can be recognized.
1377
+ * The `account_id` is injected by the account-scoped context.
1378
+ */
1379
+ get(jobIdOrUrl, params) {
1380
+ const jobId = resolveJobId(jobIdOrUrl);
1381
+ return this.ctx.request({
1382
+ method: "GET",
1383
+ path: `/v1/jobs/${jobId}`,
1384
+ ...params ? { query: params } : {}
1385
+ });
1386
+ }
1387
+ };
1388
+
1295
1389
  // src/resources/webhooks.ts
1296
1390
  var WebhooksResource = class {
1297
1391
  constructor(ctx) {
@@ -1377,6 +1471,7 @@ function buildNamespaces(ctx) {
1377
1471
  posts: new PostsResource(ctx),
1378
1472
  salesNavigator: new SalesNavigatorResource(ctx),
1379
1473
  recruiter: new RecruiterResource(ctx),
1474
+ jobs: new JobsResource(ctx),
1380
1475
  webhooks: new WebhooksResource(ctx)
1381
1476
  };
1382
1477
  }
@@ -1400,6 +1495,7 @@ var Curviate = class {
1400
1495
  this.posts = ns.posts;
1401
1496
  this.salesNavigator = ns.salesNavigator;
1402
1497
  this.recruiter = ns.recruiter;
1498
+ this.jobs = ns.jobs;
1403
1499
  this.webhooks = ns.webhooks;
1404
1500
  }
1405
1501
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/sdk",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "private": false,
5
5
  "description": "TypeScript SDK for the Curviate API.",
6
6
  "license": "MIT",