@staticbackend/backend 1.3.0 → 1.4.0

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 CHANGED
@@ -3,6 +3,10 @@ export interface ListParam {
3
3
  size: number;
4
4
  descending: boolean;
5
5
  }
6
+ export interface BulkUpdate {
7
+ update: any;
8
+ clauses: Array<Array<any>>;
9
+ }
6
10
  export interface EmailData {
7
11
  fromName: string;
8
12
  from: string;
@@ -16,6 +20,13 @@ export interface ConvertData {
16
20
  url: string;
17
21
  fullpage: boolean;
18
22
  }
23
+ export interface SMSData {
24
+ accountSID: string;
25
+ authToken: string;
26
+ toNumber: string;
27
+ fromNumber: string;
28
+ body: string;
29
+ }
19
30
  export declare class Backend {
20
31
  private baseURL;
21
32
  private pubKey;
@@ -46,6 +57,10 @@ export declare class Backend {
46
57
  ok: boolean;
47
58
  content: any;
48
59
  }>;
60
+ me(token: string): Promise<{
61
+ ok: boolean;
62
+ content: any;
63
+ }>;
49
64
  cacheGet(rootToken: string, key: string): Promise<{
50
65
  ok: boolean;
51
66
  content: any;
@@ -78,6 +93,10 @@ export declare class Backend {
78
93
  ok: boolean;
79
94
  content: any;
80
95
  }>;
96
+ updateBulk(token: string, repo: string, data: BulkUpdate): Promise<{
97
+ ok: boolean;
98
+ content: any;
99
+ }>;
81
100
  delete(token: string, repo: string, id: string): Promise<{
82
101
  ok: boolean;
83
102
  content: any;
@@ -126,5 +145,9 @@ export declare class Backend {
126
145
  ok: boolean;
127
146
  content: any;
128
147
  }>;
148
+ sudoSendSMS(rootToken: string, data: SMSData): Promise<{
149
+ ok: boolean;
150
+ content: any;
151
+ }>;
129
152
  private listParamToQuerystring;
130
153
  }
package/dist/backend.js CHANGED
@@ -103,6 +103,11 @@ class Backend {
103
103
  return yield this.req(rootToken, "GET", `/sudogettoken/${accountId}`);
104
104
  });
105
105
  }
106
+ me(token) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return yield this.req(token, "GET", "/me");
109
+ });
110
+ }
106
111
  cacheGet(rootToken, key) {
107
112
  return __awaiter(this, void 0, void 0, function* () {
108
113
  return yield this.req(rootToken, "GET", `/sudo/cache?key=${key}`);
@@ -146,6 +151,11 @@ class Backend {
146
151
  return yield this.req(token, "PUT", `/db/${repo}/${id}`, doc);
147
152
  });
148
153
  }
154
+ updateBulk(token, repo, data) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ return yield this.req(token, "PUT", `/db/${repo}?bulk=1`, data);
157
+ });
158
+ }
149
159
  delete(token, repo, id) {
150
160
  return __awaiter(this, void 0, void 0, function* () {
151
161
  return yield this.req(token, "DELETE", `/db/${repo}/${id}`);
@@ -223,6 +233,11 @@ class Backend {
223
233
  return yield this.req(token, "POST", "/extra/htmltox", data);
224
234
  });
225
235
  }
236
+ sudoSendSMS(rootToken, data) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ return yield this.req(rootToken, "POST", "/extra/sms", data);
239
+ });
240
+ }
226
241
  listParamToQuerystring(param) {
227
242
  var qs = "";
228
243
  if (param) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staticbackend/backend",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Client library for StaticBackend API",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {