Skip to content

Commit

Permalink
delete actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed Aug 8, 2023
1 parent b2aa050 commit 4bf6c5e
Show file tree
Hide file tree
Showing 26 changed files with 72 additions and 531 deletions.
3 changes: 1 addition & 2 deletions adapters/bonusprogram/BonusProgramAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class BonusProgramAdapter {
id;
config = {};
constructor(config) {
this.config = {};
this.config = config;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion adapters/captcha/CaptchaAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
*/
Object.defineProperty(exports, "__esModule", { value: true });
class CaptchaAdapter {
static taskStorage = {};
}
CaptchaAdapter.taskStorage = {};
exports.default = CaptchaAdapter;
1 change: 0 additions & 1 deletion adapters/discount/AbstractDiscountAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class AbstractDiscountHandlerINSTANCE {
static discounts;
}
exports.default = AbstractDiscountHandlerINSTANCE;
16 changes: 0 additions & 16 deletions adapters/discount/default/configuredDiscount.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ class configuredDiscount extends AbstractDiscount_1.default {
// this.displayGroupDiscount = discount.displayGroupDiscount;
// this.displayGroupDish = discount.displayGroupDish;
}
id;
isJoint;
name;
isPublic;
description;
concept;
configDiscount;
discount;
discountType;
actions;
enable;
isDeleted;
sortOrder;
productCategoryDiscounts;
hash;
worktime;
condition(order) {
throw new Error("Method not implemented.");
}
Expand Down
14 changes: 7 additions & 7 deletions adapters/discount/default/discountAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ exports.DiscountAdapter = void 0;
const configuredDiscount_1 = require("./configuredDiscount");
const worktime_1 = require("@webresto/worktime");
class DiscountAdapter {
// constructor all discounts isDeleted: true
// public readonly DiscountA: AbstractDiscount;
// protected constructor() {
// // this.DiscountA = DiscountA;
// Discount.setDelete();
// }
static discounts = {};
static async apply(order) {
// Order.concept : string
// when apply => use only discounts from this.discounts
Expand Down Expand Up @@ -103,4 +96,11 @@ class DiscountAdapter {
return DiscountAdapter.prototype;
}
}
// constructor all discounts isDeleted: true
// public readonly DiscountA: AbstractDiscount;
// protected constructor() {
// // this.DiscountA = DiscountA;
// Discount.setDelete();
// }
DiscountAdapter.discounts = {};
exports.DiscountAdapter = DiscountAdapter;
7 changes: 0 additions & 7 deletions adapters/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import RMSAdapter, { ConfigRMSAdapter } from "./rms/RMSAdapter";
import MapAdapter from "./map/MapAdapter";
import CaptchaAdapter from "./captcha/CaptchaAdapter";
import OTPAdapter from "./otp/OneTimePasswordAdapter";
import MediaFileAdapter, { ConfigMediaFileAdapter } from "./mediafile/MediaFileAdapter";
import PaymentAdapter from "./payment/PaymentAdapter";
import { DiscountAdapter } from "./discount/default/discountAdapter";
import BonusProgramAdapter from "./bonusprogram/BonusProgramAdapter";
import { Config } from "../interfaces/Config";
/**
* retruns Map-adapter
*/
export declare class Map {
static getAdapter(adapterName: string): Promise<typeof MapAdapter>;
}
/**
* retruns Captcha-adapter
*/
Expand Down
5 changes: 1 addition & 4 deletions adapters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ class OTP {
exports.OTP = OTP;
/** TODO: move other Adapters to one class adapter */
class Adapter {
// Singletons
static instanceRMS;
static instanceMF;
static WEBRESTO_MODULES_PATH = process.env.WEBRESTO_MODULES_PATH === undefined ? "@webresto" : process.env.WEBRESTO_MODULES_PATH;
static async getDiscountAdapter(adapterName, initParams) {
if (!adapterName) {
adapterName = await Settings.get("DEFAULT_DISCOUNT_ADAPTER");
Expand Down Expand Up @@ -206,4 +202,5 @@ class Adapter {
}
}
}
Adapter.WEBRESTO_MODULES_PATH = process.env.WEBRESTO_MODULES_PATH === undefined ? "@webresto" : process.env.WEBRESTO_MODULES_PATH;
exports.Adapter = Adapter;
9 changes: 9 additions & 0 deletions adapters/map/MapAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class MapAdapter {
config;
constructor(config) {
this.config = config;
}
}
exports.default = MapAdapter;
2 changes: 2 additions & 0 deletions adapters/map/MapConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
14 changes: 14 additions & 0 deletions adapters/map/Point.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
toString() {
return this.x + " " + this.y + ", ";
}
}
exports.default = Point;
25 changes: 25 additions & 0 deletions adapters/map/Polygon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Polygon {
_name;
_description;
_points;
constructor(name, description, points) {
this._name = name;
this._description = description;
this._points = points;
}
get points() {
return this._points;
}
get name() {
return this._name;
}
get asArray() {
return this._points.map((point) => [point.x, point.y]);
}
toString() {
return this._points.toString();
}
}
exports.default = Polygon;
3 changes: 0 additions & 3 deletions adapters/mediafile/MediaFileAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
const uuid_1 = require("uuid");
;
class MediaFileAdapter {
config;
initializationPromise;
UUID_NAMESPACE;
constructor(config) {
this.config = config;
this.initializationPromise = this.initialize();
Expand Down
5 changes: 2 additions & 3 deletions adapters/mediafile/default/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ const path = require("path");
// }
// },
class LocalMediaFileAdapter extends MediaFileAdapter_1.default {
processing = false;
processingTimeout; // TODO: rewrite by proxy
loadMediaFilesProcessQueue = [];
constructor(config) {
super(config);
this.processing = false;
this.loadMediaFilesProcessQueue = [];
this.loadMediaFiles();
}
getNameByUrl(url, ext, options, salt = false) {
Expand Down
2 changes: 0 additions & 2 deletions adapters/payment/PaymentAdapter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class PaymentAdapter {
InitPaymentAdapter;
config;
constructor(InitPaymentAdapter) {
this.InitPaymentAdapter = InitPaymentAdapter;
this.config = InitPaymentAdapter.config;
Expand Down
7 changes: 1 addition & 6 deletions adapters/rms/RMSAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ const ObservablePromise_1 = require("../../libs/ObservablePromise");
* An abstract RMS adapter class. Used to create new RMS adapters.
*/
class RMSAdapter {
config = {};
static syncProductsInterval;
static syncOutOfStocksInterval;
initializationPromise;
syncProductsPromise;
syncOutOfStocksPromise;
constructor(config) {
this.config = {};
this.config = config;
// Run async initialization
this.initializationPromise = this.initialize();
Expand Down
9 changes: 0 additions & 9 deletions libs/AwaitEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ const sleep = require("util").promisify(setTimeout);
* с ошибкой или время ожидания вышло).
*/
class AwaitEmitter {
events;
name;
timeout;
/**
* @param name - название нового эмиттера
* @param timeout - указывает сколько милисекунд ожидать функции, которые возвращают Promise.
Expand Down Expand Up @@ -142,8 +139,6 @@ exports.default = AwaitEmitter;
* Объект собятия, хранит название события и его слушателей
*/
class Event {
name;
fns;
constructor(name) {
this.name = name;
this.fns = [];
Expand All @@ -154,10 +149,6 @@ class Event {
* ошибку, которые вернула или вызвала функция
*/
class Response {
label;
state;
result;
error;
constructor(label, result, error, timeout) {
this.label = label;
this.result = result;
Expand Down
2 changes: 0 additions & 2 deletions libs/NotificationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationManager = void 0;
class NotificationManager {
static kitchenChannels;
static userChannels;
constructor() {
}
isChannelExist(channel) {
Expand Down
3 changes: 1 addition & 2 deletions libs/ObservablePromise.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObservablePromise = void 0;
class ObservablePromise {
_status = 'pending';
_promise;
constructor(promise) {
this._status = 'pending';
this._promise = promise
.then((value) => {
this._status = 'fulfilled';
Expand Down
95 changes: 0 additions & 95 deletions libs/actions.d.ts

This file was deleted.

Loading

0 comments on commit 4bf6c5e

Please sign in to comment.