truflow 0.0.104 → 0.0.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/Classes/ICRUDRouter.d.ts +6 -0
  2. package/dist/Classes/ICRUDRouter.js +2 -0
  3. package/dist/Classes/ILogger.d.ts +9 -0
  4. package/dist/Classes/ILogger.js +2 -0
  5. package/dist/Events/IDateEntryMoved.d.ts +11 -0
  6. package/dist/Events/IDateEntryMoved.js +2 -0
  7. package/dist/Events/INegativeValue.d.ts +9 -0
  8. package/dist/Events/INegativeValue.js +2 -0
  9. package/dist/Events/IOrderDetails.d.ts +12 -0
  10. package/dist/Events/IOrderDetails.js +2 -0
  11. package/dist/Events/IOrderMoved.d.ts +12 -0
  12. package/dist/Events/IOrderMoved.js +2 -0
  13. package/dist/Events/IOrderProcessed.d.ts +5 -0
  14. package/dist/Events/IOrderProcessed.js +2 -0
  15. package/dist/Helpers/IAdministration.d.ts +5 -0
  16. package/dist/Helpers/IAdministration.js +2 -0
  17. package/dist/Helpers/IEvents.d.ts +10 -0
  18. package/dist/Helpers/IEvents.js +2 -0
  19. package/dist/Helpers/IExporters.d.ts +42 -0
  20. package/dist/Helpers/IExporters.js +2 -0
  21. package/dist/Helpers/IOrders/IMoveDateEntry.d.ts +18 -0
  22. package/dist/Helpers/IOrders/IMoveDateEntry.js +2 -0
  23. package/dist/Helpers/IOrders/IMoveOrder.d.ts +25 -0
  24. package/dist/Helpers/IOrders/IMoveOrder.js +2 -0
  25. package/dist/Helpers/IOrders/IUpdateFullDailyTotal.d.ts +8 -0
  26. package/dist/Helpers/IOrders/IUpdateFullDailyTotal.js +2 -0
  27. package/dist/Helpers/IOrders/IUpdateIndividualDailyTotal.d.ts +3 -0
  28. package/dist/Helpers/IOrders/IUpdateIndividualDailyTotal.js +2 -0
  29. package/dist/Helpers/IOrders/index.d.ts +8 -0
  30. package/dist/Helpers/IOrders/index.js +20 -0
  31. package/dist/Helpers/ITotals.d.ts +9 -0
  32. package/dist/Helpers/ITotals.js +2 -0
  33. package/dist/Helpers/IZapier/index.d.ts +26 -0
  34. package/dist/Helpers/IZapier/index.js +2 -0
  35. package/dist/IConfig.d.ts +11 -0
  36. package/dist/IConfig.js +2 -0
  37. package/dist/IDailyTotal.d.ts +31 -0
  38. package/dist/IDailyTotal.js +2 -0
  39. package/dist/IEvent.d.ts +46 -0
  40. package/dist/IEvent.js +2 -0
  41. package/dist/IExporter.d.ts +60 -0
  42. package/dist/IExporter.js +2 -0
  43. package/dist/IExpress.d.ts +8 -0
  44. package/dist/IExpress.js +10 -0
  45. package/dist/IIntegration.d.ts +31 -0
  46. package/dist/IIntegration.js +2 -0
  47. package/dist/IJWT.d.ts +4 -0
  48. package/dist/IJWT.js +2 -0
  49. package/dist/INotification.d.ts +33 -0
  50. package/dist/INotification.js +2 -0
  51. package/dist/IOrder.d.ts +48 -0
  52. package/dist/IOrder.js +2 -0
  53. package/dist/IScript.d.ts +33 -0
  54. package/dist/IScript.js +2 -0
  55. package/dist/ISetting.d.ts +88 -0
  56. package/dist/ISetting.js +2 -0
  57. package/dist/IUser.d.ts +35 -0
  58. package/dist/IUser.js +2 -0
  59. package/dist/IWebsocket.d.ts +7 -0
  60. package/dist/IWebsocket.js +2 -0
  61. package/dist/Routes/IOrderRoutes.d.ts +32 -0
  62. package/dist/Routes/IOrderRoutes.js +4 -0
  63. package/dist/Routes/IZapierRoutes.d.ts +12 -0
  64. package/dist/Routes/IZapierRoutes.js +2 -0
  65. package/dist/Templates/IDailyTotals.d.ts +4 -0
  66. package/dist/Templates/IDailyTotals.js +2 -0
  67. package/dist/index.d.ts +24 -0
  68. package/dist/index.js +40 -0
  69. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ export interface ICRUDRouterAuthorization {
2
+ view: string;
3
+ create: string;
4
+ update: string;
5
+ delete: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export type LogLevel = "INFO" | "WARNING" | "ERROR";
2
+ export interface ILogger {
3
+ db: any | null;
4
+ log(message: string, level?: LogLevel): void;
5
+ info(message: string): void;
6
+ warning(message: string): void;
7
+ error(message: string): void;
8
+ saveToDatabase(message: string): void;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { ILeanDailyTotal } from "../IDailyTotal";
2
+ export interface IMoveData {
3
+ type: string;
4
+ quantity: number;
5
+ originalStartDate: string;
6
+ updatedStartDate: string;
7
+ }
8
+ export interface IDateEntryMoved {
9
+ moveData: IMoveData;
10
+ dailyTotalsData: ILeanDailyTotal;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { ILeanDailyTotal } from "../IDailyTotal";
2
+ import { IDateEntry } from "../IOrder";
3
+ export interface INegativeValue {
4
+ time: Date;
5
+ dateEntry: IDateEntry;
6
+ dailyTotals: ILeanDailyTotal;
7
+ negativeType: string;
8
+ negativeValue: number;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export interface IOrderDetail {
2
+ id: number;
3
+ name: string;
4
+ companyName: string;
5
+ date: string;
6
+ shipDate: string;
7
+ requestedShipDate: string;
8
+ companyID: number;
9
+ summary: string;
10
+ orderTags: string[];
11
+ companyTags: string[];
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { ILeanDailyTotal } from "../IDailyTotal";
2
+ export interface IOrderMoveData {
3
+ types: any[];
4
+ quantity: number;
5
+ originalStartDates: any[];
6
+ updatedStartDate: string;
7
+ applyToOrder: boolean;
8
+ }
9
+ export interface IOrderMoved {
10
+ moveData: IOrderMoveData;
11
+ dailyTotalsData: ILeanDailyTotal[];
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { IOrderDetail } from "./IOrderDetails";
2
+ export interface IOrderProcessed {
3
+ orderDetails?: IOrderDetail;
4
+ message: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export type IEmitUpdateData = (step: string, stage: string, data?: {
2
+ order: string;
3
+ lastOrder: number;
4
+ percent: number;
5
+ }) => void;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { IZapierOrder } from "../Routes/IZapierRoutes";
2
+ import { IMoveDateEntryEventData, IMoveOrderEventData } from "./IOrders";
3
+ interface IOrderDetails {
4
+ orderID: string;
5
+ companyName: string;
6
+ }
7
+ export type IOrderMoved = (orderDetails: IOrderDetails, eventData: IMoveOrderEventData) => Promise<string>;
8
+ export type IDateEntryMoved = (orderDetails: IOrderDetails, eventData: IMoveDateEntryEventData) => Promise<string>;
9
+ export type IOrderProcessed = (orderDetails: IZapierOrder, status: number, message: string) => Promise<void>;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,42 @@
1
+ export interface ICloudPanelAccount {
2
+ name: string;
3
+ username: string;
4
+ password: string;
5
+ }
6
+ export interface ICloudPanelAPIRequest {
7
+ DisplayName: string;
8
+ Company: string;
9
+ Username: string;
10
+ Domain: string;
11
+ Pwd: string;
12
+ confirmPwd: string;
13
+ PasswordNeverExpires: boolean;
14
+ EnableMailbox: boolean;
15
+ LocalPart: string;
16
+ DomainPart: string;
17
+ MailboxPlan: number;
18
+ }
19
+ export interface IPosteBox {
20
+ address: string;
21
+ user: string;
22
+ home: string;
23
+ name: string;
24
+ disabled: boolean;
25
+ domain_admin: boolean;
26
+ super_admin: boolean;
27
+ strict_from_disabled: boolean;
28
+ created: string;
29
+ updated: string;
30
+ redirect_only: boolean;
31
+ redirect_to: [];
32
+ discard: boolean;
33
+ }
34
+ export interface ICreatePosteBox {
35
+ name: string;
36
+ email: string;
37
+ passwordPlaintext: string;
38
+ disabled: boolean;
39
+ superAdmin: boolean;
40
+ redirectTo?: ["string"];
41
+ referenceId?: "string";
42
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { ITotalsData } from ".";
2
+ import { IOrder } from "../../IOrder";
3
+ import { IUpdateOrder } from "../../Routes/IOrderRoutes";
4
+ export interface IMoveDateEntryMoveData {
5
+ type: string;
6
+ quantity: number;
7
+ originalStartDate: string;
8
+ updatedStartDate: string;
9
+ applyToOrder: boolean;
10
+ }
11
+ export interface IMoveDateEntryEventData {
12
+ moveData: IMoveDateEntryMoveData;
13
+ dailyTotalsData: ITotalsData[];
14
+ }
15
+ export type IMoveDateEntry = (data: IUpdateOrder, order: IOrder) => Promise<{
16
+ eventData: IMoveDateEntryEventData;
17
+ updatedOrder: IOrder;
18
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import { IOrder } from "../../IOrder";
2
+ import { IUpdateOrder } from "../../Routes/IOrderRoutes";
3
+ import { IUpdateFullDailyTotalReturnData } from "./IUpdateFullDailyTotal";
4
+ export interface IMoveOrderTotalsData {
5
+ startDate: string;
6
+ updatedStartDate: string;
7
+ entries: {
8
+ limitsGroup: string;
9
+ quantity: number;
10
+ }[];
11
+ }
12
+ export interface IMoveOrderEventData {
13
+ moveData: {
14
+ types: string[];
15
+ quantity: number;
16
+ originalStartDates: string[];
17
+ updatedStartDate: string;
18
+ applyToOrder: boolean;
19
+ };
20
+ dailyTotalsData: IUpdateFullDailyTotalReturnData[];
21
+ }
22
+ export type IMoveOrder = (data: IUpdateOrder, order: IOrder) => Promise<{
23
+ eventData: IMoveOrderEventData;
24
+ updatedOrder: IOrder;
25
+ }>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { IOrder } from "../../IOrder";
2
+ import { IMoveOrderTotalsData, ITotalsData } from ".";
3
+ export interface IUpdateFullDailyTotalReturnData {
4
+ oldStartDate: string;
5
+ updatedStartDate: string;
6
+ totalsData: ITotalsData[];
7
+ }
8
+ export type IUpdateFullDailyTotal = (data: IMoveOrderTotalsData, order: IOrder) => Promise<IUpdateFullDailyTotalReturnData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { ITotalsData } from ".";
2
+ import { IDateEntry, IOrder } from "../../IOrder";
3
+ export type IUpdateIndividualDailyTotal = (originalStartDate: string, data: IDateEntry, order: IOrder) => Promise<ITotalsData[]>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { ILeanDailyTotal } from "../../IDailyTotal";
2
+ export interface ITotalsData extends ILeanDailyTotal {
3
+ position: string;
4
+ }
5
+ export * from "./IMoveDateEntry";
6
+ export * from "./IMoveOrder";
7
+ export * from "./IUpdateFullDailyTotal";
8
+ export * from "./IUpdateIndividualDailyTotal";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./IMoveDateEntry"), exports);
18
+ __exportStar(require("./IMoveOrder"), exports);
19
+ __exportStar(require("./IUpdateFullDailyTotal"), exports);
20
+ __exportStar(require("./IUpdateIndividualDailyTotal"), exports);
@@ -0,0 +1,9 @@
1
+ import { ILeanDailyTotal } from "../IDailyTotal";
2
+ import { IOrder } from "../IOrder";
3
+ import { IUpdateOrder } from "../Routes/IOrderRoutes";
4
+ export type IFormattedHolidays = string[];
5
+ export interface IDateObject {
6
+ _id: string;
7
+ totals: number[];
8
+ }
9
+ export type ICheckForNegativeValue = (totals: ILeanDailyTotal, order: IOrder, data: IUpdateOrder) => Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { DateTime } from "luxon";
2
+ import { ILimit } from "../../ISetting";
3
+ import { IZapierOrder } from "../../Routes/IZapierRoutes";
4
+ import { IDateEntry } from "../../IOrder";
5
+ export type IFetchLimits = (type: string) => Promise<ILimit>;
6
+ export type ICalculateInitialStartDate = (shipDate: DateTime, limits: ILimit) => Promise<{
7
+ startDate: DateTime;
8
+ isHighlighted: boolean;
9
+ }>;
10
+ export type ICheckDailyTotals = (date: string, quantity: number, limitData: ILimit) => Promise<{
11
+ result: boolean;
12
+ exists?: boolean;
13
+ } | boolean>;
14
+ export type ICalculateStartDate = (startDate: DateTime, isHighlighted: boolean) => Promise<{
15
+ startDate: DateTime;
16
+ isHighlighted: boolean;
17
+ }>;
18
+ export type ICalculateRPD = (requiredProductionDays: number, requestedShipDate: DateTime) => number;
19
+ export type ICalculateShipDate = (startDate: DateTime, limits: ILimit) => Promise<DateTime>;
20
+ export type ICalculateStartDates = (summary: string[], data: IZapierOrder) => Promise<{
21
+ entries: IDateEntry[];
22
+ shipDate?: DateTime;
23
+ }>;
24
+ export type IUpdateAllmoxyShipDate = (id: string | number, shipDate: DateTime) => Promise<void>;
25
+ export type IPopulateDatabase = (entries: IDateEntry[], requestBody: IZapierOrder) => Promise<void>;
26
+ export type ICreateTotalsEntry = (startDate: string, dateEntry: IDateEntry) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ export interface IConfig {
2
+ DB_HOST: string;
3
+ DB_PORT: number;
4
+ DB_NAME: string;
5
+ VERSION: string;
6
+ DB_USER?: string;
7
+ DB_PASS?: string;
8
+ DB_URL: string;
9
+ PORT: number;
10
+ NODE_ENV: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Document } from "mongoose";
26
+ export type IDailyTotal = ILeanDailyTotal & Document;
27
+ export interface ILeanDailyTotal {
28
+ _id: string;
29
+ locked: boolean;
30
+ [key: string]: any;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,46 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { IDateEntryMoved } from "./Events/IDateEntryMoved";
26
+ import { IOrderMoved } from "./Events/IOrderMoved";
27
+ import { IOrderProcessed } from "./Events/IOrderProcessed";
28
+ import { INegativeValue } from "./Events/INegativeValue";
29
+ import mongoose, { Document } from "mongoose";
30
+ export type IEvent = ILeanEvent & Document;
31
+ export interface ILeanEvent {
32
+ _id: mongoose.Types.ObjectId;
33
+ time: Date;
34
+ orderID: string;
35
+ companyName: string;
36
+ status: number;
37
+ _type?: string;
38
+ }
39
+ export interface IDateEntryMovedEvent extends Event, IDateEntryMoved {
40
+ }
41
+ export interface IOrderMovedEvent extends Event, IOrderMoved {
42
+ }
43
+ export interface IOrderProcessedEvent extends Event, IOrderProcessed {
44
+ }
45
+ export interface INegativeValueEvent extends Event, INegativeValue {
46
+ }
package/dist/IEvent.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,60 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export interface IHeader {
27
+ name: string;
28
+ defaultValue?: string;
29
+ }
30
+ export type IExporter = ILeanExporter & Document;
31
+ export interface ILeanExporter {
32
+ _id: mongoose.Types.ObjectId;
33
+ exporterName: string;
34
+ programDirectory: string;
35
+ preProcessorScript: string;
36
+ emailAddress: string;
37
+ password: string;
38
+ csvGenerator?: IHeader[];
39
+ ignoreEmptyFiles: boolean;
40
+ firstLineHeaders: boolean;
41
+ }
42
+ export interface IAttachment {
43
+ fileName: string;
44
+ content: string;
45
+ }
46
+ export interface IMailCacheObject {
47
+ _id?: mongoose.Types.ObjectId;
48
+ time: Date;
49
+ subject: string;
50
+ attachments: IAttachment[];
51
+ saveDir: string;
52
+ state: string;
53
+ logs: string[];
54
+ }
55
+ export type IMailCache = ILeanMailCache & Document;
56
+ export interface ILeanMailCache {
57
+ _id: mongoose.Types.ObjectId;
58
+ exporterID?: string;
59
+ mailCache?: IMailCacheObject[];
60
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { Request, Response, NextFunction } from "express";
2
+ export type IRequestHandler = (req: Request, res: Response, next: NextFunction) => void | Promise<any>;
3
+ export declare enum IHTTPMethod {
4
+ GET = "get",
5
+ POST = "post",
6
+ PUT = "put",
7
+ DELETE = "delete"
8
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IHTTPMethod = void 0;
4
+ var IHTTPMethod;
5
+ (function (IHTTPMethod) {
6
+ IHTTPMethod["GET"] = "get";
7
+ IHTTPMethod["POST"] = "post";
8
+ IHTTPMethod["PUT"] = "put";
9
+ IHTTPMethod["DELETE"] = "delete";
10
+ })(IHTTPMethod || (exports.IHTTPMethod = IHTTPMethod = {}));
@@ -0,0 +1,31 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export type IIntegration = ILeanIntegration & Document;
27
+ export interface ILeanIntegration {
28
+ _id: mongoose.Types.ObjectId;
29
+ name: string;
30
+ any: any;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/IJWT.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export interface IJWTToken {
2
+ id: string;
3
+ ip: string;
4
+ }
package/dist/IJWT.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export type INotification = ILeanNotification & Document;
27
+ export interface ILeanNotification {
28
+ _id: mongoose.Types.ObjectId;
29
+ title: string;
30
+ message: string;
31
+ date: string;
32
+ target?: mongoose.Types.ObjectId;
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Document } from "mongoose";
26
+ export interface IDateEntry {
27
+ _id: string;
28
+ quantity: number;
29
+ type: string;
30
+ limitsGroup: string;
31
+ startDate: string;
32
+ hasStarted: boolean;
33
+ highlight: boolean;
34
+ }
35
+ export type IOrder = ILeanOrder & Document;
36
+ export interface ILeanOrder {
37
+ _id: number;
38
+ name?: string;
39
+ companyName: string;
40
+ date?: string;
41
+ shipDate: string;
42
+ requestedShipDate: string;
43
+ companyId?: number;
44
+ summary: string;
45
+ dateEntries: IDateEntry[];
46
+ orderTags: string[];
47
+ companyTags: string[];
48
+ }
package/dist/IOrder.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export type IScript = ILeanScript & Document;
27
+ export interface ILeanScript {
28
+ _id: mongoose.Types.ObjectId;
29
+ name: string;
30
+ usage: string;
31
+ language: string;
32
+ parser: "csv2json" | "xml2json";
33
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,88 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export interface ILeanSetting {
27
+ _id: mongoose.Types.ObjectId;
28
+ modifiedAt: string;
29
+ _type: string;
30
+ }
31
+ export interface ILeanAPIToken extends ILeanSetting {
32
+ name: string;
33
+ token: string;
34
+ permissions: string[];
35
+ expiry: string;
36
+ }
37
+ export interface ILeanGroup extends ILeanSetting {
38
+ name: string;
39
+ permissions: string[];
40
+ }
41
+ export interface ILeanHoliday extends ILeanSetting {
42
+ title: string;
43
+ date: string;
44
+ recurring?: boolean;
45
+ recurs?: string;
46
+ }
47
+ export interface ILeanLimit extends ILeanSetting {
48
+ name: string;
49
+ rpd: string;
50
+ limit: string;
51
+ enabled: boolean;
52
+ products?: string[];
53
+ }
54
+ export interface ILeanOrderFlag extends ILeanSetting {
55
+ name: string;
56
+ highlightColor: string;
57
+ products?: string[];
58
+ tags?: string[];
59
+ }
60
+ export interface ILeanSorting extends ILeanSetting {
61
+ headerList?: string[];
62
+ itemList: string[];
63
+ usage: "totals-groups" | "limits";
64
+ }
65
+ export interface ICalculation {
66
+ action: "add" | "subtract";
67
+ source: string;
68
+ calculation: "add" | "subtract" | "current";
69
+ days: string;
70
+ }
71
+ export interface ILeanTotalsGroup extends ILeanSetting {
72
+ name: string;
73
+ identifier: string;
74
+ calculations?: ICalculation[];
75
+ }
76
+ export interface ILeanKeyValue extends ILeanSetting {
77
+ key: string;
78
+ value: string;
79
+ }
80
+ export type ISetting = ILeanSetting & Document;
81
+ export type IAPIToken = ILeanAPIToken & Document;
82
+ export type IGroup = ILeanGroup & Document;
83
+ export type IHoliday = ILeanHoliday & Document;
84
+ export type ILimit = ILeanLimit & Document;
85
+ export type IOrderFlag = ILeanOrderFlag & Document;
86
+ export type ISorting = ILeanSorting & Document;
87
+ export type ITotalsGroup = ILeanTotalsGroup & Document;
88
+ export type IKeyValue = ILeanKeyValue & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export type IUser = ILeanUser & Document;
27
+ export interface ILeanUser {
28
+ _id: mongoose.Types.ObjectId;
29
+ firstName: string;
30
+ lastName: string;
31
+ email: string;
32
+ password: string;
33
+ permissions: any[];
34
+ groups: any[];
35
+ }
package/dist/IUser.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { IMailCacheObject } from "./IExporter";
2
+ export interface IPendingOperation {
3
+ exporterID: string;
4
+ mailCacheID: string;
5
+ mailCacheEntryID: string;
6
+ email: IMailCacheObject;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ export interface IOrderEntry {
2
+ id: string;
3
+ orderID: number;
4
+ name: string;
5
+ companyName: string;
6
+ quantity: number;
7
+ type: string;
8
+ startDate: string;
9
+ shipDate: string;
10
+ highlight: boolean;
11
+ rpd: number;
12
+ highlightColor: string | null;
13
+ hasStarted: boolean;
14
+ }
15
+ export interface IUpdateOrderOld {
16
+ id: string;
17
+ orderID: number;
18
+ startDate: string;
19
+ updatedStartDate: string;
20
+ shipDate: string;
21
+ applyToOrder: boolean;
22
+ }
23
+ export interface IUpdateOrder {
24
+ id: string;
25
+ orderID: number;
26
+ quantity: number;
27
+ type: string;
28
+ startDate: string;
29
+ shipDate: string;
30
+ updatedStartDate: string;
31
+ applyToOrder: boolean;
32
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // TODO: dissect data pased from move order and date entry
3
+ // create specific types for both varietes of req.body input
4
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export interface IZapierOrder {
2
+ id: number;
3
+ name: string;
4
+ companyName: string;
5
+ date: string;
6
+ shipDate: string;
7
+ requestedShipDate: string;
8
+ companyID: number;
9
+ summary: string;
10
+ orderTags: string;
11
+ companyTags: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface IDailyTotalsSchema {
2
+ type: typeof Number;
3
+ required: boolean;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ export * from "./IOrder";
2
+ export * from "./IExporter";
3
+ export * from "./IScript";
4
+ export * from "./IUser";
5
+ export * from "./IEvent";
6
+ export * from "./IDailyTotal";
7
+ export * from "./ISetting";
8
+ export * from "./IJWT";
9
+ export * from "./IExpress";
10
+ export * from "./IConfig";
11
+ export * from "./IWebsocket";
12
+ export * from "./Routes/IOrderRoutes";
13
+ export * from "./Helpers/IOrders";
14
+ export * from "./Helpers/IEvents";
15
+ export * from "./Helpers/IExporters";
16
+ export * from "./Helpers/ITotals";
17
+ export * from "./Helpers/IAdministration";
18
+ export * from "./Helpers/IZapier";
19
+ export * from "./Classes/ICRUDRouter";
20
+ export * from "./Classes/ILogger";
21
+ export * from "./Templates/IDailyTotals";
22
+ export * from "./Routes/IZapierRoutes";
23
+ export * from "./IIntegration";
24
+ export * from "./INotification";
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./IOrder"), exports);
18
+ __exportStar(require("./IExporter"), exports);
19
+ __exportStar(require("./IScript"), exports);
20
+ __exportStar(require("./IUser"), exports);
21
+ __exportStar(require("./IEvent"), exports);
22
+ __exportStar(require("./IDailyTotal"), exports);
23
+ __exportStar(require("./ISetting"), exports);
24
+ __exportStar(require("./IJWT"), exports);
25
+ __exportStar(require("./IExpress"), exports);
26
+ __exportStar(require("./IConfig"), exports);
27
+ __exportStar(require("./IWebsocket"), exports);
28
+ __exportStar(require("./Routes/IOrderRoutes"), exports);
29
+ __exportStar(require("./Helpers/IOrders"), exports);
30
+ __exportStar(require("./Helpers/IEvents"), exports);
31
+ __exportStar(require("./Helpers/IExporters"), exports);
32
+ __exportStar(require("./Helpers/ITotals"), exports);
33
+ __exportStar(require("./Helpers/IAdministration"), exports);
34
+ __exportStar(require("./Helpers/IZapier"), exports);
35
+ __exportStar(require("./Classes/ICRUDRouter"), exports);
36
+ __exportStar(require("./Classes/ILogger"), exports);
37
+ __exportStar(require("./Templates/IDailyTotals"), exports);
38
+ __exportStar(require("./Routes/IZapierRoutes"), exports);
39
+ __exportStar(require("./IIntegration"), exports);
40
+ __exportStar(require("./INotification"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "truflow",
3
- "version": "0.0.104",
3
+ "version": "0.0.105",
4
4
  "main": "./dist/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {