@curviate/sdk 0.20.0 → 0.20.2

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
@@ -291,15 +291,46 @@ async function execute(method, path, opts) {
291
291
  }
292
292
  }
293
293
 
294
+ // src/internal/path.ts
295
+ function encodePathParam(value) {
296
+ return encodeURIComponent(String(value));
297
+ }
298
+ var UNSAFE_SEGMENT = /^(?:\.{1,2})?$/;
299
+ function assertPathIsSendable(path) {
300
+ const segments = path.split("/").slice(1);
301
+ for (const segment of segments) {
302
+ if (!UNSAFE_SEGMENT.test(segment)) continue;
303
+ throw new CurviateError({
304
+ code: "INVALID_REQUEST",
305
+ message: `A path parameter cannot be ${segment === "" ? "empty" : `"${segment}"`}. The URL parser resolves that away before the request is sent, so the call would reach a different endpoint. Pass the id itself.`,
306
+ userFixable: true,
307
+ retryLikelyToSucceed: false
308
+ });
309
+ }
310
+ }
311
+ function apiPath(strings, ...values) {
312
+ let out = strings[0] ?? "";
313
+ for (let i = 0; i < values.length; i++) {
314
+ out += encodePathParam(values[i]) + (strings[i + 1] ?? "");
315
+ }
316
+ return out;
317
+ }
318
+
294
319
  // src/internal/context.ts
295
320
  var ACCOUNT_ID_PLACEHOLDER = "{account_id}";
296
321
  function injectAccountIdIntoPath(path, accountId) {
297
322
  if (accountId === void 0) return path;
298
- return path.split(ACCOUNT_ID_PLACEHOLDER).join(accountId);
323
+ return path.split(ACCOUNT_ID_PLACEHOLDER).join(encodePathParam(accountId));
299
324
  }
