@internxt/sdk 1.4.79 → 1.6.3

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.
Files changed (64) hide show
  1. package/dist/auth/index.d.ts +5 -0
  2. package/dist/auth/index.js +80 -12
  3. package/dist/auth/types.d.ts +17 -4
  4. package/dist/drive/backups/index.js +3 -3
  5. package/dist/drive/index.js +5 -1
  6. package/dist/drive/payments/index.d.ts +30 -17
  7. package/dist/drive/payments/index.js +78 -25
  8. package/dist/drive/payments/types.d.ts +67 -1
  9. package/dist/drive/payments/types.js +11 -6
  10. package/dist/drive/referrals/index.js +5 -1
  11. package/dist/drive/referrals/types.js +2 -2
  12. package/dist/drive/share/index.d.ts +1 -1
  13. package/dist/drive/share/index.js +49 -44
  14. package/dist/drive/share/types.d.ts +31 -29
  15. package/dist/drive/storage/index.d.ts +130 -10
  16. package/dist/drive/storage/index.js +253 -53
  17. package/dist/drive/storage/types.d.ts +107 -21
  18. package/dist/drive/storage/types.js +2 -2
  19. package/dist/drive/trash/index.d.ts +22 -2
  20. package/dist/drive/trash/index.js +44 -9
  21. package/dist/drive/trash/types.d.ts +9 -0
  22. package/dist/drive/users/index.d.ts +30 -3
  23. package/dist/drive/users/index.js +40 -6
  24. package/dist/drive/users/types.d.ts +16 -6
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.js +12 -7
  27. package/dist/network/download.js +5 -5
  28. package/dist/network/errors/codes.d.ts +1 -1
  29. package/dist/network/errors/context.d.ts +4 -4
  30. package/dist/network/errors/context.js +2 -2
  31. package/dist/network/errors/download.js +5 -1
  32. package/dist/network/errors/index.js +5 -1
  33. package/dist/network/errors/upload.js +5 -1
  34. package/dist/network/index.d.ts +2 -3
  35. package/dist/network/index.js +14 -9
  36. package/dist/network/types.d.ts +16 -16
  37. package/dist/network/types.js +2 -2
  38. package/dist/network/upload.js +8 -9
  39. package/dist/photos/devices/index.js +8 -8
  40. package/dist/photos/index.js +5 -1
  41. package/dist/photos/photos/index.js +26 -26
  42. package/dist/photos/shares/index.js +3 -3
  43. package/dist/photos/types.d.ts +14 -14
  44. package/dist/photos/types.js +3 -3
  45. package/dist/photos/users/index.js +2 -2
  46. package/dist/shared/headers/index.d.ts +9 -6
  47. package/dist/shared/headers/index.js +27 -18
  48. package/dist/shared/http/client.d.ts +1 -1
  49. package/dist/shared/http/client.js +4 -13
  50. package/dist/shared/http/types.d.ts +4 -4
  51. package/dist/shared/index.js +5 -1
  52. package/dist/shared/types/apiConnection.d.ts +2 -1
  53. package/dist/shared/types/appsumo.js +1 -1
  54. package/dist/shared/types/errors.d.ts +2 -1
  55. package/dist/shared/types/errors.js +2 -1
  56. package/dist/shared/types/userSettings.d.ts +17 -1
  57. package/dist/utils.js +2 -3
  58. package/dist/workspaces/index.d.ts +176 -0
  59. package/dist/workspaces/index.js +419 -0
  60. package/dist/workspaces/index.test.d.ts +1 -0
  61. package/dist/workspaces/index.test.js +908 -0
  62. package/dist/workspaces/types.d.ts +294 -0
  63. package/dist/workspaces/types.js +2 -0
  64. package/package.json +13 -13
