@curviate/sdk 0.10.0 → 0.12.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
@@ -77,6 +77,7 @@ var KNOWN_CODES = /* @__PURE__ */ new Set([
77
77
  "ACCOUNT_NOT_FOUND",
78
78
  "ACCOUNT_RESTRICTED",
79
79
  "RESOURCE_NOT_FOUND",
80
+ "RESOURCE_ACCESS_RESTRICTED",
80
81
  "TIER_NOT_ACTIVE",
81
82
  "LINKEDIN_FEATURE_NOT_SUBSCRIBED",
82
83
  "RATE_LIMIT_ACCOUNT",
@@ -360,6 +361,23 @@ var AccountsResource = class {
360
361
  body
361
362
  });
362
363
  }
364
+ /**
365
+ * Re-send the pending verification challenge notification for an account.
366
+ *
367
+ * Useful when the end user says they never received the code or push
368
+ * notification for a pending checkpoint. `resent` echoes the result
369
+ * honestly: `true` once the notification was actually re-sent, `false`
370
+ * when there was nothing to re-send for that challenge type (this call
371
+ * never throws just because a resend wasn't applicable). Does not reset
372
+ * the checkpoint's expiry.
373
+ */
374
+ resendCheckpoint(body) {
375
+ return this.ctx.request({
376
+ method: "POST",
377
+ path: "/v1/accounts/checkpoints/resend",
378
+ body
379
+ });
380
+ }
363
381
  /**
364
382
  * Generate a one-time hosted connection link the end user opens to authorize a
365
383
  * LinkedIn connection without credentials transiting the API or LLM context.
@@ -371,6 +389,24 @@ var AccountsResource = class {
371
389
  body
372
390
  });
373
391
  }
392
+ /**
393
+ * Poll a hosted connect session minted by {@link createConnectLink} (its
394
+ * `session_id`).
395
+ *
396
+ * A pure status read — it makes no external call and does not itself complete
397
+ * the connection. `status` is `pending` until the end user finishes the
398
+ * hosted flow, then `resolved` (with `account_id`), or `expired` / `failed`.
399
+ * Poll until it leaves `pending`.
400
+ *
401
+ * @param sessionId - the `session_id` returned on the connect-link 201 body.
402
+ * @returns the session's current `status` and, once `resolved`, `account_id`.
403
+ */
404
+ getConnectSession(sessionId) {
405
+ return this.ctx.request({
406
+ method: "GET",
407
+ path: `/v1/accounts/connect-sessions/${sessionId}`
408
+ });
409
+ }
374
410
  /**
375
411
  * Return metadata and current state for one connected account, including the
376
412
  * central `quotas[]` view for all tracked quota families and `seat_id` (the
@@ -666,13 +702,6 @@ var ProfilesResource = class {
666
702
  ...params ? { query: params } : {}
667
703
  });
668
704
  }
669
- /** Get a company profile. `GET /v1/profiles/companies/{company_id}` */
670
- getCompany(companyId) {
671
- return this.ctx.request({
672
- method: "GET",
673
- path: `/v1/profiles/companies/${companyId}`
674
- });
675
- }
676
705
  /** Endorse a skill on a profile. `POST /v1/profiles/{profile_id}/endorse` */
