@internxt/sdk 1.9.28 → 1.9.30

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/README.md CHANGED
@@ -5,3 +5,8 @@
5
5
  - Create a `.npmrc` file from the `.npmrc.template` example provided in the repo.
6
6
  - Replace `TOKEN` with your own [Github Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) with `read:packages` permission **ONLY**
7
7
  - Use `yarn` to install project dependencies.
8
+
9
+ ## Import style guideline
10
+
11
+ - Always use **relative imports** (e.g., `../utils/helper` or `./myComponent`).
12
+ - Do **NOT** use **absolute imports** (e.g., `src/...`, `@/...`, etc).
@@ -38,6 +38,9 @@ export declare class Payments {
38
38
  }): Promise<{
39
39
  couponUsed: boolean;
40
40
  }>;
41
+ getPromoCodesUsedByUser(): Promise<{
42
+ usedCoupons: string[];
43
+ }>;
41
44
  getUserSubscription(userType?: UserType): Promise<UserSubscription>;
42
45
  getPrices(currency?: string, userType?: UserType): Promise<DisplayPrice[]>;
43
46
  requestPreventCancellation(): Promise<FreeTrialAvailable>;
@@ -137,6 +137,9 @@ var Payments = /** @class */ (function () {
137
137
  query.set('code', couponCode);
138
138
  return this.client.get("/coupon-in-use?".concat(query.toString()), this.headers());
139
139
  };
140
+ Payments.prototype.getPromoCodesUsedByUser = function () {
141
+ return this.client.get('/customer/redeemed-promotion-codes', this.headers());
142
+ };
140
143
  Payments.prototype.getUserSubscription = function (userType) {
141
144
  var query = new URLSearchParams();
142
145
  if (userType)
@@ -1,4 +1,4 @@
1
- import { PaymentMethodVerification, PaymentMethodVerificationPayload } from 'src/payments/types';
1
+ import { PaymentMethodVerification, PaymentMethodVerificationPayload } from '../../payments/types';
2
2
  import { ApiUrl, AppDetails } from '../../shared';
3
3
  import { CreatedSubscriptionData } from './types/types';
4
4
  interface ObjectStoragePlan {
@@ -1,6 +1,6 @@
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';
3
- import { ItemType } from 'src/workspaces';
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
+ import { ItemType } from '../../workspaces';
4
4
  export * as ShareTypes from './types';
5
5
  export declare class Share {
6
6
  private readonly client;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { UserType } from 'src/drive/payments/types/types';
1
+ import { UserType } from '../../drive/payments/types/types';
2
2
  export interface CreateSubscriptionPayload {
3
3
  customerId: string;
4
4
  priceId: 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.30",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",