@@ -0,0 +1,294 @@
1
+ import { SharedFiles, SharedFolders } from '../drive/share/types';
2
+ export interface WorkspaceUser {
3
+ backupsUsage: string;
4
+ createdAt: string;
5
+ deactivated: boolean;
6
+ driveUsage: string;
7
+ freeSpace: string;
8
+ id: string;
9
+ isManager: boolean;
10
+ isOwner: boolean;
11
+ key: string;
12
+ hybridModeEnabled: boolean;
13
+ member: Member;
14
+ memberId: string;
15
+ rootFolderId: string;
16
+ spaceLimit: string;
17
+ updatedAt: string;
18
+ usedSpace: string;
19
+ workspaceId: string;
20
+ }
21
+ export interface Workspace {
22
+ id: string;
23
+ ownerId: string;
24
+ address: string;
25
+ name: string;
26
+ description: string;
27
+ defaultTeamId: string;
28
+ workspaceUserId: string;
29
+ setupCompleted: boolean;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ avatar: null | string;
33
+ rootFolderId: string;
34
+ phoneNumber: null | string;
35
+ }
36
+ export interface WorkspaceData {
37
+ workspaceUser: WorkspaceUser;
38
+ workspace: Workspace;
39
+ }
40
+ export interface WorkspaceUsage {
41
+ totalWorkspaceSpace: number;
42
+ spaceAssigned: number;
43
+ spaceUsed: number;
44
+ }
45
+ export type WorkspaceSetupInfo = {
46
+ workspaceId: string;
47
+ name: string;
48
+ address: string;
49
+ description: string;
50
+ encryptedMnemonic: string;
51
+ hybridModeEnabled: boolean;
52
+ };
53
+ export type PendingWorkspace = {
54
+ address: string | null;
55
+ createdAt: string;
56
+ defaultTeamId: string;
57
+ description: string | null;
58
+ id: string;
59
+ name: string;
60
+ ownerId: string;
61
+ setupCompleted: boolean;
62
+ updatedAt: string;
63
+ workspaceUserId: string;
64
+ };
65
+ export type WorkspacesResponse = {
66
+ availableWorkspaces: WorkspaceData[];
67
+ pendingWorkspaces: PendingWorkspace[];
68
+ };
69
+ export interface CreateTeamData {
70
+ workspaceId: string;
71
+ name: string;
72
+ managerId: string;
73
+ }
74
+ export type Team = {
75
+ id: string;
76
+ name: string;
77
+ managerId: string;
78
+ workspaceId: string;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ };
82
+ export type WorkspaceMembers = {
83
+ activatedUsers: WorkspaceUser[];
84
+ disabledUsers: WorkspaceUser[];
85
+ };
86
+ export type TeamMember = {
87
+ name: string;
88
+ lastname: string;
89
+ email: string;
90
+ id: number;
91
+ uuid: string;
92
+ avatar: string | null;
93
+ };
94
+ export type TeamMembers = TeamMember[];
95
+ export type Member = {
96
+ avatar: string | null;
97
+ backupsBucket: string | null;
98
+ bridgeUser: string;
99
+ credit: number;
100
+ email: string;
101
+ errorLoginCount: number;
102
+ id: number;
103
+ isEmailActivitySended: boolean;
104
+ lastPasswordChangedAt: string | null;
105
+ lastResend: string | null;
106
+ lastname: string;
107
+ name: string;
108
+ referralCode: string;
109
+ referrer: string | null;
110
+ registerCompleted: boolean;
111
+ rootFolderId: number;
112
+ sharedWorkspace: boolean;
113
+ syncDate: string | null;
114
+ userId: string;
115
+ username: string;
116
+ uuid: string;
117
+ welcomePack: boolean;
118
+ };
119
+ export type ActivatedUser = {
120
+ isOwner: boolean;
121
+ isManager: boolean;
122
+ usedSpace: string;
123
+ freeSpace: string;
124
+ id: string;
125
+ memberId: string;
126
+ key: string;
127
+ workspaceId: string;
128
+ spaceLimit: string;
129
+ driveUsage: string;
130
+ backupsUsage: string;
131
+ deactivated: boolean;
132
+ member: Member;
133
+ createdAt: string;
134
+ updatedAt: string;
135
+ };
136
+ export type WorkspaceTeam = {
137
+ membersCount: number;
138
+ team: Team;
139
+ };
140
+ export type WorkspaceTeamResponse = WorkspaceTeam[];
141
+ export type InviteMemberBody = {
142
+ workspaceId: string;
143
+ invitedUserEmail: string;
144
+ spaceLimitBytes?: number;
145
+ encryptedMnemonicInBase64: string;
146
+ encryptionAlgorithm: string;
147
+ message: string;
148
+ hybridModeEnabled: boolean;
149
+ };
150
+ interface Invite {
151
+ id: string;
152
+ workspaceId: string;
153
+ invitedUser: string;
154
+ encryptionAlgorithm: string;
155
+ encryptionKey: string;
156
+ spaceLimit: number;
157
+ createdAt: Date;
158
+ updatedAt: Date;
159
+ }
160
+ export type PendingInvitesResponse = (Invite & {
161
+ workspace: Workspace;
162
+ })[];
163
+ export type EditWorkspaceDetailsBody = {
164
+ workspaceId: string;
165
+ name?: string;
166
+ description?: string;
167
+ };
168
+ export type GetMemberDetailsResponse = {
169
+ user: {
170
+ name: string;
171
+ lastname: string;
172
+ email: string;
173
+ uuid: string;
174
+ id: number;
175
+ avatar: string | null;
176
+ memberId: string;
177
+ workspaceId: string;
178
+ spaceLimit: string;
179
+ driveUsage: string;
180
+ backupsUsage: string;
181
+ deactivated: boolean;
182
+ };
183
+ teams: (Team & {
184
+ isManager: boolean;
185
+ })[];
186
+ };
187
+ export type FileEntry = {
188
+ name: string;
189
+ bucket: string;
190
+ fileId: string;
191
+ encryptVersion: string;
192
+ folderUuid: string;
193
+ size: number;
194
+ plainName: string;
195
+ type: string;
196
+ modificationTime: string;
197
+ date: string;
198
+ };
199
+ export interface WorkspaceCredentials {
200
+ networkPass: string;
201
+ networkUser: string;
202
+ }
203
+ export interface WorkspaceCredentialsDetails {
204
+ workspaceId: string;
205
+ bucket: string;
206
+ workspaceUserId: string;
207
+ email: string;
208
+ credentials: WorkspaceCredentials;
209
+ tokenHeader: string;
210
+ }
211
+ export interface CreateFolderPayload {
212
+ workspaceId: string;
213
+ plainName: string;
214
+ parentFolderUuid: string;
215
+ }
216
+ export type WorkspacePendingInvitations = {
217
+ id: string;
218
+ workspaceId: string;
219
+ invitedUser: string;
220
+ encryptionAlgorithm: string;
221
+ encryptionKey: string;
222
+ spaceLimit: string;
223
+ createdAt: Date;
224
+ updatedAt: Date;
225
+ user: {
226
+ name: string;
227
+ lastname: string;
228
+ email: string;
229
+ uuid: string;
230
+ avatar: string | null;
231
+ };
232
+ isGuessInvite: boolean;
233
+ };
234
+ export type ItemType = 'file' | 'folder';
235
+ export interface CreateWorkspaceSharingPayload {
236
+ workspaceId: string;
237
+ itemId: string;
238
+ itemType: ItemType;
239
+ teamUUID: string;
240
+ roleId: string;
241
+ }
242
+ export type ListWorkspaceSharedItemsResponse = {
243
+ items: SharedFiles[] | SharedFolders[];
244
+ token: string;
245
+ role: string;
246
+ parent: Parent;
247
+ bucket: string;
248
+ encryptionKey: null | string;
249
+ };
250
+ export type Parent = {
251
+ uuid: string;
252
+ name: string;
253
+ };
254
+ export type usersWithRoles = {
255
+ name: string;
256
+ lastname: string;
257
+ email: string;
258
+ sharingId: string | null;
259
+ avatar: string | null;
260
+ uuid: string;
261
+ role: {
262
+ id: string;
263
+ name: string;
264
+ createdAt: string;
265
+ updatedAt: string;
266
+ };
267
+ };
268
+ export type teamsWithRoles = {
269
+ id: string;
270
+ workspaceId: string;
271
+ managerId: string;
272
+ name: string | null;
273
+ createdAt: string;
274
+ updatedAt: string;
275
+ membersCount: number;
276
+ sharingId: string;
277
+ role: {
278
+ id: string;
279
+ name: string;
280
+ createdAt: string;
281
+ updatedAt: string;
282
+ };
283
+ };
284
+ export type UsersAndTeamsAnItemIsShareWidthResponse = {
285
+ usersWithRoles: usersWithRoles[];
286
+ teamsWithRoles: teamsWithRoles[];
287
+ };
288
+ export type OrderByOptions = 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC';
289
+ export type GetMemberUsageResponse = {
290
+ backupsUsage: number;
291
+ driveUsage: number;
292
+ spaceLimit: number;
293
+ };
294
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
- "version": "1.4.79",
3
+ "author": "Internxt <hello@internxt.com>",
4
+ "version": "1.6.3",
4
5
  "description": "An sdk for interacting with Internxt's services",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "git+https://github.com/internxt/sdk.git"