677
706
  endorse(profileId, body) {
678
707
  return this.ctx.request({
@@ -1020,12 +1049,20 @@ var SalesNavigatorResource = class {
1020
1049
  });
1021
1050
  }
1022
1051
  /**
1023
- * Save a Sales Navigator member as a lead. `POST /v1/sales-navigator/leads/{user_id}`
1052
+ * Save a Sales Navigator member into a lead list.
1053
+ * `POST /v1/sales-navigator/lead-lists/{list_id}/save`
1054
+ *
1055
+ * **BREAKING (2026-07-04):** replaces the retired v1
1056
+ * `saveLead(userId, { account_id, list_id? })` — there is no alias. The
1057
+ * list is now mandatory and addresses the path; the member id travels in
1058
+ * the body alongside `account_id` (the save endpoints carry no query
1059
+ * params, so `account_id` has nowhere else to go).
1024
1060
  */
1025
- saveLead(userId, body) {
1061
+ saveLead(input) {
1062
+ const { list_id, ...body } = input;
1026
1063
  return this.ctx.request({
1027
1064
  method: "POST",
1028
- path: `/v1/sales-navigator/leads/${userId}`,
1065
+ path: `/v1/sales-navigator/lead-lists/${list_id}/save`,
1029
1066
  body,
1030
1067
  accountIdIn: "body"
1031
1068
  });
@@ -1041,6 +1078,71 @@ var SalesNavigatorResource = class {
1041
1078
  query: params
1042
1079
  });
1043
1080
  }
1081
+ // ─── v2 list surface ──────────────────────────────────────────────────────
1082
+ /**
1083
+ * List the saved-account (company) lists on the operator's Sales Navigator seat.
1084
+ * `GET /v1/sales-navigator/account-lists`
1085
+ */
1086
+ accountLists(query) {
1087
+ return this.ctx.request({
1088
+ method: "GET",
1089
+ path: "/v1/sales-navigator/account-lists",
1090
+ ...query ? { query } : {}
1091
+ });
1092
+ }
1093
+ /**
1094
+ * List the saved-lead (member) lists on the operator's Sales Navigator seat.
1095
+ * `GET /v1/sales-navigator/lead-lists`
1096
+ */
1097
+ leadLists(query) {
1098
+ return this.ctx.request({
1099
+ method: "GET",
1100
+ path: "/v1/sales-navigator/lead-lists",
1101
+ ...query ? { query } : {}
1102
+ });
1103
+ }
1104
+ /**
1105
+ * Browse the saved accounts (companies) in one account list. Pass optional
1106
+ * `persona` / `filter` / `sort_by` / `sort_order` filters in the body.
1107
+ * `POST /v1/sales-navigator/account-lists/{list_id}`
1108
+ */
1109
+ browseAccountList(listId, body, query) {
1110
+ return this.ctx.request({
1111
+ method: "POST",
1112
+ path: `/v1/sales-navigator/account-lists/${listId}`,
1113
+ body: body ?? {},
1114
+ ...query ? { query } : {}
1115
+ });
1116
+ }
1117
+ /**
1118
+ * Browse the saved leads (members) in one lead list. Pass optional
1119
+ * `spotlight` / `sort_by` / `sort_order` filters in the body.
1120
+ * `POST /v1/sales-navigator/lead-lists/{list_id}`
1121
+ */
1122
+ browseLeadList(listId, body, query) {
1123
+ return this.ctx.request({
1124
+ method: "POST",
1125
+ path: `/v1/sales-navigator/lead-lists/${listId}`,
1126
+ body: body ?? {},
1127
+ ...query ? { query } : {}
1128
+ });
1129
+ }
1130
+ /**
1131
+ * Save a LinkedIn company into an account list.
1132
+ * `POST /v1/sales-navigator/account-lists/{list_id}/save`
1133
+ *
1134
+ * No `saved` boolean is invented — a `2xx` response body is the success
1135
+ * signal (the substrate returns no success flag).
1136
+ */
1137
+ saveAccount(input) {
1138
+ const { list_id, ...body } = input;
1139
+ return this.ctx.request({
1140
+ method: "POST",
1141
+ path: `/v1/sales-navigator/account-lists/${list_id}/save`,
1142
+ body,
1143
+ accountIdIn: "body"
1144
+ });
1145
+ }
1044
1146
  };
1045
1147
 
1046
1148
  // src/internal/job-id.ts
@@ -1351,6 +1453,88 @@ var JobsResource = class {
1351
1453
  }
1352
1454
  };
1353
1455
 
