waltronics-types 1.0.11 → 1.0.12

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.
@@ -1,36 +1,35 @@
1
- import { EmployeeNote } from "./Note";
2
- import { AppointmentLabels } from "./Label";
3
- import { Part } from "./Part";
4
- import { Repair } from "./Repair";
5
- import { Payment } from "./Payment";
6
- import { Service } from "./Service";
7
- import { Diagnosis } from "./Diagnosis";
8
-
9
- export type Appointment = {
10
- CustomerID: string;
11
- AppointmentID: string;
12
- FName: string;
13
- LName: string;
14
- Email: string;
15
- Phone: string;
16
- CreationDate: Date;
17
- UpdationDate: Date;
18
- StartDate: string|null;
19
- EndDate: string|null;
20
- Cost: number;
21
- StatusID: number;
22
- Status: string;
23
- Make: string;
24
- Model: string;
25
- ModelYear: number;
26
- VIN: string;
27
- Mileage: number;
28
- LicensePlate: string;
29
- Labels: AppointmentLabels;
30
- Notes: Array<EmployeeNote>;
31
- Parts: Array<Part>;
32
- Repairs: Array<Repair>;
33
- Payments: Array<Payment>;
34
- Services: Array<Service>;
35
- Diagnoses: Array<Diagnosis>;
36
- }
1
+ import { EmployeeNote } from "./Note";
2
+ import { AppointmentLabels } from "./Label";
3
+ import { Part } from "./Part";
4
+ import { Repair } from "./Repair";
5
+ import { Payment } from "./Payment";
6
+ import { Service } from "./Service";
7
+ import { Diagnosis } from "./Diagnosis";
8
+ export type Appointment = {
9
+ CustomerID: string;
10
+ AppointmentID: string;
11
+ FName: string;
12
+ LName: string;
13
+ Email: string;
14
+ Phone: string;
15
+ CreationDate: Date;
16
+ UpdationDate: Date;
17
+ StartDate: string | null;
18
+ EndDate: string | null;
19
+ Cost: number;
20
+ StatusID: number;
21
+ Status: string;
22
+ Make: string;
23
+ Model: string;
24
+ ModelYear: number;
25
+ VIN: string;
26
+ Mileage: number;
27
+ LicensePlate: string;
28
+ Labels: AppointmentLabels;
29
+ Notes: Array<EmployeeNote>;
30
+ Parts: Array<Part>;
31
+ Repairs: Array<Repair>;
32
+ Payments: Array<Payment>;
33
+ Services: Array<Service>;
34
+ Diagnoses: Array<Diagnosis>;
35
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +1,27 @@
1
- import { AppointmentLabels } from "./Label";
2
-
3
- export type AppointmentEntry = {
4
- AppointmentID: string;
5
- CustomerID: string;
6
- FName: string;
7
- LName: string;
8
- Email: string;
9
- Phone: string;
10
- CreationDate: Date;
11
- UpdationDate: Date;
12
- StartDate: Date;
13
- EndDate: Date;
14
- Cost: number;
15
- StatusID: number;
16
- Status: number;
17
- Make: string;
18
- Model: string;
19
- ModelYear: number;
20
- VIN: string;
21
- Mileage: number;
22
- LicensePlate: string;
23
- Labels: AppointmentLabels;
24
- }
25
-
26
- export type AppointmentList = {
27
- Count: number;
28
- Appointments: Array<AppointmentEntry>;
29
- }
1
+ import { AppointmentLabels } from "./Label";
2
+ export type AppointmentEntry = {
3
+ AppointmentID: string;
4
+ CustomerID: string;
5
+ FName: string;
6
+ LName: string;
7
+ Email: string;
8
+ Phone: string;
9
+ CreationDate: Date;
10
+ UpdationDate: Date;
11
+ StartDate: Date;
12
+ EndDate: Date;
13
+ Cost: number;
14
+ StatusID: number;
15
+ Status: number;
16
+ Make: string;
17
+ Model: string;
18
+ ModelYear: number;
19
+ VIN: string;
20
+ Mileage: number;
21
+ LicensePlate: string;
22
+ Labels: AppointmentLabels;
23
+ };
24
+ export type AppointmentList = {
25
+ Count: number;
26
+ Appointments: Array<AppointmentEntry>;
27
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
- export type Diagnosis = {
2
- DiagnosisID: number;
3
- Code: string;
4
- Message: string;
5
- }
1
+ export type Diagnosis = {
2
+ DiagnosisID: number;
3
+ Code: string;
4
+ Message: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,16 @@
1
- export type Employee = {
2
- EmployeeID: string;
3
- FName: string;
4
- LName: string;
5
- Email: string;
6
- Phone: string;
7
- }
8
-
9
- export type EmployeeName = {
10
- EmployeeID: string;
11
- FName: string;
12
- LName: string;
13
- }
14
-
15
- export type EmployeeFullName = {
16
- EmployeeID: string;
17
- FullName: string;
18
- }
1
+ export type Employee = {
2
+ EmployeeID: string;
3
+ FName: string;
4
+ LName: string;
5
+ Email: string;
6
+ Phone: string;
7
+ };
8
+ export type EmployeeName = {
9
+ EmployeeID: string;
10
+ FName: string;
11
+ LName: string;
12
+ };
13
+ export type EmployeeFullName = {
14
+ EmployeeID: string;
15
+ FullName: string;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,17 @@
1
- export type Event = {
2
- EventID: number;
3
- EmployeeID: string;
4
- Name: string;
5
- Date: string;
6
- Summary: string;
7
- AppointmentID: string|null;
8
- Sharees: Array<{
9
- ShareeID: string;
10
- EventID: string;
11
- }>;
12
- }
13
-
14
- export type EventSharee = {
15
- ShareeFName: string;
16
- ShareeLName: string;
17
- ShareeID: string;
18
- }
1
+ export type Event = {
2
+ EventID: number;
3
+ EmployeeID: string;
4
+ Name: string;
5
+ Date: string;
6
+ Summary: string;
7
+ AppointmentID: string | null;
8
+ Sharees: Array<{
9
+ ShareeID: string;
10
+ EventID: string;
11
+ }>;
12
+ };
13
+ export type EventSharee = {
14
+ ShareeFName: string;
15
+ ShareeLName: string;
16
+ ShareeID: string;
17
+ };
package/dist/Event.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,23 +1,20 @@
1
- export type InfoMake = {
2
- Make: string;
3
- }
4
-
5
- export type InfoLabel = {
6
- LabelID: number;
7
- Label: string;
8
- }
9
-
10
- export type InfoStatus = {
11
- StatusID: number;
12
- Status: string;
13
- Description: string;
14
- }
15
-
16
- export type InfoService = {
17
- ClassID: number;
18
- DivisionID: number;
19
- ServiceID: number;
20
- Class: string;
21
- Division: string;
22
- Service: string;
23
- }
1
+ export type InfoMake = {
2
+ Make: string;
3
+ };
4
+ export type InfoLabel = {
5
+ LabelID: number;
6
+ Label: string;
7
+ };
8
+ export type InfoStatus = {
9
+ StatusID: number;
10
+ Status: string;
11
+ Description: string;
12
+ };
13
+ export type InfoService = {
14
+ ClassID: number;
15
+ DivisionID: number;
16
+ ServiceID: number;
17
+ Class: string;
18
+ Division: string;
19
+ Service: string;
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +1,12 @@
1
- export type Label = {
2
- LabelID: number;
3
- Label: string;
4
- Value: number|null;
5
- AppointmentID: string;
6
- }
7
-
8
- export type AppointmentLabels = {
9
- // The "LabelName" is what the "Label"
10
- // property is in the "Label" type.
11
- [LabelName: string]: Label;
12
- }
13
-
14
- export type MultipleAppointmentLabels = {
15
- [AppointmentID: string]: AppointmentLabels;
16
- }
1
+ export type Label = {
2
+ LabelID: number;
3
+ Label: string;
4
+ Value: number | null;
5
+ AppointmentID: string;
6
+ };
7
+ export type AppointmentLabels = {
8
+ [LabelName: string]: Label;
9
+ };
10
+ export type MultipleAppointmentLabels = {
11
+ [AppointmentID: string]: AppointmentLabels;
12
+ };
package/dist/Label.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,34 +1,31 @@
1
- export type Note = {
2
- NoteID: string;
3
- EmployeeID: string;
4
- AppointmentID: string;
5
- Head: string;
6
- Body: string;
7
- ShowCustomer: string;
8
- CreationDate: Date;
9
- UpdationDate: Date;
10
- Sharees: Array<{
11
- ShareeID: string;
12
- NoteID: string;
13
- }>;
14
- Attachments: Array<NoteAttachment>;
15
- }
16
-
17
- export type NoteAttachment = {
18
- NoteID: number;
19
- AttachmentID: number;
20
- URL: string;
21
- Name: string;
22
- }
23
-
24
- export type NoteSharee = {
25
- ShareeFName: string;
26
- ShareeLName: string;
27
- ShareeID: string;
28
- }
29
-
30
- export type EmployeeNote = Note & {
31
- OwnerFName: string;
32
- OwnerLName: string;
33
- OwnerID: string;
34
- }
1
+ export type Note = {
2
+ NoteID: string;
3
+ EmployeeID: string;
4
+ AppointmentID: string;
5
+ Head: string;
6
+ Body: string;
7
+ ShowCustomer: string;
8
+ CreationDate: Date;
9
+ UpdationDate: Date;
10
+ Sharees: Array<{
11
+ ShareeID: string;
12
+ NoteID: string;
13
+ }>;
14
+ Attachments: Array<NoteAttachment>;
15
+ };
16
+ export type NoteAttachment = {
17
+ NoteID: number;
18
+ AttachmentID: number;
19
+ URL: string;
20
+ Name: string;
21
+ };
22
+ export type NoteSharee = {
23
+ ShareeFName: string;
24
+ ShareeLName: string;
25
+ ShareeID: string;
26
+ };
27
+ export type EmployeeNote = Note & {
28
+ OwnerFName: string;
29
+ OwnerLName: string;
30
+ OwnerID: string;
31
+ };
package/dist/Note.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
- export type Part = {
2
- PartID: number;
3
- PartName: string;
4
- PartNumber: string;
5
- Quantity: number;
6
- UnitCost: number;
7
- }
1
+ export type Part = {
2
+ PartID: number;
3
+ PartName: string;
4
+ PartNumber: string;
5
+ Quantity: number;
6
+ UnitCost: number;
7
+ };
package/dist/Part.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,10 @@
1
- export type Payment = {
2
- PaymentID: string;
3
- AppointmentID: string;
4
- Payment: number;
5
- PaymentDate: Date;
6
- Name: string;
7
- Type: string;
8
- CCN: string;
9
- EXP: string;
10
- }
1
+ export type Payment = {
2
+ PaymentID: string;
3
+ AppointmentID: string;
4
+ Payment: number;
5
+ PaymentDate: Date;
6
+ Name: string;
7
+ Type: string;
8
+ CCN: string;
9
+ EXP: string;
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,31 +1,30 @@
1
- import { Note } from "./Note";
2
- import { Repair } from "./Repair";
3
- import { Service } from "./Service";
4
- import { Diagnosis } from "./Diagnosis";
5
-
6
- export type ProtectedAppointment = {
7
- AppointmentID: string;
8
- CustomerID: number;
9
- FName: string;
10
- LName: string;
11
- Email: string;
12
- Phone: string;
13
- CreationDate: Date;
14
- UpdationDate: Date;
15
- StartDate: Date;
16
- EndDate: Date;
17
- Cost: number;
18
- StatusID: number;
19
- Status: string;
20
- StatusDescription: string;
21
- Make: string;
22
- Model: string;
23
- ModelYear: number;
24
- VIN: string;
25
- Mileage: number;
26
- LicensePlate: string;
27
- Notes: Array<Note>;
28
- Repairs: Array<Repair>;
29
- Services: Array<Service>;
30
- Diagnoses: Array<Diagnosis>;
31
- }
1
+ import { Note } from "./Note";
2
+ import { Repair } from "./Repair";
3
+ import { Service } from "./Service";
4
+ import { Diagnosis } from "./Diagnosis";
5
+ export type ProtectedAppointment = {
6
+ AppointmentID: string;
7
+ CustomerID: number;
8
+ FName: string;
9
+ LName: string;
10
+ Email: string;
11
+ Phone: string;
12
+ CreationDate: Date;
13
+ UpdationDate: Date;
14
+ StartDate: Date;
15
+ EndDate: Date;
16
+ Cost: number;
17
+ StatusID: number;
18
+ Status: string;
19
+ StatusDescription: string;
20
+ Make: string;
21
+ Model: string;
22
+ ModelYear: number;
23
+ VIN: string;
24
+ Mileage: number;
25
+ LicensePlate: string;
26
+ Notes: Array<Note>;
27
+ Repairs: Array<Repair>;
28
+ Services: Array<Service>;
29
+ Diagnoses: Array<Diagnosis>;
30
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- export type Repair = {
2
- RepairID: number;
3
- Repair: string;
4
- }
1
+ export type Repair = {
2
+ RepairID: number;
3
+ Repair: string;
4
+ };
package/dist/Repair.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export type Service = {
2
+ AppointmentServiceID: number;
3
+ AppointmentID: string;
4
+ Class: string;
5
+ Division: string;
6
+ Service: string;
7
+ ServiceID: number | null;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ export declare const VIN: RegExp;
3
+ export declare const UUID: RegExp;
4
+ export declare const SQL_DATE: RegExp;
5
+ export declare const isName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
+ export declare const isEmail: z.ZodEmail;
7
+ export declare const isPhone: z.ZodString;
8
+ export declare const isDate: z.ZodString;
9
+ export declare const isMoney: z.ZodCoercedNumber<unknown>;
10
+ export declare const isVIN: z.ZodString;
11
+ export declare const isInteger: z.ZodCoercedNumber<unknown>;
12
+ export declare const isIntegerArray: z.ZodArray<z.ZodCoercedNumber<unknown>>;
13
+ export declare const isUUID: z.ZodUUID;
14
+ export declare const isUUIDArray: z.ZodArray<z.ZodString>;
15
+ export declare const isBit: z.ZodEnum<{
16
+ "0, 1": "0, 1";
17
+ }>;
18
+ export declare const isID: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodCoercedNumber<unknown>]>;
19
+ export declare const hasLengthAndClean: (data: {
20
+ min: number;
21
+ max: number;
22
+ name: string;
23
+ }) => z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
24
+ export declare const isCode: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
25
+ export declare const isMessage: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
26
+ export declare const isHead: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
27
+ export declare const isBody: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
28
+ export declare const isPartName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
29
+ export declare const isPartNumber: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
30
+ export declare const isCreditCardNumber: z.ZodString;
31
+ export declare const isExpirationDate: z.ZodString;
32
+ export declare const isCreditCardType: z.ZodEnum<{
33
+ VISA: "VISA";
34
+ MASTERCARD: "MASTERCARD";
35
+ AMEX: "AMEX";
36
+ }>;
37
+ export declare const isRepair: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
38
+ export declare const isClass: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
39
+ export declare const isDivision: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
40
+ export declare const isService: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isService = exports.isDivision = exports.isClass = exports.isRepair = exports.isCreditCardType = exports.isExpirationDate = exports.isCreditCardNumber = exports.isPartNumber = exports.isPartName = exports.isBody = exports.isHead = exports.isMessage = exports.isCode = exports.hasLengthAndClean = exports.isID = exports.isBit = exports.isUUIDArray = exports.isUUID = exports.isIntegerArray = exports.isInteger = exports.isVIN = exports.isMoney = exports.isDate = exports.isPhone = exports.isEmail = exports.isName = exports.SQL_DATE = exports.UUID = exports.VIN = void 0;
7
+ const zod_1 = require("zod");
8
+ const validator_1 = __importDefault(require("validator"));
9
+ exports.VIN = /^[A-HJ-NPR-Z0-9]{17}$/;
10
+ exports.UUID = /^[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}$/;
11
+ exports.SQL_DATE = /^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}(:[0-9]{2}$|:[0-9]{2}.[0-9]{3}$)/;
12
+ exports.isName = zod_1.z.string().trim().min(2, "Must enter a name.").max(50, "Must enter a name less than 50 characters.").regex(/^[A-Za-z\s'-]*$/, "Must enter a name without symbols.").transform(s => {
13
+ return s
14
+ .replace(/\s+/g, ' ')
15
+ .split(/\s/)
16
+ .filter(w => w.length > 0)
17
+ .map(w => w[0].toUpperCase() + w.slice(1).toLowerCase())
18
+ .join(" ");
19
+ });
20
+ exports.isEmail = zod_1.z.email("Must enter a valid email.").trim().toLowerCase().max(320, "Must enter a valid email.");
21
+ exports.isPhone = zod_1.z.string().trim().refine(s => {
22
+ const hasFormat = !!s.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/);
23
+ const isMobilePhone = validator_1.default.isMobilePhone("1" + s.replaceAll("-", ""), "en-US");
24
+ return hasFormat && isMobilePhone;
25
+ }, "Must enter a valid phone number in the format 123-456-7890.");
26
+ exports.isDate = zod_1.z.string().trim().regex(/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}(:[0-9]{2}$|:[0-9]{2}.[0-9]{3}$)/, "Must enter a valid date.");
27
+ exports.isMoney = zod_1.z.coerce.number("Must enter a valid value.");
28
+ exports.isVIN = zod_1.z.string().trim().regex(/^[A-HJ-NPR-Z0-9]{17}$/, "Must enter a valid VIN.");
29
+ exports.isInteger = zod_1.z.coerce.number().int();
30
+ exports.isIntegerArray = zod_1.z.array(zod_1.z.coerce.number().int());
31
+ exports.isUUID = zod_1.z.uuid("Must enter a valid ID.");
32
+ exports.isUUIDArray = zod_1.z.array(zod_1.z.string()).refine(ids => ids.every(id => !!id.match(exports.UUID)));
33
+ exports.isBit = zod_1.z.enum(["0, 1"], "Must enter a '0' or '1'.");
34
+ exports.isID = zod_1.z.union([
35
+ zod_1.z.literal(""),
36
+ zod_1.z.coerce.number().int()
37
+ ]);
38
+ const hasLengthAndClean = (data) => {
39
+ return zod_1.z
40
+ .string()
41
+ .trim()
42
+ .min(data.min, `Must enter a ${data.name}.`)
43
+ .max(data.max, `Must enter a ${data.name} less than 50 characters.`)
44
+ .transform(s => s.replace(/\s+/g, ' '))
45
+ .refine(s => s.length > 0, `Must enter a ${data.name}.`);
46
+ };
47
+ exports.hasLengthAndClean = hasLengthAndClean;
48
+ exports.isCode = (0, exports.hasLengthAndClean)({
49
+ min: 1,
50
+ max: 100,
51
+ name: "code"
52
+ });
53
+ exports.isMessage = (0, exports.hasLengthAndClean)({
54
+ min: 1,
55
+ max: 500,
56
+ name: "message"
57
+ });
58
+ exports.isHead = (0, exports.hasLengthAndClean)({
59
+ min: 1,
60
+ max: 100,
61
+ name: "value"
62
+ });
63
+ exports.isBody = (0, exports.hasLengthAndClean)({
64
+ min: 1,
65
+ max: 500,
66
+ name: "value"
67
+ });
68
+ exports.isPartName = (0, exports.hasLengthAndClean)({
69
+ min: 1,
70
+ max: 100,
71
+ name: "name"
72
+ });
73
+ exports.isPartNumber = (0, exports.hasLengthAndClean)({
74
+ min: 1,
75
+ max: 100,
76
+ name: "name"
77
+ });
78
+ exports.isCreditCardNumber = zod_1.z.string().trim().refine(s => {
79
+ const validLength = s.length >= 13 && s.length <= 16;
80
+ const providers = ["visa", "amex", "mastercard"];
81
+ let validCreditCardNumber = false;
82
+ for (const provider of providers) {
83
+ const validCreditCardNumberForProvider = validator_1.default.isCreditCard(s, { provider });
84
+ if (validCreditCardNumberForProvider) {
85
+ validCreditCardNumber = true;
86
+ break;
87
+ }
88
+ }
89
+ return validLength && validCreditCardNumber;
90
+ }, "Must enter a valid credit card number.");
91
+ exports.isExpirationDate = zod_1.z.string().trim().regex(/^(0[1-9]|1[0-2])[0-9]{2}$/, "Must enter a valid expiration date.").refine(s => {
92
+ const month = parseInt(s.substring(0, 2));
93
+ const year = 2000 + parseInt(s.substring(2, 4));
94
+ const now = new Date();
95
+ const currentYear = now.getFullYear();
96
+ const currentMonth = now.getMonth() + 1;
97
+ if (year > currentYear)
98
+ return true;
99
+ if (year === currentYear)
100
+ return month >= currentMonth;
101
+ return false;
102
+ }, "Card has expired.");
103
+ ;
104
+ exports.isCreditCardType = zod_1.z.enum([
105
+ 'VISA',
106
+ 'MASTERCARD',
107
+ 'AMEX'
108
+ ]);
109
+ exports.isRepair = (0, exports.hasLengthAndClean)({
110
+ min: 1,
111
+ max: 500,
112
+ name: "repair"
113
+ });
114
+ exports.isClass = (0, exports.hasLengthAndClean)({
115
+ min: 1,
116
+ max: 500,
117
+ name: "repair"
118
+ });
119
+ exports.isDivision = (0, exports.hasLengthAndClean)({
120
+ min: 1,
121
+ max: 50,
122
+ name: "value"
123
+ });
124
+ exports.isService = (0, exports.hasLengthAndClean)({
125
+ min: 1,
126
+ max: 50,
127
+ name: "value"
128
+ });
@@ -0,0 +1,13 @@
1
+ export * from "./Appointment";
2
+ export * from "./AppointmentList";
3
+ export * from "./Diagnosis";
4
+ export * from "./Employee";
5
+ export * from "./Event";
6
+ export * from "./Information";
7
+ export * from "./Label";
8
+ export * from "./Note";
9
+ export * from "./Part";
10
+ export * from "./Payment";
11
+ export * from "./ProtectedAppointment";
12
+ export * from "./Repair";
13
+ export * from "./Service";
package/dist/index.js ADDED
@@ -0,0 +1,29 @@
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("./Appointment"), exports);
18
+ __exportStar(require("./AppointmentList"), exports);
19
+ __exportStar(require("./Diagnosis"), exports);
20
+ __exportStar(require("./Employee"), exports);
21
+ __exportStar(require("./Event"), exports);
22
+ __exportStar(require("./Information"), exports);
23
+ __exportStar(require("./Label"), exports);
24
+ __exportStar(require("./Note"), exports);
25
+ __exportStar(require("./Part"), exports);
26
+ __exportStar(require("./Payment"), exports);
27
+ __exportStar(require("./ProtectedAppointment"), exports);
28
+ __exportStar(require("./Repair"), exports);
29
+ __exportStar(require("./Service"), exports);
package/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "waltronics-types",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Contains the types used in the Waltronics application.",
5
- "main": "index.js",
6
- "types": "index.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
8
+ "prepublish": "npm run build",
9
+ "build": "tsc",
10
+ "test": "echo \"Error: No Test Specified\" && exit 1"
9
11
  },
10
12
  "author": "",
11
13
  "license": "ISC",
14
+ "dependencies": {
15
+ "validator": "^13.15.26",
16
+ "zod": "^4.3.5"
17
+ },
12
18
  "devDependencies": {
13
- "@types/validator": "^13.15.10"
19
+ "@types/validator": "^13.15.10",
20
+ "typescript": "^5.9.3"
14
21
  }
15
22
  }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2021",
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "outDir": "./dist",
7
+ "strict": true,
8
+ "esModuleInterop": true
9
+ }
10
+ }
package/Service.ts DELETED
@@ -1,12 +0,0 @@
1
- export type Service = {
2
- // It's kind of confusing, but "AppointmentServiceID"
3
- // refers to the unique ID given to each Service instance.
4
- // "ServiceID" refers to the Info.Service information that this
5
- // Service has.
6
- AppointmentServiceID: number;
7
- AppointmentID: string;
8
- Class: string;
9
- Division: string;
10
- Service: string;
11
- ServiceID: number|null;
12
- }
package/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from "./Appointment.ts";
2
- export * from "./AppointmentList.ts";
3
- export * from "./Diagnosis.ts";
4
- export * from "./Employee.ts";
5
- export * from "./Event.ts";
6
- export * from "./Information.ts";
7
- export * from "./Label.ts";
8
- export * from "./Note.ts";
9
- export * from "./Part.ts";
10
- export * from "./Payment.ts";
11
- export * from "./ProtectedAppointment.ts";
12
- export * from "./Repair.ts";
13
- export * from "./Service.ts";
package/index.js DELETED
@@ -1,13 +0,0 @@
1
- export * from "./Appointment.ts";
2
- export * from "./AppointmentList.ts";
3
- export * from "./Diagnosis.ts";
4
- export * from "./Employee.ts";
5
- export * from "./Event.ts";
6
- export * from "./Information.ts";
7
- export * from "./Label.ts";
8
- export * from "./Note.ts";
9
- export * from "./Part.ts";
10
- export * from "./Payment.ts";
11
- export * from "./ProtectedAppointment.ts";
12
- export * from "./Repair.ts";
13
- export * from "./Service.ts";