@curviate/sdk 0.11.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/CHANGELOG.md +16 -0
- package/dist/index.d.ts +6661 -4808
- package/dist/index.js +161 -10
- package/package.json +1 -1
- package/src/generated/types.ts +6512 -4808
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",
|
|
@@ -701,13 +702,6 @@ var ProfilesResource = class {
|
|
|
701
702
|
...params ? { query: params } : {}
|
|
702
703
|
});
|
|
703
704
|
}
|
|
704
|
-
/** Get a company profile. `GET /v1/profiles/companies/{company_id}` */
|
|
705
|
-
getCompany(companyId) {
|
|
706
|
-
return this.ctx.request({
|
|
707
|
-
method: "GET",
|
|
708
|
-
path: `/v1/profiles/companies/${companyId}`
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
705
|
/** Endorse a skill on a profile. `POST /v1/profiles/{profile_id}/endorse` */
|
|
712
706
|
endorse(profileId, body) {
|
|
713
707
|
return this.ctx.request({
|
|
@@ -1055,12 +1049,20 @@ var SalesNavigatorResource = class {
|
|
|
1055
1049
|
});
|
|
1056
1050
|
}
|
|
1057
1051
|
/**
|
|
1058
|
-
* Save a Sales Navigator member
|
|
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).
|
|
1059
1060
|
*/
|
|
1060
|
-
saveLead(
|
|
1061
|
+
saveLead(input) {
|
|
1062
|
+
const { list_id, ...body } = input;
|
|
1061
1063
|
return this.ctx.request({
|
|
1062
1064
|
method: "POST",
|
|
1063
|
-
path: `/v1/sales-navigator/
|
|
1065
|
+
path: `/v1/sales-navigator/lead-lists/${list_id}/save`,
|
|
1064
1066
|
body,
|
|
1065
1067
|
accountIdIn: "body"
|
|
1066
1068
|
});
|
|
@@ -1076,6 +1078,71 @@ var SalesNavigatorResource = class {
|
|
|
1076
1078
|
query: params
|
|
1077
1079
|
});
|
|
1078
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
|
+
}
|
|
1079
1146
|
};
|
|
1080
1147
|
|
|
1081
1148
|
// src/internal/job-id.ts
|
|
@@ -1386,6 +1453,88 @@ var JobsResource = class {
|
|
|
1386
1453
|
}
|
|
1387
1454
|
};
|
|
1388
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
|
+
|
|
1389
1538
|
// src/resources/webhooks.ts
|
|
1390
1539
|
var WebhooksResource = class {
|
|
1391
1540
|
constructor(ctx) {
|
|
@@ -1472,6 +1621,7 @@ function buildNamespaces(ctx) {
|
|
|
1472
1621
|
salesNavigator: new SalesNavigatorResource(ctx),
|
|
1473
1622
|
recruiter: new RecruiterResource(ctx),
|
|
1474
1623
|
jobs: new JobsResource(ctx),
|
|
1624
|
+
companies: new CompaniesResource(ctx),
|
|
1475
1625
|
webhooks: new WebhooksResource(ctx)
|
|
1476
1626
|
};
|
|
1477
1627
|
}
|
|
@@ -1496,6 +1646,7 @@ var Curviate = class {
|
|
|
1496
1646
|
this.salesNavigator = ns.salesNavigator;
|
|
1497
1647
|
this.recruiter = ns.recruiter;
|
|
1498
1648
|
this.jobs = ns.jobs;
|
|
1649
|
+
this.companies = ns.companies;
|
|
1499
1650
|
this.webhooks = ns.webhooks;
|
|
1500
1651
|
}
|
|
1501
1652
|
/**
|