@staticbackend/backend 1.1.1 → 1.3.1
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/backend.d.ts +29 -1
- package/dist/backend.js +29 -1
- package/package.json +1 -1
package/dist/backend.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ export interface EmailData {
|
|
|
11
11
|
body: string;
|
|
12
12
|
replyTo: string;
|
|
13
13
|
}
|
|
14
|
+
export interface ConvertData {
|
|
15
|
+
toPDF: boolean;
|
|
16
|
+
url: string;
|
|
17
|
+
fullpage: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SMSData {
|
|
20
|
+
accountSID: string;
|
|
21
|
+
authToken: string;
|
|
22
|
+
toNumber: string;
|
|
23
|
+
fromNumber: string;
|
|
24
|
+
body: string;
|
|
25
|
+
}
|
|
14
26
|
export declare class Backend {
|
|
15
27
|
private baseURL;
|
|
16
28
|
private pubKey;
|
|
@@ -97,7 +109,11 @@ export declare class Backend {
|
|
|
97
109
|
ok: boolean;
|
|
98
110
|
content: any;
|
|
99
111
|
}>;
|
|
100
|
-
|
|
112
|
+
sudoAddIndex(rootToken: string, repo: string, field: string): Promise<{
|
|
113
|
+
ok: boolean;
|
|
114
|
+
content: any;
|
|
115
|
+
}>;
|
|
116
|
+
storeFile(token: string, buf: ArrayBuffer): Promise<{
|
|
101
117
|
ok: boolean;
|
|
102
118
|
content: any;
|
|
103
119
|
}>;
|
|
@@ -109,5 +125,17 @@ export declare class Backend {
|
|
|
109
125
|
ok: boolean;
|
|
110
126
|
content: any;
|
|
111
127
|
}>;
|
|
128
|
+
resizeImage(token: string, maxWidth: number, buf: ArrayBuffer): Promise<{
|
|
129
|
+
ok: boolean;
|
|
130
|
+
content: any;
|
|
131
|
+
}>;
|
|
132
|
+
convertURLToX(token: string, data: ConvertData): Promise<{
|
|
133
|
+
ok: boolean;
|
|
134
|
+
content: any;
|
|
135
|
+
}>;
|
|
136
|
+
sudoSendSMS(rootToken: string, data: SMSData): Promise<{
|
|
137
|
+
ok: boolean;
|
|
138
|
+
content: any;
|
|
139
|
+
}>;
|
|
112
140
|
private listParamToQuerystring;
|
|
113
141
|
}
|
package/dist/backend.js
CHANGED
|
@@ -179,7 +179,13 @@ class Backend {
|
|
|
179
179
|
return yield this.req(token, "PUT", `/inc/${repo}/${id}`, body);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
sudoAddIndex(rootToken, repo, field) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const qs = `?col=${repo}&field=${field}`;
|
|
185
|
+
return yield this.req(rootToken, "POST", `/sudo/index${qs}`, null);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
storeFile(token, buf) {
|
|
183
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
190
|
let fd = new formData();
|
|
185
191
|
fd.append("file", buf, {
|
|
@@ -200,6 +206,28 @@ class Backend {
|
|
|
200
206
|
return yield this.req(rootToken, "POST", "/sudo/sendmail", data);
|
|
201
207
|
});
|
|
202
208
|
}
|
|
209
|
+
resizeImage(token, maxWidth, buf) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
let fd = new formData();
|
|
212
|
+
fd.append("file", buf, {
|
|
213
|
+
contentType: "application/octect-stream",
|
|
214
|
+
filename: "file-upload"
|
|
215
|
+
});
|
|
216
|
+
fd.append("width", maxWidth);
|
|
217
|
+
const ct = `multipart/form-data; boundary=${fd.getBoundary()}`;
|
|
218
|
+
return yield this.rawreq(ct, token, "POST", "/extra/resizeimg", fd);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
convertURLToX(token, data) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
return yield this.req(token, "POST", "/extra/htmltox", data);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
sudoSendSMS(rootToken, data) {
|
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
return yield this.req(rootToken, "POST", "/extra/sms", data);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
203
231
|
listParamToQuerystring(param) {
|
|
204
232
|
var qs = "";
|
|
205
233
|
if (param) {
|