@internxt/sdk 1.9.28 → 1.9.29

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.
@@ -1,5 +1,5 @@
1
1
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
- import { AcceptInvitationToSharedFolderPayload, CreateSharingPayload, GenerateShareLinkPayload, GetShareLinkFolderSizePayload, GetSharedDirectoryPayload, ListAllSharedFoldersResponse, ListPrivateSharedFoldersResponse, ListShareLinksResponse, ListSharedItemsResponse, PublicSharedItemInfo, RemoveUserRolePayload, Role, ShareDomainsResponse, ShareFolderWithUserPayload, ShareLink, SharedFolderSize, SharedFolderUser, SharedFoldersInvitationsAsInvitedUserResponse, SharingInvite, SharingMeta, UpdateShareLinkPayload, UpdateUserRolePayload, UpdateUserRoleResponse } from './types';
2
+ import { AcceptInvitationToSharedFolderPayload, CreateSharingPayload, GenerateShareLinkPayload, GetShareLinkFolderSizePayload, GetSharedDirectoryPayload, ListAllSharedFoldersResponse, ListPrivateSharedFoldersResponse, ListShareLinksResponse, ListSharedItemsResponse, PublicSharedItemInfo, RemoveUserRolePayload, Role, ShareDomainsResponse, ShareFolderWithUserPayload, ShareLink, SharedFolderSize, SharedFolderUser, SharedFoldersInvitationsAsInvitedUserResponse, SharingInfo, SharingInvite, SharingMeta, UpdateShareLinkPayload, UpdateUserRolePayload, UpdateUserRoleResponse } from './types';
3
3
  import { ItemType } from 'src/workspaces';
4
4
  export * as ShareTypes from './types';
5
5
  export declare class Share {
@@ -270,6 +270,16 @@ export declare class Share {
270
270
  itemId: string;
271
271
  itemType: string;
272
272
  }): Promise<SharingMeta>;
273
+ /**
274
+ * Obtains detailed sharing information for a given file or folder
275
+ * @param {string} options.itemType - folder | file
276
+ * @param {string} options.itemId - id of folder or file
277
+ * @returns {Promise<SharingInfo>} A promise that returns information about the shared item.
278
+ */
279
+ getSharingInfo({ itemId, itemType }: {
280
+ itemId: string;
281
+ itemType: string;
282
+ }): Promise<SharingInfo>;
273
283
  declineSharedFolderInvite(invitationId: string, token?: string): Promise<void>;
274
284
  /**
275
285
  * Fetches roles for sharing items.
@@ -453,6 +453,17 @@ var Share = /** @class */ (function () {
453
453
  var headers = this.headers();
454
454
  return this.client.get("sharings/".concat(itemType, "/").concat(itemId, "/type"), headers);
455
455
  };
456
+ /**
457
+ * Obtains detailed sharing information for a given file or folder
458
+ * @param {string} options.itemType - folder | file
459
+ * @param {string} options.itemId - id of folder or file
460
+ * @returns {Promise<SharingInfo>} A promise that returns information about the shared item.
461
+ */
462
+ Share.prototype.getSharingInfo = function (_a) {
463
+ var itemId = _a.itemId, itemType = _a.itemType;
464
+ var headers = this.headers();
465
+ return this.client.get("sharings/".concat(itemType, "/").concat(itemId, "/info"), headers);
466
+ };
456
467
  Share.prototype.declineSharedFolderInvite = function (invitationId, token) {
457
468
  var headers = this.getRequestHeaders(token);
458
469
  return this.client.delete("sharings/invites/".concat(invitationId), headers);
@@ -375,6 +375,15 @@ export type SharingMeta = {
375
375
  item: SharedFiles | SharedFolders;
376
376
  itemToken: string;
377
377
  };
378
+ export type SharingInfo = {
379
+ type: 'public' | 'private';
380
+ publicSharing: {
381
+ id: string;
382
+ isPasswordProtected: boolean;
383
+ encryptedCode: string;
384
+ };
385
+ invitationsCount: number;
386
+ };
378
387
  export type Sharing = {
379
388
  type: string;
380
389
  id: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
3
  "author": "Internxt <hello@internxt.com>",
4
- "version": "1.9.28",
4
+ "version": "1.9.29",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",