@unipile/sdk 2.21.0 → 2.37.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/sdk.gen.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.UnipileWebhooks = exports.UnipileAccounts = exports.UnipileHostedAuth = exports.UnipileCustomAuth = exports.UnipileInstagram = exports.UnipileLinkedIn = exports.UnipileCalendar = exports.UnipilePosts = exports.UnipileUsers = exports.UnipileEmails = exports.UnipileMessaging = void 0;
4
+ exports.UnipileWebhooks = exports.UnipileScopes = exports.UnipileApiKeys = exports.UnipileAccounts = exports.UnipileHostedAuth = exports.UnipileCustomAuth = exports.UnipileDefault = exports.UnipileInstagram = exports.UnipileLinkedIn = exports.UnipileCalendar = exports.UnipilePosts = exports.UnipileUsers = exports.UnipileEmails = exports.UnipileMessaging = void 0;
5
5
  const client_gen_1 = require("./client.gen");
6
6
  class HeyApiClient {
7
7
  constructor(args) {
@@ -163,7 +163,7 @@ class HeyApiRegistry8 {
163
163
  get(key) {
164
164
  const instance = this.instances.get(key ?? this.defaultKey);
165
165
  if (!instance) {
166
- throw new Error(`No SDK client found. Create one with "new UnipileCustomAuth()" to fix this error.`);
166
+ throw new Error(`No SDK client found. Create one with "new UnipileDefault()" to fix this error.`);
167
167
  }
168
168
  return instance;
169
169
  }
@@ -184,7 +184,7 @@ class HeyApiRegistry9 {
184
184
  get(key) {
185
185
  const instance = this.instances.get(key ?? this.defaultKey);
186
186
  if (!instance) {
187
- throw new Error(`No SDK client found. Create one with "new UnipileHostedAuth()" to fix this error.`);
187
+ throw new Error(`No SDK client found. Create one with "new UnipileCustomAuth()" to fix this error.`);
188
188
  }
189
189
  return instance;
190
190
  }
@@ -205,7 +205,7 @@ class HeyApiRegistry10 {
205
205
  get(key) {
206
206
  const instance = this.instances.get(key ?? this.defaultKey);
207
207
  if (!instance) {
208
- throw new Error(`No SDK client found. Create one with "new UnipileAccounts()" to fix this error.`);
208
+ throw new Error(`No SDK client found. Create one with "new UnipileHostedAuth()" to fix this error.`);
209
209
  }
210
210
  return instance;
211
211
  }
@@ -219,6 +219,69 @@ class HeyApiClient11 {
219
219
  }
220
220
  }
221
221
  class HeyApiRegistry11 {
222
+ constructor() {
223
+ this.defaultKey = 'default';
224
+ this.instances = new Map();
225
+ }
226
+ get(key) {
227
+ const instance = this.instances.get(key ?? this.defaultKey);
228
+ if (!instance) {
229
+ throw new Error(`No SDK client found. Create one with "new UnipileAccounts()" to fix this error.`);
230
+ }
231
+ return instance;
232
+ }
233
+ set(value, key) {
234
+ this.instances.set(key ?? this.defaultKey, value);
235
+ }
236
+ }
237
+ class HeyApiClient12 {
238
+ constructor(args) {
239
+ this.client = args?.client ?? client_gen_1.client;
240
+ }
241
+ }
242
+ class HeyApiRegistry12 {
243
+ constructor() {
244
+ this.defaultKey = 'default';
245
+ this.instances = new Map();
246
+ }
247
+ get(key) {
248
+ const instance = this.instances.get(key ?? this.defaultKey);
249
+ if (!instance) {
250
+ throw new Error(`No SDK client found. Create one with "new UnipileApiKeys()" to fix this error.`);
251
+ }
252
+ return instance;
253
+ }
254
+ set(value, key) {
255
+ this.instances.set(key ?? this.defaultKey, value);
256
+ }
257
+ }
258
+ class HeyApiClient13 {
259
+ constructor(args) {
260
+ this.client = args?.client ?? client_gen_1.client;
261
+ }
262
+ }
263
+ class HeyApiRegistry13 {
264
+ constructor() {
265
+ this.defaultKey = 'default';
266
+ this.instances = new Map();
267
+ }
268
+ get(key) {
269
+ const instance = this.instances.get(key ?? this.defaultKey);
270
+ if (!instance) {
271
+ throw new Error(`No SDK client found. Create one with "new UnipileScopes()" to fix this error.`);
272
+ }
273
+ return instance;
274
+ }
275
+ set(value, key) {
276
+ this.instances.set(key ?? this.defaultKey, value);
277
+ }
278
+ }
279
+ class HeyApiClient14 {
280
+ constructor(args) {
281
+ this.client = args?.client ?? client_gen_1.client;
282
+ }
283
+ }
284
+ class HeyApiRegistry14 {
222
285
  constructor() {
223
286
  this.defaultKey = 'default';
224
287
  this.instances = new Map();
@@ -599,6 +662,18 @@ class UnipileMessaging extends HeyApiClient {
599
662
  ...options
600
663
  });
601
664
  }
665
+ /**
666
+ * List contacts
667
+ *
668
+ * Returns a list of contacts for the connected account. Served by the email provider for email accounts and by the messaging provider for messaging accounts (e.g. WhatsApp). On providers where a contact is an overlay over a user, the contact carries the account owner's chosen name while the nested `user` object carries the user's own identity.
669
+ */
670
+ getContactsList(options) {
671
+ return (options.client ?? this.client).get({
672
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
673
+ url: '/v2/{account_id}/contacts',
674
+ ...options
675
+ });
676
+ }
602
677
  }
603
678
  exports.UnipileMessaging = UnipileMessaging;
604
679
  UnipileMessaging.__registry = new HeyApiRegistry();
@@ -884,11 +959,23 @@ class UnipileEmails extends HeyApiClient {
884
959
  });
885
960
  }
886
961
  /**
887
- * List email contacts
962
+ * List email senders
888
963
  *
889
- * Returns a list of contacts from the email provider.
964
+ * Returns the email senders available for the connected account, so you can discover the valid values to pass as `from` when sending emails or creating drafts. The list includes the primary address as well as any configured additional addresses. Supported for Google and Outlook accounts. For Outlook, additional addresses are only available on Microsoft 365 / Exchange accounts; personal Microsoft accounts return the primary address only.
890
965
  */
891
- getEmailContactsList(options) {
966
+ getEmailSenders(options) {
967
+ return (options.client ?? this.client).get({
968
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
969
+ url: '/v2/{account_id}/email-senders',
970
+ ...options
971
+ });
972
+ }
973
+ /**
974
+ * List contacts
975
+ *
976
+ * Returns a list of contacts for the connected account. Served by the email provider for email accounts and by the messaging provider for messaging accounts (e.g. WhatsApp). On providers where a contact is an overlay over a user, the contact carries the account owner's chosen name while the nested `user` object carries the user's own identity.
977
+ */
978
+ getContactsList(options) {
892
979
  return (options.client ?? this.client).get({
893
980
  security: [{ name: 'X-API-KEY', type: 'apiKey' }],
894
981
  url: '/v2/{account_id}/contacts',
@@ -918,7 +1005,7 @@ class UnipileUsers extends HeyApiClient {
918
1005
  /**
919
1006
  * Update a User Profile
920
1007
  *
921
- * Updates the specified User profile. Use `me` as `user_id` to update the account owner profile.<br/><br/>Multipart supported, refer to <a href="https://developer.unipile.com/v2.0/reference/api-usage#sending-files">Sending Files</a>.
1008
+ * Partially updates the specified User profile. Use `me` as `user_id` to update the account owner profile. Omitted properties remain unchanged; supplied values replace existing values; empty strings clear supported text fields; and null deletes nullable singleton resources.<br/><br/>Multipart supported, refer to <a href="https://developer.unipile.com/v2.0/reference/api-usage#sending-files">Sending Files</a>.
922
1009
  */
923
1010
  updateUserProfile(options) {
924
1011
  return (options.client ?? this.client).patch({
@@ -1951,7 +2038,7 @@ class UnipileLinkedIn extends HeyApiClient {
1951
2038
  getRecruiterApplicantResume(options) {
1952
2039
  return (options.client ?? this.client).get({
1953
2040
  security: [{ name: 'X-API-KEY', type: 'apiKey' }],
1954
- url: '/v2/{account_id}/linkedin/recruiter/projects/{project_id}/talent-pool/applicants/{applicant_id}/resume',
2041
+ url: '/v2/{account_id}/linkedin/recruiter/projects/{project_id}/talent-pool/applicants/{applicant_profile_id}/resume',
1955
2042
  ...options
1956
2043
  });
1957
2044
  }
@@ -2382,6 +2469,21 @@ class UnipileInstagram extends HeyApiClient {
2382
2469
  }
2383
2470
  exports.UnipileInstagram = UnipileInstagram;
2384
2471
  UnipileInstagram.__registry = new HeyApiRegistry7();
2472
+ class UnipileDefault extends HeyApiClient {
2473
+ constructor(args) {
2474
+ super(args);
2475
+ UnipileDefault.__registry.set(this, args?.key);
2476
+ }
2477
+ getV2(options) {
2478
+ return (options?.client ?? this.client).get({
2479
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2480
+ url: '/v2/',
2481
+ ...options
2482
+ });
2483
+ }
2484
+ }
2485
+ exports.UnipileDefault = UnipileDefault;
2486
+ UnipileDefault.__registry = new HeyApiRegistry8();
2385
2487
  class UnipileCustomAuth extends HeyApiClient {
2386
2488
  constructor(args) {
2387
2489
  super(args);
@@ -2453,7 +2555,7 @@ class UnipileCustomAuth extends HeyApiClient {
2453
2555
  }
2454
2556
  }
2455
2557
  exports.UnipileCustomAuth = UnipileCustomAuth;
2456
- UnipileCustomAuth.__registry = new HeyApiRegistry8();
2558
+ UnipileCustomAuth.__registry = new HeyApiRegistry9();
2457
2559
  class UnipileHostedAuth extends HeyApiClient {
2458
2560
  constructor(args) {
2459
2561
  super(args);
@@ -2477,7 +2579,7 @@ class UnipileHostedAuth extends HeyApiClient {
2477
2579
  }
2478
2580
  }
2479
2581
  exports.UnipileHostedAuth = UnipileHostedAuth;
2480
- UnipileHostedAuth.__registry = new HeyApiRegistry9();
2582
+ UnipileHostedAuth.__registry = new HeyApiRegistry10();
2481
2583
  class UnipileAccounts extends HeyApiClient {
2482
2584
  constructor(args) {
2483
2585
  super(args);
@@ -2526,7 +2628,7 @@ class UnipileAccounts extends HeyApiClient {
2526
2628
  /**
2527
2629
  * List all Accounts
2528
2630
  *
2529
- * Returns a list of all Accounts associated with the current Application. The accounts are returned sorted alphabeticaly on `name`.
2631
+ * Returns the Accounts accessible to the API Key in the current Application. Use `account_scope_id` with a Scope ID to return Accounts assigned to that Scope, or `none` to return Accounts without a Scope. Accounts are sorted alphabetically by `name`.
2530
2632
  */
2531
2633
  listAccounts(options) {
2532
2634
  return (options?.client ?? this.client).get({
@@ -2537,7 +2639,131 @@ class UnipileAccounts extends HeyApiClient {
2537
2639
  }
2538
2640
  }
2539
2641
  exports.UnipileAccounts = UnipileAccounts;
2540
- UnipileAccounts.__registry = new HeyApiRegistry10();
2642
+ UnipileAccounts.__registry = new HeyApiRegistry11();
2643
+ class UnipileApiKeys extends HeyApiClient {
2644
+ constructor(args) {
2645
+ super(args);
2646
+ UnipileApiKeys.__registry.set(this, args?.key);
2647
+ }
2648
+ /**
2649
+ * List API Keys
2650
+ *
2651
+ * Lists account-wide and scoped API keys. Service API keys are never exposed by this endpoint.
2652
+ */
2653
+ listApiKeys(options) {
2654
+ return (options?.client ?? this.client).get({
2655
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2656
+ url: '/v2/api-keys/',
2657
+ ...options
2658
+ });
2659
+ }
2660
+ /**
2661
+ * Create an API Key
2662
+ *
2663
+ * Creates an API key that can access every account or only accounts assigned to one scope. Service API keys cannot be created through this endpoint.
2664
+ */
2665
+ createApiKey(options) {
2666
+ return (options?.client ?? this.client).post({
2667
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2668
+ url: '/v2/api-keys/',
2669
+ ...options,
2670
+ headers: {
2671
+ 'Content-Type': 'application/json',
2672
+ ...options?.headers
2673
+ }
2674
+ });
2675
+ }
2676
+ /**
2677
+ * Delete an API Key
2678
+ *
2679
+ * Deletes an account-wide or scoped API key. Service API keys cannot be deleted through this endpoint.
2680
+ */
2681
+ deleteApiKey(options) {
2682
+ return (options.client ?? this.client).delete({
2683
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2684
+ url: '/v2/api-keys/{api_key_id}',
2685
+ ...options
2686
+ });
2687
+ }
2688
+ }
2689
+ exports.UnipileApiKeys = UnipileApiKeys;
2690
+ UnipileApiKeys.__registry = new HeyApiRegistry12();
2691
+ class UnipileScopes extends HeyApiClient {
2692
+ constructor(args) {
2693
+ super(args);
2694
+ UnipileScopes.__registry.set(this, args?.key);
2695
+ }
2696
+ /**
2697
+ * List Scopes
2698
+ *
2699
+ * Returns the Scopes created in the authenticated Application, including their status and the number of Accounts and API Keys assigned to each Scope.
2700
+ */
2701
+ listScopes(options) {
2702
+ return (options?.client ?? this.client).get({
2703
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2704
+ url: '/v2/scopes/',
2705
+ ...options
2706
+ });
2707
+ }
2708
+ /**
2709
+ * Create a Scope
2710
+ *
2711
+ * Creates a Scope in the authenticated Application. A Scope is an isolation boundary used to restrict Account API Keys to the Accounts assigned to it.
2712
+ */
2713
+ createScope(options) {
2714
+ return (options.client ?? this.client).post({
2715
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2716
+ url: '/v2/scopes/',
2717
+ ...options,
2718
+ headers: {
2719
+ 'Content-Type': 'application/json',
2720
+ ...options.headers
2721
+ }
2722
+ });
2723
+ }
2724
+ /**
2725
+ * Delete a Scope
2726
+ *
2727
+ * Deletes a Scope from the authenticated Application. The Scope must not contain any Accounts or API Keys, including expired API Keys.
2728
+ */
2729
+ deleteScope(options) {
2730
+ return (options.client ?? this.client).delete({
2731
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2732
+ url: '/v2/scopes/{scope_id}',
2733
+ ...options
2734
+ });
2735
+ }
2736
+ /**
2737
+ * Get a Scope
2738
+ *
2739
+ * Returns a Scope from the authenticated Application, including its status and the number of Accounts and API Keys assigned to it.
2740
+ */
2741
+ getScope(options) {
2742
+ return (options.client ?? this.client).get({
2743
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2744
+ url: '/v2/scopes/{scope_id}',
2745
+ ...options
2746
+ });
2747
+ }
2748
+ /**
2749
+ * Update a Scope
2750
+ *
2751
+ * Updates the name, unique reference, or status of a Scope. Disabling a Scope blocks its Account API Keys and authentication flows until it is enabled again.
2752
+ */
2753
+ updateScope(options) {
2754
+ return (options.client ?? this.client).patch({
2755
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2756
+ url: '/v2/scopes/{scope_id}',
2757
+ ...options,
2758
+ headers: {
2759
+ 'Content-Type': 'application/json',
2760
+ ...options.headers
2761
+ }
2762
+ });
2763
+ }
2764
+ }
2765
+ exports.UnipileScopes = UnipileScopes;
2766
+ UnipileScopes.__registry = new HeyApiRegistry13();
2541
2767
  class UnipileWebhooks extends HeyApiClient {
2542
2768
  constructor(args) {
2543
2769
  super(args);
@@ -2625,4 +2851,4 @@ class UnipileWebhooks extends HeyApiClient {
2625
2851
  }
2626
2852
  }
2627
2853
  exports.UnipileWebhooks = UnipileWebhooks;
2628
- UnipileWebhooks.__registry = new HeyApiRegistry11();
2854
+ UnipileWebhooks.__registry = new HeyApiRegistry14();