@ztimson/momentum 0.52.4 → 0.53.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/index.mjs CHANGED
@@ -15,6 +15,13 @@ function clean(obj, undefinedOnly = false) {
15
15
  }
16
16
  return obj;
17
17
  }
18
+ function deepCopy(value2) {
19
+ try {
20
+ return structuredClone(value2);
21
+ } catch {
22
+ return JSON.parse(JSONSanitize(value2));
23
+ }
24
+ }
18
25
  function isEqual(a2, b2) {
19
26
  const ta = typeof a2, tb = typeof b2;
20
27
  if (ta != "object" || a2 == null || (tb != "object" || b2 == null))
@@ -173,11 +180,11 @@ class Cache {
173
180
  return new Proxy(this, {
174
181
  get: (target, prop2) => {
175
182
  if (prop2 in target) return target[prop2];
176
- return target.store[prop2];
183
+ return deepCopy(target.store[prop2]);
177
184
  },
178
185
  set: (target, prop2, value2) => {
179
186
  if (prop2 in target) target[prop2] = value2;
180
- else target.store[prop2] = value2;
187
+ else this.set(prop2, value2);
181
188
  return true;
182
189
  }
183
190
  });
@@ -192,7 +199,7 @@ class Cache {
192
199
  * @return {T[]} Array of items
193
200
  */
194
201
  all() {
195
- return Object.values(this.store);
202
+ return deepCopy(Object.values(this.store));
196
203
  }
197
204
  /**
198
205
  * Add a new item to the cache. Like set, but finds key automatically
@@ -247,7 +254,7 @@ class Cache {
247
254
  * @return {T} Cached item
248
255
  */
249
256
  get(key) {
250
- return this.store[key];
257
+ return deepCopy(this.store[key]);
251
258
  }
252
259
  /**
253
260
  * Get a list of cached keys
@@ -263,7 +270,7 @@ class Cache {
263
270
  * @return {Record<K, T>}
264
271
  */
265
272
  map() {
266
- return structuredClone(this.store);
273
+ return deepCopy(this.store);
267
274
  }
268
275
  /**
269
276
  * Add an item to the cache manually specifying the key
@@ -333,6 +340,106 @@ class PromiseProgress extends Promise {
333
340
  return this.from(super.finally(res));
334
341
  }
335
342
  }
343
+ function formatDate(format = "YYYY-MM-DD H:mm", date = /* @__PURE__ */ new Date(), tz) {
344
+ const timezones = [
345
+ ["IDLW", -12],
346
+ ["SST", -11],
347
+ ["HST", -10],
348
+ ["AKST", -9],
349
+ ["PST", -8],
350
+ ["MST", -7],
351
+ ["CST", -6],
352
+ ["EST", -5],
353
+ ["AST", -4],
354
+ ["BRT", -3],
355
+ ["MAT", -2],
356
+ ["AZOT", -1],
357
+ ["UTC", 0],
358
+ ["CET", 1],
359
+ ["EET", 2],
360
+ ["MSK", 3],
361
+ ["AST", 4],
362
+ ["PKT", 5],
363
+ ["IST", 5.5],
364
+ ["BST", 6],
365
+ ["ICT", 7],
366
+ ["CST", 8],
367
+ ["JST", 9],
368
+ ["AEST", 10],
369
+ ["SBT", 11],
370
+ ["FJT", 12],
371
+ ["TOT", 13],
372
+ ["LINT", 14]
373
+ ];
374
+ function adjustTz(date2, gmt) {
375
+ const currentOffset = date2.getTimezoneOffset();
376
+ const adjustedOffset = gmt * 60;
377
+ return new Date(date2.getTime() + (adjustedOffset + currentOffset) * 6e4);
378
+ }
379
+ function day(num) {
380
+ return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][num] || "Unknown";
381
+ }
382
+ function doy(date2) {
383
+ const start = /* @__PURE__ */ new Date(`${date2.getFullYear()}-01-01 0:00:00`);
384
+ return Math.ceil((date2.getTime() - start.getTime()) / (1e3 * 60 * 60 * 24));
385
+ }
386
+ function month(num) {
387
+ return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][num] || "Unknown";
388
+ }
389
+ function suffix(num) {
390
+ if (num % 100 >= 11 && num % 100 <= 13) return `${num}th`;
391
+ switch (num % 10) {
392
+ case 1:
393
+ return `${num}st`;
394
+ case 2:
395
+ return `${num}nd`;
396
+ case 3:
397
+ return `${num}rd`;
398
+ default:
399
+ return `${num}th`;
400
+ }
401
+ }
402
+ function tzOffset(offset) {
403
+ const hours = ~~(offset / 60);
404
+ const minutes = offset % 60;
405
+ return (offset > 0 ? "-" : "") + `${hours}:${minutes.toString().padStart(2, "0")}`;
406
+ }
407
+ if (typeof date == "number" || typeof date == "string") date = new Date(date);
408
+ let t;
409
+ if (tz == null) tz = -(date.getTimezoneOffset() / 60);
410
+ t = timezones.find((t2) => isNaN(tz) ? t2[0] == tz : t2[1] == tz);
411
+ if (!t) throw new Error(`Unknown timezone: ${tz}`);
412
+ date = adjustTz(date, t[1]);
413
+ const tokens = {
414
+ "YYYY": date.getFullYear().toString(),
415
+ "YY": date.getFullYear().toString().slice(2),
416
+ "MMMM": month(date.getMonth()),
417
+ "MMM": month(date.getMonth()).slice(0, 3),
418
+ "MM": (date.getMonth() + 1).toString().padStart(2, "0"),
419
+ "M": (date.getMonth() + 1).toString(),
420
+ "DDD": doy(date).toString(),
421
+ "DD": date.getDate().toString().padStart(2, "0"),
422
+ "Do": suffix(date.getDate()),
423
+ "D": date.getDate().toString(),
424
+ "dddd": day(date.getDay()),
425
+ "ddd": day(date.getDay()).slice(0, 3),
426
+ "HH": date.getHours().toString().padStart(2, "0"),
427
+ "H": date.getHours().toString(),
428
+ "hh": (date.getHours() % 12 || 12).toString().padStart(2, "0"),
429
+ "h": (date.getHours() % 12 || 12).toString(),
430
+ "mm": date.getMinutes().toString().padStart(2, "0"),
431
+ "m": date.getMinutes().toString(),
432
+ "ss": date.getSeconds().toString().padStart(2, "0"),
433
+ "s": date.getSeconds().toString(),
434
+ "SSS": date.getMilliseconds().toString().padStart(3, "0"),
435
+ "A": date.getHours() >= 12 ? "PM" : "AM",
436
+ "a": date.getHours() >= 12 ? "pm" : "am",
437
+ "ZZ": tzOffset(t[1] * 60).replace(":", ""),
438
+ "Z": tzOffset(t[1] * 60),
439
+ "z": typeof tz == "string" ? tz : t[0]
440
+ };
441
+ return format.replace(/YYYY|YY|MMMM|MMM|MM|M|DDD|DD|Do|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|SSS|A|a|ZZ|Z|z/g, (token) => tokens[token]);
442
+ }
336
443
  function downloadFile(blob, name) {
337
444
  if (!(blob instanceof Blob)) blob = new Blob(makeArray(blob));
338
445
  const url = URL.createObjectURL(blob);
@@ -364,7 +471,7 @@ function fileBrowser(options = {}) {
364
471
  }
365
472
  function timestampFilename(name, date = /* @__PURE__ */ new Date()) {
366
473
  if (typeof date == "number" || typeof date == "string") date = new Date(date);
367
- const timestamp = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}_${date.getHours().toString().padStart(2, "0")}-${date.getMinutes().toString().padStart(2, "0")}-${date.getSeconds().toString().padStart(2, "0")}`;
474
+ const timestamp = formatDate("YYYY-MM-DD_HH:mm:ss", date);
368
475
  return timestamp;
369
476
  }
370
477
  function uploadWithProgress(options) {
@@ -982,6 +1089,10 @@ class Api extends Http {
982
1089
  if (token) this.token = token;
983
1090
  }
984
1091
  }
1092
+ get sameOrigin() {
1093
+ if (typeof window == "undefined" || !(window == null ? void 0 : window.location)) return false;
1094
+ return window.location.host == this.host;
1095
+ }
985
1096
  /** Current API token */
986
1097
  get token() {
987
1098
  return this._token;
@@ -1015,7 +1126,7 @@ class Api extends Http {
1015
1126
  const key = JSONSanitize(options);
1016
1127
  const method = options.method == "GET" ? "r" : options.method == "POST" ? "c" : options.method == "DELETE" ? "d" : "u";
1017
1128
  if (this.pending[key] != null) return this.pending[key];
1018
- this.pending[key] = super.request(options).then((response) => {
1129
+ this.pending[key] = super.request({ ...options, credentials: "include" }).then((response) => {
1019
1130
  this.emit(PES`api/response:${method}`, { request: options, response });
1020
1131
  return options.decode === false ? response : response.data;
1021
1132
  }).catch((err) => {
@@ -1057,6 +1168,15 @@ class Actions extends PathEventEmitter {
1057
1168
  return resp;
1058
1169
  });
1059
1170
  }
1171
+ /**
1172
+ * Manually trigger an actions execution
1173
+ * @param {string} id Action ID
1174
+ * @param {HttpRequestOptions} opts Additional arguments
1175
+ * @return {Promise<ActionResult>} All action output including console logs & return
1176
+ */
1177
+ debug(id, opts = {}) {
1178
+ return this.api.request({ url: "/api/" + PES`actions/debug/${id}`, method: "POST", ...opts });
1179
+ }
1060
1180
  /**
1061
1181
  * Delete an existing action
1062
1182
  * @param {string} id Action ID
@@ -1086,13 +1206,13 @@ class Actions extends PathEventEmitter {
1086
1206
  });
1087
1207
  }
1088
1208
  /**
1089
- * Manually trigger an actions execution
1090
- * @param {string} id Action ID
1091
- * @param {HttpRequestOptions} opts Additional arguments
1092
- * @return {Promise<ActionResult>} Result of action
1209
+ * Run an HTTP action
1210
+ * @param {string} path HTTP path excluding `/api/actions/run`
1211
+ * @param {HttpRequestOptions} opts HTTP options
1212
+ * @return {Promise<T>} HTTP response
1093
1213
  */
1094
- runById(id, opts = {}) {
1095
- return this.api.request({ url: "/api/" + PES`actions/run-by-id/${id}`, method: "POST", ...opts });
1214
+ run(path, opts = {}) {
1215
+ return this.api.request({ ...opts, url: "/api/" + PES`actions/run/${path}` });
1096
1216
  }
1097
1217
  /**
1098
1218
  * Update an action
@@ -1150,6 +1270,13 @@ class Ai extends PathEventEmitter {
1150
1270
  return resp;
1151
1271
  });
1152
1272
  }
1273
+ /**
1274
+ * Get model info
1275
+ * @return {Promise<{host: string, model: string}>} Model Info
1276
+ */
1277
+ info() {
1278
+ return this.api.request({ url: "/api/ai/info" });
1279
+ }
1153
1280
  }
1154
1281
  class Analytics extends PathEventEmitter {
1155
1282
  constructor(api) {
@@ -1268,7 +1395,7 @@ class Auth extends PathEventEmitter {
1268
1395
  this.totp = new Totp(this.api);
1269
1396
  this.relayEvents(this.token);
1270
1397
  this.opts = {
1271
- loginUrl: this.api.url + "/ui/#/login",
1398
+ loginUrl: this.api.url + "/ui/login",
1272
1399
  ...this.opts
1273
1400
  };
1274
1401
  this.api.addInterceptor((resp, next) => {
@@ -1350,12 +1477,11 @@ class Auth extends PathEventEmitter {
1350
1477
  loginRedirect(host = location.origin) {
1351
1478
  return new Promise((res, rej) => {
1352
1479
  var _a;
1353
- let origin = new URL(this.opts.loginUrl).origin, done = false, listener, win;
1480
+ let origin = new URL(this.opts.loginUrl).origin, listener, win;
1354
1481
  window.addEventListener("message", listener = (event) => {
1355
1482
  const data = (event == null ? void 0 : event.data) || {};
1356
1483
  if (event.origin != origin || data.sender != origin) return;
1357
1484
  if (!data.token) return rej("Unknown response from login");
1358
- done = true;
1359
1485
  this.api.token = data.token;
1360
1486
  window.removeEventListener("message", listener);
1361
1487
  win.close();
@@ -1366,9 +1492,6 @@ class Auth extends PathEventEmitter {
1366
1492
  window.removeEventListener("message", listener);
1367
1493
  return rej("Unable to open login");
1368
1494
  }
1369
- win.addEventListener("close", () => {
1370
- if (!done) rej("Window closed before logging in");
1371
- });
1372
1495
  });
1373
1496
  }
1374
1497
  /**
@@ -1377,6 +1500,7 @@ class Auth extends PathEventEmitter {
1377
1500
  logout() {
1378
1501
  this.emit(PES`auth/logout:d`, this.user);
1379
1502
  this.api.token = null;
1503
+ this.api.request({ url: "/api/auth/logout", method: "DELETE" });
1380
1504
  this.user = null;
1381
1505
  }
1382
1506
  /**
@@ -1388,8 +1512,10 @@ class Auth extends PathEventEmitter {
1388
1512
  var _a;
1389
1513
  if (!user.username || !user.password) throw new Error("Cannot register user, missing username or password");
1390
1514
  const u = await this.api.request({ url: "/api/auth/register", body: { ...user } });
1391
- if ((_a = u == null ? void 0 : u.image) == null ? void 0 : _a.startsWith("/")) u.image = `${this.api.url}${u.image}?token=${this.api.token}`;
1392
- this.emit(PES`auth/register:c`, u);
1515
+ if ((_a = u == null ? void 0 : u.image) == null ? void 0 : _a.startsWith("/")) u.image = `${this.api.url}${u.image}${!this.api.sameOrigin && this.api.token ? `?token=${this.api.token}` : ""}`;
1516
+ this.user = u;
1517
+ this.permissions = [];
1518
+ this.emit(PES`auth/register:u`, u);
1393
1519
  return u;
1394
1520
  }
1395
1521
  reset(emailOrPass, token) {
@@ -1420,7 +1546,7 @@ class Auth extends PathEventEmitter {
1420
1546
  this.emit(PES`auth/session:r`, session);
1421
1547
  if (set) {
1422
1548
  this.api.token = token;
1423
- if (session == null ? void 0 : session.user) session.user.image = `${this.api.url}${session.user.image}?token=${this.api.token}`;
1549
+ if (session == null ? void 0 : session.user) session.user.image = `${this.api.url}${session.user.image}${!this.api.sameOrigin && this.api.token ? `?token=${this.api.token}` : ""}`;
1424
1550
  this.user = (session == null ? void 0 : session.user) || null;
1425
1551
  this.permissions = (session == null ? void 0 : session.permissions) || [];
1426
1552
  if (session) this.emit(PES`auth/login:c`, session.user);
@@ -1505,7 +1631,7 @@ class Client extends PathEventEmitter {
1505
1631
  * @return {Promise<void>} Resolves on completion
1506
1632
  */
1507
1633
  async init(opts = {}) {
1508
- var _a, _b, _c, _d, _e, _f, _g;
1634
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1509
1635
  opts = {
1510
1636
  reload: void 0,
1511
1637
  pwa: true,
@@ -1522,7 +1648,7 @@ class Client extends PathEventEmitter {
1522
1648
  if (!this.settings.cache.keys().length) opts.reload = true;
1523
1649
  let settings = await (opts.reload ? this.settings.all(false, true) : this.settings.cache);
1524
1650
  if (opts.reload == null) this.settings.all(false, true).then(() => this.init({ reload: false }));
1525
- if (settings["title"]) document.querySelectorAll(".momentum-title").forEach((el) => el.innerText = settings["title"]);
1651
+ if (settings["title"]) document.querySelectorAll(".momentum-title").forEach((el) => el.innerText = el.innerText.includes("|") ? `${el.innerText.split("|")[0].trim()} | ${settings["title"]}` : settings["title"]);
1526
1652
  if (settings["description"]) document.querySelectorAll(".momentum-description").forEach((el) => el.innerText = settings["description"]);
1527
1653
  if (settings["version"]) document.querySelectorAll(".momentum-version").forEach((el) => el.innerText = settings["version"]);
1528
1654
  if (settings["logo"]) document.querySelectorAll(".momentum-logo").forEach((el) => el.src = settings["logo"]);
@@ -1567,6 +1693,8 @@ class Client extends PathEventEmitter {
1567
1693
  --theme-primary: ${(_e = settings["theme"]) == null ? void 0 : _e.primary} !important;
1568
1694
  --theme-accent: ${(_f = settings["theme"]) == null ? void 0 : _f.accent} !important;
1569
1695
  --theme-contrast: ${blackOrWhite((_g = settings["theme"]) == null ? void 0 : _g.background)} !important;
1696
+ --theme-primary-contrast: ${blackOrWhite((_h = settings["theme"]) == null ? void 0 : _h.primary)} !important;
1697
+ --theme-accent-contrast: ${blackOrWhite((_i = settings["theme"]) == null ? void 0 : _i.accent)} !important;
1570
1698
  }
1571
1699
  `;
1572
1700
  if (!style.parentElement) document.head.append(style);
@@ -1803,6 +1931,59 @@ class Data extends PathEventEmitter {
1803
1931
  });