8
9
  },
9
- "author": "",
10
10
  "license": "MIT",
11
11
  "bugs": {
12
12
  "url": "https://github.com/internxt/sdk/issues"
@@ -28,20 +28,20 @@
28
28
  "devDependencies": {
29
29
  "@internxt/eslint-config-internxt": "^1.0.3",
30
30
  "@internxt/prettier-config": "^1.0.1",
31
- "@types/jest": "^27.0.1",
32
- "@types/sinon": "^10.0.6",
33
- "@types/uuid": "^8.3.4",
31
+ "@types/jest": "^29.5.14",
32
+ "@types/sinon": "^17.0.3",
33
+ "@types/uuid": "^10.0.0",
34
34
  "eslint": "^7.32.0",
35
- "husky": "^7.0.1",
36
- "jest": "^27.0.6",
37
- "prettier": "^2.3.2",
38
- "sinon": "^12.0.1",
39
- "ts-jest": "^27.0.5",
40
- "typescript": "^4.3.5"
35
+ "husky": "^9.1.6",
36
+ "jest": "^29.7.0",
37
+ "prettier": "^3.3.3",
38
+ "sinon": "^19.0.2",
39
+ "ts-jest": "^29.2.5",
40
+ "typescript": "^5.6.3"
41
41
  },
42
42
  "dependencies": {
43
- "axios": "^0.24.0",
43
+ "axios": "^0.28.0",
44
44
  "query-string": "^7.1.0",
45
- "uuid": "^8.3.2"
45
+ "uuid": "^11.0.2"
46
46
  }
47
47
  }