@internxt/sdk 1.11.1 → 1.11.2

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,27 +1,3 @@
1
- export interface Device {
2
- id: number;
3
- name: string;
4
- mac: string;
5
- userId: number;
6
- createdAt: string;
7
- updatedAt: string;
8
- size: number;
9
- platform: string | null;
10
- }
11
- export interface DeviceBackup {
12
- id: number;
13
- path: string;
14
- name: string;
15
- fileId?: string;
16
- deviceId: number;
17
- userId: number;
18
- interval: number;
19
- size?: number;
20
- bucket: string;
21
- createdAt: string;
22
- updatedAt: string;
23
- encrypt_version: string;
24
- hash?: string;
25
- enabled: boolean;
26
- lastBackupAt?: string;
27
- }
1
+ import { components } from '../../schema';
2
+ export type Device = components['schemas']['DeviceDto'];
3
+ export type DeviceBackup = components['schemas']['DeviceAsFolder'];
@@ -1,9 +1,10 @@
1
+ import { paths } from '../../schema';
1
2
  import { Token } from '../../auth';
2
3
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
3
4
  import { RequestCanceler } from '../../shared/http/client';
4
5
  import { UUID } from '../../shared/types/userSettings';
5
6
  import { ItemType } from './../../workspaces/types';
6
- import { AddItemsToTrashPayload, CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, CreateThumbnailEntryPayload, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderAncestorWorkspace, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse, UsageResponseV2 } from './types';
7
+ import { CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, CreateThumbnailEntryPayload, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderAncestorWorkspace, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse, UsageResponseV2 } from './types';
7
8
  export * as StorageTypes from './types';
