@workerbase/sdk
Advanced tools
Comparing version 0.1.34-beta.6 to 0.1.34-beta.10
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.workerbase = exports.CURRENT_TASK_ACTION = exports.LIST_OPTIONS_SOURCE = exports.OPTION_ICONS = exports.STATUS_SCREEN_COLORS = exports.ACTION_ICONS = exports.STATUS_SCREEN_ICONS = exports.FLEX_DIRECTION = void 0; | ||
var WorkerbaseSDK_1 = require("./WorkerbaseSDK"); | ||
var WorkerbaseIcon_1 = require("./resources/WorkerbaseIcon"); | ||
var steps_1 = require("./types/steps"); | ||
var LayoutFlexStep_1 = require("./resources/steps/LayoutFlexStep"); | ||
var action_1 = require("./types/action"); | ||
const WorkerbaseSDK_1 = require("./WorkerbaseSDK"); | ||
const WorkerbaseIcon_1 = require("./resources/WorkerbaseIcon"); | ||
const steps_1 = require("./types/steps"); | ||
const LayoutFlexStep_1 = require("./resources/steps/LayoutFlexStep"); | ||
const action_1 = require("./types/action"); | ||
exports.FLEX_DIRECTION = LayoutFlexStep_1.FlexDirection; | ||
@@ -10,0 +10,0 @@ exports.STATUS_SCREEN_ICONS = WorkerbaseIcon_1.StatusScreenIcon; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BaseAction = void 0; | ||
var BaseAction = /** @class */ (function () { | ||
function BaseAction(type) { | ||
class BaseAction { | ||
constructor(type) { | ||
this.type = type; | ||
} | ||
return BaseAction; | ||
}()); | ||
} | ||
exports.BaseAction = BaseAction; | ||
//# sourceMappingURL=BaseAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CloseAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var CloseAction = /** @class */ (function (_super) { | ||
__extends(CloseAction, _super); | ||
function CloseAction() { | ||
return _super.call(this, action_1.StepActionType.CLOSE) || this; | ||
const action_1 = require("../../types/action"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class CloseAction extends BaseAction_1.BaseAction { | ||
constructor() { | ||
super(action_1.StepActionType.CLOSE); | ||
} | ||
return CloseAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.CloseAction = CloseAction; | ||
//# sourceMappingURL=CloseAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FinishAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var FinishAction = /** @class */ (function (_super) { | ||
__extends(FinishAction, _super); | ||
function FinishAction() { | ||
return _super.call(this, action_1.StepActionType.FINISH) || this; | ||
const action_1 = require("../../types/action"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class FinishAction extends BaseAction_1.BaseAction { | ||
constructor() { | ||
super(action_1.StepActionType.FINISH); | ||
} | ||
return FinishAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.FinishAction = FinishAction; | ||
//# sourceMappingURL=FinishAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NextActionFunctionIdAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var NextActionFunctionIdAction = /** @class */ (function (_super) { | ||
__extends(NextActionFunctionIdAction, _super); | ||
function NextActionFunctionIdAction(functionId) { | ||
var _this = _super.call(this, action_1.StepActionType.LOAD_NEXT_ACTION) || this; | ||
_this.loadNextActionFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
return _this; | ||
const action_1 = require("../../types/action"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class NextActionFunctionIdAction extends BaseAction_1.BaseAction { | ||
constructor(functionId) { | ||
super(action_1.StepActionType.LOAD_NEXT_ACTION); | ||
this.loadNextActionFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
return NextActionFunctionIdAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.NextActionFunctionIdAction = NextActionFunctionIdAction; | ||
//# sourceMappingURL=NextActionFunctionIdAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NextStepFunctionIdAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var NextStepFunctionIdAction = /** @class */ (function (_super) { | ||
__extends(NextStepFunctionIdAction, _super); | ||
function NextStepFunctionIdAction(functionId) { | ||
var _this = _super.call(this, action_1.StepActionType.LOAD_NEXT_STEP) || this; | ||
_this.loadNextStepFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
return _this; | ||
const action_1 = require("../../types/action"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class NextStepFunctionIdAction extends BaseAction_1.BaseAction { | ||
constructor(functionId) { | ||
super(action_1.StepActionType.LOAD_NEXT_STEP); | ||
this.loadNextStepFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
return NextStepFunctionIdAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.NextStepFunctionIdAction = NextStepFunctionIdAction; | ||
//# sourceMappingURL=NextStepFunctionIdAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NextStepIdAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var buttons_1 = require("../../types/buttons"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var NextStepIdAction = /** @class */ (function (_super) { | ||
__extends(NextStepIdAction, _super); | ||
function NextStepIdAction(stepId, navigationBehaviour) { | ||
var _this = _super.call(this, action_1.StepActionType.STEP) || this; | ||
_this.stepId = stepId; | ||
_this.editorContext = { | ||
const action_1 = require("../../types/action"); | ||
const buttons_1 = require("../../types/buttons"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class NextStepIdAction extends BaseAction_1.BaseAction { | ||
constructor(stepId, navigationBehaviour) { | ||
super(action_1.StepActionType.STEP); | ||
this.stepId = stepId; | ||
this.editorContext = { | ||
navigationBehaviour: navigationBehaviour || buttons_1.NavigationBehaviour.VARIABLE, | ||
}; | ||
return _this; | ||
} | ||
return NextStepIdAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.NextStepIdAction = NextStepIdAction; | ||
//# sourceMappingURL=NextStepIdAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NextTaskIdAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var NextTaskIdAction = /** @class */ (function (_super) { | ||
__extends(NextTaskIdAction, _super); | ||
function NextTaskIdAction(taskId, props) { | ||
var _this = _super.call(this, action_1.StepActionType.TASK) || this; | ||
_this.taskId = taskId; | ||
_this.currentTaskAction = | ||
(props === null || props === void 0 ? void 0 : props.currentTaskAction) || action_1.CurrentTaskAction.CLOSE; | ||
_this.initialStepId = props === null || props === void 0 ? void 0 : props.initialStepId; | ||
return _this; | ||
const action_1 = require("../../types/action"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class NextTaskIdAction extends BaseAction_1.BaseAction { | ||
constructor(taskId, props) { | ||
super(action_1.StepActionType.TASK); | ||
this.taskId = taskId; | ||
this.currentTaskAction = | ||
props?.currentTaskAction || action_1.CurrentTaskAction.CLOSE; | ||
this.initialStepId = props?.initialStepId; | ||
} | ||
return NextTaskIdAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.NextTaskIdAction = NextTaskIdAction; | ||
//# sourceMappingURL=NextTaskIdAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NextWorkinstructionAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var NextWorkinstructionAction = /** @class */ (function (_super) { | ||
__extends(NextWorkinstructionAction, _super); | ||
function NextWorkinstructionAction(workinstructionsId, props) { | ||
var _this = _super.call(this, action_1.StepActionType.WORKINSTRUCTIONS) || this; | ||
_this.workinstructionsId = workinstructionsId; | ||
_this.currentTaskAction = | ||
(props === null || props === void 0 ? void 0 : props.currentTaskAction) || action_1.CurrentTaskAction.CLOSE; | ||
_this.initialStepId = props === null || props === void 0 ? void 0 : props.initialStepId; | ||
return _this; | ||
const action_1 = require("../../types/action"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class NextWorkinstructionAction extends BaseAction_1.BaseAction { | ||
constructor(workinstructionsId, props) { | ||
super(action_1.StepActionType.WORKINSTRUCTIONS); | ||
this.workinstructionsId = workinstructionsId; | ||
this.currentTaskAction = | ||
props?.currentTaskAction || action_1.CurrentTaskAction.CLOSE; | ||
this.initialStepId = props?.initialStepId; | ||
} | ||
return NextWorkinstructionAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.NextWorkinstructionAction = NextWorkinstructionAction; | ||
//# sourceMappingURL=NextWorkinstructionAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SuspendAction = void 0; | ||
var action_1 = require("../../types/action"); | ||
var BaseAction_1 = require("./BaseAction"); | ||
var SuspendAction = /** @class */ (function (_super) { | ||
__extends(SuspendAction, _super); | ||
function SuspendAction() { | ||
return _super.call(this, action_1.StepActionType.SUSPEND) || this; | ||
const action_1 = require("../../types/action"); | ||
const BaseAction_1 = require("./BaseAction"); | ||
class SuspendAction extends BaseAction_1.BaseAction { | ||
constructor() { | ||
super(action_1.StepActionType.SUSPEND); | ||
} | ||
return SuspendAction; | ||
}(BaseAction_1.BaseAction)); | ||
} | ||
exports.SuspendAction = SuspendAction; | ||
//# sourceMappingURL=SuspendAction.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoAudioStep = /** @class */ (function (_super) { | ||
__extends(InfoAudioStep, _super); | ||
function InfoAudioStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoAudioStep extends StepBase_1.InfoMediaStepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_AUDIO, | ||
@@ -27,7 +13,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InfoAudioStep; | ||
}(StepBase_1.InfoMediaStepBase)); | ||
} | ||
exports.default = InfoAudioStep; | ||
//# sourceMappingURL=InfoAudioStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoLoadingStep = /** @class */ (function (_super) { | ||
__extends(InfoLoadingStep, _super); | ||
function InfoLoadingStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoLoadingStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_LOADING, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.taskAppearingDuration = props.taskAppearingDuration; | ||
return _this; | ||
}); | ||
this.taskAppearingDuration = props.taskAppearingDuration; | ||
} | ||
return InfoLoadingStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoLoadingStep; | ||
//# sourceMappingURL=InfoLoadingStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoLocationDirectionStep = /** @class */ (function (_super) { | ||
__extends(InfoLocationDirectionStep, _super); | ||
function InfoLocationDirectionStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoLocationDirectionStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_LOCATION_DIRECTION, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.gpsLocationLatitude = props.gpsLocationLatitude; | ||
_this.gpsLocationLongitude = props.gpsLocationLongitude; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.gpsLocationLatitude = props.gpsLocationLatitude; | ||
this.gpsLocationLongitude = props.gpsLocationLongitude; | ||
} | ||
return InfoLocationDirectionStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoLocationDirectionStep; | ||
//# sourceMappingURL=InfoLocationDirectionStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoPdfStep = /** @class */ (function (_super) { | ||
__extends(InfoPdfStep, _super); | ||
function InfoPdfStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoPdfStep extends StepBase_1.InfoMediaStepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_PDF, | ||
@@ -27,20 +13,18 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.page = '1'; | ||
_this.slideModeEnabled = true; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.page = '1'; | ||
this.slideModeEnabled = true; | ||
} | ||
InfoPdfStep.prototype.enableSlideMode = function () { | ||
enableSlideMode() { | ||
this.slideModeEnabled = true; | ||
}; | ||
InfoPdfStep.prototype.disableSlideMode = function () { | ||
} | ||
disableSlideMode() { | ||
this.slideModeEnabled = false; | ||
}; | ||
InfoPdfStep.prototype.setPageNumber = function (page) { | ||
} | ||
setPageNumber(page) { | ||
this.page = page; | ||
}; | ||
return InfoPdfStep; | ||
}(StepBase_1.InfoMediaStepBase)); | ||
} | ||
} | ||
exports.default = InfoPdfStep; | ||
//# sourceMappingURL=InfoPdfStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var Styles_1 = require("./utils/Styles"); | ||
var InfoPhotoStep = /** @class */ (function (_super) { | ||
__extends(InfoPhotoStep, _super); | ||
function InfoPhotoStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
const Styles_1 = require("./utils/Styles"); | ||
class InfoPhotoStep extends StepBase_1.InfoMediaStepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_PHOTO, | ||
@@ -28,8 +14,7 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.styles = { image: { scaleType: Styles_1.ImageScaleType.FIT } }; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.styles = { image: { scaleType: Styles_1.ImageScaleType.FIT } }; | ||
} | ||
InfoPhotoStep.prototype.showFullPicture = function (showFullPicture) { | ||
showFullPicture(showFullPicture) { | ||
if (showFullPicture) { | ||
@@ -41,6 +26,5 @@ this.styles = { image: { scaleType: Styles_1.ImageScaleType.FIT } }; | ||
} | ||
}; | ||
return InfoPhotoStep; | ||
}(StepBase_1.InfoMediaStepBase)); | ||
} | ||
} | ||
exports.default = InfoPhotoStep; | ||
//# sourceMappingURL=InfoPhotoStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoQrCodeStep = /** @class */ (function (_super) { | ||
__extends(InfoQrCodeStep, _super); | ||
function InfoQrCodeStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoQrCodeStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_QRCODE, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.qrcode = props.payload; | ||
return _this; | ||
}); | ||
this.qrcode = props.payload; | ||
} | ||
return InfoQrCodeStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoQrCodeStep; | ||
//# sourceMappingURL=InfoQrCodeStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var WorkerbaseIcon_1 = require("../WorkerbaseIcon"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoStatusStep = /** @class */ (function (_super) { | ||
__extends(InfoStatusStep, _super); | ||
function InfoStatusStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const WorkerbaseIcon_1 = require("../WorkerbaseIcon"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoStatusStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_STATUS, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.headline = props.headline; | ||
_this.color = steps_1.WorkerbaseStatusScreenColor.GREY; | ||
_this.icon = WorkerbaseIcon_1.StatusScreenIcon.INFO; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.headline = props.headline; | ||
this.color = steps_1.WorkerbaseStatusScreenColor.GREY; | ||
this.icon = WorkerbaseIcon_1.StatusScreenIcon.INFO; | ||
} | ||
InfoStatusStep.prototype.setIcon = function (icon) { | ||
setIcon(icon) { | ||
this.icon = icon; | ||
}; | ||
InfoStatusStep.prototype.setColor = function (color) { | ||
} | ||
setColor(color) { | ||
this.color = color; | ||
}; | ||
return InfoStatusStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
} | ||
exports.default = InfoStatusStep; | ||
//# sourceMappingURL=InfoStatusStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoTextLargeStep = /** @class */ (function (_super) { | ||
__extends(InfoTextLargeStep, _super); | ||
function InfoTextLargeStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoTextLargeStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_TEXT_LARGE, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
} | ||
return InfoTextLargeStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoTextLargeStep; | ||
//# sourceMappingURL=InfoTextLargeStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoTextStep = /** @class */ (function (_super) { | ||
__extends(InfoTextStep, _super); | ||
function InfoTextStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoTextStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_TEXT, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
} | ||
return InfoTextStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoTextStep; | ||
//# sourceMappingURL=InfoTextStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoVideoStep = /** @class */ (function (_super) { | ||
__extends(InfoVideoStep, _super); | ||
function InfoVideoStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoVideoStep extends StepBase_1.InfoMediaStepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_VIDEO, | ||
@@ -27,7 +13,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InfoVideoStep; | ||
}(StepBase_1.InfoMediaStepBase)); | ||
} | ||
exports.default = InfoVideoStep; | ||
//# sourceMappingURL=InfoVideoStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InfoWebviewStep = /** @class */ (function (_super) { | ||
__extends(InfoWebviewStep, _super); | ||
function InfoWebviewStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InfoWebviewStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INFO_WEBVIEW, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.url = props.url; | ||
return _this; | ||
}); | ||
this.url = props.url; | ||
} | ||
return InfoWebviewStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
exports.default = InfoWebviewStep; | ||
//# sourceMappingURL=InfoWebviewStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputAudioStep = /** @class */ (function (_super) { | ||
__extends(InputAudioStep, _super); | ||
function InputAudioStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputAudioStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_AUDIO, | ||
@@ -26,7 +12,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InputAudioStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
exports.default = InputAudioStep; | ||
//# sourceMappingURL=InputAudioStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RegexOperation = exports.Regex = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputBarcodeStep = /** @class */ (function (_super) { | ||
__extends(InputBarcodeStep, _super); | ||
function InputBarcodeStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputBarcodeStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_BARCODE, | ||
@@ -27,38 +13,34 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.allowManualBarcodeInput = false; | ||
_this.autoContinue = false; | ||
_this.regex = []; | ||
_this.regexOp = []; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.allowManualBarcodeInput = false; | ||
this.autoContinue = false; | ||
this.regex = []; | ||
this.regexOp = []; | ||
} | ||
InputBarcodeStep.prototype.setAutoContinue = function (autoContinue) { | ||
setAutoContinue(autoContinue) { | ||
this.autoContinue = autoContinue; | ||
}; | ||
InputBarcodeStep.prototype.setAllowManualBarcodeInput = function (allowManualBarcodeInput) { | ||
} | ||
setAllowManualBarcodeInput(allowManualBarcodeInput) { | ||
this.allowManualBarcodeInput = allowManualBarcodeInput; | ||
}; | ||
InputBarcodeStep.prototype.addRegex = function (regex) { | ||
} | ||
addRegex(regex) { | ||
this.regex.push(regex); | ||
}; | ||
InputBarcodeStep.prototype.addMultipleRegex = function (regexArray) { | ||
var _this = this; | ||
regexArray.forEach(function (regex) { | ||
_this.addRegex(regex); | ||
} | ||
addMultipleRegex(regexArray) { | ||
regexArray.forEach(regex => { | ||
this.addRegex(regex); | ||
}); | ||
}; | ||
InputBarcodeStep.prototype.addRegexOperation = function (regexOp) { | ||
} | ||
addRegexOperation(regexOp) { | ||
// eslint-disable-next-line no-param-reassign | ||
regexOp.id = this.regexOp.length.toString(); | ||
this.regexOp.push(regexOp); | ||
}; | ||
InputBarcodeStep.prototype.addRegexOperations = function (regexOps) { | ||
var _this = this; | ||
regexOps.forEach(function (regexOp) { | ||
_this.addRegexOperation(regexOp); | ||
} | ||
addRegexOperations(regexOps) { | ||
regexOps.forEach(regexOp => { | ||
this.addRegexOperation(regexOp); | ||
}); | ||
}; | ||
return InputBarcodeStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
} | ||
exports.default = InputBarcodeStep; | ||
@@ -78,3 +60,3 @@ var InputBarcodeRegexType; | ||
})(ComparingConditionOperator || (ComparingConditionOperator = {})); | ||
var InputBarcodeOperators = [ | ||
const InputBarcodeOperators = [ | ||
ComparingConditionOperator.EQUAL, | ||
@@ -87,4 +69,4 @@ ComparingConditionOperator.CONTAINS, | ||
]; | ||
var InputBarcodeRegex = /** @class */ (function () { | ||
function InputBarcodeRegex(value, operator) { | ||
class InputBarcodeRegex { | ||
constructor(value, operator) { | ||
this.value = value; | ||
@@ -94,71 +76,55 @@ this.type = InputBarcodeRegexType.INCLUDE; | ||
} | ||
return InputBarcodeRegex; | ||
}()); | ||
var Equals = /** @class */ (function (_super) { | ||
__extends(Equals, _super); | ||
function Equals(value) { | ||
return _super.call(this, value, ComparingConditionOperator.EQUAL) || this; | ||
} | ||
class Equals extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.EQUAL); | ||
} | ||
return Equals; | ||
}(InputBarcodeRegex)); | ||
var Contains = /** @class */ (function (_super) { | ||
__extends(Contains, _super); | ||
function Contains(value) { | ||
return _super.call(this, value, ComparingConditionOperator.CONTAINS) || this; | ||
} | ||
class Contains extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.CONTAINS); | ||
} | ||
return Contains; | ||
}(InputBarcodeRegex)); | ||
var Begins = /** @class */ (function (_super) { | ||
__extends(Begins, _super); | ||
function Begins(value) { | ||
return _super.call(this, value, ComparingConditionOperator.BEGINS) || this; | ||
} | ||
class Begins extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.BEGINS); | ||
} | ||
return Begins; | ||
}(InputBarcodeRegex)); | ||
var Ends = /** @class */ (function (_super) { | ||
__extends(Ends, _super); | ||
function Ends(value) { | ||
return _super.call(this, value, ComparingConditionOperator.ENDS) || this; | ||
} | ||
class Ends extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.ENDS); | ||
} | ||
return Ends; | ||
}(InputBarcodeRegex)); | ||
var EqualsVar = /** @class */ (function (_super) { | ||
__extends(EqualsVar, _super); | ||
function EqualsVar(value) { | ||
return _super.call(this, value, ComparingConditionOperator.EQUALS_VAR) || this; | ||
} | ||
class EqualsVar extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.EQUALS_VAR); | ||
} | ||
return EqualsVar; | ||
}(InputBarcodeRegex)); | ||
var Regex = /** @class */ (function (_super) { | ||
__extends(Regex, _super); | ||
function Regex(value) { | ||
return _super.call(this, value, ComparingConditionOperator.REGEX) || this; | ||
} | ||
class Regex extends InputBarcodeRegex { | ||
constructor(value) { | ||
super(value, ComparingConditionOperator.REGEX); | ||
} | ||
return Regex; | ||
}(InputBarcodeRegex)); | ||
} | ||
exports.Regex = Regex; | ||
var RegexOperation = /** @class */ (function () { | ||
function RegexOperation() { | ||
class RegexOperation { | ||
Equals(value) { | ||
return new Equals(value); | ||
} | ||
RegexOperation.prototype.Equals = function (value) { | ||
return new Equals(value); | ||
}; | ||
RegexOperation.prototype.Contains = function (value) { | ||
Contains(value) { | ||
return new Contains(value); | ||
}; | ||
RegexOperation.prototype.Begins = function (value) { | ||
} | ||
Begins(value) { | ||
return new Begins(value); | ||
}; | ||
RegexOperation.prototype.Ends = function (value) { | ||
} | ||
Ends(value) { | ||
return new Ends(value); | ||
}; | ||
RegexOperation.prototype.EqualsVar = function (value) { | ||
} | ||
EqualsVar(value) { | ||
return new EqualsVar(value); | ||
}; | ||
RegexOperation.prototype.Regex = function (value) { | ||
} | ||
Regex(value) { | ||
return new Regex(value); | ||
}; | ||
return RegexOperation; | ||
}()); | ||
} | ||
} | ||
exports.RegexOperation = RegexOperation; | ||
//# sourceMappingURL=InputBarcodeStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputButtonListOption = exports.InputButtonListStep = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var InputListOption_1 = require("./utils/InputListOption"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputButtonListStep = /** @class */ (function (_super) { | ||
__extends(InputButtonListStep, _super); | ||
function InputButtonListStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const InputListOption_1 = require("./utils/InputListOption"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputButtonListStep extends StepBase_1.InputListBaseStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_BUTTON_LIST, | ||
@@ -30,14 +16,13 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.showPhoto = false; | ||
_this.imageMediaIdIsVar = false; | ||
_this.autoContinue = false; | ||
return _this; | ||
}); | ||
this.showPhoto = false; | ||
this.imageMediaIdIsVar = false; | ||
this.autoContinue = false; | ||
} | ||
InputButtonListStep.prototype.displayPhoto = function (imageMediaId) { | ||
displayPhoto(imageMediaId) { | ||
this.showPhoto = true; | ||
this.imageMediaIdIsVar = true; | ||
this.imageMediaId = imageMediaId; | ||
}; | ||
InputButtonListStep.prototype.addOption = function (option) { | ||
} | ||
addOption(option) { | ||
if (this.source !== steps_1.ListOptionsSource.OPTIONS) { | ||
@@ -51,25 +36,22 @@ throw new Error('Values may be added to options only if source is set to "LIST_OPTIONS_SOURCE.OPTIONS".'); | ||
this.options.push(option); | ||
}; | ||
InputButtonListStep.prototype.addOptions = function (options) { | ||
var _this = this; | ||
options.forEach(function (option) { | ||
_this.addOption(option); | ||
} | ||
addOptions(options) { | ||
options.forEach(option => { | ||
this.addOption(option); | ||
}); | ||
}; | ||
InputButtonListStep.prototype.setAutoContinue = function (autoContinue) { | ||
} | ||
setAutoContinue(autoContinue) { | ||
this.autoContinue = autoContinue; | ||
}; | ||
InputButtonListStep.prototype.setLoadOptionsFromUrl = function (functionId) { | ||
} | ||
setLoadOptionsFromUrl(functionId) { | ||
if (this.source !== steps_1.ListOptionsSource.CONNECTOR) { | ||
throw new Error('URL may be set only if source is "LIST_OPTIONS_SOURCE.CONNECTOR".'); | ||
} | ||
this.loadOptionsFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
return InputButtonListStep; | ||
}(StepBase_1.InputListBaseStep)); | ||
this.loadOptionsFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
} | ||
exports.InputButtonListStep = InputButtonListStep; | ||
var InputButtonListOption = /** @class */ (function (_super) { | ||
__extends(InputButtonListOption, _super); | ||
function InputButtonListOption(props) { | ||
return _super.call(this, { | ||
class InputButtonListOption extends InputListOption_1.InputListOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -79,7 +61,6 @@ action: props.action, | ||
custom: props.custom, | ||
}) || this; | ||
}); | ||
} | ||
return InputButtonListOption; | ||
}(InputListOption_1.InputListOption)); | ||
} | ||
exports.InputButtonListOption = InputButtonListOption; | ||
//# sourceMappingURL=InputButtonListStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputCheckboxListOption = exports.InputCheckboxListStep = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var InputListOption_1 = require("./utils/InputListOption"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputCheckboxListStep = /** @class */ (function (_super) { | ||
__extends(InputCheckboxListStep, _super); | ||
function InputCheckboxListStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const InputListOption_1 = require("./utils/InputListOption"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputCheckboxListStep extends StepBase_1.InputListBaseStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_CHECKBOX_LIST, | ||
@@ -30,8 +16,7 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.selectAll = false; | ||
_this.minSelect = 0; | ||
return _this; | ||
}); | ||
this.selectAll = false; | ||
this.minSelect = 0; | ||
} | ||
InputCheckboxListStep.prototype.addOption = function (option) { | ||
addOption(option) { | ||
if (this.source !== steps_1.ListOptionsSource.OPTIONS) { | ||
@@ -48,14 +33,13 @@ throw new Error('Values may be added to options only if source is set to "LIST_OPTIONS_SOURCE.OPTIONS".'); | ||
this.options.push(option); | ||
}; | ||
InputCheckboxListStep.prototype.addOptions = function (options) { | ||
var _this = this; | ||
options.forEach(function (option) { | ||
_this.addOption(option); | ||
} | ||
addOptions(options) { | ||
options.forEach(option => { | ||
this.addOption(option); | ||
}); | ||
}; | ||
InputCheckboxListStep.prototype.setSelectAll = function (selectAll) { | ||
} | ||
setSelectAll(selectAll) { | ||
this.selectAll = selectAll; | ||
this.minSelect = 0; | ||
}; | ||
InputCheckboxListStep.prototype.setMinSelect = function (minSelect) { | ||
} | ||
setMinSelect(minSelect) { | ||
if (this.selectAll) { | ||
@@ -65,16 +49,14 @@ throw new Error('Cannot set minimum selection when selectAll is enabled.'); | ||
this.minSelect = minSelect; | ||
}; | ||
InputCheckboxListStep.prototype.setLoadOptionsFromUrl = function (functionId) { | ||
} | ||
setLoadOptionsFromUrl(functionId) { | ||
if (this.source !== steps_1.ListOptionsSource.CONNECTOR) { | ||
throw new Error('URL may be set only if source is "LIST_OPTIONS_SOURCE.CONNECTOR".'); | ||
} | ||
this.loadOptionsFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
return InputCheckboxListStep; | ||
}(StepBase_1.InputListBaseStep)); | ||
this.loadOptionsFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
} | ||
exports.InputCheckboxListStep = InputCheckboxListStep; | ||
var InputCheckboxListOption = /** @class */ (function (_super) { | ||
__extends(InputCheckboxListOption, _super); | ||
function InputCheckboxListOption(props) { | ||
var _this = _super.call(this, { | ||
class InputCheckboxListOption extends InputListOption_1.InputListBaseOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -84,9 +66,7 @@ action: null, | ||
custom: props.custom, | ||
}) || this; | ||
_this.isChecked = props.isChecked; | ||
return _this; | ||
}); | ||
this.isChecked = props.isChecked; | ||
} | ||
return InputCheckboxListOption; | ||
}(InputListOption_1.InputListBaseOption)); | ||
} | ||
exports.InputCheckboxListOption = InputCheckboxListOption; | ||
//# sourceMappingURL=InputCheckboxListStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputIndexListOption = exports.InputIndexListStep = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var InputListOption_1 = require("./utils/InputListOption"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputIndexListStep = /** @class */ (function (_super) { | ||
__extends(InputIndexListStep, _super); | ||
function InputIndexListStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const InputListOption_1 = require("./utils/InputListOption"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputIndexListStep extends StepBase_1.InputListBaseStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_INDEX_LIST, | ||
@@ -30,7 +16,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.autoContinue = false; | ||
return _this; | ||
}); | ||
this.autoContinue = false; | ||
} | ||
InputIndexListStep.prototype.addOption = function (option) { | ||
addOption(option) { | ||
if (this.source !== steps_1.ListOptionsSource.OPTIONS) { | ||
@@ -47,25 +32,22 @@ throw new Error('Values may be added to options only if source is set to "LIST_OPTIONS_SOURCE.OPTIONS".'); | ||
this.options.push(option); | ||
}; | ||
InputIndexListStep.prototype.addOptions = function (options) { | ||
var _this = this; | ||
options.forEach(function (option) { | ||
_this.addOption(option); | ||
} | ||
addOptions(options) { | ||
options.forEach(option => { | ||
this.addOption(option); | ||
}); | ||
}; | ||
InputIndexListStep.prototype.setAutoContinue = function (autoContinue) { | ||
} | ||
setAutoContinue(autoContinue) { | ||
this.autoContinue = autoContinue; | ||
}; | ||
InputIndexListStep.prototype.setLoadOptionsFromUrl = function (functionId) { | ||
} | ||
setLoadOptionsFromUrl(functionId) { | ||
if (this.source !== steps_1.ListOptionsSource.CONNECTOR) { | ||
throw new Error('URL may be set only if source is "LIST_OPTIONS_SOURCE.CONNECTOR".'); | ||
} | ||
this.loadOptionsFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
return InputIndexListStep; | ||
}(StepBase_1.InputListBaseStep)); | ||
this.loadOptionsFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
} | ||
exports.InputIndexListStep = InputIndexListStep; | ||
var InputIndexListOption = /** @class */ (function (_super) { | ||
__extends(InputIndexListOption, _super); | ||
function InputIndexListOption(props) { | ||
var _this = _super.call(this, { | ||
class InputIndexListOption extends InputListOption_1.InputListOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -75,9 +57,7 @@ action: null, | ||
custom: props.custom, | ||
}) || this; | ||
_this.isHeadline = props.isHeadline; | ||
return _this; | ||
}); | ||
this.isHeadline = props.isHeadline; | ||
} | ||
return InputIndexListOption; | ||
}(InputListOption_1.InputListOption)); | ||
} | ||
exports.InputIndexListOption = InputIndexListOption; | ||
//# sourceMappingURL=InputIndexListStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputLocationStep = /** @class */ (function (_super) { | ||
__extends(InputLocationStep, _super); | ||
function InputLocationStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputLocationStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_LOCATION, | ||
@@ -26,10 +12,8 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
_this.minAccuracyInMeters = props.minAccuracyInMeters; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
this.minAccuracyInMeters = props.minAccuracyInMeters; | ||
} | ||
return InputLocationStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
exports.default = InputLocationStep; | ||
//# sourceMappingURL=InputLocationStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputNoiseLevelStep = /** @class */ (function (_super) { | ||
__extends(InputNoiseLevelStep, _super); | ||
function InputNoiseLevelStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputNoiseLevelStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_NOISE_LEVEL, | ||
@@ -26,25 +12,23 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.measureDurationInSec = props.measureDurationInSec; | ||
_this.autoContinue = false; | ||
_this.autoStartMeasurement = true; | ||
_this.inputRequired = true; | ||
_this.warningThresholdInDecibel = 0; | ||
return _this; | ||
}); | ||
this.measureDurationInSec = props.measureDurationInSec; | ||
this.autoContinue = false; | ||
this.autoStartMeasurement = true; | ||
this.inputRequired = true; | ||
this.warningThresholdInDecibel = 0; | ||
} | ||
InputNoiseLevelStep.prototype.setAutoContinue = function (autoContinue) { | ||
setAutoContinue(autoContinue) { | ||
this.autoContinue = autoContinue; | ||
}; | ||
InputNoiseLevelStep.prototype.setAutoStartMeasurement = function (autoStart) { | ||
} | ||
setAutoStartMeasurement(autoStart) { | ||
this.autoStartMeasurement = autoStart; | ||
}; | ||
InputNoiseLevelStep.prototype.setInputRequired = function (requireExecution) { | ||
} | ||
setInputRequired(requireExecution) { | ||
this.inputRequired = requireExecution; | ||
}; | ||
InputNoiseLevelStep.prototype.setWarningThresholdInDecibel = function (warningThresholdInDecibel) { | ||
} | ||
setWarningThresholdInDecibel(warningThresholdInDecibel) { | ||
this.warningThresholdInDecibel = warningThresholdInDecibel; | ||
}; | ||
return InputNoiseLevelStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
} | ||
exports.default = InputNoiseLevelStep; | ||
//# sourceMappingURL=InputNoiseLevelStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputNumberPickerStep = /** @class */ (function (_super) { | ||
__extends(InputNumberPickerStep, _super); | ||
function InputNumberPickerStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputNumberPickerStep extends StepBase_1.InputNumberBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_NUMBER_PICKER, | ||
@@ -28,9 +14,7 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
} | ||
return InputNumberPickerStep; | ||
}(StepBase_1.InputNumberBase)); | ||
} | ||
exports.default = InputNumberPickerStep; | ||
//# sourceMappingURL=InputNumberPickerStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputNumberStep = /** @class */ (function (_super) { | ||
__extends(InputNumberStep, _super); | ||
function InputNumberStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputNumberStep extends StepBase_1.InputNumberBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_NUMBER, | ||
@@ -28,7 +14,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InputNumberStep; | ||
}(StepBase_1.InputNumberBase)); | ||
} | ||
exports.default = InputNumberStep; | ||
//# sourceMappingURL=InputNumberStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputPhotoStep = /** @class */ (function (_super) { | ||
__extends(InputPhotoStep, _super); | ||
function InputPhotoStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputPhotoStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_PHOTO, | ||
@@ -26,7 +12,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InputPhotoStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
exports.default = InputPhotoStep; | ||
//# sourceMappingURL=InputPhotoStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputTextStep = /** @class */ (function (_super) { | ||
__extends(InputTextStep, _super); | ||
function InputTextStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputTextStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_TEXT, | ||
@@ -26,9 +12,7 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.description = props.description; | ||
return _this; | ||
}); | ||
this.description = props.description; | ||
} | ||
return InputTextStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
exports.default = InputTextStep; | ||
//# sourceMappingURL=InputTextStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputTileListOption = exports.InputTileListStep = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var InputListOption_1 = require("./utils/InputListOption"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputTileListStep = /** @class */ (function (_super) { | ||
__extends(InputTileListStep, _super); | ||
function InputTileListStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const InputListOption_1 = require("./utils/InputListOption"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputTileListStep extends StepBase_1.InputListBaseStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_TILE_LIST, | ||
@@ -30,7 +16,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.customNextStep = false; | ||
return _this; | ||
}); | ||
this.customNextStep = false; | ||
} | ||
InputTileListStep.prototype.addOption = function (option) { | ||
addOption(option) { | ||
if (this.source !== steps_1.ListOptionsSource.OPTIONS) { | ||
@@ -47,25 +32,22 @@ throw new Error('Values may be added to options only if source is set to "LIST_OPTIONS_SOURCE.OPTIONS".'); | ||
this.options.push(option); | ||
}; | ||
InputTileListStep.prototype.addOptions = function (options) { | ||
var _this = this; | ||
options.forEach(function (option) { | ||
_this.addOption(option); | ||
} | ||
addOptions(options) { | ||
options.forEach(option => { | ||
this.addOption(option); | ||
}); | ||
}; | ||
InputTileListStep.prototype.setCustomNextStep = function (customNextStep) { | ||
} | ||
setCustomNextStep(customNextStep) { | ||
this.customNextStep = customNextStep; | ||
}; | ||
InputTileListStep.prototype.setLoadOptionsFromUrl = function (functionId) { | ||
} | ||
setLoadOptionsFromUrl(functionId) { | ||
if (this.source !== steps_1.ListOptionsSource.CONNECTOR) { | ||
throw new Error('URL may be set only if source is "LIST_OPTIONS_SOURCE.CONNECTOR".'); | ||
} | ||
this.loadOptionsFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
return InputTileListStep; | ||
}(StepBase_1.InputListBaseStep)); | ||
this.loadOptionsFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
} | ||
exports.InputTileListStep = InputTileListStep; | ||
var InputTileListOption = /** @class */ (function (_super) { | ||
__extends(InputTileListOption, _super); | ||
function InputTileListOption(props) { | ||
return _super.call(this, { | ||
class InputTileListOption extends InputListOption_1.InputListBaseOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -75,7 +57,6 @@ action: props.action, | ||
custom: props.custom, | ||
}) || this; | ||
}); | ||
} | ||
return InputTileListOption; | ||
}(InputListOption_1.InputListBaseOption)); | ||
} | ||
exports.InputTileListOption = InputTileListOption; | ||
//# sourceMappingURL=InputTileListStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputValueListOption = exports.InputValueListStep = void 0; | ||
var steps_1 = require("../../types/steps"); | ||
var createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
var InputListOption_1 = require("./utils/InputListOption"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputValueListStep = /** @class */ (function (_super) { | ||
__extends(InputValueListStep, _super); | ||
function InputValueListStep(props) { | ||
var _this = _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const createFunctionUrl_1 = require("../../utils/createFunctionUrl"); | ||
const InputListOption_1 = require("./utils/InputListOption"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputValueListStep extends StepBase_1.InputListBaseStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_VALUE_LIST, | ||
@@ -30,8 +16,7 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.customNextStep = false; | ||
_this.autoContinue = false; | ||
return _this; | ||
}); | ||
this.customNextStep = false; | ||
this.autoContinue = false; | ||
} | ||
InputValueListStep.prototype.addOption = function (option) { | ||
addOption(option) { | ||
if (this.source !== steps_1.ListOptionsSource.OPTIONS) { | ||
@@ -48,28 +33,25 @@ throw new Error('Values may be added to options only if source is set to "LIST_OPTIONS_SOURCE.OPTIONS".'); | ||
this.options.push(option); | ||
}; | ||
InputValueListStep.prototype.addOptions = function (options) { | ||
var _this = this; | ||
options.forEach(function (option) { | ||
_this.addOption(option); | ||
} | ||
addOptions(options) { | ||
options.forEach(option => { | ||
this.addOption(option); | ||
}); | ||
}; | ||
InputValueListStep.prototype.setAutoContinue = function (autoContinue) { | ||
} | ||
setAutoContinue(autoContinue) { | ||
this.autoContinue = autoContinue; | ||
}; | ||
InputValueListStep.prototype.setCustomNextStep = function (customNextStep) { | ||
} | ||
setCustomNextStep(customNextStep) { | ||
this.customNextStep = customNextStep; | ||
}; | ||
InputValueListStep.prototype.setLoadOptionsFromUrl = function (functionId) { | ||
} | ||
setLoadOptionsFromUrl(functionId) { | ||
if (this.source !== steps_1.ListOptionsSource.CONNECTOR) { | ||
throw new Error('URL may be set only if source is "LIST_OPTIONS_SOURCE.CONNECTOR".'); | ||
} | ||
this.loadOptionsFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
return InputValueListStep; | ||
}(StepBase_1.InputListBaseStep)); | ||
this.loadOptionsFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
} | ||
exports.InputValueListStep = InputValueListStep; | ||
var InputValueListOption = /** @class */ (function (_super) { | ||
__extends(InputValueListOption, _super); | ||
function InputValueListOption(props) { | ||
return _super.call(this, { | ||
class InputValueListOption extends InputListOption_1.InputListBaseOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -79,7 +61,6 @@ action: props.action, | ||
custom: props.custom, | ||
}) || this; | ||
}); | ||
} | ||
return InputValueListOption; | ||
}(InputListOption_1.InputListBaseOption)); | ||
} | ||
exports.InputValueListOption = InputValueListOption; | ||
//# sourceMappingURL=InputValueListStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var InputVideoStep = /** @class */ (function (_super) { | ||
__extends(InputVideoStep, _super); | ||
function InputVideoStep(props) { | ||
return _super.call(this, { | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class InputVideoStep extends StepBase_1.InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.INPUT_VIDEO, | ||
@@ -26,7 +12,6 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
}); | ||
} | ||
return InputVideoStep; | ||
}(StepBase_1.InputableStep)); | ||
} | ||
exports.default = InputVideoStep; | ||
//# sourceMappingURL=InputVideoStep.js.map |
@@ -26,3 +26,3 @@ import { Step } from '../../types/steps'; | ||
} | ||
export declare type FlexChild = FlexChildStep | FlexGroup; | ||
export type FlexChild = FlexChildStep | FlexGroup; | ||
declare enum FlexChildType { | ||
@@ -29,0 +29,0 @@ STEP = "step", |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlexGroup = exports.FlexChildStep = exports.FlexDirection = void 0; | ||
/* eslint-disable no-param-reassign */ | ||
var steps_1 = require("../../types/steps"); | ||
var StepBase_1 = require("./utils/StepBase"); | ||
var FlexDirection = /** @class */ (function () { | ||
function FlexDirection() { | ||
} | ||
FlexDirection.ROW = 'row'; | ||
FlexDirection.COLUMN = 'column'; | ||
return FlexDirection; | ||
}()); | ||
const steps_1 = require("../../types/steps"); | ||
const StepBase_1 = require("./utils/StepBase"); | ||
class FlexDirection { | ||
} | ||
exports.FlexDirection = FlexDirection; | ||
var LayoutFlexStep = /** @class */ (function (_super) { | ||
__extends(LayoutFlexStep, _super); | ||
function LayoutFlexStep(props) { | ||
var _this = _super.call(this, { | ||
FlexDirection.ROW = 'row'; | ||
FlexDirection.COLUMN = 'column'; | ||
class LayoutFlexStep extends StepBase_1.StepBase { | ||
constructor(props) { | ||
super({ | ||
type: steps_1.WorkinstructionStepType.LAYOUT_FLEX, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.direction = props.direction; | ||
_this.children = []; | ||
return _this; | ||
}); | ||
this.direction = props.direction; | ||
this.children = []; | ||
} | ||
LayoutFlexStep.prototype.addStep = function (props) { | ||
addStep(props) { | ||
if (!props.step.showAsBox && !props.step.hideTitleBar) { | ||
@@ -45,5 +27,5 @@ props.step.hideTitleBar = true; | ||
this.children.push(new FlexChildStep(props)); | ||
}; | ||
LayoutFlexStep.prototype.addRow = function (props) { | ||
var group = new FlexGroup({ | ||
} | ||
addRow(props) { | ||
const group = new FlexGroup({ | ||
direction: FlexDirection.ROW, | ||
@@ -54,5 +36,5 @@ flex: props.flex, | ||
return group; | ||
}; | ||
LayoutFlexStep.prototype.addColumn = function (props) { | ||
var group = new FlexGroup({ | ||
} | ||
addColumn(props) { | ||
const group = new FlexGroup({ | ||
direction: FlexDirection.COLUMN, | ||
@@ -63,5 +45,4 @@ flex: props.flex, | ||
return group; | ||
}; | ||
return LayoutFlexStep; | ||
}(StepBase_1.StepBase)); | ||
} | ||
} | ||
exports.default = LayoutFlexStep; | ||
@@ -73,28 +54,22 @@ var FlexChildType; | ||
})(FlexChildType || (FlexChildType = {})); | ||
var FlexChildBase = /** @class */ (function () { | ||
function FlexChildBase(props) { | ||
class FlexChildBase { | ||
constructor(props) { | ||
this.flex = props.flex; | ||
this.type = props.type; | ||
} | ||
return FlexChildBase; | ||
}()); | ||
var FlexChildStep = /** @class */ (function (_super) { | ||
__extends(FlexChildStep, _super); | ||
function FlexChildStep(props) { | ||
var _this = _super.call(this, { type: FlexChildType.STEP, flex: props.flex }) || this; | ||
_this.step = props.step; | ||
return _this; | ||
} | ||
class FlexChildStep extends FlexChildBase { | ||
constructor(props) { | ||
super({ type: FlexChildType.STEP, flex: props.flex }); | ||
this.step = props.step; | ||
} | ||
return FlexChildStep; | ||
}(FlexChildBase)); | ||
} | ||
exports.FlexChildStep = FlexChildStep; | ||
var FlexGroup = /** @class */ (function (_super) { | ||
__extends(FlexGroup, _super); | ||
function FlexGroup(props) { | ||
var _this = _super.call(this, { type: FlexChildType.FLEX, flex: props.flex }) || this; | ||
_this.direction = props.direction; | ||
_this.children = []; | ||
return _this; | ||
class FlexGroup extends FlexChildBase { | ||
constructor(props) { | ||
super({ type: FlexChildType.FLEX, flex: props.flex }); | ||
this.direction = props.direction; | ||
this.children = []; | ||
} | ||
FlexGroup.prototype.addStep = function (props) { | ||
addStep(props) { | ||
if (!props.step.showAsBox && !props.step.hideTitleBar) { | ||
@@ -104,5 +79,5 @@ props.step.hideTitleBar = true; | ||
this.children.push(new FlexChildStep(props)); | ||
}; | ||
FlexGroup.prototype.addRow = function (props) { | ||
var group = new FlexGroup({ | ||
} | ||
addRow(props) { | ||
const group = new FlexGroup({ | ||
direction: FlexDirection.ROW, | ||
@@ -113,5 +88,5 @@ flex: props.flex, | ||
return group; | ||
}; | ||
FlexGroup.prototype.addColumn = function (props) { | ||
var group = new FlexGroup({ | ||
} | ||
addColumn(props) { | ||
const group = new FlexGroup({ | ||
direction: FlexDirection.COLUMN, | ||
@@ -122,6 +97,5 @@ flex: props.flex, | ||
return group; | ||
}; | ||
return FlexGroup; | ||
}(FlexChildBase)); | ||
} | ||
} | ||
exports.FlexGroup = FlexGroup; | ||
//# sourceMappingURL=LayoutFlexStep.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputListOption = exports.InputListBaseOption = void 0; | ||
var WorkerbaseIcon_1 = require("../../WorkerbaseIcon"); | ||
var InputListBaseOption = /** @class */ (function () { | ||
function InputListBaseOption(props) { | ||
var _this = this; | ||
const WorkerbaseIcon_1 = require("../../WorkerbaseIcon"); | ||
class InputListBaseOption { | ||
constructor(props) { | ||
this.text = props.text; | ||
@@ -25,15 +11,12 @@ this.action = props.action; | ||
if (props.custom) { | ||
Object.entries(props.custom).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
_this[key] = value; | ||
Object.entries(props.custom).forEach(([key, value]) => { | ||
this[key] = value; | ||
}); | ||
} | ||
} | ||
return InputListBaseOption; | ||
}()); | ||
} | ||
exports.InputListBaseOption = InputListBaseOption; | ||
var InputListOption = /** @class */ (function (_super) { | ||
__extends(InputListOption, _super); | ||
function InputListOption(props) { | ||
var _this = _super.call(this, { | ||
class InputListOption extends InputListBaseOption { | ||
constructor(props) { | ||
super({ | ||
text: props.text, | ||
@@ -43,20 +26,18 @@ action: props.action, | ||
custom: props.custom, | ||
}) || this; | ||
_this.regex = props.regex; | ||
_this.icon = props.icon || WorkerbaseIcon_1.StepOptionIcons.SUPPORT; | ||
_this.title = props.title || props.text; | ||
return _this; | ||
}); | ||
this.regex = props.regex; | ||
this.icon = props.icon || WorkerbaseIcon_1.StepOptionIcons.SUPPORT; | ||
this.title = props.title || props.text; | ||
} | ||
InputListOption.prototype.setTitle = function (title) { | ||
setTitle(title) { | ||
this.title = title; | ||
}; | ||
InputListOption.prototype.setIcon = function (icon) { | ||
} | ||
setIcon(icon) { | ||
this.icon = icon; | ||
}; | ||
InputListOption.prototype.setRegex = function (regex) { | ||
} | ||
setRegex(regex) { | ||
this.regex = regex; | ||
}; | ||
return InputListOption; | ||
}(InputListBaseOption)); | ||
} | ||
} | ||
exports.InputListOption = InputListOption; | ||
//# sourceMappingURL=InputListOption.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputListOptionSelection = void 0; | ||
var InputButtonListStep_1 = require("../InputButtonListStep"); | ||
var InputCheckboxListStep_1 = require("../InputCheckboxListStep"); | ||
var InputIndexListStep_1 = require("../InputIndexListStep"); | ||
var InputTileListStep_1 = require("../InputTileListStep"); | ||
var InputListOptionSelection = /** @class */ (function () { | ||
function InputListOptionSelection() { | ||
} | ||
InputListOptionSelection.prototype.IndexListOption = function (props) { | ||
const InputButtonListStep_1 = require("../InputButtonListStep"); | ||
const InputCheckboxListStep_1 = require("../InputCheckboxListStep"); | ||
const InputIndexListStep_1 = require("../InputIndexListStep"); | ||
const InputTileListStep_1 = require("../InputTileListStep"); | ||
class InputListOptionSelection { | ||
IndexListOption(props) { | ||
return new InputIndexListStep_1.InputIndexListOption({ | ||
@@ -18,4 +16,4 @@ text: props.text, | ||
}); | ||
}; | ||
InputListOptionSelection.prototype.TileListOption = function (props) { | ||
} | ||
TileListOption(props) { | ||
return new InputTileListStep_1.InputTileListOption({ | ||
@@ -27,4 +25,4 @@ text: props.text, | ||
}); | ||
}; | ||
InputListOptionSelection.prototype.ValueListOption = function (props) { | ||
} | ||
ValueListOption(props) { | ||
return new InputTileListStep_1.InputTileListOption({ | ||
@@ -36,12 +34,11 @@ text: props.text, | ||
}); | ||
}; | ||
InputListOptionSelection.prototype.CheckboxListOption = function (props) { | ||
} | ||
CheckboxListOption(props) { | ||
return new InputCheckboxListStep_1.InputCheckboxListOption(props); | ||
}; | ||
InputListOptionSelection.prototype.ButtonListOption = function (props) { | ||
} | ||
ButtonListOption(props) { | ||
return new InputButtonListStep_1.InputButtonListOption(props); | ||
}; | ||
return InputListOptionSelection; | ||
}()); | ||
} | ||
} | ||
exports.InputListOptionSelection = InputListOptionSelection; | ||
//# sourceMappingURL=InputListOptionSelection.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputListBaseStep = exports.InputNumberBase = exports.InfoMediaStepBase = exports.InputableStep = exports.StepBase = void 0; | ||
var steps_1 = require("../../../types/steps"); | ||
var createFunctionUrl_1 = require("../../../utils/createFunctionUrl"); | ||
var generateId_1 = require("../../../utils/generateId"); | ||
var StepBase = /** @class */ (function () { | ||
function StepBase(props) { | ||
var _a; | ||
this.id = (_a = props.id) !== null && _a !== void 0 ? _a : generateId_1.generateId(); | ||
const steps_1 = require("../../../types/steps"); | ||
const createFunctionUrl_1 = require("../../../utils/createFunctionUrl"); | ||
const generateId_1 = require("../../../utils/generateId"); | ||
class StepBase { | ||
constructor(props) { | ||
this.id = props.id ?? (0, generateId_1.generateId)(); | ||
this.type = props.type; | ||
@@ -41,21 +16,20 @@ this.title = props.title; | ||
} | ||
StepBase.prototype.addButton = function (button) { | ||
addButton(button) { | ||
// eslint-disable-next-line no-param-reassign | ||
button.index = this.buttons.length; | ||
this.buttons.push(button); | ||
}; | ||
StepBase.prototype.addButtons = function (buttons) { | ||
var _this = this; | ||
buttons.forEach(function (button) { | ||
_this.addButton(button); | ||
} | ||
addButtons(buttons) { | ||
buttons.forEach(button => { | ||
this.addButton(button); | ||
}); | ||
}; | ||
StepBase.prototype.setMaxTime = function (maxTime) { | ||
} | ||
setMaxTime(maxTime) { | ||
this.maxTime = maxTime; | ||
}; | ||
StepBase.prototype.setLoadVariablesFromUrl = function (functionId) { | ||
this.loadVariablesFromUrl = createFunctionUrl_1.createFunctionUrl(functionId); | ||
}; | ||
StepBase.prototype.setStyles = function () { | ||
var boxStyles = { | ||
} | ||
setLoadVariablesFromUrl(functionId) { | ||
this.loadVariablesFromUrl = (0, createFunctionUrl_1.createFunctionUrl)(functionId); | ||
} | ||
setStyles() { | ||
const boxStyles = { | ||
backgroundColor: '#2d3b48', | ||
@@ -67,45 +41,37 @@ title: { | ||
}; | ||
this.styles = __assign(__assign({}, boxStyles), this.styles); | ||
}; | ||
StepBase.prototype.enableShowAsBox = function (props) { | ||
this.styles = { ...boxStyles, ...this.styles }; | ||
} | ||
enableShowAsBox(props) { | ||
this.showAsBox = true; | ||
this.setStyles(); | ||
this.hideTitleBar = (props === null || props === void 0 ? void 0 : props.hideTitleBar) || false; | ||
}; | ||
return StepBase; | ||
}()); | ||
this.hideTitleBar = props?.hideTitleBar || false; | ||
} | ||
} | ||
exports.StepBase = StepBase; | ||
var InputableStep = /** @class */ (function (_super) { | ||
__extends(InputableStep, _super); | ||
function InputableStep(props) { | ||
var _this = _super.call(this, { | ||
class InputableStep extends StepBase { | ||
constructor(props) { | ||
super({ | ||
type: props.type, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.outputVarName = props.outputVarName; | ||
return _this; | ||
}); | ||
this.outputVarName = props.outputVarName; | ||
} | ||
return InputableStep; | ||
}(StepBase)); | ||
} | ||
exports.InputableStep = InputableStep; | ||
var InfoMediaStepBase = /** @class */ (function (_super) { | ||
__extends(InfoMediaStepBase, _super); | ||
function InfoMediaStepBase(props) { | ||
var _this = _super.call(this, { | ||
class InfoMediaStepBase extends StepBase { | ||
constructor(props) { | ||
super({ | ||
type: props.type, | ||
title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.isVar = props.isVar; | ||
_this.mediaId = props.mediaId; | ||
return _this; | ||
}); | ||
this.isVar = props.isVar; | ||
this.mediaId = props.mediaId; | ||
} | ||
return InfoMediaStepBase; | ||
}(StepBase)); | ||
} | ||
exports.InfoMediaStepBase = InfoMediaStepBase; | ||
var InputNumberBase = /** @class */ (function (_super) { | ||
__extends(InputNumberBase, _super); | ||
function InputNumberBase(props) { | ||
var _this = _super.call(this, { | ||
class InputNumberBase extends InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: props.type, | ||
@@ -115,24 +81,21 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.integerDigits = props.integerDigits; | ||
_this.decimalDigits = props.decimalDigits; | ||
_this.defaultValueDecimal = props.defaultValueDecimal; | ||
return _this; | ||
}); | ||
this.integerDigits = props.integerDigits; | ||
this.decimalDigits = props.decimalDigits; | ||
this.defaultValueDecimal = props.defaultValueDecimal; | ||
} | ||
InputNumberBase.prototype.setIntegerDigits = function (integerDigits) { | ||
setIntegerDigits(integerDigits) { | ||
this.integerDigits = integerDigits; | ||
}; | ||
InputNumberBase.prototype.setDecimalDigits = function (decimalDigits) { | ||
} | ||
setDecimalDigits(decimalDigits) { | ||
this.decimalDigits = decimalDigits; | ||
}; | ||
InputNumberBase.prototype.setDefaultValueDecimal = function (defaultValueDecimal) { | ||
} | ||
setDefaultValueDecimal(defaultValueDecimal) { | ||
this.defaultValueDecimal = defaultValueDecimal; | ||
}; | ||
return InputNumberBase; | ||
}(InputableStep)); | ||
} | ||
} | ||
exports.InputNumberBase = InputNumberBase; | ||
var InputListBaseStep = /** @class */ (function (_super) { | ||
__extends(InputListBaseStep, _super); | ||
function InputListBaseStep(props) { | ||
var _this = _super.call(this, { | ||
class InputListBaseStep extends InputableStep { | ||
constructor(props) { | ||
super({ | ||
type: props.type, | ||
@@ -142,22 +105,21 @@ title: props.title, | ||
id: props.id, | ||
}) || this; | ||
_this.source = props.source; | ||
_this.minSelect = 0; | ||
}); | ||
this.source = props.source; | ||
this.minSelect = 0; | ||
if (props.source === steps_1.ListOptionsSource.OPTIONS) { | ||
_this.prepareOptions(); | ||
this.prepareOptions(); | ||
} | ||
else if (props.source === steps_1.ListOptionsSource.CONNECTOR) { | ||
_this.prepareConnector(); | ||
this.prepareConnector(); | ||
} | ||
return _this; | ||
} | ||
InputListBaseStep.prototype.prepareOptions = function () { | ||
prepareOptions() { | ||
this.options = []; | ||
this.loadFromUrl = false; | ||
}; | ||
InputListBaseStep.prototype.prepareConnector = function () { | ||
} | ||
prepareConnector() { | ||
this.loadOptionsFromUrl = ''; | ||
this.loadFromUrl = true; | ||
}; | ||
InputListBaseStep.prototype.setRequireSelection = function (requireSelection) { | ||
} | ||
setRequireSelection(requireSelection) { | ||
if (this.type === steps_1.WorkinstructionStepType.INPUT_CHECKBOX_LIST) { | ||
@@ -167,6 +129,5 @@ throw new Error('Cannot use this method for Checkbox List Step'); | ||
this.minSelect = requireSelection ? 1 : 0; | ||
}; | ||
return InputListBaseStep; | ||
}(InputableStep)); | ||
} | ||
} | ||
exports.InputListBaseStep = InputListBaseStep; | ||
//# sourceMappingURL=StepBase.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -22,27 +9,13 @@ exports.InfoPhotoStyles = exports.StepStyles = exports.ImageStyles = exports.ImageScaleType = void 0; | ||
})(ImageScaleType = exports.ImageScaleType || (exports.ImageScaleType = {})); | ||
var ImageStyles = /** @class */ (function () { | ||
function ImageStyles() { | ||
} | ||
return ImageStyles; | ||
}()); | ||
class ImageStyles { | ||
} | ||
exports.ImageStyles = ImageStyles; | ||
var TextStyles = /** @class */ (function () { | ||
function TextStyles() { | ||
} | ||
return TextStyles; | ||
}()); | ||
var StepStyles = /** @class */ (function () { | ||
function StepStyles() { | ||
} | ||
return StepStyles; | ||
}()); | ||
class TextStyles { | ||
} | ||
class StepStyles { | ||
} | ||
exports.StepStyles = StepStyles; | ||
var InfoPhotoStyles = /** @class */ (function (_super) { | ||
__extends(InfoPhotoStyles, _super); | ||
function InfoPhotoStyles() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
return InfoPhotoStyles; | ||
}(StepStyles)); | ||
class InfoPhotoStyles extends StepStyles { | ||
} | ||
exports.InfoPhotoStyles = InfoPhotoStyles; | ||
//# sourceMappingURL=Styles.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WorkerbaseAction = void 0; | ||
var buttons_1 = require("../types/buttons"); | ||
var CloseAction_1 = require("./actions/CloseAction"); | ||
var FinishAction_1 = require("./actions/FinishAction"); | ||
var NextActionFunctionIdAction_1 = require("./actions/NextActionFunctionIdAction"); | ||
var NextStepFunctionIdAction_1 = require("./actions/NextStepFunctionIdAction"); | ||
var NextStepIdAction_1 = require("./actions/NextStepIdAction"); | ||
var NextTaskIdAction_1 = require("./actions/NextTaskIdAction"); | ||
var NextWorkinstructionAction_1 = require("./actions/NextWorkinstructionAction"); | ||
var SuspendAction_1 = require("./actions/SuspendAction"); | ||
var WorkerbaseAction = /** @class */ (function () { | ||
function WorkerbaseAction() { | ||
const buttons_1 = require("../types/buttons"); | ||
const CloseAction_1 = require("./actions/CloseAction"); | ||
const FinishAction_1 = require("./actions/FinishAction"); | ||
const NextActionFunctionIdAction_1 = require("./actions/NextActionFunctionIdAction"); | ||
const NextStepFunctionIdAction_1 = require("./actions/NextStepFunctionIdAction"); | ||
const NextStepIdAction_1 = require("./actions/NextStepIdAction"); | ||
const NextTaskIdAction_1 = require("./actions/NextTaskIdAction"); | ||
const NextWorkinstructionAction_1 = require("./actions/NextWorkinstructionAction"); | ||
const SuspendAction_1 = require("./actions/SuspendAction"); | ||
class WorkerbaseAction { | ||
Finish() { | ||
return new FinishAction_1.FinishAction(); | ||
} | ||
WorkerbaseAction.prototype.Finish = function () { | ||
return new FinishAction_1.FinishAction(); | ||
}; | ||
WorkerbaseAction.prototype.Close = function () { | ||
Close() { | ||
return new CloseAction_1.CloseAction(); | ||
}; | ||
WorkerbaseAction.prototype.Suspend = function () { | ||
} | ||
Suspend() { | ||
return new SuspendAction_1.SuspendAction(); | ||
}; | ||
WorkerbaseAction.prototype.NextStepFunctionId = function (functionId) { | ||
} | ||
NextStepFunctionId(functionId) { | ||
return new NextStepFunctionIdAction_1.NextStepFunctionIdAction(functionId); | ||
}; | ||
WorkerbaseAction.prototype.NextActionFunctionId = function (functionId) { | ||
} | ||
NextActionFunctionId(functionId) { | ||
return new NextActionFunctionIdAction_1.NextActionFunctionIdAction(functionId); | ||
}; | ||
WorkerbaseAction.prototype.NextWorkinstruction = function (workinstructionsId, props) { | ||
} | ||
NextWorkinstruction(workinstructionsId, props) { | ||
return new NextWorkinstructionAction_1.NextWorkinstructionAction(workinstructionsId, props); | ||
}; | ||
WorkerbaseAction.prototype.NextStepId = function (stepId) { | ||
} | ||
NextStepId(stepId) { | ||
return new NextStepIdAction_1.NextStepIdAction(stepId); | ||
}; | ||
WorkerbaseAction.prototype.NextTaskId = function (taskId, props) { | ||
} | ||
NextTaskId(taskId, props) { | ||
return new NextTaskIdAction_1.NextTaskIdAction(taskId, props); | ||
}; | ||
WorkerbaseAction.prototype.Back = function (stepId) { | ||
} | ||
Back(stepId) { | ||
return new NextStepIdAction_1.NextStepIdAction(stepId, buttons_1.NavigationBehaviour.PREVIOUS_STEP); | ||
}; | ||
WorkerbaseAction.prototype.Continue = function (stepId) { | ||
} | ||
Continue(stepId) { | ||
return new NextStepIdAction_1.NextStepIdAction(stepId, buttons_1.NavigationBehaviour.NEXT_STEP); | ||
}; | ||
return WorkerbaseAction; | ||
}()); | ||
} | ||
} | ||
exports.WorkerbaseAction = WorkerbaseAction; | ||
//# sourceMappingURL=WorkerbaseAction.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WorkerbaseButton = void 0; | ||
var action_1 = require("../types/action"); | ||
var buttons_1 = require("../types/buttons"); | ||
var generateId_1 = require("../utils/generateId"); | ||
var WorkerbaseIcon_1 = require("./WorkerbaseIcon"); | ||
var NextStepIdAction_1 = require("./actions/NextStepIdAction"); | ||
var WorkerbaseButton = /** @class */ (function () { | ||
function WorkerbaseButton(props) { | ||
const action_1 = require("../types/action"); | ||
const buttons_1 = require("../types/buttons"); | ||
const generateId_1 = require("../utils/generateId"); | ||
const WorkerbaseIcon_1 = require("./WorkerbaseIcon"); | ||
const NextStepIdAction_1 = require("./actions/NextStepIdAction"); | ||
class WorkerbaseButton { | ||
constructor(props) { | ||
this.setButtonProperties(props); | ||
this.action = props.action; | ||
this.styles = { backgroundColor: '#287AF5', textColor: '#DEEDFF' }; | ||
this.id = props.id || generateId_1.generateId(); | ||
this.id = props.id || (0, generateId_1.generateId)(); | ||
this.index = 0; | ||
} | ||
WorkerbaseButton.prototype.setButtonProperties = function (props) { | ||
setButtonProperties(props) { | ||
if (props.action.type === action_1.StepActionType.CLOSE) { | ||
@@ -57,12 +57,11 @@ this.text = props.text || 'Close'; | ||
this.icon = props.icon || WorkerbaseIcon_1.StepButtonIcons.NEXT; | ||
}; | ||
WorkerbaseButton.prototype.setBackgroundColor = function (backgroundColor) { | ||
} | ||
setBackgroundColor(backgroundColor) { | ||
this.styles.backgroundColor = backgroundColor; | ||
}; | ||
WorkerbaseButton.prototype.setTextColor = function (textColor) { | ||
} | ||
setTextColor(textColor) { | ||
this.styles.textColor = textColor; | ||
}; | ||
return WorkerbaseButton; | ||
}()); | ||
} | ||
} | ||
exports.WorkerbaseButton = WorkerbaseButton; | ||
//# sourceMappingURL=WorkerbaseButton.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseConnector = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseConnector = /** @class */ (function () { | ||
function WorkerbaseConnector() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseConnector { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.PROJECTS_SERVICE_HOST); | ||
@@ -64,89 +17,38 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseConnector.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.put(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async create(itemData) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
...itemData, | ||
}); | ||
}; | ||
WorkerbaseConnector.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseConnector.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.put(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseConnector.prototype.create = function (itemData) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", __assign({}, itemData))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseConnector.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseConnector.prototype.trigger = function (id, payload) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id + "/trigger", payload)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseConnector; | ||
}()); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
async trigger(id, payload) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}/trigger`, payload); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseConnector = WorkerbaseConnector; | ||
//# sourceMappingURL=WorkerbaseConnector.js.map |
@@ -5,3 +5,3 @@ import { Database } from '../types/database'; | ||
import { WorkerbaseDatabaseItem, WorkerbaseDatabaseItemSDK } from './WorkerbaseDatabaseItem'; | ||
declare type DatabaseObject = Database & { | ||
type DatabaseObject = Database & { | ||
items: WorkerbaseDatabaseItemSDK; | ||
@@ -8,0 +8,0 @@ }; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,8 +7,8 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseDatabase = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseDatabaseItem_1 = require("./WorkerbaseDatabaseItem"); | ||
var WorkerbaseDatabase = /** @class */ (function () { | ||
function WorkerbaseDatabase() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
const WorkerbaseDatabaseItem_1 = require("./WorkerbaseDatabaseItem"); | ||
class WorkerbaseDatabase { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
@@ -65,50 +18,32 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseDatabase.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data, item; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { | ||
params: options, | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
item = data.data; | ||
// eslint-disable-next-line dot-notation | ||
item['items'] = new WorkerbaseDatabaseItem_1.WorkerbaseDatabaseItem(this._endpoint + "/" + data.data._id + "/"); | ||
return [2 /*return*/, item]; | ||
} | ||
}); | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { | ||
params: options, | ||
}); | ||
}; | ||
WorkerbaseDatabase.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data, items; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
items = data.data; | ||
items.map(function (item) { | ||
var databaseObject = item; | ||
// eslint-disable-next-line dot-notation | ||
databaseObject['items'] = new WorkerbaseDatabaseItem_1.WorkerbaseDatabaseItem(_this._endpoint + "/" + item._id + "/"); | ||
return databaseObject; | ||
}); | ||
return [2 /*return*/, data.data]; | ||
} | ||
const item = data.data; | ||
// eslint-disable-next-line dot-notation | ||
item['items'] = new WorkerbaseDatabaseItem_1.WorkerbaseDatabaseItem(`${this._endpoint}/${data.data._id}/`); | ||
return item; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
return WorkerbaseDatabase; | ||
}()); | ||
const items = data.data; | ||
items.map(item => { | ||
const databaseObject = item; | ||
// eslint-disable-next-line dot-notation | ||
databaseObject['items'] = new WorkerbaseDatabaseItem_1.WorkerbaseDatabaseItem(`${this._endpoint}/${item._id}/`); | ||
return databaseObject; | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
} | ||
exports.WorkerbaseDatabase = WorkerbaseDatabase; | ||
//# sourceMappingURL=WorkerbaseDatabase.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,125 +7,59 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseDatabaseItem = void 0; | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseDatabaseItem = /** @class */ (function () { | ||
function WorkerbaseDatabaseItem(parentAPIPath) { | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseDatabaseItem { | ||
constructor(parentAPIPath) { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(); | ||
this._apiClient = new ApiClient_1.ApiClient(); | ||
this._endpoint = parentAPIPath + "items"; | ||
this._endpoint = `${parentAPIPath}items`; | ||
} | ||
// Overrides baseURL, as it uses a different internal host than get/list methods | ||
WorkerbaseDatabaseItem.prototype.query = function (payload, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var requestParams, baseUrl, data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
requestParams = { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
}; | ||
baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
return [4 /*yield*/, this._apiClient.api.post(baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/query", payload, requestParams)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
async query(payload, options = {}) { | ||
const requestParams = { | ||
params: { perpage: constants_1.ENTRIES_PER_PAGE, ...options }, | ||
}; | ||
const baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
const { data } = await this._apiClient.api.post(`${baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/query`, payload, requestParams); | ||
return data.data; | ||
} | ||
// Overrides baseURL, as it uses a different internal host than get/list methods | ||
WorkerbaseDatabaseItem.prototype.create = function (payload, externalId) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseUrl, newEndpoint, data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
newEndpoint = this._endpoint.slice(0, this._endpoint.length - 1); | ||
return [4 /*yield*/, this._apiClient.api.post(baseUrl + "api/" + constants_1.API_VERSION + "/" + newEndpoint + "/", { externalId: externalId, payload: payload })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
async create(payload, externalId) { | ||
const baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
const newEndpoint = this._endpoint.slice(0, this._endpoint.length - 1); | ||
const { data } = await this._apiClient.api.post(`${baseUrl}api/${constants_1.API_VERSION}/${newEndpoint}/`, { externalId, payload }); | ||
return data.data; | ||
} | ||
// Overrides baseURL, as it uses a different internal host than get/list methods | ||
WorkerbaseDatabaseItem.prototype.createMany = function (items) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseUrl, data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
return [4 /*yield*/, this._apiClient.api.post(baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { items: items })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async createMany(items) { | ||
const baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.DATABASES_SERVICE_HOST); | ||
const { data } = await this._apiClient.api.post(`${baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { items }); | ||
return data.data; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
}); | ||
}; | ||
WorkerbaseDatabaseItem.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseDatabaseItem.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseDatabaseItem.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.put(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseDatabaseItem.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseDatabaseItem; | ||
}()); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.put(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseDatabaseItem = WorkerbaseDatabaseItem; | ||
//# sourceMappingURL=WorkerbaseDatabaseItem.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseFunction = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseFunction = /** @class */ (function () { | ||
function WorkerbaseFunction() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseFunction { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(); | ||
@@ -64,69 +17,32 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseFunction.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
}); | ||
}; | ||
WorkerbaseFunction.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
// Overrides baseURL, as it uses a different internal host than get/list methods | ||
WorkerbaseFunction.prototype.deploy = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseUrl, data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.PROJECTS_SERVICE_HOST); | ||
return [4 /*yield*/, this._apiClient.api.post(baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id + "/deploy")]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
async deploy(id) { | ||
const baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.PROJECTS_SERVICE_HOST); | ||
const { data } = await this._apiClient.api.post(`${baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}/deploy`); | ||
return data; | ||
} | ||
// Overrides baseURL, as it uses a different internal host than get/list methods | ||
WorkerbaseFunction.prototype.invoke = function (id, payload) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseUrl, data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.PROJECTS_SERVICE_HOST); | ||
return [4 /*yield*/, this._apiClient.api.post(baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id + "/invoke", payload)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseFunction; | ||
}()); | ||
async invoke(id, payload) { | ||
const baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.PROJECTS_SERVICE_HOST); | ||
const { data } = await this._apiClient.api.post(`${baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}/invoke`, payload); | ||
return data.data; | ||
} | ||
} | ||
exports.WorkerbaseFunction = WorkerbaseFunction; | ||
//# sourceMappingURL=WorkerbaseFunction.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StatusScreenIcon = exports.StepOptionIcons = exports.StepButtonIcons = void 0; | ||
var StepButtonIcons = /** @class */ (function () { | ||
function StepButtonIcons() { | ||
} | ||
StepButtonIcons.CONFIRM = 'confirm'; | ||
StepButtonIcons.CLOSE = 'close'; | ||
StepButtonIcons.QUESTION_YELLOW = 'question-yellow'; | ||
StepButtonIcons.REPEAT = 'repeat'; | ||
StepButtonIcons.WARNING_RED_CLEAR_BG = 'warning-red-clear-bg'; | ||
StepButtonIcons.WARNING_RED = 'warning-red'; | ||
StepButtonIcons.WARNING_YELLOW = 'warning-yellow'; | ||
StepButtonIcons.WARNING = 'warning'; | ||
StepButtonIcons.REFRESH = 'refresh'; | ||
StepButtonIcons.INFO = 'info'; | ||
StepButtonIcons.INFO_BLUE = 'info-blue'; | ||
StepButtonIcons.BACK = 'back'; | ||
StepButtonIcons.NEXT = 'next'; | ||
StepButtonIcons.CONFIRM_ENCIRCLED = 'confirm-encircled'; | ||
StepButtonIcons.CONFIRM_ENCIRCLED_GREEN = 'confirm-encircled-green'; | ||
StepButtonIcons.PLUS = 'plus'; | ||
StepButtonIcons.MINUS = 'minus'; | ||
StepButtonIcons.INSTRUCTIONS = 'instructions'; | ||
StepButtonIcons.LIST = 'list'; | ||
StepButtonIcons.HOME = 'home'; | ||
return StepButtonIcons; | ||
}()); | ||
class StepButtonIcons { | ||
} | ||
exports.StepButtonIcons = StepButtonIcons; | ||
var StepOptionIcons = /** @class */ (function () { | ||
function StepOptionIcons() { | ||
} | ||
StepOptionIcons.INFO = 'icon-info.png'; | ||
StepOptionIcons.ERROR = 'icon-error.png'; | ||
StepOptionIcons.SUCCESS = 'icon-success.png'; | ||
StepOptionIcons.SUPPORT = 'icon-support.png'; | ||
return StepOptionIcons; | ||
}()); | ||
StepButtonIcons.CONFIRM = 'confirm'; | ||
StepButtonIcons.CLOSE = 'close'; | ||
StepButtonIcons.QUESTION_YELLOW = 'question-yellow'; | ||
StepButtonIcons.REPEAT = 'repeat'; | ||
StepButtonIcons.WARNING_RED_CLEAR_BG = 'warning-red-clear-bg'; | ||
StepButtonIcons.WARNING_RED = 'warning-red'; | ||
StepButtonIcons.WARNING_YELLOW = 'warning-yellow'; | ||
StepButtonIcons.WARNING = 'warning'; | ||
StepButtonIcons.REFRESH = 'refresh'; | ||
StepButtonIcons.INFO = 'info'; | ||
StepButtonIcons.INFO_BLUE = 'info-blue'; | ||
StepButtonIcons.BACK = 'back'; | ||
StepButtonIcons.NEXT = 'next'; | ||
StepButtonIcons.CONFIRM_ENCIRCLED = 'confirm-encircled'; | ||
StepButtonIcons.CONFIRM_ENCIRCLED_GREEN = 'confirm-encircled-green'; | ||
StepButtonIcons.PLUS = 'plus'; | ||
StepButtonIcons.MINUS = 'minus'; | ||
StepButtonIcons.INSTRUCTIONS = 'instructions'; | ||
StepButtonIcons.LIST = 'list'; | ||
StepButtonIcons.HOME = 'home'; | ||
class StepOptionIcons { | ||
} | ||
exports.StepOptionIcons = StepOptionIcons; | ||
var StatusScreenIcon = /** @class */ (function () { | ||
function StatusScreenIcon() { | ||
} | ||
StatusScreenIcon.SUCCESS = 'icon-success.png'; | ||
StatusScreenIcon.INFO = 'icon-info.png'; | ||
StatusScreenIcon.ERROR = 'icon-error.png'; | ||
return StatusScreenIcon; | ||
}()); | ||
StepOptionIcons.INFO = 'icon-info.png'; | ||
StepOptionIcons.ERROR = 'icon-error.png'; | ||
StepOptionIcons.SUCCESS = 'icon-success.png'; | ||
StepOptionIcons.SUPPORT = 'icon-support.png'; | ||
class StatusScreenIcon { | ||
} | ||
exports.StatusScreenIcon = StatusScreenIcon; | ||
StatusScreenIcon.SUCCESS = 'icon-success.png'; | ||
StatusScreenIcon.INFO = 'icon-info.png'; | ||
StatusScreenIcon.ERROR = 'icon-error.png'; | ||
//# sourceMappingURL=WorkerbaseIcon.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseLocation = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseLocation = /** @class */ (function () { | ||
function WorkerbaseLocation() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseLocation { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.SETTINGS_SERVICE_HOST); | ||
@@ -64,106 +17,48 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseLocation.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async create(itemData) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
...itemData, | ||
}); | ||
}; | ||
WorkerbaseLocation.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseLocation.prototype.create = function (itemData) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", __assign({}, itemData))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseLocation.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseLocation.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseLocation.prototype.getPartsByLevel = function (levelId) { | ||
var _this = this; | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/parts/" + levelId)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseLocation.prototype.getLevels = function () { | ||
var _this = this; | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/settings/", {})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.locationStructure]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
return WorkerbaseLocation; | ||
}()); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
getPartsByLevel(levelId) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/parts/${levelId}`); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
getLevels() { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/settings/`, {}); | ||
return data.locationStructure; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
} | ||
exports.WorkerbaseLocation = WorkerbaseLocation; | ||
//# sourceMappingURL=WorkerbaseLocation.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseMedia = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseMedia = /** @class */ (function () { | ||
function WorkerbaseMedia() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseMedia { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.MEDIA_SERVICE_HOST); | ||
@@ -64,50 +17,24 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseMedia.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id + "/meta", { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}/meta`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
}); | ||
}; | ||
WorkerbaseMedia.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseMedia.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseMedia; | ||
}()); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseMedia = WorkerbaseMedia; | ||
//# sourceMappingURL=WorkerbaseMedia.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseRole = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseRole = /** @class */ (function () { | ||
function WorkerbaseRole() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseRole { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.USERS_SERVICE_HOST); | ||
@@ -64,76 +17,34 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseRole.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.put(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async create(itemData) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
...itemData, | ||
}); | ||
}; | ||
WorkerbaseRole.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseRole.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.put(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseRole.prototype.create = function (itemData) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", __assign({}, itemData))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseRole.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseRole; | ||
}()); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseRole = WorkerbaseRole; | ||
//# sourceMappingURL=WorkerbaseRole.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseSkill = void 0; | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseSkill = /** @class */ (function () { | ||
function WorkerbaseSkill() { | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseSkill { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.USERS_SERVICE_HOST); | ||
@@ -64,76 +17,34 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseSkill.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.put(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async create(itemData) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
...itemData, | ||
}); | ||
}; | ||
WorkerbaseSkill.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseSkill.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.put(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseSkill.prototype.create = function (itemData) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", __assign({}, itemData))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseSkill.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseSkill; | ||
}()); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseSkill = WorkerbaseSkill; | ||
//# sourceMappingURL=WorkerbaseSkill.js.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -17,3 +21,3 @@ if (k2 === undefined) k2 = k; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
@@ -27,115 +31,114 @@ return result; | ||
exports.WorkerbaseStep = void 0; | ||
var InfoTextLargeStep_1 = __importDefault(require("./steps/InfoTextLargeStep")); | ||
var InfoTextStep_1 = __importDefault(require("./steps/InfoTextStep")); | ||
var InputTextStep_1 = __importDefault(require("./steps/InputTextStep")); | ||
var InfoPhotoStep_1 = __importDefault(require("./steps/InfoPhotoStep")); | ||
var InfoAudioStep_1 = __importDefault(require("./steps/InfoAudioStep")); | ||
var InfoVideoStep_1 = __importDefault(require("./steps/InfoVideoStep")); | ||
var InfoWebviewStep_1 = __importDefault(require("./steps/InfoWebviewStep")); | ||
var InfoPdfStep_1 = __importDefault(require("./steps/InfoPdfStep")); | ||
var InfoStatusStep_1 = __importDefault(require("./steps/InfoStatusStep")); | ||
var InfoLocationDirectionStep_1 = __importDefault(require("./steps/InfoLocationDirectionStep")); | ||
var InputAudioStep_1 = __importDefault(require("./steps/InputAudioStep")); | ||
var InputLocationStep_1 = __importDefault(require("./steps/InputLocationStep")); | ||
var InputBarcodeStep_1 = __importStar(require("./steps/InputBarcodeStep")); | ||
var InputNumberStep_1 = __importDefault(require("./steps/InputNumberStep")); | ||
var InputNumberPickerStep_1 = __importDefault(require("./steps/InputNumberPickerStep")); | ||
var InputPhotoStep_1 = __importDefault(require("./steps/InputPhotoStep")); | ||
var InputVideoStep_1 = __importDefault(require("./steps/InputVideoStep")); | ||
var InputIndexListStep_1 = require("./steps/InputIndexListStep"); | ||
var InputListOptionSelection_1 = require("./steps/utils/InputListOptionSelection"); | ||
var InputTileListStep_1 = require("./steps/InputTileListStep"); | ||
var InputValueListStep_1 = require("./steps/InputValueListStep"); | ||
var InputCheckboxListStep_1 = require("./steps/InputCheckboxListStep"); | ||
var InputNoiseLevelStep_1 = __importDefault(require("./steps/InputNoiseLevelStep")); | ||
var InfoLoadingStep_1 = __importDefault(require("./steps/InfoLoadingStep")); | ||
var InputButtonListStep_1 = require("./steps/InputButtonListStep"); | ||
var InfoQrCodeStep_1 = __importDefault(require("./steps/InfoQrCodeStep")); | ||
var LayoutFlexStep_1 = __importDefault(require("./steps/LayoutFlexStep")); | ||
var WorkerbaseStep = /** @class */ (function () { | ||
function WorkerbaseStep() { | ||
const InfoTextLargeStep_1 = __importDefault(require("./steps/InfoTextLargeStep")); | ||
const InfoTextStep_1 = __importDefault(require("./steps/InfoTextStep")); | ||
const InputTextStep_1 = __importDefault(require("./steps/InputTextStep")); | ||
const InfoPhotoStep_1 = __importDefault(require("./steps/InfoPhotoStep")); | ||
const InfoAudioStep_1 = __importDefault(require("./steps/InfoAudioStep")); | ||
const InfoVideoStep_1 = __importDefault(require("./steps/InfoVideoStep")); | ||
const InfoWebviewStep_1 = __importDefault(require("./steps/InfoWebviewStep")); | ||
const InfoPdfStep_1 = __importDefault(require("./steps/InfoPdfStep")); | ||
const InfoStatusStep_1 = __importDefault(require("./steps/InfoStatusStep")); | ||
const InfoLocationDirectionStep_1 = __importDefault(require("./steps/InfoLocationDirectionStep")); | ||
const InputAudioStep_1 = __importDefault(require("./steps/InputAudioStep")); | ||
const InputLocationStep_1 = __importDefault(require("./steps/InputLocationStep")); | ||
const InputBarcodeStep_1 = __importStar(require("./steps/InputBarcodeStep")); | ||
const InputNumberStep_1 = __importDefault(require("./steps/InputNumberStep")); | ||
const InputNumberPickerStep_1 = __importDefault(require("./steps/InputNumberPickerStep")); | ||
const InputPhotoStep_1 = __importDefault(require("./steps/InputPhotoStep")); | ||
const InputVideoStep_1 = __importDefault(require("./steps/InputVideoStep")); | ||
const InputIndexListStep_1 = require("./steps/InputIndexListStep"); | ||
const InputListOptionSelection_1 = require("./steps/utils/InputListOptionSelection"); | ||
const InputTileListStep_1 = require("./steps/InputTileListStep"); | ||
const InputValueListStep_1 = require("./steps/InputValueListStep"); | ||
const InputCheckboxListStep_1 = require("./steps/InputCheckboxListStep"); | ||
const InputNoiseLevelStep_1 = __importDefault(require("./steps/InputNoiseLevelStep")); | ||
const InfoLoadingStep_1 = __importDefault(require("./steps/InfoLoadingStep")); | ||
const InputButtonListStep_1 = require("./steps/InputButtonListStep"); | ||
const InfoQrCodeStep_1 = __importDefault(require("./steps/InfoQrCodeStep")); | ||
const LayoutFlexStep_1 = __importDefault(require("./steps/LayoutFlexStep")); | ||
class WorkerbaseStep { | ||
constructor() { | ||
this.regex = new InputBarcodeStep_1.RegexOperation(); | ||
this.options = new InputListOptionSelection_1.InputListOptionSelection(); | ||
} | ||
WorkerbaseStep.prototype.InfoText = function (props) { | ||
InfoText(props) { | ||
return new InfoTextStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoTextLarge = function (props) { | ||
} | ||
InfoTextLarge(props) { | ||
return new InfoTextLargeStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoQrCode = function (props) { | ||
} | ||
InfoQrCode(props) { | ||
return new InfoQrCodeStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoStatus = function (props) { | ||
} | ||
InfoStatus(props) { | ||
return new InfoStatusStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoWebview = function (props) { | ||
} | ||
InfoWebview(props) { | ||
return new InfoWebviewStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoPhoto = function (props) { | ||
} | ||
InfoPhoto(props) { | ||
return new InfoPhotoStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoAudio = function (props) { | ||
} | ||
InfoAudio(props) { | ||
return new InfoAudioStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoVideo = function (props) { | ||
} | ||
InfoVideo(props) { | ||
return new InfoVideoStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoPdf = function (props) { | ||
} | ||
InfoPdf(props) { | ||
return new InfoPdfStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoLoading = function (props) { | ||
} | ||
InfoLoading(props) { | ||
return new InfoLoadingStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InfoLocationDirection = function (props) { | ||
} | ||
InfoLocationDirection(props) { | ||
return new InfoLocationDirectionStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputText = function (props) { | ||
} | ||
InputText(props) { | ||
return new InputTextStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputBarcode = function (props) { | ||
} | ||
InputBarcode(props) { | ||
return new InputBarcodeStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputNumberPicker = function (props) { | ||
} | ||
InputNumberPicker(props) { | ||
return new InputNumberPickerStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputNumber = function (props) { | ||
} | ||
InputNumber(props) { | ||
return new InputNumberStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputLocation = function (props) { | ||
} | ||
InputLocation(props) { | ||
return new InputLocationStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputAudio = function (props) { | ||
} | ||
InputAudio(props) { | ||
return new InputAudioStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputVideo = function (props) { | ||
} | ||
InputVideo(props) { | ||
return new InputVideoStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputPhoto = function (props) { | ||
} | ||
InputPhoto(props) { | ||
return new InputPhotoStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputIndexList = function (props) { | ||
} | ||
InputIndexList(props) { | ||
return new InputIndexListStep_1.InputIndexListStep(props); | ||
}; | ||
WorkerbaseStep.prototype.InputTileList = function (props) { | ||
} | ||
InputTileList(props) { | ||
return new InputTileListStep_1.InputTileListStep(props); | ||
}; | ||
WorkerbaseStep.prototype.InputValueList = function (props) { | ||
} | ||
InputValueList(props) { | ||
return new InputValueListStep_1.InputValueListStep(props); | ||
}; | ||
WorkerbaseStep.prototype.InputCheckboxList = function (props) { | ||
} | ||
InputCheckboxList(props) { | ||
return new InputCheckboxListStep_1.InputCheckboxListStep(props); | ||
}; | ||
WorkerbaseStep.prototype.InputNoiseLevel = function (props) { | ||
} | ||
InputNoiseLevel(props) { | ||
return new InputNoiseLevelStep_1.default(props); | ||
}; | ||
WorkerbaseStep.prototype.InputButtonList = function (props) { | ||
} | ||
InputButtonList(props) { | ||
return new InputButtonListStep_1.InputButtonListStep(props); | ||
}; | ||
WorkerbaseStep.prototype.LayoutFlex = function (props) { | ||
} | ||
LayoutFlex(props) { | ||
return new LayoutFlexStep_1.default(props); | ||
}; | ||
return WorkerbaseStep; | ||
}()); | ||
} | ||
} | ||
exports.WorkerbaseStep = WorkerbaseStep; | ||
//# sourceMappingURL=WorkerbaseStep.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseTask = void 0; | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseTask = /** @class */ (function () { | ||
function WorkerbaseTask() { | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseTask { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.TASKS_SERVICE_HOST); | ||
@@ -64,63 +17,28 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseTask.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
}); | ||
}; | ||
WorkerbaseTask.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseTask.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseTask.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseTask; | ||
}()); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseTask = WorkerbaseTask; | ||
//# sourceMappingURL=WorkerbaseTask.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -54,7 +7,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.WorkerbaseUser = void 0; | ||
var addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
var ApiClient_1 = require("../utils/ApiClient"); | ||
var constants_1 = require("../utils/constants"); | ||
var WorkerbaseUser = /** @class */ (function () { | ||
function WorkerbaseUser() { | ||
const addArrayMethods_1 = __importDefault(require("../utils/addArrayMethods")); | ||
const ApiClient_1 = require("../utils/ApiClient"); | ||
const constants_1 = require("../utils/constants"); | ||
class WorkerbaseUser { | ||
constructor() { | ||
this._baseUrl = ApiClient_1.ApiClient.createBaseUrl(process.env.USERS_SERVICE_HOST); | ||
@@ -64,76 +17,34 @@ this._apiClient = new ApiClient_1.ApiClient(); | ||
} | ||
WorkerbaseUser.prototype.get = function (id, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, { params: options })]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
async get(id, options = {}) { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { params: options }); | ||
return data.data; | ||
} | ||
list(options = {}) { | ||
const asyncListGet = async () => { | ||
const { data } = await this._apiClient.api.get(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
params: { | ||
perpage: constants_1.ENTRIES_PER_PAGE, | ||
...options, | ||
}, | ||
}); | ||
return data.data; | ||
}; | ||
return (0, addArrayMethods_1.default)(asyncListGet()); | ||
} | ||
async update(id, changes) { | ||
const { data } = await this._apiClient.api.put(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`, { ...changes }); | ||
return data.data; | ||
} | ||
async create(itemData) { | ||
const { data } = await this._apiClient.api.post(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/`, { | ||
...itemData, | ||
}); | ||
}; | ||
WorkerbaseUser.prototype.list = function (options) { | ||
var _this = this; | ||
if (options === void 0) { options = {}; } | ||
var asyncListGet = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.get(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", { | ||
params: __assign({ perpage: constants_1.ENTRIES_PER_PAGE }, options), | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); }; | ||
return addArrayMethods_1.default(asyncListGet()); | ||
}; | ||
WorkerbaseUser.prototype.update = function (id, changes) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.put(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id, __assign({}, changes))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseUser.prototype.create = function (itemData) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.post(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/", __assign({}, itemData))]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data.data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
WorkerbaseUser.prototype.delete = function (id) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this._apiClient.api.delete(this._baseUrl + "api/" + constants_1.API_VERSION + "/" + this._endpoint + "/" + id)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return WorkerbaseUser; | ||
}()); | ||
return data.data; | ||
} | ||
async delete(id) { | ||
const { data } = await this._apiClient.api.delete(`${this._baseUrl}api/${constants_1.API_VERSION}/${this._endpoint}/${id}`); | ||
return data; | ||
} | ||
} | ||
exports.WorkerbaseUser = WorkerbaseUser; | ||
//# sourceMappingURL=WorkerbaseUser.js.map |
@@ -25,2 +25,2 @@ import { CloseAction } from '../resources/actions/CloseAction'; | ||
} | ||
export declare type Action = CloseAction | SuspendAction | FinishAction | NextStepIdAction | NextTaskIdAction | NextWorkinstructionAction | NextStepFunctionIdAction | NextActionFunctionIdAction; | ||
export type Action = CloseAction | SuspendAction | FinishAction | NextStepIdAction | NextTaskIdAction | NextWorkinstructionAction | NextStepFunctionIdAction | NextActionFunctionIdAction; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StepActionType = exports.CurrentTaskAction = void 0; | ||
var CurrentTaskAction = /** @class */ (function () { | ||
function CurrentTaskAction() { | ||
} | ||
CurrentTaskAction.FINISH = 'finish'; | ||
CurrentTaskAction.SUSPEND = 'suspend'; | ||
CurrentTaskAction.CLOSE = 'close'; | ||
return CurrentTaskAction; | ||
}()); | ||
class CurrentTaskAction { | ||
} | ||
exports.CurrentTaskAction = CurrentTaskAction; | ||
CurrentTaskAction.FINISH = 'finish'; | ||
CurrentTaskAction.SUSPEND = 'suspend'; | ||
CurrentTaskAction.CLOSE = 'close'; | ||
var StepActionType; | ||
@@ -14,0 +11,0 @@ (function (StepActionType) { |
@@ -17,3 +17,3 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type ConnectorPOST = Pick<Connector, 'name' | 'description' | 'project' | 'type'>; | ||
export declare type ConnectorPUT = Partial<Pick<Connector, 'description' | 'name' | 'variables'>>; | ||
export type ConnectorPOST = Pick<Connector, 'name' | 'description' | 'project' | 'type'>; | ||
export type ConnectorPUT = Partial<Pick<Connector, 'description' | 'name' | 'variables'>>; |
import { MetaFields } from './MetaFields'; | ||
export declare type SupportedTypes = 'String' | 'Integer' | 'Location' | 'Boolean' | 'DateTime' | 'Date' | 'Time' | 'User' | 'Media'; | ||
export type SupportedTypes = 'String' | 'Integer' | 'Location' | 'Boolean' | 'DateTime' | 'Date' | 'Time' | 'User' | 'Media'; | ||
export interface DatabaseColumn { | ||
@@ -4,0 +4,0 @@ type: SupportedTypes; |
@@ -1,2 +0,2 @@ | ||
export declare type ItemPayload = Record<string, string>; | ||
export type ItemPayload = Record<string, string>; | ||
export interface DatabaseItem { | ||
@@ -7,2 +7,2 @@ _id: string; | ||
} | ||
export declare type DatabaseItemPOST = Omit<DatabaseItem, '_id'>; | ||
export type DatabaseItemPOST = Omit<DatabaseItem, '_id'>; |
@@ -15,3 +15,3 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type FunctionPOST = Pick<Function, 'name' | 'description' | 'project' | 'files'>; | ||
export declare type FunctionPUT = Omit<Function, 'project'>; | ||
export type FunctionPOST = Pick<Function, 'name' | 'description' | 'project' | 'files'>; | ||
export type FunctionPUT = Omit<Function, 'project'>; |
@@ -28,2 +28,2 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type LocationPUT = LocationPOST; | ||
export type LocationPUT = LocationPOST; |
@@ -15,3 +15,3 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type RolePOST = Omit<Role, '_id' | 'meta' | 'accessRights' | 'users' | 'createdAt'>; | ||
export declare type RolePUT = Partial<RolePOST>; | ||
export type RolePOST = Omit<Role, '_id' | 'meta' | 'accessRights' | 'users' | 'createdAt'>; | ||
export type RolePUT = Partial<RolePOST>; |
@@ -8,3 +8,3 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type SkillPOST = Omit<Skill, '_id' | 'meta'>; | ||
export declare type SkillPUT = Partial<Skill>; | ||
export type SkillPOST = Omit<Skill, '_id' | 'meta'>; | ||
export type SkillPUT = Partial<Skill>; |
@@ -68,2 +68,2 @@ import InfoAudioStep from '../resources/steps/InfoAudioStep'; | ||
} | ||
export declare type Step = InfoWebviewStep | InfoTextStep | InfoTextLargeStep | InfoAudioStep | InfoVideoStep | InfoPhotoStep | InfoPdfStep | InfoLoadingStep | InfoStatusStep | InfoQrCodeStep | InputAudioStep | InputTextStep | InputLocationStep | InfoLocationDirectionStep | InputBarcodeStep | InputNumberStep | InputNumberPickerStep | InputPhotoStep | InputVideoStep | InputValueListStep | InputCheckboxListStep | InputIndexListStep | InputTileListStep | InputButtonListStep | InputNoiseLevelStep | LayoutFlexStep; | ||
export type Step = InfoWebviewStep | InfoTextStep | InfoTextLargeStep | InfoAudioStep | InfoVideoStep | InfoPhotoStep | InfoPdfStep | InfoLoadingStep | InfoStatusStep | InfoQrCodeStep | InputAudioStep | InputTextStep | InputLocationStep | InfoLocationDirectionStep | InputBarcodeStep | InputNumberStep | InputNumberPickerStep | InputPhotoStep | InputVideoStep | InputValueListStep | InputCheckboxListStep | InputIndexListStep | InputTileListStep | InputButtonListStep | InputNoiseLevelStep | LayoutFlexStep; |
@@ -36,19 +36,13 @@ "use strict"; | ||
})(WorkinstructionStepType = exports.WorkinstructionStepType || (exports.WorkinstructionStepType = {})); | ||
var WorkerbaseStatusScreenColor = /** @class */ (function () { | ||
function WorkerbaseStatusScreenColor() { | ||
} | ||
WorkerbaseStatusScreenColor.GREY = '#3E4D59'; | ||
WorkerbaseStatusScreenColor.GREEN = '#75A200'; | ||
WorkerbaseStatusScreenColor.RED = '#DE3E40'; | ||
return WorkerbaseStatusScreenColor; | ||
}()); | ||
class WorkerbaseStatusScreenColor { | ||
} | ||
exports.WorkerbaseStatusScreenColor = WorkerbaseStatusScreenColor; | ||
var ListOptionsSource = /** @class */ (function () { | ||
function ListOptionsSource() { | ||
} | ||
ListOptionsSource.CONNECTOR = 'connector'; | ||
ListOptionsSource.OPTIONS = 'options'; | ||
return ListOptionsSource; | ||
}()); | ||
WorkerbaseStatusScreenColor.GREY = '#3E4D59'; | ||
WorkerbaseStatusScreenColor.GREEN = '#75A200'; | ||
WorkerbaseStatusScreenColor.RED = '#DE3E40'; | ||
class ListOptionsSource { | ||
} | ||
exports.ListOptionsSource = ListOptionsSource; | ||
ListOptionsSource.CONNECTOR = 'connector'; | ||
ListOptionsSource.OPTIONS = 'options'; | ||
//# sourceMappingURL=steps.js.map |
@@ -12,2 +12,2 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type TaskPUT = Partial<Task>; | ||
export type TaskPUT = Partial<Task>; |
@@ -31,3 +31,3 @@ import { MetaFields } from './MetaFields'; | ||
} | ||
export declare type UserPOST = Partial<Omit<User, '_id' | 'meta'> & { | ||
export type UserPOST = Partial<Omit<User, '_id' | 'meta'> & { | ||
barcodeCredentials: { | ||
@@ -39,2 +39,2 @@ identifier: string; | ||
}>; | ||
export declare type UserPUT = Partial<UserPOST>; | ||
export type UserPUT = Partial<UserPOST>; |
@@ -1,2 +0,2 @@ | ||
export declare type ArrayPromiseWithMethods<T> = Promise<T[]> & { | ||
export type ArrayPromiseWithMethods<T> = Promise<T[]> & { | ||
filterBy<T>(conditions: Partial<T>): ArrayPromiseWithMethods<T>; | ||
@@ -3,0 +3,0 @@ distinctBy<T>(field: keyof T): Promise<[]>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var addArrayMethods = function (array) { | ||
const addArrayMethods = (array) => { | ||
function filterBy(conditions) { | ||
var filteredArrayPromise = this.then(function (arr) { | ||
return arr.filter(function (item) { | ||
return Object.keys(conditions).reduce(function (flag, key) { return flag && conditions[key] === item[key]; }, true); | ||
}); | ||
}); | ||
const filteredArrayPromise = this.then((arr) => arr.filter(item => Object.keys(conditions).reduce((flag, key) => flag && conditions[key] === item[key], true))); | ||
return addArrayMethods(filteredArrayPromise); | ||
} | ||
function distinctBy(field) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this]; | ||
case 1: return [2 /*return*/, (_a.sent()) | ||
.map(function (item) { return item[field]; }) | ||
.filter(function (el, i, arr) { return arr.indexOf(el) === i; })]; | ||
} | ||
}); | ||
}); | ||
async function distinctBy(field) { | ||
return (await this) | ||
.map(item => item[field]) | ||
.filter((el, i, arr) => arr.indexOf(el) === i); | ||
} | ||
Object.assign(array, { filterBy: filterBy, distinctBy: distinctBy }); | ||
Object.assign(array, { filterBy, distinctBy }); | ||
return array; | ||
@@ -62,0 +15,0 @@ }; |
@@ -13,3 +13,3 @@ import { AxiosError, AxiosInstance } from 'axios'; | ||
} | ||
export declare type ApiBackendError = AxiosError<BackendErrorResponse>; | ||
export type ApiBackendError = AxiosError<BackendErrorResponse>; | ||
export declare class ApiClient { | ||
@@ -16,0 +16,0 @@ accessToken: string | undefined; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -65,9 +7,9 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.ApiClient = void 0; | ||
var axios_1 = __importDefault(require("axios")); | ||
var lodash_1 = require("lodash"); | ||
var constants_1 = require("./constants"); | ||
var config_1 = require("./config"); | ||
var ApiClient = /** @class */ (function () { | ||
function ApiClient() { | ||
var _this = this; | ||
const axios_1 = __importDefault(require("axios")); | ||
const lodash_1 = require("lodash"); | ||
const constants_1 = require("./constants"); | ||
const config_1 = require("./config"); | ||
const url_1 = require("url"); | ||
class ApiClient { | ||
constructor() { | ||
this.accessToken = config_1.Config.accessToken; | ||
@@ -80,24 +22,22 @@ if (!config_1.Config.apiUrl) { | ||
} | ||
this.api = axios_1.default.create({ | ||
headers: { | ||
"User-Agent": "workerbase-sdk (" + constants_1.PACKAGE_VERSION + ")" | ||
this.api = axios_1.default.create(); | ||
axios_1.default.defaults.headers.post['User-Agent'] = `workerbase-sdk (${constants_1.PACKAGE_VERSION})`; | ||
this.api.interceptors.request.use(async (config) => { | ||
if (this.accessToken) { | ||
(0, lodash_1.set)(config, 'headers.accesstoken', this.accessToken); | ||
} | ||
(0, lodash_1.set)(config, 'headers.Accept', 'application/json'); | ||
return config; | ||
}); | ||
this.api.interceptors.request.use(function (config) { return __awaiter(_this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
if (this.accessToken) { | ||
lodash_1.set(config, 'headers.accesstoken', this.accessToken); | ||
} | ||
lodash_1.set(config, 'headers.Accept', 'application/json'); | ||
return [2 /*return*/, config]; | ||
}); | ||
}); }); | ||
this.api.interceptors.response.use(function (response) { return response; }, function (error) { | ||
var parsedError = __assign(__assign({}, error), { message: _this._parseBackendErrorMessage(error) }); | ||
this.api.interceptors.response.use(response => response, error => { | ||
const parsedError = { | ||
...error, | ||
message: this._parseBackendErrorMessage(error), | ||
}; | ||
throw parsedError; | ||
}); | ||
} | ||
ApiClient.createBaseUrl = function (internalHostname) { | ||
var apiUrl = config_1.Config.apiUrl; | ||
var url = new URL(apiUrl !== null && apiUrl !== void 0 ? apiUrl : ''); | ||
static createBaseUrl(internalHostname) { | ||
const { apiUrl } = config_1.Config; | ||
let url = new url_1.URL(apiUrl ?? ''); | ||
if (!url) { | ||
@@ -107,51 +47,52 @@ throw new Error('No WB_API_URL in environment or option found'); | ||
if (config_1.Config.isInternalRoutingEnabled && internalHostname) { | ||
url = new URL("http://" + internalHostname + ":3000/"); | ||
url = new url_1.URL(`http://${internalHostname}:3000/`); | ||
} | ||
var baseUrl = url.href; | ||
const baseUrl = url.href; | ||
return baseUrl; | ||
}; | ||
ApiClient.prototype._parseBackendErrorMessage = function (err) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q; | ||
var backendError = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data; | ||
var errorMessage = (backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) || err.message; | ||
if ((backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) === 'HTTP Trigger failed' && ((_c = (_b = backendError === null || backendError === void 0 ? void 0 : backendError.error) === null || _b === void 0 ? void 0 : _b.additionalData) === null || _c === void 0 ? void 0 : _c.errors)) { | ||
errorMessage = (_e = (_d = backendError === null || backendError === void 0 ? void 0 : backendError.error) === null || _d === void 0 ? void 0 : _d.additionalData) === null || _e === void 0 ? void 0 : _e.errors.map(function (ruleError) { | ||
var _a, _b; | ||
var ruleErrorReason = ((_a = ruleError === null || ruleError === void 0 ? void 0 : ruleError.err) === null || _a === void 0 ? void 0 : _a.message) ? ": " + ((_b = ruleError === null || ruleError === void 0 ? void 0 : ruleError.err) === null || _b === void 0 ? void 0 : _b.message) | ||
} | ||
_parseBackendErrorMessage(err) { | ||
const backendError = err.response?.data; | ||
let errorMessage = backendError?.errorMessage || err.message; | ||
if (backendError?.errorMessage === 'HTTP Trigger failed' && | ||
backendError?.error?.additionalData?.errors) { | ||
errorMessage = backendError?.error?.additionalData?.errors | ||
.map(ruleError => { | ||
const ruleErrorReason = ruleError?.err?.message | ||
? `: ${ruleError?.err?.message}` | ||
: ''; | ||
var message = "Connector triggering RuleId " + ruleError.ruleId + " failed " + ruleErrorReason; | ||
const message = `Connector triggering RuleId ${ruleError.ruleId} failed ${ruleErrorReason}`; | ||
return message.trim(); | ||
}).join(', '); | ||
}) | ||
.join(', '); | ||
} | ||
else if ((backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) && | ||
typeof (backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) === 'string') { | ||
errorMessage = backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage; | ||
else if (backendError?.errorMessage && | ||
typeof backendError?.errorMessage === 'string') { | ||
errorMessage = backendError?.errorMessage; | ||
} | ||
else if ((backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) && | ||
typeof (backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage) === 'object') { | ||
errorMessage = JSON.stringify(backendError === null || backendError === void 0 ? void 0 : backendError.errorMessage); | ||
else if (backendError?.errorMessage && | ||
typeof backendError?.errorMessage === 'object') { | ||
errorMessage = JSON.stringify(backendError?.errorMessage); | ||
} | ||
else if ((_f = err.response) === null || _f === void 0 ? void 0 : _f.data) { | ||
errorMessage = JSON.stringify((_g = err.response) === null || _g === void 0 ? void 0 : _g.data); | ||
else if (err.response?.data) { | ||
errorMessage = JSON.stringify(err.response?.data); | ||
} | ||
var errorToThrow = new Error(errorMessage); | ||
const errorToThrow = new Error(errorMessage); | ||
Object.assign(errorToThrow, { | ||
requestUrl: (_j = (_h = err === null || err === void 0 ? void 0 : err.request) === null || _h === void 0 ? void 0 : _h.res) === null || _j === void 0 ? void 0 : _j.responseUrl, | ||
requestMethod: (_k = err === null || err === void 0 ? void 0 : err.request) === null || _k === void 0 ? void 0 : _k.method, | ||
requestData: (_l = err === null || err === void 0 ? void 0 : err.config) === null || _l === void 0 ? void 0 : _l.data, | ||
requestParams: (_m = err === null || err === void 0 ? void 0 : err.config) === null || _m === void 0 ? void 0 : _m.params, | ||
responseStatusCode: (_o = err === null || err === void 0 ? void 0 : err.response) === null || _o === void 0 ? void 0 : _o.status, | ||
responseData: (_p = err === null || err === void 0 ? void 0 : err.response) === null || _p === void 0 ? void 0 : _p.data, | ||
requestUrl: err?.request?.res?.responseUrl, | ||
requestMethod: err?.request?.method, | ||
requestData: err?.config?.data, | ||
requestParams: err?.config?.params, | ||
responseStatusCode: err?.response?.status, | ||
responseData: err?.response?.data, | ||
}); | ||
if ((_q = err.response) === null || _q === void 0 ? void 0 : _q.data) { | ||
var _r = err.response.data, _message = _r.errorMessage, // skipping this property | ||
_success = _r.success, // skipping this property | ||
otherErrorData = __rest(_r, ["errorMessage", "success"]); | ||
if (err.response?.data) { | ||
const { errorMessage: _message, // skipping this property | ||
success: _success, // skipping this property | ||
...otherErrorData } = err.response.data; | ||
Object.assign(errorToThrow, otherErrorData); | ||
} | ||
throw errorToThrow; | ||
}; | ||
return ApiClient; | ||
}()); | ||
} | ||
} | ||
exports.ApiClient = ApiClient; | ||
//# sourceMappingURL=ApiClient.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createFunctionUrl = void 0; | ||
var constants_1 = require("./constants"); | ||
const constants_1 = require("./constants"); | ||
function createFunctionUrl(functionId) { | ||
return "api/" + constants_1.API_VERSION + "/functions/" + functionId + "/invoke"; | ||
return `api/${constants_1.API_VERSION}/functions/${functionId}/invoke`; | ||
} | ||
exports.createFunctionUrl = createFunctionUrl; | ||
//# sourceMappingURL=createFunctionUrl.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateId = void 0; | ||
exports.generateId = function () { | ||
return Buffer.from(Math.random() | ||
.toString() | ||
.slice(2)) | ||
.toString('base64') | ||
.slice(0, 10); | ||
}; | ||
const generateId = () => Buffer.from(Math.random() | ||
.toString() | ||
.slice(2)) | ||
.toString('base64') | ||
.slice(0, 10); | ||
exports.generateId = generateId; | ||
//# sourceMappingURL=generateId.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Workerbase = void 0; | ||
var WorkerbaseAction_1 = require("./resources/WorkerbaseAction"); | ||
var WorkerbaseButton_1 = require("./resources/WorkerbaseButton"); | ||
var WorkerbaseConnector_1 = require("./resources/WorkerbaseConnector"); | ||
var WorkerbaseDatabase_1 = require("./resources/WorkerbaseDatabase"); | ||
var WorkerbaseFunction_1 = require("./resources/WorkerbaseFunction"); | ||
var WorkerbaseLocation_1 = require("./resources/WorkerbaseLocation"); | ||
var WorkerbaseMedia_1 = require("./resources/WorkerbaseMedia"); | ||
var WorkerbaseRole_1 = require("./resources/WorkerbaseRole"); | ||
var WorkerbaseSkill_1 = require("./resources/WorkerbaseSkill"); | ||
var WorkerbaseStep_1 = require("./resources/WorkerbaseStep"); | ||
var WorkerbaseTask_1 = require("./resources/WorkerbaseTask"); | ||
var WorkerbaseUser_1 = require("./resources/WorkerbaseUser"); | ||
var Workerbase = /** @class */ (function () { | ||
function Workerbase() { | ||
const WorkerbaseAction_1 = require("./resources/WorkerbaseAction"); | ||
const WorkerbaseButton_1 = require("./resources/WorkerbaseButton"); | ||
const WorkerbaseConnector_1 = require("./resources/WorkerbaseConnector"); | ||
const WorkerbaseDatabase_1 = require("./resources/WorkerbaseDatabase"); | ||
const WorkerbaseFunction_1 = require("./resources/WorkerbaseFunction"); | ||
const WorkerbaseLocation_1 = require("./resources/WorkerbaseLocation"); | ||
const WorkerbaseMedia_1 = require("./resources/WorkerbaseMedia"); | ||
const WorkerbaseRole_1 = require("./resources/WorkerbaseRole"); | ||
const WorkerbaseSkill_1 = require("./resources/WorkerbaseSkill"); | ||
const WorkerbaseStep_1 = require("./resources/WorkerbaseStep"); | ||
const WorkerbaseTask_1 = require("./resources/WorkerbaseTask"); | ||
const WorkerbaseUser_1 = require("./resources/WorkerbaseUser"); | ||
class Workerbase { | ||
button(props) { | ||
return new WorkerbaseButton_1.WorkerbaseButton(props); | ||
} | ||
constructor() { | ||
this.tasks = new WorkerbaseTask_1.WorkerbaseTask(); | ||
@@ -31,8 +34,4 @@ this.databases = new WorkerbaseDatabase_1.WorkerbaseDatabase(); | ||
} | ||
Workerbase.prototype.button = function (props) { | ||
return new WorkerbaseButton_1.WorkerbaseButton(props); | ||
}; | ||
return Workerbase; | ||
}()); | ||
} | ||
exports.Workerbase = Workerbase; | ||
//# sourceMappingURL=WorkerbaseSDK.js.map |
{ | ||
"name": "@workerbase/sdk", | ||
"version": "0.1.34-beta.6", | ||
"version": "0.1.34-beta.10", | ||
"description": "", | ||
@@ -34,17 +34,14 @@ "scripts": { | ||
"@types/node": "^14.0.13", | ||
"@typescript-eslint/eslint-plugin": "^2.24.0", | ||
"@typescript-eslint/parser": "^2.24.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb": "^18.1.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.21.2", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"@typescript-eslint/eslint-plugin": "^5.30.5", | ||
"@typescript-eslint/parser": "^5.30.5", | ||
"eslint": "^8.19.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-react": "^7.20.0", | ||
"eslint-plugin-react-hooks": "^2.5.0", | ||
"prettier": "^1.19.1", | ||
"typescript": "^3.9.5" | ||
"typescript": "^4.7.4" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.19.2", | ||
"axios": "^1.4.0", | ||
"gql-query-builder": "^3.6.0", | ||
@@ -51,0 +48,0 @@ "lodash": "^4.17.21", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12
260876
4063
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removedaxios@0.19.2(transitive)
- Removedfollow-redirects@1.5.10(transitive)
Updatedaxios@^1.4.0