@internxt/sdk 1.4.77 → 1.5.25

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 +122 -122
  2. package/dist/auth/index.js +310 -310
  3. package/dist/auth/types.d.ts +54 -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 +19 -19
  11. package/dist/drive/payments/index.d.ts +71 -53
  12. package/dist/drive/payments/index.js +208 -153
  13. package/dist/drive/payments/types.d.ts +176 -114
  14. package/dist/drive/payments/types.js +37 -32
  15. package/dist/drive/referrals/index.d.ts +19 -19
  16. package/dist/drive/referrals/index.js +50 -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 +540 -539
  21. package/dist/drive/share/types.d.ts +360 -358
  22. package/dist/drive/share/types.js +2 -2
  23. package/dist/drive/storage/index.d.ts +315 -195
  24. package/dist/drive/storage/index.js +630 -434
  25. package/dist/drive/storage/types.d.ts +473 -394
  26. package/dist/drive/storage/types.js +13 -13
  27. package/dist/drive/trash/index.d.ts +75 -55
  28. package/dist/drive/trash/index.js +180 -149
  29. package/dist/drive/trash/types.d.ts +29 -20
  30. package/dist/drive/trash/types.js +2 -2
  31. package/dist/drive/users/index.d.ts +135 -108
  32. package/dist/drive/users/index.js +204 -174
  33. package/dist/drive/users/types.d.ts +51 -43
  34. package/dist/drive/users/types.js +2 -2
  35. package/dist/index.d.ts +6 -5
  36. package/dist/index.js +31 -30
  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 +48 -48
  45. package/dist/network/errors/index.d.ts +3 -3
  46. package/dist/network/errors/index.js +15 -15
  47. package/dist/network/errors/upload.d.ts +13 -13
  48. package/dist/network/errors/upload.js +78 -78
  49. package/dist/network/index.d.ts +70 -71
  50. package/dist/network/index.js +311 -310
  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 +159 -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 +52 -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 -18
  68. package/dist/shared/headers/index.js +79 -69
  69. package/dist/shared/http/client.d.ts +85 -85
  70. package/dist/shared/http/client.js +172 -181
  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 +13 -13
  75. package/dist/shared/types/apiConnection.d.ts +12 -11
  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 -4
  80. package/dist/shared/types/errors.js +28 -27
  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 +29 -27
  84. package/dist/shared/types/userSettings.js +2 -2
  85. package/dist/utils.d.ts +3 -3
  86. package/dist/utils.js +25 -25
  87. package/dist/workspaces/index.d.ts +176 -0
  88. package/dist/workspaces/index.js +415 -0
  89. package/dist/workspaces/index.test.d.ts +1 -0
  90. package/dist/workspaces/index.test.js +903 -0
  91. package/dist/workspaces/types.d.ts +291 -0
  92. package/dist/workspaces/types.js +2 -0
  93. package/package.json +1 -1