1456
+ // src/resources/companies.ts
1457
+ var CompaniesResource = class {
1458
+ constructor(ctx) {
1459
+ this.ctx = ctx;
1460
+ }
1461
+ /**
1462
+ * Retrieve a company's full LinkedIn profile.
1463
+ * `GET /v1/companies/{identifier}`
1464
+ *
1465
+ * Accepts a public handle (the slug in `linkedin.com/company/<handle>`,
1466
+ * e.g. `t-systems`) or a numeric id (e.g. `1234567`). A URN is not accepted.
1467
+ * The `account_id` is injected by the account-scoped context.
1468
+ */
1469
+ get(identifier) {
1470
+ return this.ctx.request({
1471
+ method: "GET",
1472
+ path: `/v1/companies/${identifier}`
1473
+ });
1474
+ }
1475
+ /**
1476
+ * List people who currently work at the company.
1477
+ * `GET /v1/companies/{identifier}/employees`
1478
+ *
1479
+ * A facade over people search with the company filter applied — filter
1480
+ * further with `keywords` or `location`. `identifier` must be the
1481
+ * company's numeric provider_id (the same `id` field `get()` returns) —
1482
+ * a handle or URN is rejected before any upstream call.
1483
+ */
1484
+ employees(identifier, params) {
1485
+ return this.ctx.request({
1486
+ method: "GET",
1487
+ path: `/v1/companies/${identifier}/employees`,
1488
+ ...params ? { query: params } : {}
1489
+ });
1490
+ }
1491
+ /**
1492
+ * List the company's posts.
1493
+ * `GET /v1/companies/{identifier}/posts`
1494
+ *
1495
+ * A facade over post search with the company filter applied. `identifier`
1496
+ * must be the company's numeric provider_id.
1497
+ */
1498
+ posts(identifier, params) {
1499
+ return this.ctx.request({
1500
+ method: "GET",
1501
+ path: `/v1/companies/${identifier}/posts`,
1502
+ ...params ? { query: params } : {}
1503
+ });
1504
+ }
1505
+ /**
1506
+ * List the company's open job postings.
1507
+ * `GET /v1/companies/{identifier}/jobs`
1508
+ *
1509
+ * A facade over job search with the company filter applied — filter
1510
+ * further with `keywords`. An empty `items[]` is a valid result (the
1511
+ * company currently has no open postings). `identifier` must be the
1512
+ * company's numeric provider_id.
1513
+ */
1514
+ jobs(identifier, params) {
1515
+ return this.ctx.request({
1516
+ method: "GET",
1517
+ path: `/v1/companies/${identifier}/jobs`,
1518
+ ...params ? { query: params } : {}
1519
+ });
1520
+ }
1521
+ /**
1522
+ * List the company's followers.
1523
+ * `GET /v1/companies/{identifier}/followers`
1524
+ *
1525
+ * Native — reuses the same seam that backs `profiles.listFollowers()`.
1526
+ * You must be an administrator of the target company page.
1527
+ * `identifier` must be the company's numeric provider_id.
1528
+ */
1529
+ followers(identifier, params) {
1530
+ return this.ctx.request({
1531
+ method: "GET",
1532
+ path: `/v1/companies/${identifier}/followers`,
1533
+ ...params ? { query: params } : {}
1534
+ });
1535
+ }
1536
+ };
1537
+
1354
1538
  // src/resources/webhooks.ts
1355
1539
  var WebhooksResource = class {
1356
1540
  constructor(ctx) {
@@ -1437,6 +1621,7 @@ function buildNamespaces(ctx) {
1437
1621
  salesNavigator: new SalesNavigatorResource(ctx),
1438
1622
  recruiter: new RecruiterResource(ctx),
1439
1623
  jobs: new JobsResource(ctx),
1624
+ companies: new CompaniesResource(ctx),
1440
1625
  webhooks: new WebhooksResource(ctx)
1441
1626
  };
1442
1627
  }
@@ -1461,6 +1646,7 @@ var Curviate = class {
1461
1646
  this.salesNavigator = ns.salesNavigator;
1462
1647
  this.recruiter = ns.recruiter;
1463
1648
  this.jobs = ns.jobs;
1649
+ this.companies = ns.companies;
1464
1650
  this.webhooks = ns.webhooks;
1465
1651
  }
1466
1652
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/sdk",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "description": "TypeScript SDK for the Curviate API.",
6
6
  "license": "MIT",