@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.
Files changed (93) hide show
  1. package/dist/auth/index.d.ts +127 -122
  2. package/dist/auth/index.js +378 -310
  3. package/dist/auth/types.d.ts +65 -54
  4. package/dist/auth/types.js +26 -26
  5. package/dist/drive/backups/index.d.ts +18 -18
  6. package/dist/drive/backups/index.js +40 -40
  7. package/dist/drive/backups/types.d.ts +27 -27
  8. package/dist/drive/backups/types.js +2 -2
  9. package/dist/drive/index.d.ts +7 -7
  10. package/dist/drive/index.js +23 -19
  11. package/dist/drive/payments/index.d.ts +66 -71
  12. package/dist/drive/payments/index.js +206 -208
  13. package/dist/drive/payments/types.d.ts +180 -176
  14. package/dist/drive/payments/types.js +37 -37
  15. package/dist/drive/referrals/index.d.ts +19 -19
  16. package/dist/drive/referrals/index.js +54 -50
  17. package/dist/drive/referrals/types.d.ts +21 -21
  18. package/dist/drive/referrals/types.js +18 -18
  19. package/dist/drive/share/index.d.ts +319 -319
  20. package/dist/drive/share/index.js +544 -540
  21. package/dist/drive/share/types.d.ts +360 -360
  22. package/dist/drive/share/types.js +2 -2
  23. package/dist/drive/storage/index.d.ts +315 -315
  24. package/dist/drive/storage/index.js +634 -630
  25. package/dist/drive/storage/types.d.ts +480 -473
  26. package/dist/drive/storage/types.js +13 -13
  27. package/dist/drive/trash/index.d.ts +75 -75
  28. package/dist/drive/trash/index.js +184 -180
  29. package/dist/drive/trash/types.d.ts +29 -29
  30. package/dist/drive/trash/types.js +2 -2
  31. package/dist/drive/users/index.d.ts +135 -135
  32. package/dist/drive/users/index.js +208 -204
  33. package/dist/drive/users/types.d.ts +53 -51
  34. package/dist/drive/users/types.js +2 -2
  35. package/dist/index.d.ts +6 -6
  36. package/dist/index.js +35 -31
  37. package/dist/network/download.d.ts +8 -8
  38. package/dist/network/download.js +123 -123
  39. package/dist/network/errors/codes.d.ts +24 -24
  40. package/dist/network/errors/codes.js +48 -48
  41. package/dist/network/errors/context.d.ts +35 -35
  42. package/dist/network/errors/context.js +39 -39
  43. package/dist/network/errors/download.d.ts +4 -4
  44. package/dist/network/errors/download.js +52 -48
  45. package/dist/network/errors/index.d.ts +3 -3
  46. package/dist/network/errors/index.js +19 -15
  47. package/dist/network/errors/upload.d.ts +13 -13
  48. package/dist/network/errors/upload.js +82 -78
  49. package/dist/network/index.d.ts +70 -70
  50. package/dist/network/index.js +315 -311
  51. package/dist/network/types.d.ts +102 -102
  52. package/dist/network/types.js +18 -18
  53. package/dist/network/upload.d.ts +4 -4
  54. package/dist/network/upload.js +158 -159
  55. package/dist/photos/devices/index.d.ts +10 -10
  56. package/dist/photos/devices/index.js +79 -79
  57. package/dist/photos/index.d.ts +17 -17
  58. package/dist/photos/index.js +56 -52
  59. package/dist/photos/photos/index.d.ts +60 -60
  60. package/dist/photos/photos/index.js +225 -225
  61. package/dist/photos/shares/index.d.ts +8 -8
  62. package/dist/photos/shares/index.js +34 -34
  63. package/dist/photos/types.d.ts +154 -154
  64. package/dist/photos/types.js +19 -19
  65. package/dist/photos/users/index.d.ts +7 -7
  66. package/dist/photos/users/index.js +46 -46
  67. package/dist/shared/headers/index.d.ts +21 -21
  68. package/dist/shared/headers/index.js +78 -79
  69. package/dist/shared/http/client.d.ts +85 -85
  70. package/dist/shared/http/client.js +172 -172
  71. package/dist/shared/http/types.d.ts +7 -7
  72. package/dist/shared/http/types.js +2 -2
  73. package/dist/shared/index.d.ts +1 -1
  74. package/dist/shared/index.js +17 -13
  75. package/dist/shared/types/apiConnection.d.ts +12 -12
  76. package/dist/shared/types/apiConnection.js +2 -2
  77. package/dist/shared/types/appsumo.d.ts +16 -16
  78. package/dist/shared/types/appsumo.js +12 -12
  79. package/dist/shared/types/errors.d.ts +5 -5
  80. package/dist/shared/types/errors.js +28 -28
  81. package/dist/shared/types/teams.d.ts +9 -9
  82. package/dist/shared/types/teams.js +2 -2
  83. package/dist/shared/types/userSettings.d.ts +43 -29
  84. package/dist/shared/types/userSettings.js +2 -2
  85. package/dist/utils.d.ts +3 -3
  86. package/dist/utils.js +24 -25
  87. package/dist/workspaces/index.d.ts +176 -176
  88. package/dist/workspaces/index.js +419 -415
  89. package/dist/workspaces/index.test.d.ts +1 -1
  90. package/dist/workspaces/index.test.js +908 -903
  91. package/dist/workspaces/types.d.ts +294 -291
  92. package/dist/workspaces/types.js +2 -2
  93. package/package.json +13 -13
