@internxt/sdk 1.5.25 → 1.6.4
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 +127 -122
- package/dist/auth/index.js +378 -310
- package/dist/auth/types.d.ts +65 -54
- package/dist/auth/types.js +26 -26
- package/dist/drive/backups/index.d.ts +18 -18
- package/dist/drive/backups/index.js +40 -40
- package/dist/drive/backups/types.d.ts +27 -27
- package/dist/drive/backups/types.js +2 -2
- package/dist/drive/index.d.ts +7 -7
- package/dist/drive/index.js +23 -19
- package/dist/drive/payments/index.d.ts +66 -71
- package/dist/drive/payments/index.js +206 -208
- package/dist/drive/payments/types.d.ts +180 -176
- package/dist/drive/payments/types.js +37 -37
- package/dist/drive/referrals/index.d.ts +19 -19
- package/dist/drive/referrals/index.js +54 -50
- package/dist/drive/referrals/types.d.ts +21 -21
- package/dist/drive/referrals/types.js +18 -18
- package/dist/drive/share/index.d.ts +319 -319
- package/dist/drive/share/index.js +544 -540
- package/dist/drive/share/types.d.ts +360 -360
- package/dist/drive/share/types.js +2 -2
- package/dist/drive/storage/index.d.ts +315 -315
- package/dist/drive/storage/index.js +634 -630
- package/dist/drive/storage/types.d.ts +480 -473
- package/dist/drive/storage/types.js +13 -13
- package/dist/drive/trash/index.d.ts +75 -75
- package/dist/drive/trash/index.js +184 -180
- package/dist/drive/trash/types.d.ts +29 -29
- package/dist/drive/trash/types.js +2 -2
- package/dist/drive/users/index.d.ts +135 -135
- package/dist/drive/users/index.js +208 -204
- package/dist/drive/users/types.d.ts +53 -51
- package/dist/drive/users/types.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +35 -31
- package/dist/network/download.d.ts +8 -8
- package/dist/network/download.js +123 -123
- package/dist/network/errors/codes.d.ts +24 -24
- package/dist/network/errors/codes.js +48 -48
- package/dist/network/errors/context.d.ts +35 -35
- package/dist/network/errors/context.js +39 -39
- package/dist/network/errors/download.d.ts +4 -4
- package/dist/network/errors/download.js +52 -48
- package/dist/network/errors/index.d.ts +3 -3
- package/dist/network/errors/index.js +19 -15
- package/dist/network/errors/upload.d.ts +13 -13
- package/dist/network/errors/upload.js +82 -78
- package/dist/network/index.d.ts +70 -70
- package/dist/network/index.js +315 -311
- package/dist/network/types.d.ts +102 -102
- package/dist/network/types.js +18 -18
- package/dist/network/upload.d.ts +4 -4
- package/dist/network/upload.js +158 -159
- package/dist/photos/devices/index.d.ts +10 -10
- package/dist/photos/devices/index.js +79 -79
- package/dist/photos/index.d.ts +17 -17
- package/dist/photos/index.js +56 -52
- package/dist/photos/photos/index.d.ts +60 -60
- package/dist/photos/photos/index.js +225 -225
- package/dist/photos/shares/index.d.ts +8 -8
- package/dist/photos/shares/index.js +34 -34
- package/dist/photos/types.d.ts +154 -154
- package/dist/photos/types.js +19 -19
- package/dist/photos/users/index.d.ts +7 -7
- package/dist/photos/users/index.js +46 -46
- package/dist/shared/headers/index.d.ts +21 -21
- package/dist/shared/headers/index.js +78 -79
- package/dist/shared/http/client.d.ts +85 -85
- package/dist/shared/http/client.js +172 -172
- package/dist/shared/http/types.d.ts +7 -7
- package/dist/shared/http/types.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +17 -13
- package/dist/shared/types/apiConnection.d.ts +12 -12
- package/dist/shared/types/apiConnection.js +2 -2
- package/dist/shared/types/appsumo.d.ts +16 -16
- package/dist/shared/types/appsumo.js +12 -12
- package/dist/shared/types/errors.d.ts +5 -5
- package/dist/shared/types/errors.js +28 -28
- package/dist/shared/types/teams.d.ts +9 -9
- package/dist/shared/types/teams.js +2 -2
- package/dist/shared/types/userSettings.d.ts +43 -29
- package/dist/shared/types/userSettings.js +2 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +24 -25
- package/dist/workspaces/index.d.ts +176 -176
- package/dist/workspaces/index.js +419 -415
- package/dist/workspaces/index.test.d.ts +1 -1
- package/dist/workspaces/index.test.js +908 -903
- package/dist/workspaces/types.d.ts +294 -291
- package/dist/workspaces/types.js +2 -2
- package/package.json +13 -13
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,122 +1,127 @@
|
|
|
1
|
-
import { Token, CryptoProvider, Keys, LoginDetails, RegisterDetails, SecurityDetails, TwoFactorAuthQR, RegisterPreCreatedUser, RegisterPreCreatedUserResponse } from './types';
|
|
2
|
-
import { UserSettings, UUID } from '../shared/types/userSettings';
|
|
3
|
-
import { TeamsSettings } from '../shared/types/teams';
|
|
4
|
-
import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export declare class Auth {
|
|
7
|
-
private readonly client;
|
|
8
|
-
private readonly appDetails;
|
|
9
|
-
private readonly apiSecurity?;
|
|
10
|
-
private readonly apiUrl;
|
|
11
|
-
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity?: ApiSecurity): Auth;
|
|
12
|
-
private constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Tries to register a new user
|
|
15
|
-
* @param registerDetails
|
|
16
|
-
*/
|
|
17
|
-
register(registerDetails: RegisterDetails): Promise<{
|
|
18
|
-
token: Token;
|
|
19
|
-
user: Omit<UserSettings, 'bucket'> & {
|
|
20
|
-
referralCode: string;
|
|
21
|
-
};
|
|
22
|
-
uuid: UUID;
|
|
23
|
-
}>;
|
|
24
|
-
/**
|
|
25
|
-
* Registers a precreated user
|
|
26
|
-
* @param registerDetails
|
|
27
|
-
* @returns {Promise<RegisterPreCreatedUserResponse>} Returns sign in token, user data and uuid.
|
|
28
|
-
*/
|
|
29
|
-
registerPreCreatedUser(registerDetails: RegisterPreCreatedUser): Promise<RegisterPreCreatedUserResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Requests account unblock email
|
|
32
|
-
*
|
|
33
|
-
* @param {string} email - The email address associated with the account.
|
|
34
|
-
* @returns {Promise<void>} - Resolves when the email is sent.
|
|
35
|
-
*/
|
|
36
|
-
requestUnblockAccount(email: string): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Unblocks account with token
|
|
39
|
-
*
|
|
40
|
-
* @param {string} token - The token received via email to verify and unblock the account.
|
|
41
|
-
* @returns {Promise<void>} - Resolves successfuly when account is unblocked
|
|
42
|
-
*/
|
|
43
|
-
unblockAccount(token: string): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Tries to log in a user given its login details
|
|
46
|
-
* @param details
|
|
47
|
-
* @param cryptoProvider
|
|
48
|
-
*/
|
|
49
|
-
login(details: LoginDetails, cryptoProvider: CryptoProvider): Promise<{
|
|
50
|
-
token: Token;
|
|
51
|
-
newToken: Token;
|
|
52
|
-
user: UserSettings;
|
|
53
|
-
userTeam: TeamsSettings | null;
|
|
54
|
-
}>;
|
|
55
|
-
/**
|
|
56
|
-
* Updates the asymmetric keys
|
|
57
|
-
* @param keys
|
|
58
|
-
* @param token
|
|
59
|
-
*/
|
|
60
|
-
updateKeys(keys: Keys, token: Token): Promise<unknown>;
|
|
61
|
-
/**
|
|
62
|
-
* Returns general security details
|
|
63
|
-
* @param email
|
|
64
|
-
*/
|
|
65
|
-
securityDetails(email: string): Promise<SecurityDetails>;
|
|
66
|
-
/**
|
|
67
|
-
* Generates a new TwoFactorAuth code
|
|
68
|
-
*/
|
|
69
|
-
generateTwoFactorAuthQR(): Promise<TwoFactorAuthQR>;
|
|
70
|
-
/**
|
|
71
|
-
* Disables TwoFactorAuthentication
|
|
72
|
-
* @param pass
|
|
73
|
-
* @param code
|
|
74
|
-
*/
|
|
75
|
-
disableTwoFactorAuth(pass: string, code: string): Promise<void>;
|
|
76
|
-
/**
|
|
77
|
-
* Store TwoFactorAuthentication details
|
|
78
|
-
* @param backupKey
|
|
79
|
-
* @param code
|
|
80
|
-
*/
|
|
81
|
-
storeTwoFactorAuthKey(backupKey: string, code: string): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Sends request to send the email to delete the account
|
|
84
|
-
* @param email
|
|
85
|
-
*/
|
|
86
|
-
sendDeactivationEmail(email: string): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Confirms the account deactivation
|
|
89
|
-
* @param token
|
|
90
|
-
*/
|
|
91
|
-
confirmDeactivation(token: string): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* Checks if the password is correct for this email
|
|
94
|
-
* @param email
|
|
95
|
-
* @param hashedPassword
|
|
96
|
-
* @returns
|
|
97
|
-
*/
|
|
98
|
-
areCredentialsCorrect(email: string, hashedPassword: string): Promise<boolean>;
|
|
99
|
-
/**
|
|
100
|
-
* Send email to change password
|
|
101
|
-
* @param email
|
|
102
|
-
*/
|
|
103
|
-
sendChangePasswordEmail(email: string): Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @param
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
* @param
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
import { Token, CryptoProvider, Keys, LoginDetails, RegisterDetails, SecurityDetails, TwoFactorAuthQR, RegisterPreCreatedUser, RegisterPreCreatedUserResponse } from './types';
|
|
2
|
+
import { UserSettings, UUID } from '../shared/types/userSettings';
|
|
3
|
+
import { TeamsSettings } from '../shared/types/teams';
|
|
4
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export declare class Auth {
|
|
7
|
+
private readonly client;
|
|
8
|
+
private readonly appDetails;
|
|
9
|
+
private readonly apiSecurity?;
|
|
10
|
+
private readonly apiUrl;
|
|
11
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity?: ApiSecurity): Auth;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Tries to register a new user
|
|
15
|
+
* @param registerDetails
|
|
16
|
+
*/
|
|
17
|
+
register(registerDetails: RegisterDetails): Promise<{
|
|
18
|
+
token: Token;
|
|
19
|
+
user: Omit<UserSettings, 'bucket'> & {
|
|
20
|
+
referralCode: string;
|
|
21
|
+
};
|
|
22
|
+
uuid: UUID;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Registers a precreated user
|
|
26
|
+
* @param registerDetails
|
|
27
|
+
* @returns {Promise<RegisterPreCreatedUserResponse>} Returns sign in token, user data and uuid.
|
|
28
|
+
*/
|
|
29
|
+
registerPreCreatedUser(registerDetails: RegisterPreCreatedUser): Promise<RegisterPreCreatedUserResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Requests account unblock email
|
|
32
|
+
*
|
|
33
|
+
* @param {string} email - The email address associated with the account.
|
|
34
|
+
* @returns {Promise<void>} - Resolves when the email is sent.
|
|
35
|
+
*/
|
|
36
|
+
requestUnblockAccount(email: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Unblocks account with token
|
|
39
|
+
*
|
|
40
|
+
* @param {string} token - The token received via email to verify and unblock the account.
|
|
41
|
+
* @returns {Promise<void>} - Resolves successfuly when account is unblocked
|
|
42
|
+
*/
|
|
43
|
+
unblockAccount(token: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Tries to log in a user given its login details
|
|
46
|
+
* @param details
|
|
47
|
+
* @param cryptoProvider
|
|
48
|
+
*/
|
|
49
|
+
login(details: LoginDetails, cryptoProvider: CryptoProvider): Promise<{
|
|
50
|
+
token: Token;
|
|
51
|
+
newToken: Token;
|
|
52
|
+
user: UserSettings;
|
|
53
|
+
userTeam: TeamsSettings | null;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Updates the asymmetric keys
|
|
57
|
+
* @param keys
|
|
58
|
+
* @param token
|
|
59
|
+
*/
|
|
60
|
+
updateKeys(keys: Keys, token: Token): Promise<unknown>;
|
|
61
|
+
/**
|
|
62
|
+
* Returns general security details
|
|
63
|
+
* @param email
|
|
64
|
+
*/
|
|
65
|
+
securityDetails(email: string): Promise<SecurityDetails>;
|
|
66
|
+
/**
|
|
67
|
+
* Generates a new TwoFactorAuth code
|
|
68
|
+
*/
|
|
69
|
+
generateTwoFactorAuthQR(): Promise<TwoFactorAuthQR>;
|
|
70
|
+
/**
|
|
71
|
+
* Disables TwoFactorAuthentication
|
|
72
|
+
* @param pass
|
|
73
|
+
* @param code
|
|
74
|
+
*/
|
|
75
|
+
disableTwoFactorAuth(pass: string, code: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Store TwoFactorAuthentication details
|
|
78
|
+
* @param backupKey
|
|
79
|
+
* @param code
|
|
80
|
+
*/
|
|
81
|
+
storeTwoFactorAuthKey(backupKey: string, code: string): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Sends request to send the email to delete the account
|
|
84
|
+
* @param email
|
|
85
|
+
*/
|
|
86
|
+
sendDeactivationEmail(email: string): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Confirms the account deactivation
|
|
89
|
+
* @param token
|
|
90
|
+
*/
|
|
91
|
+
confirmDeactivation(token: string): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if the password is correct for this email
|
|
94
|
+
* @param email
|
|
95
|
+
* @param hashedPassword
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
areCredentialsCorrect(email: string, hashedPassword: string): Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* Send email to change password
|
|
101
|
+
* @param email
|
|
102
|
+
*/
|
|
103
|
+
sendChangePasswordEmail(email: string): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Upgrade hash in the database
|
|
106
|
+
* @param newHash
|
|
107
|
+
*/
|
|
108
|
+
upgradeHash(newHash: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Restore password with email link
|
|
111
|
+
* @param token
|
|
112
|
+
* @param password
|
|
113
|
+
* @param salt
|
|
114
|
+
* @param mnemonic
|
|
115
|
+
*/
|
|
116
|
+
changePasswordWithLink(token: string | undefined, password: string, salt: string, mnemonic: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Reset account with token
|
|
119
|
+
* @param token
|
|
120
|
+
* @param password
|
|
121
|
+
* @param salt
|
|
122
|
+
* @param mnemonic
|
|
123
|
+
*/
|
|
124
|
+
resetAccountWithToken(token: string | undefined, password: string, salt: string, mnemonic: string): Promise<void>;
|
|
125
|
+
private basicHeaders;
|
|
126
|
+
private headersWithToken;
|
|
127
|
+
}
|