@internxt/sdk 1.11.11 → 1.11.12
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/auth/index.d.ts +7 -0
- package/dist/auth/index.js +37 -0
- package/dist/schema.d.ts +78 -7
- package/package.json +6 -6
package/dist/auth/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
|
2
2
|
import { TeamsSettings } from '../shared/types/teams';
|
|
3
3
|
import { UserSettings, UUID } from '../shared/types/userSettings';
|
|
4
4
|
import { ChangePasswordWithLinkPayload, CryptoProvider, Keys, LoginDetails, PrivateKeys, RegisterDetails, RegisterPreCreatedUser, RegisterPreCreatedUserResponse, SecurityDetails, Token, TwoFactorAuthQR } from './types';
|
|
5
|
+
import { paths } from '../schema';
|
|
5
6
|
export * from './types';
|
|
6
7
|
export declare class Auth {
|
|
7
8
|
private readonly client;
|
|
@@ -71,6 +72,12 @@ export declare class Auth {
|
|
|
71
72
|
user: UserSettings;
|
|
72
73
|
userTeam: TeamsSettings | null;
|
|
73
74
|
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Tries to log in a user given its cli login details
|
|
77
|
+
* @param details
|
|
78
|
+
* @param cryptoProvider
|
|
79
|
+
*/
|
|
80
|
+
loginAccess(details: LoginDetails, cryptoProvider: CryptoProvider): Promise<paths['/auth/cli/login/access']['post']['responses']['200']['content']['application/json']>;
|
|
74
81
|
/**
|
|
75
82
|
* Tries to log in a user given its login details without sending keys
|
|
76
83
|
* @param details
|
package/dist/auth/index.js
CHANGED
|
@@ -239,6 +239,43 @@ var Auth = /** @class */ (function () {
|
|
|
239
239
|
});
|
|
240
240
|
});
|
|
241
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* Tries to log in a user given its cli login details
|
|
244
|
+
* @param details
|
|
245
|
+
* @param cryptoProvider
|
|
246
|
+
*/
|
|
247
|
+
Auth.prototype.loginAccess = function (details, cryptoProvider) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
249
|
+
var securityDetails, encryptedSalt, encryptedPasswordHash, keys;
|
|
250
|
+
return __generator(this, function (_a) {
|
|
251
|
+
switch (_a.label) {
|
|
252
|
+
case 0: return [4 /*yield*/, this.securityDetails(details.email)];
|
|
253
|
+
case 1:
|
|
254
|
+
securityDetails = _a.sent();
|
|
255
|
+
encryptedSalt = securityDetails.encryptedSalt;
|
|
256
|
+
encryptedPasswordHash = cryptoProvider.encryptPasswordHash(details.password, encryptedSalt);
|
|
257
|
+
return [4 /*yield*/, cryptoProvider.generateKeys(details.password)];
|
|
258
|
+
case 2:
|
|
259
|
+
keys = _a.sent();
|
|
260
|
+
return [2 /*return*/, this.client.post('/auth/cli/login/access', {
|
|
261
|
+
email: details.email,
|
|
262
|
+
password: encryptedPasswordHash,
|
|
263
|
+
tfa: details.tfaCode,
|
|
264
|
+
keys: {
|
|
265
|
+
ecc: {
|
|
266
|
+
publicKey: keys.ecc.publicKey,
|
|
267
|
+
privateKey: keys.ecc.privateKeyEncrypted,
|
|
268
|
+
},
|
|
269
|
+
kyber: {
|
|
270
|
+
publicKey: keys.kyber.publicKey,
|
|
271
|
+
privateKey: keys.kyber.privateKeyEncrypted,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
}, this.basicHeaders())];
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
};
|
|
242
279
|
/**
|
|
243
280
|
* Tries to log in a user given its login details without sending keys
|
|
244
281
|
* @param details
|
package/dist/schema.d.ts
CHANGED
|
@@ -2668,6 +2668,23 @@ export interface paths {
|
|
|
2668
2668
|
patch?: never;
|
|
2669
2669
|
trace?: never;
|
|
2670
2670
|
};
|
|
2671
|
+
'/auth/cli/login/access': {
|
|
2672
|
+
parameters: {
|
|
2673
|
+
query?: never;
|
|
2674
|
+
header?: never;
|
|
2675
|
+
path?: never;
|
|
2676
|
+
cookie?: never;
|
|
2677
|
+
};
|
|
2678
|
+
get?: never;
|
|
2679
|
+
put?: never;
|
|
2680
|
+
/** CLI platform login access */
|
|
2681
|
+
post: operations['AuthController_cliLoginAccess'];
|
|
2682
|
+
delete?: never;
|
|
2683
|
+
options?: never;
|
|
2684
|
+
head?: never;
|
|
2685
|
+
patch?: never;
|
|
2686
|
+
trace?: never;
|
|
2687
|
+
};
|
|
2671
2688
|
'/links': {
|
|
2672
2689
|
parameters: {
|
|
2673
2690
|
query?: never;
|
|
@@ -3105,12 +3122,27 @@ export interface components {
|
|
|
3105
3122
|
*/
|
|
3106
3123
|
plainNames: string[];
|
|
3107
3124
|
};
|
|
3108
|
-
|
|
3125
|
+
ExistentFoldersDto: {
|
|
3109
3126
|
existentFolders: components['schemas']['FolderDto'][];
|
|
3110
3127
|
};
|
|
3128
|
+
FilesNameAndType: {
|
|
3129
|
+
/**
|
|
3130
|
+
* @description Type of file
|
|
3131
|
+
* @example pdf
|
|
3132
|
+
*/
|
|
3133
|
+
type?: string;
|
|
3134
|
+
/**
|
|
3135
|
+
* @description Plain name of file
|
|
3136
|
+
* @example example
|
|
3137
|
+
*/
|
|
3138
|
+
plainName: string;
|
|
3139
|
+
};
|
|
3111
3140
|
CheckFileExistenceInFolderDto: {
|
|
3112
3141
|
/** @description Array of files with names and types */
|
|
3113
|
-
files:
|
|
3142
|
+
files: components['schemas']['FilesNameAndType'][];
|
|
3143
|
+
};
|
|
3144
|
+
ExistentFilesDto: {
|
|
3145
|
+
existentFiles: components['schemas']['FileDto'][];
|
|
3114
3146
|
};
|
|
3115
3147
|
GetFolderContentDto: {
|
|
3116
3148
|
type: string;
|
|
@@ -4699,6 +4731,11 @@ export interface components {
|
|
|
4699
4731
|
* @example 123456
|
|
4700
4732
|
*/
|
|
4701
4733
|
maxSpaceBytes: number;
|
|
4734
|
+
/**
|
|
4735
|
+
* @description Tier ID to update user tier (optional)
|
|
4736
|
+
* @example a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
4737
|
+
*/
|
|
4738
|
+
tierId?: string;
|
|
4702
4739
|
};
|
|
4703
4740
|
};
|
|
4704
4741
|
responses: never;
|
|
@@ -5204,7 +5241,7 @@ export interface operations {
|
|
|
5204
5241
|
[name: string]: unknown;
|
|
5205
5242
|
};
|
|
5206
5243
|
content: {
|
|
5207
|
-
'application/json': components['schemas']['
|
|
5244
|
+
'application/json': components['schemas']['ExistentFoldersDto'];
|
|
5208
5245
|
};
|
|
5209
5246
|
};
|
|
5210
5247
|
};
|
|
@@ -5224,11 +5261,13 @@ export interface operations {
|
|
|
5224
5261
|
};
|
|
5225
5262
|
};
|
|
5226
5263
|
responses: {
|
|
5227
|
-
|
|
5264
|
+
200: {
|
|
5228
5265
|
headers: {
|
|
5229
5266
|
[name: string]: unknown;
|
|
5230
5267
|
};
|
|
5231
|
-
content
|
|
5268
|
+
content: {
|
|
5269
|
+
'application/json': components['schemas']['ExistentFilesDto'];
|
|
5270
|
+
};
|
|
5232
5271
|
};
|
|
5233
5272
|
};
|
|
5234
5273
|
};
|
|
@@ -6433,12 +6472,12 @@ export interface operations {
|
|
|
6433
6472
|
};
|
|
6434
6473
|
WorkspacesController_getFiles: {
|
|
6435
6474
|
parameters: {
|
|
6436
|
-
query
|
|
6475
|
+
query?: {
|
|
6437
6476
|
/** @description Items per page */
|
|
6438
6477
|
limit?: number;
|
|
6439
6478
|
/** @description Offset for pagination */
|
|
6440
6479
|
offset?: number;
|
|
6441
|
-
status
|
|
6480
|
+
status?: 'EXISTS' | 'TRASHED' | 'DELETED' | 'ALL';
|
|
6442
6481
|
bucket?: string;
|
|
6443
6482
|
sort?: string;
|
|
6444
6483
|
order?: string;
|
|
@@ -6495,6 +6534,7 @@ export interface operations {
|
|
|
6495
6534
|
limit?: number;
|
|
6496
6535
|
/** @description Offset for pagination */
|
|
6497
6536
|
offset?: number;
|
|
6537
|
+
status?: 'EXISTS' | 'TRASHED' | 'DELETED' | 'ALL';
|
|
6498
6538
|
};
|
|
6499
6539
|
header?: never;
|
|
6500
6540
|
path: {
|
|
@@ -8869,6 +8909,37 @@ export interface operations {
|
|
|
8869
8909
|
};
|
|
8870
8910
|
};
|
|
8871
8911
|
};
|
|
8912
|
+
AuthController_cliLoginAccess: {
|
|
8913
|
+
parameters: {
|
|
8914
|
+
query?: never;
|
|
8915
|
+
header?: never;
|
|
8916
|
+
path?: never;
|
|
8917
|
+
cookie?: never;
|
|
8918
|
+
};
|
|
8919
|
+
requestBody: {
|
|
8920
|
+
content: {
|
|
8921
|
+
'application/json': components['schemas']['LoginAccessDto'];
|
|
8922
|
+
};
|
|
8923
|
+
};
|
|
8924
|
+
responses: {
|
|
8925
|
+
/** @description CLI user successfully accessed their account */
|
|
8926
|
+
200: {
|
|
8927
|
+
headers: {
|
|
8928
|
+
[name: string]: unknown;
|
|
8929
|
+
};
|
|
8930
|
+
content: {
|
|
8931
|
+
'application/json': components['schemas']['LoginAccessResponseDto'];
|
|
8932
|
+
};
|
|
8933
|
+
};
|
|
8934
|
+
/** @description This user current tier does not allow CLI access */
|
|
8935
|
+
402: {
|
|
8936
|
+
headers: {
|
|
8937
|
+
[name: string]: unknown;
|
|
8938
|
+
};
|
|
8939
|
+
content?: never;
|
|
8940
|
+
};
|
|
8941
|
+
};
|
|
8942
|
+
};
|
|
8872
8943
|
SendController_createLinks: {
|
|
8873
8944
|
parameters: {
|
|
8874
8945
|
query?: never;
|
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.
|
|
4
|
+
"version": "1.11.12",
|
|
5
5
|
"description": "An sdk for interacting with Internxt's services",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"@types/jest": "30.0.0",
|
|
33
33
|
"@types/sinon": "17.0.4",
|
|
34
34
|
"@types/uuid": "10.0.0",
|
|
35
|
-
"eslint": "9.
|
|
35
|
+
"eslint": "9.36.0",
|
|
36
36
|
"husky": "9.1.7",
|
|
37
|
-
"jest": "30.
|
|
38
|
-
"lint-staged": "16.
|
|
37
|
+
"jest": "30.2.0",
|
|
38
|
+
"lint-staged": "16.2.3",
|
|
39
39
|
"openapi-typescript": "^7.9.1",
|
|
40
40
|
"prettier": "3.6.2",
|
|
41
41
|
"sinon": "21.0.0",
|
|
42
|
-
"ts-jest": "29.4.
|
|
43
|
-
"typescript": "5.9.
|
|
42
|
+
"ts-jest": "29.4.4",
|
|
43
|
+
"typescript": "5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"axios": "^1.12.2",
|