1804
1932
  }
1805
1933
  }
1934
+ class Discounts extends PathEventEmitter {
1935
+ constructor(api) {
1936
+ super();
1937
+ this.api = api;
1938
+ }
1939
+ all() {
1940
+ return this.api.request({
1941
+ url: `/api/payments/discounts`,
1942
+ method: "GET"
1943
+ }).then((resp) => {
1944
+ this.emit(`discounts:r`, resp);
1945
+ return resp;
1946
+ });
1947
+ }
1948
+ create(discount) {
1949
+ return this.api.request({
1950
+ url: "/api/payments/discounts",
1951
+ method: "POST",
1952
+ body: discount
1953
+ }).then((resp) => {
1954
+ this.emit(`discounts/${resp.code}:c`, resp);
1955
+ return resp;
1956
+ });
1957
+ }
1958
+ delete(discount) {
1959
+ const code = typeof discount == "string" ? discount : discount.code;
1960
+ return this.api.request({
1961
+ url: `/api/payments/discounts/${code}`,
1962
+ method: "DELETE"
1963
+ }).then(() => {
1964
+ this.emit(`discounts/${code}:d`, code);
1965
+ });
1966
+ }
1967
+ read(code) {
1968
+ return this.api.request({
1969
+ url: `/api/payments/discounts/${code}`,
1970
+ method: "GET"
1971
+ }).then((resp) => {
1972
+ this.emit(`discounts/${code}:r`, resp);
1973
+ return resp;
1974
+ });
1975
+ }
1976
+ update(discount) {
1977
+ return this.api.request({
1978
+ url: "/api/payments/discounts",
1979
+ method: "PATCH",
1980
+ body: discount
1981
+ }).then((resp) => {
1982
+ this.emit(`discounts/${resp.code}:u`, resp);
1983
+ return resp;
1984
+ });
1985
+ }
1986
+ }
1806
1987
  class Email extends PathEventEmitter {
1807
1988
  constructor(api) {
1808
1989
  super();
@@ -1938,7 +2119,7 @@ class Logger extends PathEventEmitter {
1938
2119
  if (LOG_LEVEL[logLevel] >= 0) {
1939
2120
  console.error = (...args) => {
1940
2121
  this.console.error(...args);
1941
- this.error(...args);
2122
+ this.error(args);
1942
2123
  };
1943
2124
  window.addEventListener("unhandledrejection", async (event) => {
1944
2125
  var _a, _b, _c, _d;
@@ -1953,25 +2134,25 @@ ${log}`;
1953
2134
  if (LOG_LEVEL[logLevel] >= 1) {
1954
2135
  console.warn = (...args) => {
1955
2136
  this.console.warn(...args);
1956
- this.warn(...args);
2137
+ this.warn(args);
1957
2138
  };
1958
2139
  }
1959
2140
  if (LOG_LEVEL[logLevel] >= 2) {
1960
2141
  console.info = (...args) => {
1961
2142
  this.console.info(...args);
1962
- this.info(...args);
2143
+ this.info(args);
1963
2144
  };
1964
2145
  }
1965
2146
  if (LOG_LEVEL[logLevel] >= 3) {
1966
2147
  console.log = (...args) => {
1967
2148
  this.console.log(...args);
1968
- this.log(...args);
2149
+ this.log(args);
1969
2150
  };
1970
2151
  }
1971
2152
  if (LOG_LEVEL[logLevel] >= 4) {
1972
2153
  console.debug = (...args) => {
1973
2154
  this.console.debug(...args);
1974
- this.debug(...args);
2155
+ this.debug(args);
1975
2156
  };
1976
2157
  }
1977
2158
  }
@@ -2027,6 +2208,7 @@ class Payments extends PathEventEmitter {
2027
2208
  constructor(api, opts = {}) {
2028
2209
  super();
2029
2210
  __publicField(this, "api");
2211
+ __publicField(this, "discounts");
2030
2212
  /** Stripe object */
2031
2213
  __publicField(this, "stripe");
2032
2214
  /** Public stripe token */
@@ -2034,9 +2216,11 @@ class Payments extends PathEventEmitter {
2034
2216
  this.opts = opts;
2035
2217
  this.api = typeof api == "string" ? new Api(api) : api;
2036
2218
  this.opts = {
2037
- paymentUrl: this.api.url + "/ui/#/payment",
2219
+ paymentUrl: this.api.url + "/ui/payments/checkout",
2038
2220
  ...this.opts
2039
2221
  };
2222
+ this.discounts = new Discounts(this.api);
2223
+ this.relayEvents(this.discounts);
2040
2224
  }
2041
2225
  /**
2042
2226
  * Initialize stripe API
@@ -2151,12 +2335,11 @@ class Payments extends PathEventEmitter {
2151
2335
  paymentRedirect(id, host = location.origin) {
2152
2336
  return new Promise(async (res, rej) => {
2153
2337
  var _a;
2154
- let origin = new URL(this.opts.paymentUrl).origin, done = false, listener, win;
2338
+ let origin = new URL(this.opts.paymentUrl).origin, listener, win;
2155
2339
  window.addEventListener("message", listener = (event) => {
2156
2340
  const data = (event == null ? void 0 : event.data) || {};
2157
2341
  if (event.origin != origin || data.sender != origin) return;
2158
2342
  if (!data.response) return rej("Unknown response from payment page");
2159
- done = true;
2160
2343
  window.removeEventListener("message", listener);
2161
2344
  win.close();
2162
2345
  res(data.response);
@@ -2166,9 +2349,17 @@ class Payments extends PathEventEmitter {
2166
2349
  window.removeEventListener("message", listener);
2167
2350
  return rej("Unable to open payment page");
2168
2351
  }
2169
- win.addEventListener("close", () => {
2170
- if (!done) rej("Window closed before payment was complete");
2171
- });
2352
+ });
2353
+ }
2354
+ /**
2355
+ * Refund a transaction
2356
+ * @param {string} id Transaction number to refund
2357
+ * @return {PromiseProgress<any>}
2358
+ */
2359
+ refund(id) {
2360
+ return this.api.request({ url: `/api/payments/transactions/${id || ""}`, method: "DELETE" }).then((resp) => {
2361
+ this.emit(PES`products/${id ?? ""}:d`, resp);
2362
+ return resp;
2172
2363
  });
2173
2364
  }
2174
2365
  }
@@ -2304,7 +2495,7 @@ let Storage$1 = class Storage2 extends PathEventEmitter {
2304
2495
  }
2305
2496
  open(path, target = "_blank") {
2306
2497
  if (!path) throw new Error("Cannot download file, missing path");
2307
- const link = `${this.api.url}/api/` + PES`${this.path}/${path}` + (this.api.token ? `?token=${this.api.token}` : "");
2498
+ const link = `${this.api.url}/api/` + PES`${this.path}/${path}${!this.api.sameOrigin && this.api.token ? `?token=${this.api.token}` : ""}`;
2308
2499
  if (!target) return link;
2309
2500
  this.emit(PES`${this.path}/${path}:r`, path);
2310
2501
  return window.open(link, target);
@@ -2353,7 +2544,7 @@ class Users extends PathEventEmitter {
2353
2544
  if (!reload && this.cache.complete) return this.cache.all();
2354
2545
  return this.api.request({ url: "/api/" + PES`users` }).then((resp) => {
2355
2546
  resp == null ? void 0 : resp.forEach((r) => {
2356
- r.image = this.api.url + r.image + `?token=${this.api.token}`;
2547
+ r.image = `${this.api.url}${r.image}${!this.api.sameOrigin && this.api.token ? `?token=${this.api.token}` : ""}`;
2357
2548
  return r;
2358
2549
  });
2359
2550
  this.cache.addAll(resp);
@@ -2376,7 +2567,7 @@ class Users extends PathEventEmitter {
2376
2567
  if (!reload && this.cache.get(username)) return this.cache.get(username);
2377
2568
  return this.api.request({ url: "/api/" + PES`users/${username}` }).then((resp) => {
2378
2569
  if (resp) {
2379
- resp.image = this.api.url + resp.image + `?token=${this.api.token}`;
2570
+ resp.image = `${this.api.url}${resp.image}${!this.api.sameOrigin && this.api.token ? `?token=${this.api.token}` : ""}`;
2380
2571
  this.cache.add(resp);
2381
2572
  }
2382
2573
  this.emit(PES`users/${username}:r`, resp);
@@ -2537,6 +2728,7 @@ export {
2537
2728
  Auth,
2538
2729
  Client,
2539
2730
  Data,
2731
+ Discounts,
2540
2732
  Email,
2541
2733
  Forms,
2542
2734
  Groups,
@@ -1,9 +1,10 @@
1
1
  import { PathEventEmitter } from '@ztimson/utils';
2
2
  import { Api } from './api';
3
3
  import { Meta } from './core';
4
- /** Creditcard information for payments */
4
+ import { Discounts } from './discounts';
5
+ /** Credit-card information for payments */
5
6
  export type Card = {
6
- /** Creditcard number */
7
+ /** Credit-card number */
7
8
  number: number | string;
8
9
  /** Year card expires */
9
10
  expYear: number | string;
@@ -21,21 +22,6 @@ export type Card = {
21
22
  };
22
23
  };
23
24
  };
24
- /** Payment discounts */
25
- export type Discount = Meta & {
26
- /** Public discount code */
27
- code: string;
28
- /** Discount information */
29
- description?: string;
30
- /** Invalidate discount code */
31
- expire?: Date;
32
- /** Discount by fixed amount */
33
- fixed?: number;
34
- /** Limit the numer of uses */
35
- limit?: number;
36
- /** Discount by percentage */
37
- percent?: number;
38
- };
39
25
  /** User financial status */
40
26
  export type Finances = {
41
27
  /** Username */
@@ -50,6 +36,8 @@ export type Finances = {
50
36
  created: Date;
51
37
  /** Number of days the subscription lasts */
52
38
  interval: number;
39
+ /** Date of next renewal, null if cancelled */
40
+ renewal?: Date | null;
53
41
  }[];
54
42
  };
55
43
  /** Payment API options */
@@ -58,7 +46,7 @@ export type PaymentOptions = {
58
46
  paymentUrl?: string;
59
47
  };
60
48
  /** Returned products */
61
- export type Product = any & {
49
+ export type Product<T = any> = T & {
62
50
  _id: number;
63
51
  name: string;
64
52
  cost: number;
@@ -78,12 +66,18 @@ export type Transaction = Meta & {
78
66
  /** Individual unit cost */
79
67
  cost: number;
80
68
  }[];
69
+ /** How was the transaction completed */
70
+ complete?: string;
81
71
  /** Apply credit (Infinity to use all credit) */
82
72
  credit: number;
83
73
  /** Apply discount */
84
- discount?: Partial<Omit<Discount, keyof Meta | 'description' | 'expire' | 'limit'>>;
85
- /** Completion method, null to send invoice (creditcard, cash, transfer, etc) */
86
- method?: string | null;
74
+ discount?: {
75
+ code?: string;
76
+ type: 'fixed' | 'percent';
77
+ value: number;
78
+ };
79
+ /** Receipt/Invoice number */
80
+ invoiceNum?: string;
87
81
  /** Transaction notes */
88
82
  notes?: string | null;
89
83
  /** Recipient username or information */
@@ -97,6 +91,10 @@ export type Transaction = Meta & {
97
91
  /** Account name */
98
92
  username?: string;
99
93
  };
94
+ /** Whether the transaction/invoice has been refunded / canceled respectively */
95
+ refunded?: boolean;
96
+ /** Current status of transaction - null for self-checkout */
97
+ status?: 'Invoice' | 'Cancelled' | 'Receipt' | 'Refunded';
100
98
  /** Transaction total */
101
99
  subtotal: number;
102
100
  /** Tax percentage as float */
@@ -109,6 +107,7 @@ export type Transaction = Meta & {
109
107
  export declare class Payments extends PathEventEmitter {
110
108
  readonly opts: PaymentOptions;
111
109
  private readonly api;
110
+ discounts: Discounts;
112
111
  /** Stripe object */
113
112
  stripe?: any;
114
113
  /** Public stripe token */
@@ -134,6 +133,7 @@ export declare class Payments extends PathEventEmitter {
134
133
  */
135
134
  checkout(transaction: Partial<Transaction> & {
136
135
  recipient: string;
136
+ discount: string;
137
137
  }): Promise<Transaction>;
138
138
  /**
139
139
  * Get translation history
@@ -174,5 +174,11 @@ export declare class Payments extends PathEventEmitter {
174
174
  * @return {Promise<string>} Translation ID on success
175
175
  */
176
176
  paymentRedirect(id: string, host?: string): Promise<string>;
177
+ /**
178
+ * Refund a transaction
179
+ * @param {string} id Transaction number to refund
180
+ * @return {PromiseProgress<any>}
181
+ */
182
+ refund(id: string): import('@ztimson/utils').PromiseProgress<any>;
177
183
  }
178
184
  //# sourceMappingURL=payments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAM,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAW,MAAM,QAAQ,CAAC;AAEtC,0CAA0C;AAC1C,MAAM,MAAM,IAAI,GAAG;IAClB,wBAAwB;IACxB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,wBAAwB;IACxB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,4BAA4B;IAC5B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,wCAAwC;IACxC,OAAO,CAAC,EAAE;QACT,sBAAsB;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,sBAAsB;QACtB,OAAO,CAAC,EAAE;YACT,WAAW,CAAC,EAAE,MAAM,CAAC;SACrB,CAAA;KACD,CAAA;CACD,CAAA;AAED,wBAAwB;AACxB,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG;IAC7B,2BAA2B;IAC3B,IAAI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EAAkB,IAAI,GAAE,cAAmB;IAaxE;;;;OAIG;YACW,IAAI;IAYlB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAKpB;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAWzG;;;;OAIG;IACG,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAOxD;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC;;;;OAIG;IACH,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAO5C;;;;;OAKG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;IAanD;;;;;OAKG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAW3E;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,GAAE,MAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB5E;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM;CAMjB"}
package/dist/users.d.ts CHANGED
@@ -6,6 +6,7 @@ export type User = Meta & {
6
6
  name: string;
7
7
  email?: string;
8
8
  phone?: string;
9
+ address?: string;
9
10
  image: string;
10
11
  disabled?: boolean;
11
12
  groups: string[];
@@ -13,7 +14,9 @@ export type User = Meta & {
13
14
  permissions: string[];
14
15
  notes?: string;
15
16
  custom: any;
17
+ balance?: number;
16
18
  lastLogin?: number | null;
19
+ subscriptions?: any[];
17
20
  totp?: false | 'app' | 'email' | 'phone';
18
21
  };
19
22
  export declare class Users extends PathEventEmitter {
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,KAAK,EAAE,gBAAgB,EAA0B,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAC,IAAI,EAAE,YAAY,EAAC,MAAM,QAAQ,CAAC;AAE1C,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IAGZ,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;CACzC,CAAA;AAED,qBAAa,KAAM,SAAQ,gBAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;IAE3B,KAAK,sBAAuC;gBAEhC,GAAG,EAAE,GAAG,GAAG,MAAM;IAKvB,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAa5C,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,E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