@@ -1,225 +1,225 @@
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 query_string_1 = __importDefault(require("query-string"));
19
- var utils_1 = require("../../utils");
20
- var PhotosSubmodule = /** @class */ (function () {
21
- function PhotosSubmodule(model) {
22
- this.model = model;
23
- }
24
- PhotosSubmodule.prototype.getPhotoById = function (photoId) {
25
- var _this = this;
26
- return axios_1.default
27
- .get(this.model.baseUrl + "/photos/" + photoId, {
28
- headers: {
29
- Authorization: "Bearer " + this.model.accessToken,
30
- },
31
- })
32
- .then(function (res) { return _this.parse(res.data); })
33
- .catch(function (err) {
34
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
35
- });
36
- };
37
- PhotosSubmodule.prototype.getPhotosSorted = function (filter, sort, skip, limit, includeDownloadLinks) {
38
- var _this = this;
39
- var query = query_string_1.default.stringify(__assign(__assign(__assign(__assign({}, filter), { skip: skip, limit: limit }), sort), { includeDownloadLinks: includeDownloadLinks === true }));
40
- if (skip < 0) {
41
- throw new Error('Invalid skip. Skip should be positive. Provided skip was: ' + skip);
42
- }
43
- return axios_1.default
44
- .get(this.model.baseUrl + "/photos/sorted?" + query, {
45
- headers: {
46
- Authorization: "Bearer " + this.model.accessToken,
47
- },
48
- })
49
- .then(function (res) { return ({
50
- results: res.data.results.map(function (photoJson) { return _this.parse(photoJson); }),
51
- bucketId: res.data.bucketId,
52
- }); })
53
- .catch(function (err) {
54
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
55
- });
56
- };
57
- PhotosSubmodule.prototype.getPhotos = function (filter, skip, limit, includeDownloadLinks) {
58
- var _this = this;
59
- if (skip === void 0) { skip = 0; }
60
- if (limit === void 0) { limit = 1; }
61
- var query = query_string_1.default.stringify(__assign(__assign({}, filter), { skip: skip, limit: limit, includeDownloadLinks: includeDownloadLinks }));
62
- if (skip < 0) {
63
- throw new Error('Invalid skip. Skip should be positive. Provided skip was: ' + skip);
64
- }
65
- return axios_1.default
66
- .get(this.model.baseUrl + "/photos/?" + query, {
67
- headers: {
68
- Authorization: "Bearer " + this.model.accessToken,
69
- },
70
- })
71
- .then(function (res) { return ({
72
- results: res.data.results.map(function (photoJson) { return _this.parse(photoJson); }),
73
- bucketId: res.data.bucketId,
74
- }); })
75
- .catch(function (err) {
76
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
77
- });
78
- };
79
- PhotosSubmodule.prototype.createPhoto = function (data) {
80
- var _this = this;
81
- return axios_1.default
82
- .post(this.model.baseUrl + "/photos", data, {
83
- headers: {
84
- Authorization: "Bearer " + this.model.accessToken,
85
- },
86
- })
87
- .then(function (res) { return _this.parse(res.data); })
88
- .catch(function (err) {
89
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
90
- });
91
- };
92
- PhotosSubmodule.prototype.findOrCreatePhoto = function (data) {
93
- var _this = this;
94
- return axios_1.default
95
- .post(this.model.baseUrl + "/photos/photo/exists", data, {
96
- headers: {
97
- Authorization: "Bearer " + this.model.accessToken,
98
- },
99
- })
100
- .then(function (res) { return _this.parse(res.data); })
101
- .catch(function (err) {
102
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
103
- });
104
- };
105
- PhotosSubmodule.prototype.deletePhotosById = function (photos) {
106
- return axios_1.default
107
- .delete(this.model.baseUrl + "/photos/photos", {
108
- headers: {
109
- Authorization: "Bearer " + this.model.accessToken,
110
- },
111
- data: {
112
- photos: photos,
113
- },
114
- })
115
- .then(function () { return undefined; })
116
- .catch(function (err) {
117
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
118
- });
119
- };
120
- PhotosSubmodule.prototype.deletePhotoById = function (photoId) {
121
- return axios_1.default
122
- .delete(this.model.baseUrl + "/photos/" + photoId, {
123
- headers: {
124
- Authorization: "Bearer " + this.model.accessToken,
125
- },
126
- })
127
- .then(function () { return undefined; })
128
- .catch(function (err) {
129
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
130
- });
131
- };
132
- PhotosSubmodule.prototype.trashPhotosById = function (photos) {
133
- return axios_1.default
134
- .post(this.model.baseUrl + "/photos/photos/trash", {
135
- photos: photos,
136
- }, {
137
- headers: {
138
- Authorization: "Bearer " + this.model.accessToken,
139
- },
140
- })
141
- .then(function () { return undefined; })
142
- .catch(function (err) {
143
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
144
- });
145
- };
146
- PhotosSubmodule.prototype.trashPhotoById = function (photoId) {
147
- return axios_1.default
148
- .post(this.model.baseUrl + "/photos/" + photoId + "/trash", {}, {
149
- headers: {
150
- Authorization: "Bearer " + this.model.accessToken,
151
- },
152
- })
153
- .then(function () { return undefined; })
154
- .catch(function (err) {
155
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
156
- });
157
- };
158
- PhotosSubmodule.prototype.getUsage = function () {
159
- return axios_1.default
160
- .get(this.model.baseUrl + "/photos/usage", {
161
- headers: {
162
- Authorization: "Bearer " + this.model.accessToken,
163
- },
164
- })
165
- .then(function (result) {
166
- return result.data;
167
- })
168
- .catch(function (err) {
169
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
170
- });
171
- };
172
- PhotosSubmodule.prototype.photosExists = function (photosExistPayload) {
173
- var _this = this;
174
- return axios_1.default
175
- .post(this.model.baseUrl + "/photos/exists", { photos: photosExistPayload }, {
176
- headers: {
177
- Authorization: "Bearer " + this.model.accessToken,
178
- },
179
- })
180
- .then(function (res) {
181
- return res.data.photos.map(function (result) {
182
- if ('id' in result) {
183
- return __assign(__assign({}, _this.parse(result)), { exists: true });
184
- }
185
- else {
186
- return __assign(__assign({}, result), { takenAt: new Date(result.takenAt) });
187
- }
188
- });
189
- })
190
- .catch(function (err) {
191
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
192
- });
193
- };
194
- PhotosSubmodule.prototype.updatePhoto = function (photoId, data) {
195
- return axios_1.default
196
- .patch(this.model.baseUrl + "/photos/" + photoId, data, {
197
- headers: {
198
- Authorization: "Bearer " + this.model.accessToken,
199
- },
200
- })
201
- .then(function (result) {
202
- return result.data;
203
- })
204
- .catch(function (err) {
205
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
206
- });
207
- };
208
- PhotosSubmodule.prototype.getCount = function () {
209
- return axios_1.default
210
- .get(this.model.baseUrl + "/photos/count", {
211
- headers: {
212
- Authorization: "Bearer " + this.model.accessToken,
213
- },
214
- })
215
- .then(function (result) { return result.data; })
216
- .catch(function (err) {
217
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
218
- });
219
- };
220
- PhotosSubmodule.prototype.parse = function (json) {
221
- return __assign(__assign({}, json), { takenAt: new Date(json.takenAt), statusChangedAt: new Date(json.statusChangedAt), createdAt: new Date(json.createdAt), updatedAt: new Date(json.updatedAt) });
222
- };
223
- return PhotosSubmodule;
224
- }());
225
- exports.default = PhotosSubmodule;
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 query_string_1 = __importDefault(require("query-string"));
19
+ var utils_1 = require("../../utils");
20
+ var PhotosSubmodule = /** @class */ (function () {
21
+ function PhotosSubmodule(model) {
22
+ this.model = model;
23
+ }
24
+ PhotosSubmodule.prototype.getPhotoById = function (photoId) {
25
+ var _this = this;
26
+ return axios_1.default
27
+ .get(this.model.baseUrl + "/photos/" + photoId, {
28
+ headers: {
29
+ Authorization: "Bearer " + this.model.accessToken,
30
+ },
31
+ })
32
+ .then(function (res) { return _this.parse(res.data); })
33
+ .catch(function (err) {
34
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
35
+ });
36
+ };
37
+ PhotosSubmodule.prototype.getPhotosSorted = function (filter, sort, skip, limit, includeDownloadLinks) {
38
+ var _this = this;
39
+ var query = query_string_1.default.stringify(__assign(__assign(__assign(__assign({}, filter), { skip: skip, limit: limit }), sort), { includeDownloadLinks: includeDownloadLinks === true }));
40
+ if (skip < 0) {
41
+ throw new Error('Invalid skip. Skip should be positive. Provided skip was: ' + skip);
42
+ }
43
+ return axios_1.default
44
+ .get(this.model.baseUrl + "/photos/sorted?" + query, {
45
+ headers: {
46
+ Authorization: "Bearer " + this.model.accessToken,
47
+ },
48
+ })
49
+ .then(function (res) { return ({
50
+ results: res.data.results.map(function (photoJson) { return _this.parse(photoJson); }),
51
+ bucketId: res.data.bucketId,
52
+ }); })
53
+ .catch(function (err) {
54
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
55
+ });
56
+ };
57
+ PhotosSubmodule.prototype.getPhotos = function (filter, skip, limit, includeDownloadLinks) {
58
+ var _this = this;
59
+ if (skip === void 0) { skip = 0; }
60
+ if (limit === void 0) { limit = 1; }
61
+ var query = query_string_1.default.stringify(__assign(__assign({}, filter), { skip: skip, limit: limit, includeDownloadLinks: includeDownloadLinks }));
62
+ if (skip < 0) {
63
+ throw new Error('Invalid skip. Skip should be positive. Provided skip was: ' + skip);
64
+ }
65
+ return axios_1.default
66
+ .get(this.model.baseUrl + "/photos/?" + query, {
67
+ headers: {
68
+ Authorization: "Bearer " + this.model.accessToken,
69
+ },
70
+ })
71
+ .then(function (res) { return ({
72
+ results: res.data.results.map(function (photoJson) { return _this.parse(photoJson); }),
73
+ bucketId: res.data.bucketId,
74
+ }); })
75
+ .catch(function (err) {
76
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
77
+ });
78
+ };
79
+ PhotosSubmodule.prototype.createPhoto = function (data) {
80
+ var _this = this;
81
+ return axios_1.default
82
+ .post(this.model.baseUrl + "/photos", data, {
83
+ headers: {
84
+ Authorization: "Bearer " + this.model.accessToken,
85
+ },
86
+ })
87
+ .then(function (res) { return _this.parse(res.data); })
88
+ .catch(function (err) {
89
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
90
+ });
91
+ };
92
+ PhotosSubmodule.prototype.findOrCreatePhoto = function (data) {
93
+ var _this = this;
94
+ return axios_1.default
95
+ .post(this.model.baseUrl + "/photos/photo/exists", data, {
96
+ headers: {
97
+ Authorization: "Bearer " + this.model.accessToken,
98
+ },
99
+ })
100
+ .then(function (res) { return _this.parse(res.data); })
101
+ .catch(function (err) {
102
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
103
+ });
104
+ };
105
+ PhotosSubmodule.prototype.deletePhotosById = function (photos) {
106
+ return axios_1.default
107
+ .delete(this.model.baseUrl + "/photos/photos", {
108
+ headers: {
109
+ Authorization: "Bearer " + this.model.accessToken,
110
+ },
111
+ data: {
112
+ photos: photos,
113
+ },
114
+ })
115
+ .then(function () { return undefined; })
116
+ .catch(function (err) {
117
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
118
+ });
119
+ };
120
+ PhotosSubmodule.prototype.deletePhotoById = function (photoId) {
121
+ return axios_1.default
122
+ .delete(this.model.baseUrl + "/photos/" + photoId, {
123
+ headers: {
124
+ Authorization: "Bearer " + this.model.accessToken,
125
+ },
126
+ })
127
+ .then(function () { return undefined; })
128
+ .catch(function (err) {
129
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
130
+ });
131
+ };
132
+ PhotosSubmodule.prototype.trashPhotosById = function (photos) {
133
+ return axios_1.default
134
+ .post(this.model.baseUrl + "/photos/photos/trash", {
135
+ photos: photos,
136
+ }, {
137
+ headers: {
138
+ Authorization: "Bearer " + this.model.accessToken,
139
+ },
140
+ })
141
+ .then(function () { return undefined; })
142
+ .catch(function (err) {
143
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
144
+ });
145
+ };
146
+ PhotosSubmodule.prototype.trashPhotoById = function (photoId) {
147
+ return axios_1.default
148
+ .post(this.model.baseUrl + "/photos/" + photoId + "/trash", {}, {
149
+ headers: {
150
+ Authorization: "Bearer " + this.model.accessToken,
151
+ },
152
+ })
153
+ .then(function () { return undefined; })
154
+ .catch(function (err) {
155
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
156
+ });
157
+ };
158
+ PhotosSubmodule.prototype.getUsage = function () {
159
+ return axios_1.default
160
+ .get(this.model.baseUrl + "/photos/usage", {
161
+ headers: {
162
+ Authorization: "Bearer " + this.model.accessToken,
163
+ },
164
+ })
165
+ .then(function (result) {
166
+ return result.data;
167
+ })
168
+ .catch(function (err) {
169
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
170
+ });
171
+ };
172
+ PhotosSubmodule.prototype.photosExists = function (photosExistPayload) {
173
+ var _this = this;
174
+ return axios_1.default
175
+ .post(this.model.baseUrl + "/photos/exists", { photos: photosExistPayload }, {
176
+ headers: {
177
+ Authorization: "Bearer " + this.model.accessToken,
178
+ },
179
+ })
180
+ .then(function (res) {
181
+ return res.data.photos.map(function (result) {
182
+ if ('id' in result) {
183
+ return __assign(__assign({}, _this.parse(result)), { exists: true });
184
+ }
185
+ else {
186
+ return __assign(__assign({}, result), { takenAt: new Date(result.takenAt) });
187
+ }
188
+ });
189
+ })
190
+ .catch(function (err) {
191
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
192
+ });
193
+ };
194
+ PhotosSubmodule.prototype.updatePhoto = function (photoId, data) {
195
+ return axios_1.default
196
+ .patch(this.model.baseUrl + "/photos/" + photoId, data, {
197
+ headers: {
198
+ Authorization: "Bearer " + this.model.accessToken,
199
+ },
200
+ })
201
+ .then(function (result) {
202
+ return result.data;
203
+ })
204
+ .catch(function (err) {
205
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
206
+ });
207
+ };
208
+ PhotosSubmodule.prototype.getCount = function () {
209
+ return axios_1.default
210
+ .get(this.model.baseUrl + "/photos/count", {
211
+ headers: {
212
+ Authorization: "Bearer " + this.model.accessToken,
213
+ },
214
+ })
215
+ .then(function (result) { return result.data; })
216
+ .catch(function (err) {
217
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
218
+ });
219
+ };
220
+ PhotosSubmodule.prototype.parse = function (json) {
221
+ return __assign(__assign({}, json), { takenAt: new Date(json.takenAt), statusChangedAt: new Date(json.statusChangedAt), createdAt: new Date(json.createdAt), updatedAt: new Date(json.updatedAt) });
222
+ };
223
+ return PhotosSubmodule;
224
+ }());
225
+ exports.default = PhotosSubmodule;
@@ -1,8 +1,8 @@
1
- import { CreatePhotoShareBody, PhotosSdkModel } from '..';
2
- import { GetPhotoShareResponse, Share } from '../types';
3
- export default class SharesSubmodule {
4
- private model;
5
- constructor(model: PhotosSdkModel);
6
- getShare(id: string, code: string): Promise<GetPhotoShareResponse>;
7
- createShare(body: CreatePhotoShareBody): Promise<Share>;
8
- }
1
+ import { CreatePhotoShareBody, PhotosSdkModel } from '..';
2
+ import { GetPhotoShareResponse, Share } from '../types';
3
+ export default class SharesSubmodule {
4
+ private model;
5
+ constructor(model: PhotosSdkModel);
6
+ getShare(id: string, code: string): Promise<GetPhotoShareResponse>;
7
+ createShare(body: CreatePhotoShareBody): Promise<Share>;
8
+ }
@@ -1,34 +1,34 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var axios_1 = __importDefault(require("axios"));
7
- var utils_1 = require("../../utils");
8
- var SharesSubmodule = /** @class */ (function () {
9
- function SharesSubmodule(model) {
10
- this.model = model;
11
- }
12
- SharesSubmodule.prototype.getShare = function (id, code) {
13
- return axios_1.default
14
- .get(this.model.baseUrl + "/shares/" + id + "?code=" + code)
15
- .then(function (response) { return response.data; })
16
- .catch(function (err) {
17
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
18
- });
19
- };
20
- SharesSubmodule.prototype.createShare = function (body) {
21
- return axios_1.default
22
- .post(this.model.baseUrl + "/shares", body, {
23
- headers: {
24
- Authorization: "Bearer " + this.model.accessToken,
25
- },
26
- })
27
- .then(function (response) { return response.data; })
28
- .catch(function (err) {
29
- throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
30
- });
31
- };
32
- return SharesSubmodule;
33
- }());
34
- exports.default = SharesSubmodule;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var axios_1 = __importDefault(require("axios"));
7
+ var utils_1 = require("../../utils");
8
+ var SharesSubmodule = /** @class */ (function () {
9
+ function SharesSubmodule(model) {
10
+ this.model = model;
11
+ }
12
+ SharesSubmodule.prototype.getShare = function (id, code) {
13
+ return axios_1.default
14
+ .get(this.model.baseUrl + "/shares/" + id + "?code=" + code)
15
+ .then(function (response) { return response.data; })
16
+ .catch(function (err) {
17
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
18
+ });
19
+ };
20
+ SharesSubmodule.prototype.createShare = function (body) {
21
+ return axios_1.default
22
+ .post(this.model.baseUrl + "/shares", body, {
23
+ headers: {
24
+ Authorization: "Bearer " + this.model.accessToken,
25
+ },
26
+ })
27
+ .then(function (response) { return response.data; })
28
+ .catch(function (err) {
29
+ throw new Error((0, utils_1.extractAxiosErrorMessage)(err));
30
+ });
31
+ };
32
+ return SharesSubmodule;
33
+ }());
34
+ exports.default = SharesSubmodule;