@@ -1,79 +1,79 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var axios_1 = __importDefault(require("axios"));
18
- var utils_1 = require("../../utils");
19
- var DevicesSubmodule = /** @class */ (function () {
20
- function DevicesSubmodule(model) {
21
- this.model = model;
22
- }
23
- DevicesSubmodule.prototype.getDeviceById = function (deviceId) {
24
- var _this = this;
25
- return axios_1.default
26
- .get(this.model.baseUrl + "/devices/" + deviceId, {
27
- headers: {
28
- Authorization: "Bearer " + this.model.accessToken,
29
- },
30
- })
31
- .then(function (res) { return _this.parse(res.data); })
32
- .catch(function (err) {
33
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
34
- });
35
- };
36
- DevicesSubmodule.prototype.getDevices = function () {
37
- var _this = this;
38
- return axios_1.default
39
- .get(this.model.baseUrl + "/devices", {
40
- headers: {
41
- Authorization: "Bearer " + this.model.accessToken,
42
- },
43
- })
44
- .then(function (res) { return res.data.results.map(function (json) { return _this.parse(json); }); })
45
- .catch(function (err) {
46
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
47
- });
48
- };
49
- DevicesSubmodule.prototype.createDevice = function (data) {
50
- var _this = this;
51
- return axios_1.default
52
- .post(this.model.baseUrl + "/devices", data, {
53
- headers: {
54
- Authorization: "Bearer " + this.model.accessToken,
55
- },
56
- })
57
- .then(function (res) { return _this.parse(res.data); })
58
- .catch(function (err) {
59
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
60
- });
61
- };
62
- DevicesSubmodule.prototype.deleteDevice = function (deviceId) {
63
- return axios_1.default
64
- .delete(this.model.baseUrl + "/devices/" + deviceId, {
65
- headers: {
66
- Authorization: "Bearer " + this.model.accessToken,
67
- },
68
- })
69
- .then(function () { return undefined; })
70
- .catch(function (err) {
71
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
72
- });
73
- };
74
- DevicesSubmodule.prototype.parse = function (json) {
75
- return __assign(__assign({}, json), { newestDate: new Date(json.newestDate), oldestDate: json.oldestDate === null ? json.oldestDate : new Date(json.oldestDate), createdAt: new Date(json.createdAt), updatedAt: new Date(json.updatedAt) });
76
- };
77
- return DevicesSubmodule;
78
- }());
79
- exports.default = DevicesSubmodule;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var axios_1 = __importDefault(require("axios"));
18
+ var utils_1 = require("../../utils");
19
+ var DevicesSubmodule = /** @class */ (function () {
20
+ function DevicesSubmodule(model) {
21
+ this.model = model;
22
+ }
23
+ DevicesSubmodule.prototype.getDeviceById = function (deviceId) {
24
+ var _this = this;
25
+ return axios_1.default
26
+ .get("".concat(this.model.baseUrl, "/devices/").concat(deviceId), {
27
+ headers: {
28
+ Authorization: "Bearer ".concat(this.model.accessToken),
29
+ },
30
+ })
31
+ .then(function (res) { return _this.parse(res.data); })
32
+ .catch(function (err) {
33
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
34
+ });
35
+ };
36
+ DevicesSubmodule.prototype.getDevices = function () {
37
+ var _this = this;
38
+ return axios_1.default
39
+ .get("".concat(this.model.baseUrl, "/devices"), {
40
+ headers: {
41
+ Authorization: "Bearer ".concat(this.model.accessToken),
42
+ },
43
+ })
44
+ .then(function (res) { return res.data.results.map(function (json) { return _this.parse(json); }); })
45
+ .catch(function (err) {
46
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
47
+ });
48
+ };
49
+ DevicesSubmodule.prototype.createDevice = function (data) {
50
+ var _this = this;
51
+ return axios_1.default
52
+ .post("".concat(this.model.baseUrl, "/devices"), data, {
53
+ headers: {
54
+ Authorization: "Bearer ".concat(this.model.accessToken),
55
+ },
56
+ })
57
+ .then(function (res) { return _this.parse(res.data); })
58
+ .catch(function (err) {
59
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
60
+ });
61
+ };
62
+ DevicesSubmodule.prototype.deleteDevice = function (deviceId) {
63
+ return axios_1.default
64
+ .delete("".concat(this.model.baseUrl, "/devices/").concat(deviceId), {
65
+ headers: {
66
+ Authorization: "Bearer ".concat(this.model.accessToken),
67
+ },
68
+ })
69
+ .then(function () { return undefined; })
70
+ .catch(function (err) {
71
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
72
+ });
73
+ };
74
+ DevicesSubmodule.prototype.parse = function (json) {
75
+ return __assign(__assign({}, json), { newestDate: new Date(json.newestDate), oldestDate: json.oldestDate === null ? json.oldestDate : new Date(json.oldestDate), createdAt: new Date(json.createdAt), updatedAt: new Date(json.updatedAt) });
76
+ };
77
+ return DevicesSubmodule;
78
+ }());
79
+ exports.default = DevicesSubmodule;
@@ -1,17 +1,17 @@
1
- import UsersSubmodule from './users';
2
- import DevicesSubmodule from './devices';
3
- import PhotosSubmodule from './photos';
4
- import SharesSubmodule from './shares';
5
- export declare class Photos {
6
- private readonly model;
7
- readonly users: UsersSubmodule;
8
- readonly photos: PhotosSubmodule;
9
- readonly devices: DevicesSubmodule;
10
- readonly shares: SharesSubmodule;
11
- constructor(baseUrl: string, accessToken?: string);
12
- setBaseUrl(baseUrl: string): void;
13
- setAccessToken(accessToken: string): void;
14
- get baseUrl(): string | undefined;
15
- get accessToken(): string | undefined;
16
- }
17
- export * from './types';
1
+ import UsersSubmodule from './users';
2
+ import DevicesSubmodule from './devices';
3
+ import PhotosSubmodule from './photos';
4
+ import SharesSubmodule from './shares';
5
+ export declare class Photos {
6
+ private readonly model;
7
+ readonly users: UsersSubmodule;
8
+ readonly photos: PhotosSubmodule;
9
+ readonly devices: DevicesSubmodule;
10
+ readonly shares: SharesSubmodule;
11
+ constructor(baseUrl: string, accessToken?: string);
12
+ setBaseUrl(baseUrl: string): void;
13
+ setAccessToken(accessToken: string): void;
14
+ get baseUrl(): string | undefined;
15
+ get accessToken(): string | undefined;
16
+ }
17
+ export * from './types';
@@ -1,52 +1,56 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Photos = void 0;
17
- var users_1 = __importDefault(require("./users"));
18
- var devices_1 = __importDefault(require("./devices"));
19
- var photos_1 = __importDefault(require("./photos"));
20
- var shares_1 = __importDefault(require("./shares"));
21
- var Photos = /** @class */ (function () {
22
- function Photos(baseUrl, accessToken) {
23
- this.model = { baseUrl: baseUrl, accessToken: accessToken };
24
- this.users = new users_1.default(this.model);
25
- this.photos = new photos_1.default(this.model);
26
- this.devices = new devices_1.default(this.model);
27
- this.shares = new shares_1.default(this.model);
28
- }
29
- Photos.prototype.setBaseUrl = function (baseUrl) {
30
- this.model.baseUrl = baseUrl;
31
- };
32
- Photos.prototype.setAccessToken = function (accessToken) {
33
- this.model.accessToken = accessToken;
34
- };
35
- Object.defineProperty(Photos.prototype, "baseUrl", {
36
- get: function () {
37
- return this.model.baseUrl;
38
- },
39
- enumerable: false,
40
- configurable: true
41
- });
42
- Object.defineProperty(Photos.prototype, "accessToken", {
43
- get: function () {
44
- return this.model.accessToken;
45
- },
46
- enumerable: false,
47
- configurable: true
48
- });
49
- return Photos;
50
- }());
51
- exports.Photos = Photos;
52
- __exportStar(require("./types"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.Photos = void 0;
21
+ var users_1 = __importDefault(require("./users"));
22
+ var devices_1 = __importDefault(require("./devices"));
23
+ var photos_1 = __importDefault(require("./photos"));
24
+ var shares_1 = __importDefault(require("./shares"));
25
+ var Photos = /** @class */ (function () {
26
+ function Photos(baseUrl, accessToken) {
27
+ this.model = { baseUrl: baseUrl, accessToken: accessToken };
28
+ this.users = new users_1.default(this.model);
29
+ this.photos = new photos_1.default(this.model);
30
+ this.devices = new devices_1.default(this.model);
31
+ this.shares = new shares_1.default(this.model);
32
+ }
33
+ Photos.prototype.setBaseUrl = function (baseUrl) {
34
+ this.model.baseUrl = baseUrl;
35
+ };
36
+ Photos.prototype.setAccessToken = function (accessToken) {
37
+ this.model.accessToken = accessToken;
38
+ };
39
+ Object.defineProperty(Photos.prototype, "baseUrl", {
40
+ get: function () {
41
+ return this.model.baseUrl;
42
+ },
43
+ enumerable: false,
44
+ configurable: true
45
+ });
46
+ Object.defineProperty(Photos.prototype, "accessToken", {
47
+ get: function () {
48
+ return this.model.accessToken;
49
+ },
50
+ enumerable: false,
51
+ configurable: true
52
+ });
53
+ return Photos;
54
+ }());
55
+ exports.Photos = Photos;
56
+ __exportStar(require("./types"), exports);
@@ -1,60 +1,60 @@
1
- import { CreatePhotoData, Photo, PhotoId, PhotosSdkModel, PhotoStatus } from '..';
2
- import { PhotoWithDownloadLink, PhotoExistsPayload, PhotoExistsData, PhotosUsage, UpdatePhotoPayload, PhotosCount, PhotosSortBy } from '../types';
3
- export default class PhotosSubmodule {
4
- private model;
5
- constructor(model: PhotosSdkModel);
6
- getPhotoById(photoId: PhotoId): Promise<Photo>;
7
- getPhotosSorted(filter: {
8
- status?: PhotoStatus;
9
- updatedAt?: Date;
10
- }, sort: {
11
- sortBy: PhotosSortBy;
12
- sortType: 'ASC' | 'DESC';
13
- }, skip: number, limit: number, includeDownloadLinks: true): Promise<{
14
- results: PhotoWithDownloadLink[];
15
- bucketId: string;
16
- }>;
17
- getPhotosSorted(filter: {
18
- status?: PhotoStatus;
19
- updatedAt?: Date;
20
- }, sort: {
21
- sortBy: PhotosSortBy;
22
- sortType: 'ASC' | 'DESC';
23
- }, skip: number, limit: number, includeDownloadLinks: false): Promise<{
24
- results: Photo[];
25
- bucketId: string;
26
- }>;
27
- getPhotos(filter: {
28
- name?: string;
29
- status?: PhotoStatus;
30
- updatedAt?: Date;
31
- }, skip: number, limit: number): Promise<{
32
- results: Photo[];
33
- bucketId: string;
34
- }>;
35
- getPhotos(filter: {
36
- name?: string;
37
- status?: PhotoStatus;
38
- updatedAt?: Date;
39
- }, skip: number, limit: number, includeDownloadLinks: true): Promise<{
40
- results: PhotoWithDownloadLink[];
41
- bucketId: string;
42
- }>;
43
- createPhoto(data: CreatePhotoData): Promise<Photo>;
44
- findOrCreatePhoto(data: CreatePhotoData): Promise<Photo>;
45
- deletePhotosById(photos: {
46
- id: PhotoId;
47
- }[]): Promise<void>;
48
- deletePhotoById(photoId: PhotoId): Promise<void>;
49
- trashPhotosById(photos: {
50
- id: PhotoId;
51
- }[]): Promise<void>;
52
- trashPhotoById(photoId: PhotoId): Promise<void>;
53
- getUsage(): Promise<PhotosUsage>;
54
- photosExists(photosExistPayload: PhotoExistsPayload[]): Promise<PhotoExistsData[]>;
55
- updatePhoto(photoId: PhotoId, data: UpdatePhotoPayload): Promise<{
56
- message: string;
57
- }>;
58
- getCount(): Promise<PhotosCount>;
59
- private parse;
60
- }
1
+ import { CreatePhotoData, Photo, PhotoId, PhotosSdkModel, PhotoStatus } from '..';
2
+ import { PhotoWithDownloadLink, PhotoExistsPayload, PhotoExistsData, PhotosUsage, UpdatePhotoPayload, PhotosCount, PhotosSortBy } from '../types';
3
+ export default class PhotosSubmodule {
4
+ private model;
5
+ constructor(model: PhotosSdkModel);
6
+ getPhotoById(photoId: PhotoId): Promise<Photo>;
7
+ getPhotosSorted(filter: {
8
+ status?: PhotoStatus;
9
+ updatedAt?: Date;
10
+ }, sort: {
11
+ sortBy: PhotosSortBy;
12
+ sortType: 'ASC' | 'DESC';
13
+ }, skip: number, limit: number, includeDownloadLinks: true): Promise<{
14
+ results: PhotoWithDownloadLink[];
15
+ bucketId: string;
16
+ }>;
17
+ getPhotosSorted(filter: {
18
+ status?: PhotoStatus;
19
+ updatedAt?: Date;
20
+ }, sort: {
21
+ sortBy: PhotosSortBy;
22
+ sortType: 'ASC' | 'DESC';
23
+ }, skip: number, limit: number, includeDownloadLinks: false): Promise<{
24
+ results: Photo[];
25
+ bucketId: string;
26
+ }>;
27
+ getPhotos(filter: {
28
+ name?: string;
29
+ status?: PhotoStatus;
30
+ updatedAt?: Date;
31
+ }, skip: number, limit: number): Promise<{
32
+ results: Photo[];
33
+ bucketId: string;
34
+ }>;
35
+ getPhotos(filter: {
36
+ name?: string;
37
+ status?: PhotoStatus;
38
+ updatedAt?: Date;
39
+ }, skip: number, limit: number, includeDownloadLinks: true): Promise<{
40
+ results: PhotoWithDownloadLink[];
41
+ bucketId: string;
42
+ }>;
43
+ createPhoto(data: CreatePhotoData): Promise<Photo>;
44
+ findOrCreatePhoto(data: CreatePhotoData): Promise<Photo>;
45
+ deletePhotosById(photos: {
46
+ id: PhotoId;
47
+ }[]): Promise<void>;
48
+ deletePhotoById(photoId: PhotoId): Promise<void>;
49
+ trashPhotosById(photos: {
50
+ id: PhotoId;
51
+ }[]): Promise<void>;
52
+ trashPhotoById(photoId: PhotoId): Promise<void>;
53
+ getUsage(): Promise<PhotosUsage>;
54
+ photosExists(photosExistPayload: PhotoExistsPayload[]): Promise<PhotoExistsData[]>;
55
+ updatePhoto(photoId: PhotoId, data: UpdatePhotoPayload): Promise<{
56
+ message: string;
57
+ }>;
58
+ getCount(): Promise<PhotosCount>;
59
+ private parse;
60
+ }