8
9
  export declare class Storage {
9
10
  private readonly client;
@@ -237,7 +238,7 @@ export declare class Storage {
237
238
  * Add Items to Trash
238
239
  * @param payload
239
240
  */
240
- addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
241
+ addItemsToTrash(payload: paths['/storage/trash/add']['post']['requestBody']['content']['application/json']): Promise<void>;
241
242
  /**
242
243
  * @returns whether the user has uploaded any files
243
244
  */
@@ -383,13 +383,6 @@ export type UsageResponseV2 = {
383
383
  export interface FetchLimitResponse {
384
384
  maxSpaceBytes: number;
385
385
  }
386
- export interface AddItemsToTrashPayload {
387
- items: Array<{
388
- id?: string;
389
- uuid?: string;
390
- type: string;
391
- }>;
392
- }
393
386
  export interface SearchResult {
394
387
  id: string;
395
388
  itemId: string;
@@ -1,6 +1,7 @@
1
+ import { paths } from '../../schema';
1
2
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
3
  import { FetchFolderContentResponse, FetchTrashContentResponse } from '../storage/types';
3
- import { AddItemsToTrashPayload, DeleteFilePayload, DeleteItemsPermanentlyByUUIDPayload, DeleteItemsPermanentlyPayload } from './types';
4
+ import { DeleteFilePayload, DeleteItemsPermanentlyByUUIDPayload, DeleteItemsPermanentlyPayload } from './types';
4
5
  export * as TrashTypes from './types';
5
6
  export declare class Trash {
6
7
  private readonly client;
@@ -50,7 +51,7 @@ export declare class Trash {
50
51
  * Add Items to Trash
51
52
  * @param payload
52
53
  */
53
- addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
54
+ addItemsToTrash(payload: paths['/storage/trash/add']['post']['requestBody']['content']['application/json']): Promise<void>;
54
55
  /**
55
56
  * Removes all items from the trash
56
57
  */
@@ -1,10 +1,3 @@
1
- export interface AddItemsToTrashPayload {
2
- items: Array<{
3
- id?: string;
4
- uuid?: string;
5
- type: string;
6
- }>;
7
- }
8
1
  export interface DeleteFilePayload {
9
2
  fileId: number;
10
3
  folderId: number;
@@ -44,5 +44,5 @@ var CodeError = /** @class */ (function (_super) {
44
44
  exports.CodeError = CodeError;
45
45
  exports.default = {
46
46
  Upload: UploadErrorCode,
47
- Download: DownloadErrorCode
47
+ Download: DownloadErrorCode,
48
48
  };
@@ -13,6 +13,6 @@ var SymmetricCryptoAlgorithm;
13
13
  exports.ALGORITHMS = (_a = {},
14
14
  _a[SymmetricCryptoAlgorithm.AES256CTR] = {
15
15
  type: SymmetricCryptoAlgorithm.AES256CTR,
16
- ivSize: 32
16
+ ivSize: 32,
17
17
  },
18
18
  _a);
@@ -14,10 +14,11 @@ export declare class Checkout {
14
14
  * @param companyVatId - The VAT ID of the company (optional)
15
15
  * @returns The customer ID and the user token used to create a subscription or payment intent
16
16
  */
17
- getCustomerId({ customerName, postalCode, country, companyVatId, }: {
17
+ getCustomerId({ customerName, postalCode, country, captchaToken, companyVatId, }: {
18
18
  customerName: string;
19
19
  postalCode: string;
20
20
  country: string;
21
+ captchaToken: string;
21
22
  companyVatId?: string;
22
23
  }): Promise<{
23
24
  customerId: string;
@@ -37,7 +38,7 @@ export declare class Checkout {
37
38
  * - `subscriptionId`: The ID of the subscription (optional)
38
39
  * - `paymentIntentId`: The ID of the payment intent (optional)
39
40
  */
40
- createSubscription({ customerId, priceId, token, currency, promoCodeId, quantity, }: CreateSubscriptionPayload): Promise<CreatedSubscriptionData>;
41
+ createSubscription({ customerId, priceId, token, currency, captchaToken, promoCodeId, quantity, }: CreateSubscriptionPayload): Promise<CreatedSubscriptionData>;
41
42
  /**
42
43
  * @description Creates a payment intent for a given customer
43
44
  * @param customerId - The ID of the customer
@@ -55,7 +56,7 @@ export declare class Checkout {
55
56
  * - `payload.url`: The URL of the invoice
56
57
  * - `payload.qrUrl`: The QR code URL of the invoice
57
58
  */
58
- createPaymentIntent({ customerId, priceId, token, currency, promoCodeId, }: CreatePaymentIntentPayload): Promise<PaymentIntent>;
59
+ createPaymentIntent({ customerId, priceId, token, currency, captchaToken, promoCodeId, }: CreatePaymentIntentPayload): Promise<PaymentIntent>;
59
60
  /**
60
61
  * @description Fetch a requested price by its ID and its tax rate
61
62
  * @param priceId - The ID of the price
@@ -31,11 +31,12 @@ var Checkout = /** @class */ (function () {
31
31
  * @returns The customer ID and the user token used to create a subscription or payment intent
32
32
  */
33
33
  Checkout.prototype.getCustomerId = function (_a) {
34
- var customerName = _a.customerName, postalCode = _a.postalCode, country = _a.country, companyVatId = _a.companyVatId;
34
+ var customerName = _a.customerName, postalCode = _a.postalCode, country = _a.country, captchaToken = _a.captchaToken, companyVatId = _a.companyVatId;
35
35
  var query = new URLSearchParams();
36
36
  query.set('customerName', customerName);
37
37
  query.set('country', country);
38
38
  query.set('postalCode', postalCode);
39
+ query.set('captchaToken', captchaToken);
39
40
  if (companyVatId !== undefined)
40
41
  query.set('companyVatId', companyVatId);
41
42
  return this.client.get("/checkout/customer?".concat(query.toString()), this.authHeaders());
@@ -55,12 +56,13 @@ var Checkout = /** @class */ (function () {
55
56
  * - `paymentIntentId`: The ID of the payment intent (optional)
56
57
  */
57
58
  Checkout.prototype.createSubscription = function (_a) {
58
- var customerId = _a.customerId, priceId = _a.priceId, token = _a.token, currency = _a.currency, promoCodeId = _a.promoCodeId, quantity = _a.quantity;
59
+ var customerId = _a.customerId, priceId = _a.priceId, token = _a.token, currency = _a.currency, captchaToken = _a.captchaToken, promoCodeId = _a.promoCodeId, quantity = _a.quantity;
59
60
  return this.client.post('/checkout/subscription', {
60
61
  customerId: customerId,
61
62
  priceId: priceId,
62
63
  token: token,
63
64
  currency: currency,
65
+ captchaToken: captchaToken,
64
66
  promoCodeId: promoCodeId,
65
67
  quantity: quantity,
66
68
  }, this.authHeaders());
@@ -83,12 +85,13 @@ var Checkout = /** @class */ (function () {
83
85
  * - `payload.qrUrl`: The QR code URL of the invoice
84
86
  */
85
87
  Checkout.prototype.createPaymentIntent = function (_a) {
86
- var customerId = _a.customerId, priceId = _a.priceId, token = _a.token, currency = _a.currency, promoCodeId = _a.promoCodeId;
88
+ var customerId = _a.customerId, priceId = _a.priceId, token = _a.token, currency = _a.currency, captchaToken = _a.captchaToken, promoCodeId = _a.promoCodeId;
87
89
  return this.client.post('/checkout/payment-intent', {
88
90
  customerId: customerId,
89
91
  priceId: priceId,
90
92
  token: token,
91
93
  currency: currency,
94
+ captchaToken: captchaToken,
92
95
  promoCodeId: promoCodeId,
93
96
  }, this.authHeaders());
94
97
  };
@@ -3,6 +3,7 @@ export interface CreateSubscriptionPayload {
3
3
  customerId: string;
4
4
  priceId: string;
5
5
  token: string;
6
+ captchaToken: string;
6
7
  currency?: string;
7
8
  promoCodeId?: string;
8
9
  quantity?: number;
@@ -12,6 +13,7 @@ export interface CreatePaymentIntentPayload {
12
13
  priceId: string;
13
14
  token: string;
14
15
  currency: string;
16
+ captchaToken: string;
15
17
  promoCodeId?: string;
16
18
  }
17
19
  export interface PaymentMethodVerificationPayload {
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.11.1",
4
+ "version": "1.11.2",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",
@@ -23,7 +23,8 @@
23
23
  "test:cov": "jest --coverage",
24
24
  "build": "tsc",
25
25
  "lint": "eslint ./src",
26
- "format": "prettier src/**/*.ts"
26
+ "format": "prettier src/**/*.ts --write",
27
+ "swagger": "openapi-typescript https://gateway.internxt.com/drive/api-json -o ./src/schema.d.ts && prettier ./src/schema.d.ts --write"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@internxt/eslint-config-internxt": "2.0.1",
@@ -35,6 +36,7 @@
35
36
  "husky": "9.1.7",
36
37
  "jest": "30.0.5",
37
38
  "lint-staged": "16.1.5",
39
+ "openapi-typescript": "^7.9.1",
38
40
  "prettier": "3.6.2",
39
41
  "sinon": "21.0.0",
40
42
  "ts-jest": "29.4.1",
@@ -46,7 +48,7 @@
46
48
  },
47
49
  "lint-staged": {
48
50
  "*.{js,jsx,tsx,ts}": [
49
- "prettier --write"
51
+ "yarn format"
50
52
  ]
51
53
  }
52
54
  }