@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 +5 -0
- package/dist/drive/payments/index.d.ts +3 -0
- package/dist/drive/payments/index.js +3 -0
- package/dist/drive/payments/object-storage.d.ts +1 -1
- package/dist/drive/share/index.d.ts +12 -2
- package/dist/drive/share/index.js +11 -0
- package/dist/drive/share/types.d.ts +9 -0
- package/dist/payments/types/index.d.ts +1 -1
- package/package.json +1 -1
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 '
|
|
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 '
|
|
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;
|