@internxt/sdk 1.10.1 → 1.10.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.
|
@@ -32,6 +32,42 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
45
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
46
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
47
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48
|
+
function step(op) {
|
|
49
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
50
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
51
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
52
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
53
|
+
switch (op[0]) {
|
|
54
|
+
case 0: case 1: t = op; break;
|
|
55
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
56
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
57
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
58
|
+
default:
|
|
59
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
60
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
61
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
62
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
63
|
+
if (t[2]) _.ops.pop();
|
|
64
|
+
_.trys.pop(); continue;
|
|
65
|
+
}
|
|
66
|
+
op = body.call(thisArg, _);
|
|
67
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
68
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
35
71
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
72
|
exports.Users = exports.UserTypes = void 0;
|
|
37
73
|
var headers_1 = require("../../shared/headers");
|
|
@@ -154,19 +190,23 @@ var Users = /** @class */ (function () {
|
|
|
154
190
|
* @param payload
|
|
155
191
|
*/
|
|
156
192
|
Users.prototype.updateAvatar = function (payload) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
193
|
+
return this.client.putForm('/user/avatar', {
|
|
194
|
+
avatar: payload.avatar,
|
|
195
|
+
}, this.headers());
|
|
160
196
|
};
|
|
161
197
|
/**
|
|
162
198
|
* Updates a user avatar
|
|
163
199
|
* @param payload
|
|
164
200
|
*/
|
|
165
201
|
Users.prototype.updateUserAvatar = function (payload, token) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
202
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
203
|
+
var _a;
|
|
204
|
+
return __generator(this, function (_b) {
|
|
205
|
+
return [2 /*return*/, this.client.putForm('/users/avatar', {
|
|
206
|
+
avatar: payload.avatar,
|
|
207
|
+
}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token))];
|
|
208
|
+
});
|
|
209
|
+
});
|
|
170
210
|
};
|
|
171
211
|
/**
|
|
172
212
|
* @deprecated Use `deleteUserAvatar` instead.
|
|
@@ -34,6 +34,13 @@ export declare class HttpClient {
|
|
|
34
34
|
* @param headers
|
|
35
35
|
*/
|
|
36
36
|
post<Response>(url: URL, params: Parameters, headers: Headers): Promise<Response>;
|
|
37
|
+
/**
|
|
38
|
+
* Requests a POST FORM
|
|
39
|
+
* @param url
|
|
40
|
+
* @param params
|
|
41
|
+
* @param headers
|
|
42
|
+
*/
|
|
43
|
+
postForm<Response>(url: URL, params: Parameters, headers: Headers): Promise<Response>;
|
|
37
44
|
/**
|
|
38
45
|
* Requests a POST with option to cancel
|
|
39
46
|
* @param url
|
|
@@ -58,6 +65,13 @@ export declare class HttpClient {
|
|
|
58
65
|
* @param headers
|
|
59
66
|
*/
|
|
60
67
|
put<Response>(url: URL, params: Parameters, headers: Headers): Promise<Response>;
|
|
68
|
+
/**
|
|
69
|
+
* Requests a PUT FORM
|
|
70
|
+
* @param url
|
|
71
|
+
* @param params
|
|
72
|
+
* @param headers
|
|
73
|
+
*/
|
|
74
|
+
putForm<Response>(url: URL, params: Parameters, headers: Headers): Promise<Response>;
|
|
61
75
|
/**
|
|
62
76
|
* Requests a DELETE
|
|
63
77
|
* @param url
|
|
@@ -72,6 +72,17 @@ var HttpClient = /** @class */ (function () {
|
|
|
72
72
|
headers: headers,
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* Requests a POST FORM
|
|
77
|
+
* @param url
|
|
78
|
+
* @param params
|
|
79
|
+
* @param headers
|
|
80
|
+
*/
|
|
81
|
+
HttpClient.prototype.postForm = function (url, params, headers) {
|
|
82
|
+
return this.axios.postForm(url, params, {
|
|
83
|
+
headers: headers,
|
|
84
|
+
});
|
|
85
|
+
};
|
|
75
86
|
/**
|
|
76
87
|
* Requests a POST with option to cancel
|
|
77
88
|
* @param url
|
|
@@ -114,6 +125,17 @@ var HttpClient = /** @class */ (function () {
|
|
|
114
125
|
headers: headers,
|
|
115
126
|
});
|
|
116
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Requests a PUT FORM
|
|
130
|
+
* @param url
|
|
131
|
+
* @param params
|
|
132
|
+
* @param headers
|
|
133
|
+
*/
|
|
134
|
+
HttpClient.prototype.putForm = function (url, params, headers) {
|
|
135
|
+
return this.axios.putForm(url, params, {
|
|
136
|
+
headers: headers,
|
|
137
|
+
});
|
|
138
|
+
};
|
|
117
139
|
/**
|
|
118
140
|
* Requests a DELETE
|
|
119
141
|
* @param url
|
package/dist/workspaces/index.js
CHANGED
|
@@ -84,9 +84,9 @@ var Workspaces = /** @class */ (function () {
|
|
|
84
84
|
* @returns The response from the server.
|
|
85
85
|
*/
|
|
86
86
|
Workspaces.prototype.uploadWorkspaceAvatar = function (workspaceId, avatar) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
return this.client.postForm("workspaces/".concat(workspaceId, "/avatar"), {
|
|
88
|
+
file: avatar,
|
|
89
|
+
}, this.headers());
|
|
90
90
|
};
|
|
91
91
|
Workspaces.prototype.deleteWorkspaceAvatar = function (workspaceId) {
|
|
92
92
|
return this.client.delete("workspaces/".concat(workspaceId, "/avatar"), this.headers());
|
|
@@ -102,9 +102,9 @@ var Workspaces = /** @class */ (function () {
|
|
|
102
102
|
return this.client.patch("workspaces/".concat(workspaceId), details, this.headers());
|
|
103
103
|
};
|
|
104
104
|
Workspaces.prototype.updateAvatar = function (workspaceId, payload) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
return this.client.postForm("workspaces/".concat(workspaceId, "/avatar"), {
|
|
106
|
+
file: payload.avatar,
|
|
107
|
+
}, this.headers());
|
|
108
108
|
};
|
|
109
109
|
Workspaces.prototype.deleteAvatar = function (workspaceId) {
|
|
110
110
|
return this.client.delete("workspaces/".concat(workspaceId, "/avatar"), this.headers());
|