truflow 0.0.195 → 1.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/API/Allmoxy/IGeneric.d.ts +1 -0
  2. package/dist/API/Allmoxy/IOrderInventoryItems.d.ts +27 -0
  3. package/dist/API/Allmoxy/IOrderInventoryItems.js +2 -0
  4. package/dist/API/Allmoxy/index.d.ts +2 -0
  5. package/dist/API/Allmoxy/index.js +2 -0
  6. package/dist/Helpers/IExporters.d.ts +1 -42
  7. package/dist/IAutomation.d.ts +71 -3
  8. package/dist/IBackorder.d.ts +79 -0
  9. package/dist/IBackorder.js +2 -0
  10. package/dist/IDocumentType.d.ts +36 -0
  11. package/dist/IDocumentType.js +2 -0
  12. package/dist/IIntegration.d.ts +28 -0
  13. package/dist/IJobRole.d.ts +56 -0
  14. package/dist/IJobRole.js +2 -0
  15. package/dist/IMailCache.d.ts +1 -0
  16. package/dist/INotification.d.ts +1 -1
  17. package/dist/IOrder.d.ts +15 -0
  18. package/dist/ISMTPServerConfig.d.ts +41 -0
  19. package/dist/ISMTPServerConfig.js +2 -0
  20. package/dist/ISOP.d.ts +118 -0
  21. package/dist/ISOP.js +5 -0
  22. package/dist/ISchedule.d.ts +27 -3
  23. package/dist/ISetting.d.ts +16 -0
  24. package/dist/IShipment.d.ts +47 -0
  25. package/dist/IShipment.js +2 -0
  26. package/dist/ISupplier.d.ts +3 -0
  27. package/dist/IUser.d.ts +12 -0
  28. package/dist/Inventory/ILocation.d.ts +2 -0
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +4 -0
  31. package/package.json +1 -1
  32. package/src/API/Allmoxy/IContact.ts +59 -0
  33. package/src/API/Allmoxy/IGeneric.ts +1 -0
  34. package/src/API/Allmoxy/IOrderInventoryItems.ts +28 -0
  35. package/src/API/Allmoxy/index.ts +2 -0
  36. package/src/Helpers/IExporters.ts +3 -45
  37. package/src/IAutomation.ts +84 -1
  38. package/src/IDocumentType.ts +14 -0
  39. package/src/IIntegration.ts +36 -0
  40. package/src/IJobRole.ts +36 -0
  41. package/src/IMailCache.ts +1 -0
  42. package/src/INotification.ts +1 -0
  43. package/src/IOrder.ts +16 -0
  44. package/src/ISMTPServerConfig.ts +19 -0
  45. package/src/ISOP.ts +128 -0
  46. package/src/ISchedule.ts +31 -3
  47. package/src/ISetting.ts +22 -0
  48. package/src/ISupplier.ts +4 -0
  49. package/src/IUser.ts +14 -1
  50. package/src/Inventory/ILocation.ts +3 -0
  51. package/src/index.ts +4 -0
