@ztimson/momentum 0.49.0 → 0.50.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/ai.d.ts +1 -0
- package/dist/ai.d.ts.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/index.cjs +29 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +29 -8
- package/dist/momentum.d.ts +2 -0
- package/dist/momentum.d.ts.map +1 -1
- package/dist/phone.d.ts +19 -0
- package/dist/phone.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/ai.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export declare class Ai extends PathEventEmitter {
|
|
|
5
5
|
constructor(api: Api | string);
|
|
6
6
|
ask(question: string, context?: any): import('@ztimson/utils').PromiseProgress<any>;
|
|
7
7
|
clear(): import('@ztimson/utils').PromiseProgress<any>;
|
|
8
|
+
history(): import('@ztimson/utils').PromiseProgress<any>;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=ai.d.ts.map
|
package/dist/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAM,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,qBAAa,EAAG,SAAQ,gBAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IAWnC,KAAK;
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAM,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnF,qBAAa,MAAO,SAAQ,gBAAgB;IAqC/B,OAAO,CAAC,GAAG;IAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAnCvD,IAAI,MAAM,YAAyD;IAEnE,OAAO,CAAC,cAAc,CAAS;IAC/B,IAAI,aAAa,IACkB,OAAO,CADS;IACnD,OAAO,KAAK,aAAa,QAGxB;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAWvB;IAED,IAAI,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAGvD;IAED,OAAO,CAAC,IAAI,CAAC,CAAU;IACvB,IAAI,GAAG,IAAI,OAAO,CAIjB;gBAEmB,GAAG,EAAE,GAAG,EAAmB,QAAQ,EAAE,QAAQ;IAK3D,MAAM,CAAC,MAAM,UAAQ,EAAE,SAAS,UAAO;IA2F7C,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;IAoIhC,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAa7C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;CAO3C"}
|
package/dist/core.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type Meta = {
|
|
|
6
6
|
_updatedBy: string;
|
|
7
7
|
_updatedDate: Date;
|
|
8
8
|
};
|
|
9
|
-
export type NotificationMethod = '
|
|
9
|
+
export type NotificationMethod = 'email' | 'notification' | 'sms' | 'voice';
|
|
10
10
|
export type Notification = {
|
|
11
11
|
event: string;
|
|
12
12
|
method: NotificationMethod[];
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAI,OAAO,GAAG,cAAc,GAAG,KAAK,GAAG,OAAO,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAC;IAClE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;CACxB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1100,6 +1100,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1100
1100
|
clear() {
|
|
1101
1101
|
return this.api.request({ url: "/api/" + PES`ai`, method: "DELETE" }).then(() => this.emit(PES`ai:d`, this.api.token));
|
|
1102
1102
|
}
|
|
1103
|
+
history() {
|
|
1104
|
+
return this.api.request({ url: "/api/" + PES`ai` }).then((resp) => {
|
|
1105
|
+
this.emit(PES`ai:r`, resp);
|
|
1106
|
+
return resp;
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1103
1109
|
}
|
|
1104
1110
|
class Analytics extends PathEventEmitter {
|
|
1105
1111
|
constructor(api) {
|
|
@@ -1305,7 +1311,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1305
1311
|
return this._platform;
|
|
1306
1312
|
}
|
|
1307
1313
|
get pushSubscription() {
|
|
1308
|
-
|
|
1314
|
+
var _a;
|
|
1315
|
+
if (!((_a = navigator.serviceWorker) == null ? void 0 : _a.controller)) return Promise.resolve(null);
|
|
1309
1316
|
return navigator.serviceWorker.ready.then((sw) => sw.pushManager.getSubscription());
|
|
1310
1317
|
}
|
|
1311
1318
|
get pwa() {
|
|
@@ -1314,7 +1321,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1314
1321
|
return this._pwa;
|
|
1315
1322
|
}
|
|
1316
1323
|
async inject(reload = false, firstLoad = true) {
|
|
1317
|
-
var _a, _b, _c, _d, _e
|
|
1324
|
+
var _a, _b, _c, _d, _e;
|
|
1318
1325
|
let settings = this.settings.cache;
|
|
1319
1326
|
if (firstLoad) this.settings.all(false, reload).then(() => this.inject(false, false)).catch(() => {
|
|
1320
1327
|
});
|
|
@@ -1371,12 +1378,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1371
1378
|
}
|
|
1372
1379
|
style.innerHTML = `
|
|
1373
1380
|
:root {
|
|
1374
|
-
--theme-
|
|
1375
|
-
--theme-
|
|
1376
|
-
--theme-
|
|
1377
|
-
--theme-secondary: ${(_f = settings["theme"]) == null ? void 0 : _f.secondary};
|
|
1378
|
-
--theme-text: ${((_g = settings["theme"]) == null ? void 0 : _g.darkMode) ? "#ffffff" : "#000000"};
|
|
1379
|
-
--theme-muted: ${((_h = settings["theme"]) == null ? void 0 : _h.darkMode) ? "#cccccc" : "#6c757d"};
|
|
1381
|
+
--theme-backdrop: ${(_c = settings["theme"]) == null ? void 0 : _c.background};
|
|
1382
|
+
--theme-primary: ${(_d = settings["theme"]) == null ? void 0 : _d.primary};
|
|
1383
|
+
--theme-accent: ${(_e = settings["theme"]) == null ? void 0 : _e.secondary};
|
|
1380
1384
|
}`;
|
|
1381
1385
|
}
|
|
1382
1386
|
if (settings["pwa"]) {
|
|
@@ -1893,6 +1897,19 @@ ${log}`;
|
|
|
1893
1897
|
return this.createPdf({ url }, options);
|
|
1894
1898
|
}
|
|
1895
1899
|
}
|
|
1900
|
+
class Phone extends PathEventEmitter {
|
|
1901
|
+
constructor(api) {
|
|
1902
|
+
super();
|
|
1903
|
+
__publicField(this, "api");
|
|
1904
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1905
|
+
}
|
|
1906
|
+
sms(message) {
|
|
1907
|
+
return this.api.request({ url: "/api/" + PES`phone/sms`, body: message }).then((resp) => this.emit(PES`sms/${message.to}`, resp));
|
|
1908
|
+
}
|
|
1909
|
+
voice(message) {
|
|
1910
|
+
return this.api.request({ url: "/api/" + PES`phone/voice`, body: message }).then((resp) => this.emit(PES`voice/${message.to}`, resp));
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1896
1913
|
const _Socket = class _Socket {
|
|
1897
1914
|
constructor(api) {
|
|
1898
1915
|
__publicField(this, "api");
|
|
@@ -2171,6 +2188,7 @@ ${log}`;
|
|
|
2171
2188
|
__publicField(this, "groups");
|
|
2172
2189
|
__publicField(this, "logger");
|
|
2173
2190
|
__publicField(this, "payments");
|
|
2191
|
+
__publicField(this, "phone");
|
|
2174
2192
|
__publicField(this, "pdf");
|
|
2175
2193
|
__publicField(this, "settings");
|
|
2176
2194
|
__publicField(this, "socket");
|
|
@@ -2189,6 +2207,7 @@ ${log}`;
|
|
|
2189
2207
|
this.logger = new Logger(this.api, (opts == null ? void 0 : opts.app) || "client", opts == null ? void 0 : opts.logLevel);
|
|
2190
2208
|
if (opts == null ? void 0 : opts.stripeSecret) this.payments = new Payments(this.api, opts.stripeSecret);
|
|
2191
2209
|
this.pdf = new Pdf(this.api);
|
|
2210
|
+
this.phone = new Phone(this.api);
|
|
2192
2211
|
this.settings = new Settings(this.api);
|
|
2193
2212
|
if (opts == null ? void 0 : opts.socket) this.socket = new Socket(this.api);
|
|
2194
2213
|
this.static = new Static(this.api);
|
|
@@ -2207,6 +2226,7 @@ ${log}`;
|
|
|
2207
2226
|
this.relayEvents(this.logger);
|
|
2208
2227
|
if (this.payments) this.relayEvents(this.payments);
|
|
2209
2228
|
this.relayEvents(this.pdf);
|
|
2229
|
+
this.relayEvents(this.phone);
|
|
2210
2230
|
this.relayEvents(this.settings);
|
|
2211
2231
|
this.relayEvents(this.static);
|
|
2212
2232
|
this.relayEvents(this.storage);
|
|
@@ -2240,6 +2260,7 @@ ${log}`;
|
|
|
2240
2260
|
exports2.PathEventEmitter = PathEventEmitter;
|
|
2241
2261
|
exports2.Payments = Payments;
|
|
2242
2262
|
exports2.Pdf = Pdf;
|
|
2263
|
+
exports2.Phone = Phone;
|
|
2243
2264
|
exports2.Settings = Settings;
|
|
2244
2265
|
exports2.Socket = Socket;
|
|
2245
2266
|
exports2.Static = Static;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,EAAE,EAAE,GAAG,EAAE,SAAS,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,gBAAgB,EAChB,MAAM,gBAAgB,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,EAAE,EAAE,GAAG,EAAE,SAAS,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,gBAAgB,EAChB,MAAM,gBAAgB,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1096,6 +1096,12 @@ class Ai extends PathEventEmitter {
|
|
|
1096
1096
|
clear() {
|
|
1097
1097
|
return this.api.request({ url: "/api/" + PES`ai`, method: "DELETE" }).then(() => this.emit(PES`ai:d`, this.api.token));
|
|
1098
1098
|
}
|
|
1099
|
+
history() {
|
|
1100
|
+
return this.api.request({ url: "/api/" + PES`ai` }).then((resp) => {
|
|
1101
|
+
this.emit(PES`ai:r`, resp);
|
|
1102
|
+
return resp;
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1099
1105
|
}
|
|
1100
1106
|
class Analytics extends PathEventEmitter {
|
|
1101
1107
|
constructor(api) {
|
|
@@ -1301,7 +1307,8 @@ class Client extends PathEventEmitter {
|
|
|
1301
1307
|
return this._platform;
|
|
1302
1308
|
}
|
|
1303
1309
|
get pushSubscription() {
|
|
1304
|
-
|
|
1310
|
+
var _a;
|
|
1311
|
+
if (!((_a = navigator.serviceWorker) == null ? void 0 : _a.controller)) return Promise.resolve(null);
|
|
1305
1312
|
return navigator.serviceWorker.ready.then((sw) => sw.pushManager.getSubscription());
|
|
1306
1313
|
}
|
|
1307
1314
|
get pwa() {
|
|
@@ -1310,7 +1317,7 @@ class Client extends PathEventEmitter {
|
|
|
1310
1317
|
return this._pwa;
|
|
1311
1318
|
}
|
|
1312
1319
|
async inject(reload = false, firstLoad = true) {
|
|
1313
|
-
var _a, _b, _c, _d, _e
|
|
1320
|
+
var _a, _b, _c, _d, _e;
|
|
1314
1321
|
let settings = this.settings.cache;
|
|
1315
1322
|
if (firstLoad) this.settings.all(false, reload).then(() => this.inject(false, false)).catch(() => {
|
|
1316
1323
|
});
|
|
@@ -1367,12 +1374,9 @@ class Client extends PathEventEmitter {
|
|
|
1367
1374
|
}
|
|
1368
1375
|
style.innerHTML = `
|
|
1369
1376
|
:root {
|
|
1370
|
-
--theme-
|
|
1371
|
-
--theme-
|
|
1372
|
-
--theme-
|
|
1373
|
-
--theme-secondary: ${(_f = settings["theme"]) == null ? void 0 : _f.secondary};
|
|
1374
|
-
--theme-text: ${((_g = settings["theme"]) == null ? void 0 : _g.darkMode) ? "#ffffff" : "#000000"};
|
|
1375
|
-
--theme-muted: ${((_h = settings["theme"]) == null ? void 0 : _h.darkMode) ? "#cccccc" : "#6c757d"};
|
|
1377
|
+
--theme-backdrop: ${(_c = settings["theme"]) == null ? void 0 : _c.background};
|
|
1378
|
+
--theme-primary: ${(_d = settings["theme"]) == null ? void 0 : _d.primary};
|
|
1379
|
+
--theme-accent: ${(_e = settings["theme"]) == null ? void 0 : _e.secondary};
|
|
1376
1380
|
}`;
|
|
1377
1381
|
}
|
|
1378
1382
|
if (settings["pwa"]) {
|
|
@@ -1889,6 +1893,19 @@ class Pdf extends PathEventEmitter {
|
|
|
1889
1893
|
return this.createPdf({ url }, options);
|
|
1890
1894
|
}
|
|
1891
1895
|
}
|
|
1896
|
+
class Phone extends PathEventEmitter {
|
|
1897
|
+
constructor(api) {
|
|
1898
|
+
super();
|
|
1899
|
+
__publicField(this, "api");
|
|
1900
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1901
|
+
}
|
|
1902
|
+
sms(message) {
|
|
1903
|
+
return this.api.request({ url: "/api/" + PES`phone/sms`, body: message }).then((resp) => this.emit(PES`sms/${message.to}`, resp));
|
|
1904
|
+
}
|
|
1905
|
+
voice(message) {
|
|
1906
|
+
return this.api.request({ url: "/api/" + PES`phone/voice`, body: message }).then((resp) => this.emit(PES`voice/${message.to}`, resp));
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1892
1909
|
const _Socket = class _Socket {
|
|
1893
1910
|
constructor(api) {
|
|
1894
1911
|
__publicField(this, "api");
|
|
@@ -2167,6 +2184,7 @@ class Momentum extends PathEventEmitter {
|
|
|
2167
2184
|
__publicField(this, "groups");
|
|
2168
2185
|
__publicField(this, "logger");
|
|
2169
2186
|
__publicField(this, "payments");
|
|
2187
|
+
__publicField(this, "phone");
|
|
2170
2188
|
__publicField(this, "pdf");
|
|
2171
2189
|
__publicField(this, "settings");
|
|
2172
2190
|
__publicField(this, "socket");
|
|
@@ -2185,6 +2203,7 @@ class Momentum extends PathEventEmitter {
|
|
|
2185
2203
|
this.logger = new Logger(this.api, (opts == null ? void 0 : opts.app) || "client", opts == null ? void 0 : opts.logLevel);
|
|
2186
2204
|
if (opts == null ? void 0 : opts.stripeSecret) this.payments = new Payments(this.api, opts.stripeSecret);
|
|
2187
2205
|
this.pdf = new Pdf(this.api);
|
|
2206
|
+
this.phone = new Phone(this.api);
|
|
2188
2207
|
this.settings = new Settings(this.api);
|
|
2189
2208
|
if (opts == null ? void 0 : opts.socket) this.socket = new Socket(this.api);
|
|
2190
2209
|
this.static = new Static(this.api);
|
|
@@ -2203,6 +2222,7 @@ class Momentum extends PathEventEmitter {
|
|
|
2203
2222
|
this.relayEvents(this.logger);
|
|
2204
2223
|
if (this.payments) this.relayEvents(this.payments);
|
|
2205
2224
|
this.relayEvents(this.pdf);
|
|
2225
|
+
this.relayEvents(this.phone);
|
|
2206
2226
|
this.relayEvents(this.settings);
|
|
2207
2227
|
this.relayEvents(this.static);
|
|
2208
2228
|
this.relayEvents(this.storage);
|
|
@@ -2237,6 +2257,7 @@ export {
|
|
|
2237
2257
|
PathEventEmitter,
|
|
2238
2258
|
Payments,
|
|
2239
2259
|
Pdf,
|
|
2260
|
+
Phone,
|
|
2240
2261
|
Settings,
|
|
2241
2262
|
Socket,
|
|
2242
2263
|
Static,
|
package/dist/momentum.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { PathEventEmitter } from '@ztimson/utils';
|
|
|
11
11
|
import { Logger, LogLevel } from './logger';
|
|
12
12
|
import { Payments } from './payments';
|
|
13
13
|
import { Pdf } from './pdf';
|
|
14
|
+
import { Phone } from './phone';
|
|
14
15
|
import { Socket } from './sockets';
|
|
15
16
|
import { Storage } from './storage';
|
|
16
17
|
import { Client } from './client';
|
|
@@ -42,6 +43,7 @@ export declare class Momentum extends PathEventEmitter {
|
|
|
42
43
|
groups: Groups;
|
|
43
44
|
logger: Logger;
|
|
44
45
|
payments: Payments;
|
|
46
|
+
phone: Phone;
|
|
45
47
|
pdf: Pdf;
|
|
46
48
|
settings: Settings;
|
|
47
49
|
socket?: Socket;
|
package/dist/momentum.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentum.d.ts","sourceRoot":"","sources":["../src/momentum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,EAAE,EAAC,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,GAAG,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,IAAI,EAAE,WAAW,EAAC,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACp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AsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAA;AAED,qBAAa,QAAS,SAAQ,gBAAgB;IAC7C,GAAG,EAAG,GAAG,CAAC;IACV,OAAO,EAAG,OAAO,CAAC;IAClB,EAAE,EAAG,EAAE,CAAC;IACR,SAAS,EAAG,SAAS,CAAC;IACtB,IAAI,EAAG,IAAI,CAAC;IACZ,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,EAAG,IAAI,CAAC;IACZ,KAAK,EAAG,KAAK,CAAC;IACd,KAAK,EAAG,KAAK,CAAC;IACd,MAAM,EAAG,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,QAAQ,EAAG,QAAQ,CAAC;IACpB,KAAK,EAAG,KAAK,CAAC;IACd,GAAG,EAAG,GAAG,CAAC;IACV,QAAQ,EAAG,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,OAAO,EAAG,OAAO,CAAC;IAClB,KAAK,EAAG,KAAK,CAAC;gBAEF,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe;CAmDhD"}
|
package/dist/phone.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PathEventEmitter } from '@ztimson/utils';
|
|
2
|
+
import { Api } from './api';
|
|
3
|
+
export type Message = {
|
|
4
|
+
_id?: string;
|
|
5
|
+
_createdBy?: string;
|
|
6
|
+
_createdDate?: Date;
|
|
7
|
+
to: string;
|
|
8
|
+
from?: string;
|
|
9
|
+
body: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
} | string;
|
|
12
|
+
};
|
|
13
|
+
export declare class Phone extends PathEventEmitter {
|
|
14
|
+
private readonly api;
|
|
15
|
+
constructor(api: Api | string);
|
|
16
|
+
sms(message: Message): import('@ztimson/utils').PromiseProgress<any>;
|
|
17
|
+
voice(message: Message): import('@ztimson/utils').PromiseProgress<any>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=phone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone.d.ts","sourceRoot":"","sources":["../src/phone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAM,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,OAAO,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;CACvC,CAAA;AAED,qBAAa,KAAM,SAAQ,gBAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,GAAG,CAAC,OAAO,EAAE,OAAO;IAKpB,KAAK,CAAC,OAAO,EAAE,OAAO;CAItB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztimson/momentum",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "Client library for momentum",
|
|
5
5
|
"keywords": ["Momentum"],
|
|
6
6
|
"author": "Zak Timson <zaktimson@gmail.com>",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"postbuild": "node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.cjs','../server/public/momentum.js')\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ztimson/utils": "0.22.
|
|
27
|
+
"@ztimson/utils": "0.22.6",
|
|
28
28
|
"var-persist": "^1.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|