300
325
  function createContext(config, accountId) {
301
326
  const request = (args) => {
302
- const path = injectAccountIdIntoPath(args.path, accountId);
327
+ let path;
328
+ try {
329
+ path = injectAccountIdIntoPath(args.path, accountId);
330
+ assertPathIsSendable(path);
331
+ } catch (err) {
332
+ return Promise.reject(err);
333
+ }
303
334
  return execute(args.method, path, {
304
335
  apiKey: config.apiKey,
305
336
  baseUrl: config.baseUrl,
@@ -370,7 +401,7 @@ var AccountsResource = class {
370
401
  get(accountId) {
371
402
  return this.ctx.request({
372
403
  method: "GET",
373
- path: `/v1/accounts/${accountId}`
404
+ path: apiPath`/v1/accounts/${accountId}`
374
405
  });
375
406
  }
376
407
  /**
@@ -385,7 +416,7 @@ var AccountsResource = class {
385
416
  update(accountId, body) {
386
417
  return this.ctx.request({
387
418
  method: "PATCH",
388
- path: `/v1/accounts/${accountId}`,
419
+ path: apiPath`/v1/accounts/${accountId}`,
389
420
  body
390
421
  });
391
422
  }
@@ -395,7 +426,7 @@ var AccountsResource = class {
395
426
  disconnect(accountId) {
396
427
  return this.ctx.request({
397
428
  method: "DELETE",
398
- path: `/v1/accounts/${accountId}`
429
+ path: apiPath`/v1/accounts/${accountId}`
399
430
  });
400
431
  }
401
432
  };
@@ -504,7 +535,7 @@ var AuthResource = class {
504
535
  getSession(sessionId) {
505
536
  return this.ctx.request({
506
537
  method: "GET",
507
- path: `/v1/auth/sessions/${sessionId}`
538
+ path: apiPath`/v1/auth/sessions/${sessionId}`
508
539
  });
509
540
  }
510
541
  };
@@ -542,7 +573,7 @@ var MessagingResource = class {
542
573
  getChat(chatId) {
543
574
  return this.ctx.request({
544
575
  method: "GET",
545
- path: `/v1/{account_id}/chats/${chatId}`
576
+ path: apiPath`/v1/{account_id}/chats/${chatId}`
546
577
  });
547
578
  }
548
579
  /**
@@ -552,7 +583,7 @@ var MessagingResource = class {
552
583
  markChatRead(chatId, body) {
553
584
  return this.ctx.request({
554
585
  method: "PATCH",
555
- path: `/v1/{account_id}/chats/${chatId}`,
586
+ path: apiPath`/v1/{account_id}/chats/${chatId}`,
556
587
  body
557
588
  });
558
589
  }
@@ -563,7 +594,7 @@ var MessagingResource = class {
563
594
  listMessages(chatId, params) {
564
595
  return this.ctx.request({
565
596
  method: "GET",
566
- path: `/v1/{account_id}/chats/${chatId}/messages`,
597
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages`,
567
598
  ...params ? { query: params } : {}
568
599
  });
569
600
  }
@@ -598,7 +629,7 @@ var MessagingResource = class {
598
629
  sendMessage(chatId, body) {
599
630
  return this.ctx.request({
600
631
  method: "POST",
601
- path: `/v1/{account_id}/chats/${chatId}/messages`,
632
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages`,
602
633
  body
603
634
  });
604
635
  }
@@ -609,7 +640,7 @@ var MessagingResource = class {
609
640
  getMessage(chatId, messageId) {
610
641
  return this.ctx.request({
611
642
  method: "GET",
612
- path: `/v1/{account_id}/chats/${chatId}/messages/${messageId}`
643
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages/${messageId}`
613
644
  });
614
645
  }
615
646
  /**
@@ -619,7 +650,7 @@ var MessagingResource = class {
619
650
  editMessage(chatId, messageId, body) {
620
651
  return this.ctx.request({
621
652
  method: "PATCH",
622
- path: `/v1/{account_id}/chats/${chatId}/messages/${messageId}`,
653
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages/${messageId}`,
623
654
  body
624
655
  });
625
656
  }
@@ -630,7 +661,7 @@ var MessagingResource = class {
630
661
  deleteMessage(chatId, messageId) {
631
662
  return this.ctx.request({
632
663
  method: "DELETE",
633
- path: `/v1/{account_id}/chats/${chatId}/messages/${messageId}`
664
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages/${messageId}`
634
665
  });
635
666
  }
636
667
  /**
@@ -640,7 +671,7 @@ var MessagingResource = class {
640
671
  addReaction(chatId, messageId, body) {
641
672
  return this.ctx.request({
642
673
  method: "POST",
643
- path: `/v1/{account_id}/chats/${chatId}/messages/${messageId}/reactions`,
674
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages/${messageId}/reactions`,
644
675
  body
645
676
  });
646
677
  }
@@ -652,7 +683,7 @@ var MessagingResource = class {
652
683
  getAttachment(chatId, messageId, attachmentId) {
653
684
  return this.ctx.request({
654
685
  method: "GET",
655
- path: `/v1/{account_id}/chats/${chatId}/messages/${messageId}/attachments/${attachmentId}`
686
+ path: apiPath`/v1/{account_id}/chats/${chatId}/messages/${messageId}/attachments/${attachmentId}`
656
687
  });
657
688
  }
658
689
  /** Send an InMail. `POST /v1/{account_id}/messages/inmail` */
@@ -693,7 +724,7 @@ var UsersResource = class {
693
724
  get(userId, params) {
694
725
  return this.ctx.request({
695
726
  method: "GET",
696
- path: `/v1/{account_id}/users/${userId}`,
727
+ path: apiPath`/v1/{account_id}/users/${userId}`,
697
728
  ...params ? { query: params } : {}
698
729
  });
699
730
  }
@@ -711,7 +742,7 @@ var UsersResource = class {
711
742
  const { description: _description, ...safeBody } = body;
712
743
  return this.ctx.request({
713
744
  method: "PATCH",
714
- path: `/v1/{account_id}/users/${userId}`,
745
+ path: apiPath`/v1/{account_id}/users/${userId}`,
715
746
  body: safeBody
716
747
  });
717
748
  }
@@ -731,7 +762,7 @@ var UsersResource = class {
731
762
  listFollowers(userId, params) {
732
763
  return this.ctx.request({
733
764
  method: "GET",
734
- path: `/v1/{account_id}/users/${userId}/followers`,
765
+ path: apiPath`/v1/{account_id}/users/${userId}/followers`,
735
766
  ...params ? { query: params } : {}
736
767
  });
737
768
  }
@@ -739,7 +770,7 @@ var UsersResource = class {
739
770
  listFollowing(userId, params) {
740
771
  return this.ctx.request({
741
772
  method: "GET",
742
- path: `/v1/{account_id}/users/${userId}/following`,
773
+ path: apiPath`/v1/{account_id}/users/${userId}/following`,
743
774
  ...params ? { query: params } : {}
744
775
  });
745
776
  }
@@ -751,7 +782,7 @@ var UsersResource = class {
751
782
  follow(userId) {
752
783
  return this.ctx.request({
753
784
  method: "POST",
754
- path: `/v1/{account_id}/users/${userId}/follow`
785
+ path: apiPath`/v1/{account_id}/users/${userId}/follow`
755
786
  });
756
787
  }
757
788
  /**
@@ -762,7 +793,7 @@ var UsersResource = class {
762
793
  unfollow(userId) {
763
794
  return this.ctx.request({
764
795
  method: "DELETE",
765
- path: `/v1/{account_id}/users/${userId}/follow`
796
+ path: apiPath`/v1/{account_id}/users/${userId}/follow`
766
797
  });
767
798
  }
768
799
  /**
@@ -786,7 +817,7 @@ var UsersResource = class {
786
817
  endorseSkill(userId, body) {
787
818
  return this.ctx.request({
788
819
  method: "POST",
789
- path: `/v1/{account_id}/users/${userId}/endorse-skill`,
820
+ path: apiPath`/v1/{account_id}/users/${userId}/endorse-skill`,
790
821
  body
791
822
  });
792
823
  }
@@ -829,7 +860,7 @@ var InvitesResource = class {
829
860
  accept(invitationId) {
830
861
  return this.ctx.request({
831
862
  method: "POST",
832
- path: `/v1/{account_id}/invites/received/${invitationId}/accept`
863
+ path: apiPath`/v1/{account_id}/invites/received/${invitationId}/accept`
833
864
  });
834
865
  }
835
866
  /**
@@ -840,7 +871,7 @@ var InvitesResource = class {
840
871
  decline(invitationId) {
841
872
  return this.ctx.request({
842
873
  method: "POST",
843
- path: `/v1/{account_id}/invites/received/${invitationId}/decline`
874
+ path: apiPath`/v1/{account_id}/invites/received/${invitationId}/decline`
844
875
  });
845
876
  }
846
877
  /**
@@ -851,7 +882,7 @@ var InvitesResource = class {
851
882
  cancel(invitationId) {
852
883
  return this.ctx.request({
853
884
  method: "DELETE",
854
- path: `/v1/{account_id}/invites/sent/${invitationId}`
885
+ path: apiPath`/v1/{account_id}/invites/sent/${invitationId}`
855
886
  });
856
887
  }
857
888
  };
@@ -1015,22 +1046,35 @@ var PostsResource = class {
1015
1046
  listComments(postId, params) {
1016
1047
  return this.ctx.request({
1017
1048
  method: "GET",
1018
- path: `/v1/{account_id}/posts/${postId}/comments`,
1049
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments`,
1019
1050
  ...params ? { query: params } : {}
1020
1051
  });
1021
1052
  }
1022
- /** Get a single post. `GET /v1/{account_id}/posts/{post_id}` */
1053
+ /**
1054
+ * Get a single post. `GET /v1/{account_id}/posts/{post_id}`
1055
+ *
1056
+ * @param postId - the post's `id` as returned by {@link listUserPosts} or
1057
+ * {@link create}. A bare numeric id (`7332661864792854528`), a URN
1058
+ * (`urn:li:activity:N`, `urn:li:ugcPost:N`, `urn:li:share:N`), and a full
1059
+ * share URL (`https://www.linkedin.com/posts/...` or
1060
+ * `https://www.linkedin.com/feed/update/urn:li:activity:N`) all resolve to
1061
+ * the same post. Pass the value as-is; it is percent-encoded into the path
1062
+ * for you, so do not encode it yourself.
1063
+ *
1064
+ * {@link listComments} and the reaction operations are stricter: they take
1065
+ * the opaque `id` form only.
1066
+ */
1023
1067
  get(postId) {
1024
1068
  return this.ctx.request({
1025
1069
  method: "GET",
1026
- path: `/v1/{account_id}/posts/${postId}`
1070
+ path: apiPath`/v1/{account_id}/posts/${postId}`
1027
1071
  });
1028
1072
  }
1029
1073
  /** Delete a post (bodyless, 204). `DELETE /v1/{account_id}/posts/{post_id}` */
1030
1074
  delete(postId) {
1031
1075
  return this.ctx.request({
1032
1076
  method: "DELETE",
1033
- path: `/v1/{account_id}/posts/${postId}`
1077
+ path: apiPath`/v1/{account_id}/posts/${postId}`
1034
1078
  });
1035
1079
  }
1036
1080
  /**
@@ -1052,7 +1096,7 @@ var PostsResource = class {
1052
1096
  listUserPosts(userId, params) {
1053
1097
  return this.ctx.request({
1054
1098
  method: "GET",
1055
- path: `/v1/{account_id}/users/${userId}/posts`,
1099
+ path: apiPath`/v1/{account_id}/users/${userId}/posts`,
1056
1100
  ...params ? { query: params } : {}
1057
1101
  });
1058
1102
  }
@@ -1060,7 +1104,7 @@ var PostsResource = class {
1060
1104
  listReactions(postId, params) {
1061
1105
  return this.ctx.request({
1062
1106
  method: "GET",
1063
- path: `/v1/{account_id}/posts/${postId}/reactions`,
1107
+ path: apiPath`/v1/{account_id}/posts/${postId}/reactions`,
1064
1108
  ...params ? { query: params } : {}
1065
1109
  });
1066
1110
  }
@@ -1068,7 +1112,7 @@ var PostsResource = class {
1068
1112
  react(postId, body) {
1069
1113
  return this.ctx.request({
1070
1114
  method: "POST",
1071
- path: `/v1/{account_id}/posts/${postId}/reactions`,
1115
+ path: apiPath`/v1/{account_id}/posts/${postId}/reactions`,
1072
1116
  body
1073
1117
  });
1074
1118
  }
@@ -1080,7 +1124,7 @@ var PostsResource = class {
1080
1124
  unreact(postId, body) {
1081
1125
  return this.ctx.request({
1082
1126
  method: "DELETE",
1083
- path: `/v1/{account_id}/posts/${postId}/reactions`,
1127
+ path: apiPath`/v1/{account_id}/posts/${postId}/reactions`,
1084
1128
  body
1085
1129
  });
1086
1130
  }
@@ -1091,7 +1135,7 @@ var PostsResource = class {
1091
1135
  listUserReactions(userId, params) {
1092
1136
  return this.ctx.request({
1093
1137
  method: "GET",
1094
- path: `/v1/{account_id}/users/${userId}/reactions`,
1138
+ path: apiPath`/v1/{account_id}/users/${userId}/reactions`,
1095
1139
  ...params ? { query: params } : {}
1096
1140
  });
1097
1141
  }
@@ -1144,7 +1188,7 @@ var PostsResource = class {
1144
1188
  unsave(postId) {
1145
1189
  return this.ctx.request({
1146
1190
  method: "DELETE",
1147
- path: `/v1/{account_id}/saved-posts/${postId}`
1191
+ path: apiPath`/v1/{account_id}/saved-posts/${postId}`
1148
1192
  });
1149
1193
  }
1150
1194
  };
@@ -1162,7 +1206,7 @@ var CommentsResource = class {
1162
1206
  listUserComments(userId, params) {
1163
1207
  return this.ctx.request({
1164
1208
  method: "GET",
1165
- path: `/v1/{account_id}/users/${userId}/comments`,
1209
+ path: apiPath`/v1/{account_id}/users/${userId}/comments`,
1166
1210
  ...params ? { query: params } : {}
1167
1211
  });
1168
1212
  }
@@ -1174,7 +1218,7 @@ var CommentsResource = class {
1174
1218
  create(postId, body) {
1175
1219
  return this.ctx.request({
1176
1220
  method: "POST",
1177
- path: `/v1/{account_id}/posts/${postId}/comments`,
1221
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments`,
1178
1222
  body
1179
1223
  });
1180
1224
  }
@@ -1185,7 +1229,7 @@ var CommentsResource = class {
1185
1229
  edit(postId, commentId, body) {
1186
1230
  return this.ctx.request({
1187
1231
  method: "PATCH",
1188
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}`,
1232
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}`,
1189
1233
  body
1190
1234
  });
1191
1235
  }
@@ -1196,7 +1240,7 @@ var CommentsResource = class {
1196
1240
  delete(postId, commentId) {
1197
1241
  return this.ctx.request({
1198
1242
  method: "DELETE",
1199
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}`
1243
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}`
1200
1244
  });
1201
1245
  }
1202
1246
  /**
@@ -1207,7 +1251,7 @@ var CommentsResource = class {
1207
1251
  reply(postId, commentId, body) {
1208
1252
  return this.ctx.request({
1209
1253
  method: "POST",
1210
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}`,
1254
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}`,
1211
1255
  body
1212
1256
  });
1213
1257
  }
@@ -1218,7 +1262,7 @@ var CommentsResource = class {
1218
1262
  listReplies(postId, commentId, params) {
1219
1263
  return this.ctx.request({
1220
1264
  method: "GET",
1221
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}/replies`,
1265
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}/replies`,
1222
1266
  ...params ? { query: params } : {}
1223
1267
  });
1224
1268
  }
@@ -1229,7 +1273,7 @@ var CommentsResource = class {
1229
1273
  listReactions(postId, commentId, params) {
1230
1274
  return this.ctx.request({
1231
1275
  method: "GET",
1232
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1276
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1233
1277
  ...params ? { query: params } : {}
1234
1278
  });
1235
1279
  }
@@ -1239,7 +1283,7 @@ var CommentsResource = class {
1239
1283
  addReaction(postId, commentId, body) {
1240
1284
  return this.ctx.request({
1241
1285
  method: "POST",
1242
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1286
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1243
1287
  body
1244
1288
  });
1245
1289
  }
@@ -1251,7 +1295,7 @@ var CommentsResource = class {
1251
1295
  removeReaction(postId, commentId, body) {
1252
1296
  return this.ctx.request({
1253
1297
  method: "DELETE",
1254
- path: `/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1298
+ path: apiPath`/v1/{account_id}/posts/${postId}/comments/${commentId}/reactions`,
1255
1299
  body
1256
1300
  });
1257
1301
  }
@@ -1365,7 +1409,7 @@ var GroupsResource = class {
1365
1409
  get(group) {
1366
1410
  return this.ctx.request({
1367
1411
  method: "GET",
1368
- path: `/v1/{account_id}/groups/${group}`
1412
+ path: apiPath`/v1/{account_id}/groups/${group}`
1369
1413
  });
1370
1414
  }
1371
1415
  /**
@@ -1382,7 +1426,7 @@ var GroupsResource = class {
1382
1426
  members(group, params) {
1383
1427
  return this.ctx.request({
1384
1428
  method: "GET",
1385
- path: `/v1/{account_id}/groups/${group}/members`,
1429
+ path: apiPath`/v1/{account_id}/groups/${group}/members`,
1386
1430
  ...params ? { query: params } : {}
1387
1431
  });
1388
1432
  }
@@ -1484,7 +1528,7 @@ var InboxesResource = class {
1484
1528
  listChats(inboxId, params) {
1485
1529
  return this.ctx.request({
1486
1530
  method: "GET",
1487
- path: `/v1/{account_id}/inboxes/${inboxId}/chats`,
1531
+ path: apiPath`/v1/{account_id}/inboxes/${inboxId}/chats`,
1488
1532
  ...params ? { query: params } : {}
1489
1533
  });
1490
1534
  }
@@ -1540,7 +1584,7 @@ var NotificationsResource = class {
1540
1584
  delete(cardUrn) {
1541
1585
  return this.ctx.request({
1542
1586
  method: "DELETE",
1543
- path: `/v1/{account_id}/notifications/${encodeURIComponent(cardUrn)}`
1587
+ path: apiPath`/v1/{account_id}/notifications/${cardUrn}`
1544
1588
  });
1545
1589
  }
1546
1590
  /**
@@ -1566,7 +1610,7 @@ var NotificationsResource = class {
1566
1610
  showLess(cardUrn) {
1567
1611
  return this.ctx.request({
1568
1612
  method: "POST",
1569
- path: `/v1/{account_id}/notifications/${encodeURIComponent(cardUrn)}/show-less`
1613
+ path: apiPath`/v1/{account_id}/notifications/${cardUrn}/show-less`
1570
1614
  });
1571
1615
  }
1572
1616
  };
@@ -1631,7 +1675,7 @@ var SalesNavigatorResource = class {
1631
1675
  getProfile(identifier, query) {
1632
1676
  return this.ctx.request({
1633
1677
  method: "GET",
1634
- path: `/v1/{account_id}/sales-navigator/profiles/${identifier}`,
1678
+ path: apiPath`/v1/{account_id}/sales-navigator/profiles/${identifier}`,
1635
1679
  // cast needed: with_sections is string[] but transport encodes arrays as repeated params
1636
1680
  ...query ? { query } : {}
1637
1681
  });
@@ -1666,7 +1710,7 @@ var SalesNavigatorResource = class {
1666
1710
  browseAccountList(listId, body, query) {
1667
1711
  return this.ctx.request({
1668
1712
  method: "POST",
1669
- path: `/v1/{account_id}/sales-navigator/account-lists/${listId}`,
1713
+ path: apiPath`/v1/{account_id}/sales-navigator/account-lists/${listId}`,
1670
1714
  body: body ?? {},
1671
1715
  ...query ? { query } : {}
1672
1716
  });
@@ -1679,7 +1723,7 @@ var SalesNavigatorResource = class {
1679
1723
  browseLeadList(listId, body, query) {
1680
1724
  return this.ctx.request({
1681
1725
  method: "POST",
1682
- path: `/v1/{account_id}/sales-navigator/lead-lists/${listId}`,
1726
+ path: apiPath`/v1/{account_id}/sales-navigator/lead-lists/${listId}`,
1683
1727
  body: body ?? {},
1684
1728
  ...query ? { query } : {}
1685
1729
  });
@@ -1696,7 +1740,7 @@ var SalesNavigatorResource = class {
1696
1740
  const { list_id, ...body } = input;
1697
1741
  return this.ctx.request({
1698
1742
  method: "POST",
1699
- path: `/v1/{account_id}/sales-navigator/account-lists/${list_id}/save`,
1743
+ path: apiPath`/v1/{account_id}/sales-navigator/account-lists/${list_id}/save`,
1700
1744
  body
1701
1745
  });
1702
1746
  }
@@ -1709,7 +1753,7 @@ var SalesNavigatorResource = class {
1709
1753
  const { list_id, ...body } = input;
1710
1754
  return this.ctx.request({
1711
1755
  method: "POST",
1712
- path: `/v1/{account_id}/sales-navigator/lead-lists/${list_id}/save`,
1756
+ path: apiPath`/v1/{account_id}/sales-navigator/lead-lists/${list_id}/save`,
1713
1757
  body
1714
1758
  });
1715
1759
  }
@@ -1758,7 +1802,7 @@ var RecruiterResource = class {
1758
1802
  getProfile(identifier, params) {
1759
1803
  return this.ctx.request({
1760
1804
  method: "GET",
1761
- path: `/v1/{account_id}/recruiter/profiles/${identifier}`,
1805
+ path: apiPath`/v1/{account_id}/recruiter/profiles/${identifier}`,
1762
1806
  ...params ? { query: params } : {}
1763
1807
  });
1764
1808
  }
@@ -1808,7 +1852,7 @@ var RecruiterResource = class {
1808
1852
  searchTalentPool(projectId, body, params) {
1809
1853
  return this.ctx.request({
1810
1854
  method: "POST",
1811
- path: `/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/search`,
1855
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/search`,
1812
1856
  body,
1813
1857
  ...params ? { query: params } : {}
1814
1858
  });
@@ -1845,7 +1889,7 @@ var RecruiterResource = class {
1845
1889
  getProject(projectId) {
1846
1890
  return this.ctx.request({
1847
1891
  method: "GET",
1848
- path: `/v1/{account_id}/recruiter/projects/${projectId}`
1892
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}`
1849
1893
  });
1850
1894
  }
1851
1895
  /**
@@ -1856,7 +1900,7 @@ var RecruiterResource = class {
1856
1900
  updateProject(projectId, body) {
1857
1901
  return this.ctx.request({
1858
1902
  method: "PATCH",
1859
- path: `/v1/{account_id}/recruiter/projects/${projectId}`,
1903
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}`,
1860
1904
  body
1861
1905
  });
1862
1906
  }
@@ -1869,7 +1913,7 @@ var RecruiterResource = class {
1869
1913
  listPipeline(projectId, body = {}, params) {
1870
1914
  return this.ctx.request({
1871
1915
  method: "POST",
1872
- path: `/v1/{account_id}/recruiter/projects/${projectId}/pipeline`,
1916
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/pipeline`,
1873
1917
  body,
1874
1918
  ...params ? { query: params } : {}
1875
1919
  });
@@ -1882,7 +1926,7 @@ var RecruiterResource = class {
1882
1926
  getProjectJob(projectId) {
1883
1927
  return this.ctx.request({
1884
1928
  method: "GET",
1885
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs`
1929
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs`
1886
1930
  });
1887
1931
  }
1888
1932
  /**
@@ -1893,7 +1937,7 @@ var RecruiterResource = class {
1893
1937
  createProjectJob(projectId, body) {
1894
1938
  return this.ctx.request({
1895
1939
  method: "POST",
1896
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs`,
1940
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs`,
1897
1941
  body
1898
1942
  });
1899
1943
  }
@@ -1905,7 +1949,7 @@ var RecruiterResource = class {
1905
1949
  getProjectJobBudget(projectId, jobId) {
1906
1950
  return this.ctx.request({
1907
1951
  method: "GET",
1908
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/budget`
1952
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/budget`
1909
1953
  });
1910
1954
  }
1911
1955
  /**
@@ -1946,7 +1990,7 @@ var RecruiterResource = class {
1946
1990
  const jobId = resolveJobId(jobIdOrUrl);
1947
1991
  return this.ctx.request({
1948
1992
  method: "GET",
1949
- path: `/v1/{account_id}/recruiter/jobs/${jobId}`
1993
+ path: apiPath`/v1/{account_id}/recruiter/jobs/${jobId}`
1950
1994
  });
1951
1995
  }
1952
1996
  /**
@@ -1958,7 +2002,7 @@ var RecruiterResource = class {
1958
2002
  updateProjectJob(projectId, jobId, body) {
1959
2003
  return this.ctx.request({
1960
2004
  method: "PATCH",
1961
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}`,
2005
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}`,
1962
2006
  body
1963
2007
  });
1964
2008
  }
@@ -1973,7 +2017,7 @@ var RecruiterResource = class {
1973
2017
  publishJob(projectId, jobId, body) {
1974
2018
  return this.ctx.request({
1975
2019
  method: "POST",
1976
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/publish`,
2020
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/publish`,
1977
2021
  body
1978
2022
  });
1979
2023
  }
@@ -1986,7 +2030,7 @@ var RecruiterResource = class {
1986
2030
  closeJob(projectId, jobId) {
1987
2031
  return this.ctx.request({
1988
2032
  method: "POST",
1989
- path: `/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/close`
2033
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/jobs/${jobId}/close`
1990
2034
  });
1991
2035
  }
1992
2036
  /**
@@ -1997,7 +2041,7 @@ var RecruiterResource = class {
1997
2041
  saveCandidate(projectId, body) {
1998
2042
  return this.ctx.request({
1999
2043
  method: "POST",
2000
- path: `/v1/{account_id}/recruiter/projects/${projectId}/pipeline/candidate/save`,
2044
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/pipeline/candidate/save`,
2001
2045
  body
2002
2046
  });
2003
2047
  }
@@ -2010,7 +2054,7 @@ var RecruiterResource = class {
2010
2054
  listApplicants(projectId, body, params) {
2011
2055
  return this.ctx.request({
2012
2056
  method: "POST",
2013
- path: `/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants`,
2057
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants`,
2014
2058
  body,
2015
2059
  ...params ? { query: params } : {}
2016
2060
  });
@@ -2022,7 +2066,7 @@ var RecruiterResource = class {
2022
2066
  getApplicant(projectId, applicantId) {
2023
2067
  return this.ctx.request({
2024
2068
  method: "GET",
2025
- path: `/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants/${applicantId}`
2069
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants/${applicantId}`
2026
2070
  });
2027
2071
  }
2028
2072
  /**
@@ -2033,7 +2077,7 @@ var RecruiterResource = class {
2033
2077
  downloadResume(projectId, applicantId) {
2034
2078
  return this.ctx.request({
2035
2079
  method: "GET",
2036
- path: `/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants/${applicantId}/resume`
2080
+ path: apiPath`/v1/{account_id}/recruiter/projects/${projectId}/talent-pool/applicants/${applicantId}/resume`
2037
2081
  });
2038
2082
  }
2039
2083
  };
@@ -2081,7 +2125,7 @@ var JobsResource = class {
2081
2125
  const jobId = resolveJobId(jobIdOrUrl);
2082
2126
  return this.ctx.request({
2083
2127
  method: "GET",
2084
- path: `/v1/{account_id}/jobs/${jobId}`,
2128
+ path: apiPath`/v1/{account_id}/jobs/${jobId}`,
2085
2129
  ...params ? { query: params } : {}
2086
2130
  });
2087
2131
  }
@@ -2093,7 +2137,7 @@ var JobsResource = class {
2093
2137
  update(jobId, body) {
2094
2138
  return this.ctx.request({
2095
2139
  method: "PATCH",
2096
- path: `/v1/{account_id}/jobs/${jobId}`,
2140
+ path: apiPath`/v1/{account_id}/jobs/${jobId}`,
2097
2141
  body
2098
2142
  });
2099
2143
  }
@@ -2104,7 +2148,7 @@ var JobsResource = class {
2104
2148
  getBudget(jobId) {
2105
2149
  return this.ctx.request({
2106
2150
  method: "GET",
2107
- path: `/v1/{account_id}/jobs/${jobId}/budget`
2151
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/budget`
2108
2152
  });
2109
2153
  }
2110
2154
  /**
@@ -2117,7 +2161,7 @@ var JobsResource = class {
2117
2161
  publish(jobId, body) {
2118
2162
  return this.ctx.request({
2119
2163
  method: "POST",
2120
- path: `/v1/{account_id}/jobs/${jobId}/publish`,
2164
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/publish`,
2121
2165
  body
2122
2166
  });
2123
2167
  }
@@ -2129,7 +2173,7 @@ var JobsResource = class {
2129
2173
  close(jobId) {
2130
2174
  return this.ctx.request({
2131
2175
  method: "POST",
2132
- path: `/v1/{account_id}/jobs/${jobId}/close`
2176
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/close`
2133
2177
  });
2134
2178
  }
2135
2179
  /**
@@ -2144,7 +2188,7 @@ var JobsResource = class {
2144
2188
  const hasQuery = cursor !== void 0 || limit !== void 0;
2145
2189
  return this.ctx.request({
2146
2190
  method: "POST",
2147
- path: `/v1/{account_id}/jobs/${jobId}/applicants`,
2191
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/applicants`,
2148
2192
  body,
2149
2193
  ...hasQuery ? {
2150
2194
  query: {
@@ -2161,7 +2205,7 @@ var JobsResource = class {
2161
2205
  getApplicant(jobId, applicantId) {
2162
2206
  return this.ctx.request({
2163
2207
  method: "GET",
2164
- path: `/v1/{account_id}/jobs/${jobId}/applicants/${applicantId}`
2208
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/applicants/${applicantId}`
2165
2209
  });
2166
2210
  }
2167
2211
  /**
@@ -2172,7 +2216,7 @@ var JobsResource = class {
2172
2216
  downloadResume(jobId, applicantId) {
2173
2217
  return this.ctx.request({
2174
2218
  method: "GET",
2175
- path: `/v1/{account_id}/jobs/${jobId}/applicants/${applicantId}/resume`
2219
+ path: apiPath`/v1/{account_id}/jobs/${jobId}/applicants/${applicantId}/resume`
2176
2220
  });
2177
2221
  }
2178
2222
  };
@@ -2192,7 +2236,7 @@ var CompaniesResource = class {
2192
2236
  get(identifier) {
2193
2237
  return this.ctx.request({
2194
2238
  method: "GET",
2195
- path: `/v1/{account_id}/companies/${identifier}`
2239
+ path: apiPath`/v1/{account_id}/companies/${identifier}`
2196
2240
  });
2197
2241
  }
2198
2242
  /**
@@ -2207,7 +2251,7 @@ var CompaniesResource = class {
2207
2251
  employees(identifier, params) {
2208
2252
  return this.ctx.request({
2209
2253
  method: "GET",
2210
- path: `/v1/{account_id}/companies/${identifier}/employees`,
2254
+ path: apiPath`/v1/{account_id}/companies/${identifier}/employees`,
2211
2255
  ...params ? { query: params } : {}
2212
2256
  });
2213
2257
  }
@@ -2221,7 +2265,7 @@ var CompaniesResource = class {
2221
2265
  posts(identifier, params) {
2222
2266
  return this.ctx.request({
2223
2267
  method: "GET",
2224
- path: `/v1/{account_id}/companies/${identifier}/posts`,
2268
+ path: apiPath`/v1/{account_id}/companies/${identifier}/posts`,
2225
2269
  ...params ? { query: params } : {}
2226
2270
  });
2227
2271
  }
@@ -2237,7 +2281,7 @@ var CompaniesResource = class {
2237
2281
  jobs(identifier, params) {
2238
2282
  return this.ctx.request({
2239
2283
  method: "GET",
2240
- path: `/v1/{account_id}/companies/${identifier}/jobs`,
2284
+ path: apiPath`/v1/{account_id}/companies/${identifier}/jobs`,
2241
2285
  ...params ? { query: params } : {}
2242
2286
  });
2243
2287
  }
@@ -2266,7 +2310,7 @@ var CompaniesResource = class {
2266
2310
  followers(identifier, params) {
2267
2311
  return this.ctx.request({
2268
2312
  method: "GET",
2269
- path: `/v1/{account_id}/companies/${identifier}/followers`,
2313
+ path: apiPath`/v1/{account_id}/companies/${identifier}/followers`,
2270
2314
  ...params ? { query: params } : {}
2271
2315
  });
2272
2316
  }
@@ -2281,7 +2325,7 @@ var CompaniesResource = class {
2281
2325
  invitableFollowers(identifier, params) {
2282
2326
  return this.ctx.request({
2283
2327
  method: "GET",
2284
- path: `/v1/{account_id}/companies/${identifier}/invitable-followers`,
2328
+ path: apiPath`/v1/{account_id}/companies/${identifier}/invitable-followers`,
2285
2329
  ...params ? { query: params } : {}
2286
2330
  });
2287
2331
  }
@@ -2301,7 +2345,7 @@ var CompaniesResource = class {
2301
2345
  followInvite(identifier, body) {
2302
2346
  return this.ctx.request({
2303
2347
  method: "POST",
2304
- path: `/v1/{account_id}/companies/${identifier}/follow-invite`,
2348
+ path: apiPath`/v1/{account_id}/companies/${identifier}/follow-invite`,
2305
2349
  body
2306
2350
  });
2307
2351
  }
@@ -2319,7 +2363,7 @@ var CompaniesResource = class {
2319
2363
  chats(identifier, params) {
2320
2364
  return this.ctx.request({
2321
2365
  method: "GET",
2322
- path: `/v1/{account_id}/companies/${identifier}/chats`,
2366
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats`,
2323
2367
  ...params ? { query: params } : {}
2324
2368
  });
2325
2369
  }
@@ -2332,7 +2376,7 @@ var CompaniesResource = class {
2332
2376
  chat(identifier, chatId) {
2333
2377
  return this.ctx.request({
2334
2378
  method: "GET",
2335
- path: `/v1/{account_id}/companies/${identifier}/chats/${chatId}`
2379
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats/${chatId}`
2336
2380
  });
2337
2381
  }
2338
2382
  /**
@@ -2345,7 +2389,7 @@ var CompaniesResource = class {
2345
2389
  messages(identifier, chatId, params) {
2346
2390
  return this.ctx.request({
2347
2391
  method: "GET",
2348
- path: `/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages`,
2392
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages`,
2349
2393
  ...params ? { query: params } : {}
2350
2394
  });
2351
2395
  }
@@ -2358,7 +2402,7 @@ var CompaniesResource = class {
2358
2402
  message(identifier, chatId, messageId) {
2359
2403
  return this.ctx.request({
2360
2404
  method: "GET",
2361
- path: `/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages/${messageId}`
2405
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages/${messageId}`
2362
2406
  });
2363
2407
  }
2364
2408
  /**
@@ -2373,7 +2417,7 @@ var CompaniesResource = class {
2373
2417
  searchChats(identifier, params) {
2374
2418
  return this.ctx.request({
2375
2419
  method: "GET",
2376
- path: `/v1/{account_id}/companies/${identifier}/chats/search`,
2420
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats/search`,
2377
2421
  ...params ? { query: params } : {}
2378
2422
  });
2379
2423
  }
@@ -2410,7 +2454,7 @@ var CompaniesResource = class {
2410
2454
  sendMessage(identifier, chatId, body) {
2411
2455
  return this.ctx.request({
2412
2456
  method: "POST",
2413
- path: `/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages`,
2457
+ path: apiPath`/v1/{account_id}/companies/${identifier}/chats/${chatId}/messages`,
2414
2458
  body
2415
2459
  });
2416
2460
  }
@@ -2465,7 +2509,7 @@ var WebhooksResource = class {
2465
2509
  get(id) {
2466
2510
  return this.ctx.request({
2467
2511
  method: "GET",
2468
- path: `/v1/webhooks/${id}`
2512
+ path: apiPath`/v1/webhooks/${id}`
2469
2513
  });
2470
2514
  }
2471
2515
  /**
@@ -2475,7 +2519,7 @@ var WebhooksResource = class {
2475
2519
  update(id, body) {
2476
2520
  return this.ctx.request({
2477
2521
  method: "PATCH",
2478
- path: `/v1/webhooks/${id}`,
2522
+ path: apiPath`/v1/webhooks/${id}`,
2479
2523
  body
2480
2524
  });
2481
2525
  }
@@ -2486,7 +2530,7 @@ var WebhooksResource = class {
2486
2530
  delete(id) {
2487
2531
  return this.ctx.request({
2488
2532
  method: "DELETE",
2489
- path: `/v1/webhooks/${id}`
2533
+ path: apiPath`/v1/webhooks/${id}`
2490
2534
  });
2491
2535
  }
2492
2536
  };