@unipile/sdk 2.32.0 → 2.41.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.UnipileDefault = 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) {
@@ -240,6 +240,48 @@ class HeyApiClient12 {
240
240
  }
241
241
  }
242
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 {
243
285
  constructor() {
244
286
  this.defaultKey = 'default';
245
287
  this.instances = new Map();
@@ -963,7 +1005,7 @@ class UnipileUsers extends HeyApiClient {
963
1005
  /**
964
1006
  * Update a User Profile
965
1007
  *
966
- * 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>.
967
1009
  */
968
1010
  updateUserProfile(options) {
969
1011
  return (options.client ?? this.client).patch({
@@ -1200,6 +1242,22 @@ class UnipilePosts extends HeyApiClient {
1200
1242
  }
1201
1243
  });
1202
1244
  }
1245
+ /**
1246
+ * Create a Story
1247
+ *
1248
+ * Creates a new story from a single image or video attachment (if supported by the provider).<br/><br/>Multipart supported, refer to <a href="https://developer.unipile.com/v2.0/reference/api-usage#sending-files">Sending Files</a>.
1249
+ */
1250
+ createStory(options) {
1251
+ return (options.client ?? this.client).post({
1252
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
1253
+ url: '/v2/{account_id}/posts/stories',
1254
+ ...options,
1255
+ headers: {
1256
+ 'Content-Type': 'application/json',
1257
+ ...options.headers
1258
+ }
1259
+ });
1260
+ }
1203
1261
  /**
1204
1262
  * Remove Reaction from a Post
1205
1263
  *
@@ -1478,6 +1536,7 @@ class UnipileCalendar extends HeyApiClient {
1478
1536
  * List all calendar events
1479
1537
  *
1480
1538
  * Returns a list of calendar events.
1539
+ * - For Outlook, the attendee list of an invitation the connected account received is the one the organizer sent, and their responses are not refreshed on it. Only the response of the connected account is kept up to date.
1481
1540
  */
1482
1541
  getCalendarEventList(options) {
1483
1542
  return (options.client ?? this.client).get({
@@ -1518,6 +1577,8 @@ class UnipileCalendar extends HeyApiClient {
1518
1577
  * Get a calendar event
1519
1578
  *
1520
1579
  * Retrieves a calendar event object.
1580
+ * - For Outlook, the attendee list of an invitation the connected account received is the one the organizer sent, and their responses are not refreshed on it. Only the response of the connected account is kept up to date. Read the event from the calendar of its organizer to get the responses of the other attendees.
1581
+ * - For Outlook, an account invited through one of its aliases is not identifiable in the attendee list: Microsoft does not support an alias taking part in a calendar, so the invitation keeps the alias address while the account answers with its primary one.
1521
1582
  */
1522
1583
  getCalendarEvent(options) {
1523
1584
  return (options.client ?? this.client).get({
@@ -1542,6 +1603,56 @@ class UnipileCalendar extends HeyApiClient {
1542
1603
  }
1543
1604
  });
1544
1605
  }
1606
+ /**
1607
+ * Respond to a calendar event
1608
+ *
1609
+ * Sets the response of the connected account to an event it is invited to. Only the response of the connected account is affected, the other attendees are left untouched.
1610
+ * - For Outlook, declining an invitation also removes the event from the calendar of the connected account, and the organizer of an event cannot respond to it.
1611
+ * - For Google, the organizer can respond when they are also an attendee of the event.
1612
+ */
1613
+ setCalendarEventRsvp(options) {
1614
+ return (options.client ?? this.client).post({
1615
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
1616
+ url: '/v2/{account_id}/calendars/{calendar_id}/events/{event_id}/rsvp',
1617
+ ...options,
1618
+ headers: {
1619
+ 'Content-Type': 'application/json',
1620
+ ...options.headers
1621
+ }
1622
+ });
1623
+ }
1624
+ /**
1625
+ * Cancel a calendar event
1626
+ *
1627
+ * Cancels the specified event and notifies its attendees. Only the organizer of the event can cancel it, use the delete event method to remove an event from the calendar of the connected account.
1628
+ * - For Google, the event is deleted and stays readable as a cancelled event.
1629
+ * - For Outlook, the event is moved to the Deleted Items folder and is no longer readable by the organizer.
1630
+ */
1631
+ cancelCalendarEvent(options) {
1632
+ return (options.client ?? this.client).post({
1633
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
1634
+ url: '/v2/{account_id}/calendars/{calendar_id}/events/{event_id}/cancel',
1635
+ ...options,
1636
+ headers: {
1637
+ 'Content-Type': 'application/json',
1638
+ ...options.headers
1639
+ }
1640
+ });
1641
+ }
1642
+ /**
1643
+ * Restore a cancelled calendar event
1644
+ *
1645
+ * Restores an event previously cancelled by the connected account. Only the organizer of the event can restore it.
1646
+ * - Only available for Google Calendar, and only while Google still holds the data of the cancelled event.
1647
+ * - Outlook exposes no way to restore a cancelled event and always answers a `provider/method_not_allowed` error.
1648
+ */
1649
+ restoreCalendarEvent(options) {
1650
+ return (options.client ?? this.client).post({
1651
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
1652
+ url: '/v2/{account_id}/calendars/{calendar_id}/events/{event_id}/restore',
1653
+ ...options
1654
+ });
1655
+ }
1545
1656
  }
1546
1657
  exports.UnipileCalendar = UnipileCalendar;
1547
1658
  UnipileCalendar.__registry = new HeyApiRegistry5();
@@ -2586,7 +2697,7 @@ class UnipileAccounts extends HeyApiClient {
2586
2697
  /**
2587
2698
  * List all Accounts
2588
2699
  *
2589
- * Returns a list of all Accounts associated with the current Application. The accounts are returned sorted alphabeticaly on `name`.
2700
+ * 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`.
2590
2701
  */
2591
2702
  listAccounts(options) {
2592
2703
  return (options?.client ?? this.client).get({
@@ -2598,6 +2709,130 @@ class UnipileAccounts extends HeyApiClient {
2598
2709
  }
2599
2710
  exports.UnipileAccounts = UnipileAccounts;
2600
2711
  UnipileAccounts.__registry = new HeyApiRegistry11();
2712
+ class UnipileApiKeys extends HeyApiClient {
2713
+ constructor(args) {
2714
+ super(args);
2715
+ UnipileApiKeys.__registry.set(this, args?.key);
2716
+ }
2717
+ /**
2718
+ * List API Keys
2719
+ *
2720
+ * Lists account-wide and scoped API keys. Service API keys are never exposed by this endpoint.
2721
+ */
2722
+ listApiKeys(options) {
2723
+ return (options?.client ?? this.client).get({
2724
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2725
+ url: '/v2/api-keys/',
2726
+ ...options
2727
+ });
2728
+ }
2729
+ /**
2730
+ * Create an API Key
2731
+ *
2732
+ * 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.
2733
+ */
2734
+ createApiKey(options) {
2735
+ return (options?.client ?? this.client).post({
2736
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2737
+ url: '/v2/api-keys/',
2738
+ ...options,
2739
+ headers: {
2740
+ 'Content-Type': 'application/json',
2741
+ ...options?.headers
2742
+ }
2743
+ });
2744
+ }
2745
+ /**
2746
+ * Delete an API Key
2747
+ *
2748
+ * Deletes an account-wide or scoped API key. Service API keys cannot be deleted through this endpoint.
2749
+ */
2750
+ deleteApiKey(options) {
2751
+ return (options.client ?? this.client).delete({
2752
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2753
+ url: '/v2/api-keys/{api_key_id}',
2754
+ ...options
2755
+ });
2756
+ }
2757
+ }
2758
+ exports.UnipileApiKeys = UnipileApiKeys;
2759
+ UnipileApiKeys.__registry = new HeyApiRegistry12();
2760
+ class UnipileScopes extends HeyApiClient {
2761
+ constructor(args) {
2762
+ super(args);
2763
+ UnipileScopes.__registry.set(this, args?.key);
2764
+ }
2765
+ /**
2766
+ * List Scopes
2767
+ *
2768
+ * Returns the Scopes created in the authenticated Application, including their status and the number of Accounts and API Keys assigned to each Scope.
2769
+ */
2770
+ listScopes(options) {
2771
+ return (options?.client ?? this.client).get({
2772
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2773
+ url: '/v2/scopes/',
2774
+ ...options
2775
+ });
2776
+ }
2777
+ /**
2778
+ * Create a Scope
2779
+ *
2780
+ * 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.
2781
+ */
2782
+ createScope(options) {
2783
+ return (options.client ?? this.client).post({
2784
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2785
+ url: '/v2/scopes/',
2786
+ ...options,
2787
+ headers: {
2788
+ 'Content-Type': 'application/json',
2789
+ ...options.headers
2790
+ }
2791
+ });
2792
+ }
2793
+ /**
2794
+ * Delete a Scope
2795
+ *
2796
+ * Deletes a Scope from the authenticated Application. The Scope must not contain any Accounts or API Keys, including expired API Keys.
2797
+ */
2798
+ deleteScope(options) {
2799
+ return (options.client ?? this.client).delete({
2800
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2801
+ url: '/v2/scopes/{scope_id}',
2802
+ ...options
2803
+ });
2804
+ }
2805
+ /**
2806
+ * Get a Scope
2807
+ *
2808
+ * Returns a Scope from the authenticated Application, including its status and the number of Accounts and API Keys assigned to it.
2809
+ */
2810
+ getScope(options) {
2811
+ return (options.client ?? this.client).get({
2812
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2813
+ url: '/v2/scopes/{scope_id}',
2814
+ ...options
2815
+ });
2816
+ }
2817
+ /**
2818
+ * Update a Scope
2819
+ *
2820
+ * 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.
2821
+ */
2822
+ updateScope(options) {
2823
+ return (options.client ?? this.client).patch({
2824
+ security: [{ name: 'X-API-KEY', type: 'apiKey' }],
2825
+ url: '/v2/scopes/{scope_id}',
2826
+ ...options,
2827
+ headers: {
2828
+ 'Content-Type': 'application/json',
2829
+ ...options.headers
2830
+ }
2831
+ });
2832
+ }
2833
+ }
2834
+ exports.UnipileScopes = UnipileScopes;
2835
+ UnipileScopes.__registry = new HeyApiRegistry13();
2601
2836
  class UnipileWebhooks extends HeyApiClient {
2602
2837
  constructor(args) {
2603
2838
  super(args);
@@ -2685,4 +2920,4 @@ class UnipileWebhooks extends HeyApiClient {
2685
2920
  }
2686
2921
  }
2687
2922
  exports.UnipileWebhooks = UnipileWebhooks;
2688
- UnipileWebhooks.__registry = new HeyApiRegistry12();
2923
+ UnipileWebhooks.__registry = new HeyApiRegistry14();