@@ -43,6 +43,7 @@ export interface IStatusChangeTrigger {
43
43
  contact_tags: any[];
44
44
  delivery_date: string;
45
45
  due_date: string;
46
+ previous_delivery_date?: string;
46
47
  entered_date: string;
47
48
  exported: string;
48
49
  gst: string;
@@ -0,0 +1,27 @@
1
+ export interface IOrderInventoryItemsQuery {
2
+ order_id?: number;
3
+ }
4
+ export interface IOrderInventoryItemsResponse {
5
+ supply_id: number;
6
+ order_id: number;
7
+ location_id: number | null;
8
+ item_id: number;
9
+ quantity: number;
10
+ /** Allmoxy returns price as a numeric string (e.g. "0E-8"). Parsed to number when storing internally. */
11
+ price: string | number;
12
+ type: string | null;
13
+ allocated_by: string | null;
14
+ timestamp: string | null;
15
+ createdby: string | null;
16
+ createdbyid: number | null;
17
+ createddate: string | null;
18
+ updatedby: string | null;
19
+ updatedbyid: number | null;
20
+ updateddate: string | null;
21
+ inventory_item_name: string;
22
+ inventory_item_piece_size: string;
23
+ inventory_item_status: number;
24
+ order_name: string;
25
+ order_type: string;
26
+ order_status: string;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export * from "./IAnnouncement";
2
2
  export * from "./ICompany";
3
+ export * from "./IContact";
3
4
  export * from "./IGeneric";
4
5
  export * from "./IInventoryItem";
5
6
  export * from "./IInventoryOrder";
@@ -13,4 +14,5 @@ export * from "./IProductAttributeOptions";
13
14
  export * from "./IProductProductAttribute";
14
15
  export * from "./ITrigger";
15
16
  export * from "./IOrderBatch";
17
+ export * from "./IOrderInventoryItems";
16
18
  export * from "./IShippingMethod";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./IAnnouncement"), exports);
18
18
  __exportStar(require("./ICompany"), exports);
19
+ __exportStar(require("./IContact"), exports);
19
20
  __exportStar(require("./IGeneric"), exports);
20
21
  __exportStar(require("./IInventoryItem"), exports);
21
22
  __exportStar(require("./IInventoryOrder"), exports);
@@ -29,4 +30,5 @@ __exportStar(require("./IProductAttributeOptions"), exports);
29
30
  __exportStar(require("./IProductProductAttribute"), exports);
30
31
  __exportStar(require("./ITrigger"), exports);
31
32
  __exportStar(require("./IOrderBatch"), exports);
33
+ __exportStar(require("./IOrderInventoryItems"), exports);
32
34
  __exportStar(require("./IShippingMethod"), exports);
@@ -1,42 +1 @@
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
- }
1
+ export {};
@@ -23,8 +23,8 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import mongoose, { Document } from "mongoose";
26
- export type AutomationTriggerType = "order.created" | "order.updated" | "order.statusChanged" | "schedule.entryAdded" | "schedule.fieldChanged" | "measurement.added" | "measurement.completed" | "walkthrough.submitted" | "walkthrough.arrived";
27
- export type AutomationActionType = "webhook" | "email" | "notification" | "sms" | "slack" | "update_field" | "add_note";
26
+ export type AutomationTriggerType = "order.created" | "order.updated" | "order.statusChanged" | "schedule.entryAdded" | "schedule.fieldChanged" | "measurement.added" | "measurement.completed" | "walkthrough.submitted" | "walkthrough.arrived" | "machineCheck.submitted" | "machineCheck.arrived" | "machineStatus.changed";
27
+ export type AutomationActionType = "webhook" | "email" | "notification" | "push_notification" | "sms" | "slack" | "google_chat" | "clickup" | "update_field" | "add_note";
28
28
  export type AutomationConditionOperator = "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "exists" | "notExists" | "in" | "notIn";
29
29
  export interface IAutomationCondition {
30
30
  field: string;
@@ -91,6 +91,19 @@ export interface IAutomationSlackAction {
91
91
  username?: string;
92
92
  iconEmoji?: string;
93
93
  }
94
+ export interface IAutomationGoogleChatAction {
95
+ type: "google_chat";
96
+ integrationId: string;
97
+ spaceId: string;
98
+ message: string;
99
+ threadKey?: string;
100
+ }
101
+ export interface IAutomationClickUpAction {
102
+ type: "clickup";
103
+ integrationId: string;
104
+ channelId: string;
105
+ message: string;
106
+ }
94
107
  export interface IAutomationUpdateFieldAction {
95
108
  type: "update_field";
96
109
  targetType: "order" | "scheduleEntry";
@@ -102,7 +115,17 @@ export interface IAutomationAddNoteAction {
102
115
  noteText: string;
103
116
  mentionUserIds?: string[];
104
117
  }
105
- export type IAutomationAction = IAutomationWebhookAction | IAutomationEmailAction | IAutomationNotificationAction | IAutomationSMSAction | IAutomationSlackAction | IAutomationUpdateFieldAction | IAutomationAddNoteAction;
118
+ export interface IAutomationPushNotificationAction {
119
+ type: "push_notification";
120
+ userIds: string[];
121
+ title: string;
122
+ message: string;
123
+ /** Optional deep-link payload. Supports template variables in string values.
124
+ * e.g. { screen: "Walkthroughs", templateId: "{{walkthrough.templateId}}" }
125
+ */
126
+ data?: Record<string, string>;
127
+ }
128
+ export type IAutomationAction = IAutomationWebhookAction | IAutomationEmailAction | IAutomationNotificationAction | IAutomationPushNotificationAction | IAutomationSMSAction | IAutomationSlackAction | IAutomationGoogleChatAction | IAutomationClickUpAction | IAutomationUpdateFieldAction | IAutomationAddNoteAction;
106
129
  export interface ILeanAutomation {
107
130
  _id: mongoose.Types.ObjectId;
108
131
  name: string;
@@ -192,6 +215,51 @@ export interface IAutomationContext {
192
215
  }>;
193
216
  [key: string]: any;
194
217
  };
218
+ machineCheck?: {
219
+ id: string;
220
+ templateId: string;
221
+ templateName: string;
222
+ machineId: string;
223
+ machineName: string;
224
+ submittedBy: {
225
+ id: string;
226
+ firstName: string;
227
+ lastName: string;
228
+ email?: string;
229
+ };
230
+ submittedAt: string;
231
+ comments?: string;
232
+ fields: Array<{
233
+ fieldId: string;
234
+ label: string;
235
+ type: "number" | "yesno" | "comment";
236
+ value: any;
237
+ status?: string;
238
+ }>;
239
+ [key: string]: any;
240
+ };
241
+ machineStatus?: {
242
+ machineId: string;
243
+ machineName: string;
244
+ oldStatus?: {
245
+ id: string;
246
+ name: string;
247
+ color: string;
248
+ };
249
+ newStatus: {
250
+ id: string;
251
+ name: string;
252
+ color: string;
253
+ };
254
+ changedBy: {
255
+ id: string;
256
+ firstName: string;
257
+ lastName: string;
258
+ email?: string;
259
+ };
260
+ changedAt: string;
261
+ comments?: string;
262
+ };
195
263
  triggeredBy?: {
196
264
  userId?: string;
197
265
  userName?: string;
@@ -0,0 +1,79 @@
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 IBackorderAttribute {
27
+ attributeName: string;
28
+ value: string | number;
29
+ }
30
+ export interface IBackorderLineItem {
31
+ id: number;
32
+ width?: number;
33
+ height?: number;
34
+ thickness?: number;
35
+ quantity: number;
36
+ description?: string;
37
+ reason: string;
38
+ attributes?: IBackorderAttribute[];
39
+ }
40
+ export interface IBackorderAllmoxyData {
41
+ groupId?: number;
42
+ opId?: number;
43
+ opiId?: number;
44
+ productId: number;
45
+ productAttributes?: IBackorderAttribute[];
46
+ lineItems?: IBackorderLineItem[];
47
+ }
48
+ export interface IBackorderOrderProduct {
49
+ _id?: string;
50
+ quantity: number;
51
+ type: string;
52
+ productionLine?: string;
53
+ startDate?: string;
54
+ hasStarted?: boolean;
55
+ highlight?: boolean;
56
+ allmoxyData?: IBackorderAllmoxyData;
57
+ }
58
+ export interface IBackorderEntry {
59
+ _id?: mongoose.Types.ObjectId;
60
+ orderId?: number;
61
+ orderName?: string;
62
+ orderProducts: IBackorderOrderProduct[];
63
+ createdBy: mongoose.Types.ObjectId;
64
+ assignedTo?: mongoose.Types.ObjectId;
65
+ status: "pending" | "in-progress" | "completed" | "cancelled";
66
+ completedAt?: Date;
67
+ notes?: string;
68
+ createdAt?: Date;
69
+ updatedAt?: Date;
70
+ }
71
+ export type IBackorder = IBackorderEntry & Document;
72
+ export interface IBackorderReason {
73
+ _id?: mongoose.Types.ObjectId;
74
+ reason: string;
75
+ enabled: boolean;
76
+ order: number;
77
+ createdAt?: Date;
78
+ updatedAt?: Date;
79
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
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 ILeanDocumentType {
27
+ _id?: mongoose.Types.ObjectId;
28
+ name: string;
29
+ slug: string;
30
+ description?: string;
31
+ isActive: boolean;
32
+ isSystem: boolean;
33
+ createdAt?: Date;
34
+ updatedAt?: Date;
35
+ }
36
+ export type IDocumentType = ILeanDocumentType & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -47,6 +47,13 @@ export interface ILeanAllmoxyIntegration extends ILeanIntegration {
47
47
  authToken: string;
48
48
  }[];
49
49
  saveSelectedAttributesInOrder?: boolean;
50
+ enableShipDateSync?: boolean;
51
+ shipDateWebhook?: {
52
+ id: string;
53
+ url: string;
54
+ event: string;
55
+ authToken: string;
56
+ };
50
57
  webhook?: {
51
58
  id: string;
52
59
  url: string;
@@ -57,3 +64,24 @@ export interface ILeanAllmoxyIntegration extends ILeanIntegration {
57
64
  };
58
65
  }
59
66
  export type IAllmoxyIntegration = ILeanAllmoxyIntegration & Document;
67
+ export interface IGoogleChatSpace {
68
+ _id: mongoose.Types.ObjectId;
69
+ name: string;
70
+ type: "space" | "dm" | "group";
71
+ webhookUrl: string;
72
+ }
73
+ export interface ILeanGoogleChatIntegration extends ILeanIntegration {
74
+ spaces: IGoogleChatSpace[];
75
+ }
76
+ export type IGoogleChatIntegration = ILeanGoogleChatIntegration & Document;
77
+ export interface IClickUpChannel {
78
+ _id: mongoose.Types.ObjectId;
79
+ name: string;
80
+ type: "channel" | "dm";
81
+ channelId: string;
82
+ }
83
+ export interface ILeanClickUpIntegration extends ILeanIntegration {
84
+ apiKey: string;
85
+ channels: IClickUpChannel[];
86
+ }
87
+ export type IClickUpIntegration = ILeanClickUpIntegration & Document;
@@ -0,0 +1,56 @@
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 IJobRole = ILeanJobRole & Document;
27
+ export interface ILeanJobRole {
28
+ _id: mongoose.Types.ObjectId;
29
+ name: string;
30
+ description?: string;
31
+ responsibilities?: string;
32
+ tasks?: IJobRoleTask[];
33
+ metrics?: IJobRoleMetric[];
34
+ qualifications?: string;
35
+ safetyNotes?: string;
36
+ tools?: string;
37
+ reportingTo?: string;
38
+ notes?: string;
39
+ assignedMachineIds?: (mongoose.Types.ObjectId | string)[];
40
+ assignedDepartmentIds?: (mongoose.Types.ObjectId | string)[];
41
+ assignedSOPIds?: (mongoose.Types.ObjectId | string)[];
42
+ enabled?: boolean;
43
+ createdAt?: Date;
44
+ updatedAt?: Date;
45
+ }
46
+ export interface IJobRoleTask {
47
+ title: string;
48
+ frequency: "daily" | "weekly" | "biweekly" | "monthly" | "asNeeded";
49
+ description?: string;
50
+ }
51
+ export interface IJobRoleMetric {
52
+ name: string;
53
+ description?: string;
54
+ unit?: string;
55
+ target?: string;
56
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -49,5 +49,6 @@ export interface IPDFAttachment {
49
49
  storagePath?: string;
50
50
  gridFSId?: mongoose.Types.ObjectId;
51
51
  orderNumber?: number;
52
+ documentType?: string;
52
53
  }
53
54
  export type IMailCache = ILeanMailCache & Document;
@@ -29,7 +29,7 @@ export interface INotificationAction {
29
29
  value: string;
30
30
  data?: Record<string, any>;
31
31
  }
32
- export type NotificationTag = "walkthrough" | "order_update" | "mention" | "automation" | "system" | "quality_control" | "inventory" | "schedule" | "general";
32
+ export type NotificationTag = "walkthrough" | "machine-check" | "order_update" | "mention" | "automation" | "system" | "quality_control" | "inventory" | "schedule" | "general";
33
33
  export type INotification = ILeanNotification & Document;
34
34
  export interface ILeanNotification {
35
35
  _id: mongoose.Types.ObjectId;
package/dist/IOrder.d.ts CHANGED
@@ -60,6 +60,7 @@ export interface ILineItem {
60
60
  width: number;
61
61
  height: number;
62
62
  thickness: number;
63
+ price?: number;
63
64
  attributes: IProductAttribute[];
64
65
  measurements?: IMeasurement[];
65
66
  }
@@ -89,6 +90,9 @@ export interface ILeanOrder {
89
90
  status: string;
90
91
  notes?: INote[];
91
92
  shippingComplete?: boolean;
93
+ subtotal?: number;
94
+ total?: number;
95
+ inventoryItems?: IOrderInventoryItem[];
92
96
  }
93
97
  export interface IMeasurement {
94
98
  width: number;
@@ -97,3 +101,14 @@ export interface IMeasurement {
97
101
  outOfSquare: number;
98
102
  comments: string;
99
103
  }
104
+ export interface IOrderInventoryItem {
105
+ supply_id: number;
106
+ item_id: number;
107
+ location_id?: number | null;
108
+ quantity: number;
109
+ price?: number;
110
+ inventory_item_name: string;
111
+ inventory_item_piece_size: string;
112
+ /** Whether this is a quote (pre-allocation) or initial (confirmed allocation) entry */
113
+ type: "quote" | "initial";
114
+ }
@@ -0,0 +1,41 @@
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 ILeanSMTPServerConfig {
27
+ _id?: mongoose.Types.ObjectId;
28
+ enabled: boolean;
29
+ host: string;
30
+ port: number;
31
+ secure: boolean;
32
+ domain: string;
33
+ maxSize: number;
34
+ requireAuth: boolean;
35
+ authUsername?: string;
36
+ authPassword?: string;
37
+ rejectUnauthorized: boolean;
38
+ createdAt?: Date;
39
+ updatedAt?: Date;
40
+ }
41
+ export type ISMTPServerConfig = ILeanSMTPServerConfig & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/ISOP.d.ts ADDED
@@ -0,0 +1,118 @@
1
+ /**
2
+ * SOP (Standard Operating Procedure) Type Definitions
3
+ */
4
+ /**
5
+ * Linked SOP reference
6
+ */
7
+ export interface ILinkedSOP {
8
+ sopId: string;
9
+ label?: string;
10
+ }
11
+ /**
12
+ * External link
13
+ */
14
+ export interface IExternalLink {
15
+ url: string;
16
+ label?: string;
17
+ }
18
+ /**
19
+ * Linked machine check reference
20
+ */
21
+ export interface ILinkedMachineCheck {
22
+ checkId: string;
23
+ label?: string;
24
+ }
25
+ /**
26
+ * Step in a step-based SOP
27
+ */
28
+ export interface ISOPStep {
29
+ stepNumber: number;
30
+ title: string;
31
+ description?: string;
32
+ imageUrl?: string;
33
+ linkedSOPs?: ILinkedSOP[];
34
+ externalLinks?: IExternalLink[];
35
+ linkedMachineChecks?: ILinkedMachineCheck[];
36
+ }
37
+ /**
38
+ * Row in an operating parameters table
39
+ */
40
+ export interface IParameterRow {
41
+ rowIndex: number;
42
+ rowHeader?: string;
43
+ cells: string[];
44
+ }
45
+ /**
46
+ * Operating parameters structure for parameter-based SOPs
47
+ */
48
+ export interface ISOPParameters {
49
+ rowHeaderLabel?: string;
50
+ columnHeaders?: string[];
51
+ rows?: IParameterRow[];
52
+ footer?: string;
53
+ }
54
+ /**
55
+ * Main SOP document interface
56
+ */
57
+ export interface ISOP {
58
+ _id: string;
59
+ title: string;
60
+ description?: string;
61
+ type: "document" | "steps" | "parameters";
62
+ content?: string;
63
+ steps?: ISOPStep[];
64
+ parameters?: ISOPParameters;
65
+ machineIds?: string[];
66
+ folderId?: string;
67
+ trainingStep?: string;
68
+ linkedSOPs?: ILinkedSOP[];
69
+ externalLinks?: IExternalLink[];
70
+ linkedMachineChecks?: ILinkedMachineCheck[];
71
+ enabled: boolean;
72
+ version: number;
73
+ note?: string;
74
+ createdAt: Date;
75
+ updatedAt: Date;
76
+ }
77
+ /**
78
+ * SOP data snapshot stored in revisions
79
+ */
80
+ export interface ISOPRevisionData {
81
+ title: string;
82
+ description?: string;
83
+ type: "document" | "steps" | "parameters";
84
+ content?: string;
85
+ steps?: ISOPStep[];
86
+ parameters?: ISOPParameters;
87
+ machineIds?: string[];
88
+ trainingStep?: string;
89
+ linkedSOPs?: ILinkedSOP[];
90
+ externalLinks?: IExternalLink[];
91
+ linkedMachineChecks?: ILinkedMachineCheck[];
92
+ enabled: boolean;
93
+ }
94
+ /**
95
+ * SOP Revision document interface
96
+ */
97
+ export interface ISOPRevision {
98
+ _id: string;
99
+ sopId: string;
100
+ revisionNumber: number;
101
+ sopData: ISOPRevisionData;
102
+ createdBy?: string;
103
+ changeReason?: string;
104
+ createdAt: Date;
105
+ updatedAt: Date;
106
+ }
107
+ /**
108
+ * SOP Folder interface for organizing SOPs
109
+ */
110
+ export interface ISOPFolder {
111
+ _id: string;
112
+ name: string;
113
+ description?: string;
114
+ color?: string;
115
+ order?: number;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ }
package/dist/ISOP.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * SOP (Standard Operating Procedure) Type Definitions
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });