@tiboli/types 0.0.3 → 0.0.5

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 (58) hide show
  1. package/dist/index.js +19 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/schemas/book.schema.d.ts +15 -0
  4. package/dist/schemas/book.schema.js +45 -0
  5. package/dist/schemas/book.schema.js.map +1 -0
  6. package/dist/schemas/copy.schema.d.ts +12 -0
  7. package/dist/schemas/copy.schema.js +44 -0
  8. package/dist/schemas/copy.schema.js.map +1 -0
  9. package/dist/schemas/customer.schema.d.ts +18 -0
  10. package/dist/schemas/customer.schema.js +46 -0
  11. package/dist/schemas/customer.schema.js.map +1 -0
  12. package/dist/schemas/group.schema.d.ts +12 -0
  13. package/dist/schemas/group.schema.js +44 -0
  14. package/dist/schemas/group.schema.js.map +1 -0
  15. package/dist/schemas/index.js +24 -0
  16. package/dist/schemas/index.js.map +1 -0
  17. package/dist/schemas/loan.schema.d.ts +24 -0
  18. package/dist/schemas/loan.schema.js +48 -0
  19. package/dist/schemas/loan.schema.js.map +1 -0
  20. package/{src/types/book.type.ts → dist/types/book.type.d.ts} +0 -1
  21. package/dist/types/book.type.js +3 -0
  22. package/dist/types/book.type.js.map +1 -0
  23. package/{src/types/copy.type.ts → dist/types/copy.type.d.ts} +0 -1
  24. package/dist/types/copy.type.js +3 -0
  25. package/dist/types/copy.type.js.map +1 -0
  26. package/{src/types/customer.type.ts → dist/types/customer.type.d.ts} +0 -1
  27. package/dist/types/customer.type.js +3 -0
  28. package/dist/types/customer.type.js.map +1 -0
  29. package/{src/types/group.types.ts → dist/types/group.types.d.ts} +0 -1
  30. package/dist/types/group.types.js +3 -0
  31. package/dist/types/group.types.js.map +1 -0
  32. package/{src/types/index.ts → dist/types/index.d.ts} +1 -5
  33. package/dist/types/index.js +3 -0
  34. package/dist/types/index.js.map +1 -0
  35. package/{src/types/loan.type.ts → dist/types/loan.type.d.ts} +0 -1
  36. package/dist/types/loan.type.js +3 -0
  37. package/dist/types/loan.type.js.map +1 -0
  38. package/package.json +4 -1
  39. package/.editorconfig +0 -39
  40. package/.github/CODE_OF_CONDUCT.md +0 -59
  41. package/.github/CONTRIBUTING.md +0 -148
  42. package/.github/workflows/ci.yml +0 -36
  43. package/.github/workflows/release.yml +0 -123
  44. package/.husky/pre-commit +0 -1
  45. package/.nvmrc +0 -1
  46. package/.prettierignore +0 -3
  47. package/.prettierrc +0 -19
  48. package/eslint.config.mjs +0 -112
  49. package/jest.config.js +0 -11
  50. package/src/schemas/book.schema.ts +0 -10
  51. package/src/schemas/copy.schema.ts +0 -9
  52. package/src/schemas/customer.schema.ts +0 -11
  53. package/src/schemas/group.schema.ts +0 -9
  54. package/src/schemas/loan.schema.ts +0 -13
  55. package/test/schemas/book.schema.test.ts +0 -20
  56. package/tsconfig.json +0 -21
  57. /package/{src/index.ts → dist/index.d.ts} +0 -0
  58. /package/{src/schemas/index.ts → dist/schemas/index.d.ts} +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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("./schemas"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB"}
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ export declare const BookSchema: z.ZodObject<{
3
+ id: z.ZodInt;
4
+ title: z.ZodString;
5
+ author: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const BookCreationSchema: z.ZodObject<{
8
+ title: z.ZodString;
9
+ author: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const BookUpdateSchema: z.ZodObject<{
12
+ id: z.ZodNonOptional<z.ZodOptional<z.ZodInt>>;
13
+ title: z.ZodOptional<z.ZodString>;
14
+ author: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
@@ -0,0 +1,45 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.BookUpdateSchema = exports.BookCreationSchema = exports.BookSchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ exports.BookSchema = z.object({
39
+ id: z.int(),
40
+ title: z.string(),
41
+ author: z.string(),
42
+ });
43
+ exports.BookCreationSchema = exports.BookSchema.omit({ id: true });
44
+ exports.BookUpdateSchema = exports.BookSchema.partial().required({ id: true });
45
+ //# sourceMappingURL=book.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book.schema.js","sourceRoot":"","sources":["../../src/schemas/book.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEZ,QAAA,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,QAAA,gBAAgB,GAAG,kBAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as z from 'zod';
2
+ export declare const CopySchema: z.ZodObject<{
3
+ id: z.ZodInt;
4
+ bookId: z.ZodInt;
5
+ }, z.core.$strip>;
6
+ export declare const CopyCreationSchema: z.ZodObject<{
7
+ bookId: z.ZodInt;
8
+ }, z.core.$strip>;
9
+ export declare const CopyUpdateSchema: z.ZodObject<{
10
+ id: z.ZodNonOptional<z.ZodOptional<z.ZodInt>>;
11
+ bookId: z.ZodOptional<z.ZodInt>;
12
+ }, z.core.$strip>;
@@ -0,0 +1,44 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CopyUpdateSchema = exports.CopyCreationSchema = exports.CopySchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ exports.CopySchema = z.object({
39
+ id: z.int(),
40
+ bookId: z.int(),
41
+ });
42
+ exports.CopyCreationSchema = exports.CopySchema.omit({ id: true });
43
+ exports.CopyUpdateSchema = exports.CopySchema.partial().required({ id: true });
44
+ //# sourceMappingURL=copy.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.schema.js","sourceRoot":"","sources":["../../src/schemas/copy.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEZ,QAAA,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;IACX,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE;CACf,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,QAAA,gBAAgB,GAAG,kBAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as z from 'zod';
2
+ export declare const CustomerSchema: z.ZodObject<{
3
+ id: z.ZodInt;
4
+ name: z.ZodString;
5
+ lastname: z.ZodString;
6
+ email: z.ZodEmail;
7
+ }, z.core.$strip>;
8
+ export declare const CustomerCreationSchema: z.ZodObject<{
9
+ name: z.ZodString;
10
+ email: z.ZodEmail;
11
+ lastname: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export declare const CustomerUpdateSchema: z.ZodObject<{
14
+ id: z.ZodNonOptional<z.ZodOptional<z.ZodInt>>;
15
+ name: z.ZodOptional<z.ZodString>;
16
+ lastname: z.ZodOptional<z.ZodString>;
17
+ email: z.ZodOptional<z.ZodEmail>;
18
+ }, z.core.$strip>;
@@ -0,0 +1,46 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CustomerUpdateSchema = exports.CustomerCreationSchema = exports.CustomerSchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ exports.CustomerSchema = z.object({
39
+ id: z.int(),
40
+ name: z.string(),
41
+ lastname: z.string(),
42
+ email: z.email(),
43
+ });
44
+ exports.CustomerCreationSchema = exports.CustomerSchema.omit({ id: true });
45
+ exports.CustomerUpdateSchema = exports.CustomerSchema.partial().required({ id: true });
46
+ //# sourceMappingURL=customer.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.schema.js","sourceRoot":"","sources":["../../src/schemas/customer.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEZ,QAAA,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE;CAChB,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,sBAAc,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,QAAA,oBAAoB,GAAG,sBAAc,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as z from 'zod';
2
+ export declare const GroupSchema: z.ZodObject<{
3
+ id: z.ZodInt;
4
+ name: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const GroupCreationSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const GroupUpdateSchema: z.ZodObject<{
10
+ id: z.ZodNonOptional<z.ZodOptional<z.ZodInt>>;
11
+ name: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
@@ -0,0 +1,44 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.GroupUpdateSchema = exports.GroupCreationSchema = exports.GroupSchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ exports.GroupSchema = z.object({
39
+ id: z.int(),
40
+ name: z.string(),
41
+ });
42
+ exports.GroupCreationSchema = exports.GroupSchema.omit({ id: true });
43
+ exports.GroupUpdateSchema = exports.GroupSchema.partial().required({ id: true });
44
+ //# sourceMappingURL=group.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.schema.js","sourceRoot":"","sources":["../../src/schemas/group.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEZ,QAAA,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,mBAAW,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACrD,QAAA,iBAAiB,GAAG,mBAAW,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoanUpdateSchema = exports.LoanCreationSchema = exports.LoanSchema = exports.GroupUpdateSchema = exports.GroupCreationSchema = exports.GroupSchema = exports.CustomerUpdateSchema = exports.CustomerCreationSchema = exports.CustomerSchema = exports.CopyUpdateSchema = exports.CopyCreationSchema = exports.CopySchema = exports.BookUpdateSchema = exports.BookCreationSchema = exports.BookSchema = void 0;
4
+ var book_schema_1 = require("./book.schema");
5
+ Object.defineProperty(exports, "BookSchema", { enumerable: true, get: function () { return book_schema_1.BookSchema; } });
6
+ Object.defineProperty(exports, "BookCreationSchema", { enumerable: true, get: function () { return book_schema_1.BookCreationSchema; } });
7
+ Object.defineProperty(exports, "BookUpdateSchema", { enumerable: true, get: function () { return book_schema_1.BookUpdateSchema; } });
8
+ var copy_schema_1 = require("./copy.schema");
9
+ Object.defineProperty(exports, "CopySchema", { enumerable: true, get: function () { return copy_schema_1.CopySchema; } });
10
+ Object.defineProperty(exports, "CopyCreationSchema", { enumerable: true, get: function () { return copy_schema_1.CopyCreationSchema; } });
11
+ Object.defineProperty(exports, "CopyUpdateSchema", { enumerable: true, get: function () { return copy_schema_1.CopyUpdateSchema; } });
12
+ var customer_schema_1 = require("./customer.schema");
13
+ Object.defineProperty(exports, "CustomerSchema", { enumerable: true, get: function () { return customer_schema_1.CustomerSchema; } });
14
+ Object.defineProperty(exports, "CustomerCreationSchema", { enumerable: true, get: function () { return customer_schema_1.CustomerCreationSchema; } });
15
+ Object.defineProperty(exports, "CustomerUpdateSchema", { enumerable: true, get: function () { return customer_schema_1.CustomerUpdateSchema; } });
16
+ var group_schema_1 = require("./group.schema");
17
+ Object.defineProperty(exports, "GroupSchema", { enumerable: true, get: function () { return group_schema_1.GroupSchema; } });
18
+ Object.defineProperty(exports, "GroupCreationSchema", { enumerable: true, get: function () { return group_schema_1.GroupCreationSchema; } });
19
+ Object.defineProperty(exports, "GroupUpdateSchema", { enumerable: true, get: function () { return group_schema_1.GroupUpdateSchema; } });
20
+ var loan_schema_1 = require("./loan.schema");
21
+ Object.defineProperty(exports, "LoanSchema", { enumerable: true, get: function () { return loan_schema_1.LoanSchema; } });
22
+ Object.defineProperty(exports, "LoanCreationSchema", { enumerable: true, get: function () { return loan_schema_1.LoanCreationSchema; } });
23
+ Object.defineProperty(exports, "LoanUpdateSchema", { enumerable: true, get: function () { return loan_schema_1.LoanUpdateSchema; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":";;;AAAA,6CAAiF;AAAxE,yGAAA,UAAU,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AACzD,6CAAiF;AAAxE,yGAAA,UAAU,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AACzD,qDAAiG;AAAxF,iHAAA,cAAc,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AAAE,uHAAA,oBAAoB,OAAA;AACrE,+CAAqF;AAA5E,2GAAA,WAAW,OAAA;AAAE,mHAAA,mBAAmB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAC5D,6CAAiF;AAAxE,yGAAA,UAAU,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,+GAAA,gBAAgB,OAAA"}
@@ -0,0 +1,24 @@
1
+ import * as z from 'zod';
2
+ export declare const LoanSchema: z.ZodObject<{
3
+ id: z.ZodInt;
4
+ copyId: z.ZodInt;
5
+ customerId: z.ZodInt;
6
+ lentDate: z.ZodDate;
7
+ dueDate: z.ZodDate;
8
+ returnDate: z.ZodDate;
9
+ }, z.core.$strip>;
10
+ export declare const LoanCreationSchema: z.ZodObject<{
11
+ copyId: z.ZodInt;
12
+ customerId: z.ZodInt;
13
+ lentDate: z.ZodDate;
14
+ dueDate: z.ZodDate;
15
+ returnDate: z.ZodDate;
16
+ }, z.core.$strip>;
17
+ export declare const LoanUpdateSchema: z.ZodObject<{
18
+ id: z.ZodNonOptional<z.ZodOptional<z.ZodInt>>;
19
+ copyId: z.ZodOptional<z.ZodInt>;
20
+ customerId: z.ZodOptional<z.ZodInt>;
21
+ lentDate: z.ZodOptional<z.ZodDate>;
22
+ dueDate: z.ZodOptional<z.ZodDate>;
23
+ returnDate: z.ZodOptional<z.ZodDate>;
24
+ }, z.core.$strip>;
@@ -0,0 +1,48 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.LoanUpdateSchema = exports.LoanCreationSchema = exports.LoanSchema = void 0;
37
+ const z = __importStar(require("zod"));
38
+ exports.LoanSchema = z.object({
39
+ id: z.int(),
40
+ copyId: z.int(),
41
+ customerId: z.int(),
42
+ lentDate: z.date(),
43
+ dueDate: z.date(),
44
+ returnDate: z.date(),
45
+ });
46
+ exports.LoanCreationSchema = exports.LoanSchema.omit({ id: true });
47
+ exports.LoanUpdateSchema = exports.LoanSchema.partial().required({ id: true });
48
+ //# sourceMappingURL=loan.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loan.schema.js","sourceRoot":"","sources":["../../src/schemas/loan.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEZ,QAAA,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;IACX,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE;CACpB,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,QAAA,gBAAgB,GAAG,kBAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { BookCreationSchema, BookSchema, BookUpdateSchema } from '../schemas';
3
-
4
3
  export type BookAttributes = z.infer<typeof BookSchema>;
5
4
  export type BookCreationAttributes = z.infer<typeof BookCreationSchema>;
6
5
  export type BookUpdateAttributes = z.infer<typeof BookUpdateSchema>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=book.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book.type.js","sourceRoot":"","sources":["../../src/types/book.type.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { CopyCreationSchema, CopySchema, CopyUpdateSchema } from '../schemas';
3
-
4
3
  export type CopyAttributes = z.infer<typeof CopySchema>;
5
4
  export type CopyCreationAttributes = z.infer<typeof CopyCreationSchema>;
6
5
  export type CopyUpdateAttributes = z.infer<typeof CopyUpdateSchema>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=copy.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.type.js","sourceRoot":"","sources":["../../src/types/copy.type.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { CustomerSchema, CustomerCreationSchema, CustomerUpdateSchema } from '../schemas';
3
-
4
3
  export type CustomerAttributes = z.infer<typeof CustomerSchema>;
5
4
  export type CustomerCreationAttributes = z.infer<typeof CustomerCreationSchema>;
6
5
  export type CustomerUpdateAttributes = z.infer<typeof CustomerUpdateSchema>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=customer.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.type.js","sourceRoot":"","sources":["../../src/types/customer.type.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { GroupSchema, GroupCreationSchema, GroupUpdateSchema } from '../schemas';
3
-
4
3
  export type GroupAttributes = z.infer<typeof GroupSchema>;
5
4
  export type GroupCreationAttributes = z.infer<typeof GroupCreationSchema>;
6
5
  export type GroupUpdateAttributes = z.infer<typeof GroupUpdateSchema>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=group.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.types.js","sourceRoot":"","sources":["../../src/types/group.types.ts"],"names":[],"mappings":""}
@@ -1,9 +1,5 @@
1
1
  export { BookAttributes, BookCreationAttributes, BookUpdateAttributes } from './book.type';
2
2
  export { CopyAttributes, CopyCreationAttributes, CopyUpdateAttributes } from './copy.type';
3
- export {
4
- CustomerAttributes,
5
- CustomerCreationAttributes,
6
- CustomerUpdateAttributes,
7
- } from './customer.type';
3
+ export { CustomerAttributes, CustomerCreationAttributes, CustomerUpdateAttributes, } from './customer.type';
8
4
  export { GroupAttributes, GroupCreationAttributes, GroupUpdateAttributes } from './group.types';
9
5
  export { LoanAttributes, LoanCreationAttributes, LoanUpdateAttributes } from './loan.type';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { LoanCreationSchema, LoanSchema, LoanUpdateSchema } from '../schemas';
3
-
4
3
  export type LoanAttributes = z.infer<typeof LoanSchema>;
5
4
  export type LoanCreationAttributes = z.infer<typeof LoanCreationSchema>;
6
5
  export type LoanUpdateAttributes = z.infer<typeof LoanUpdateSchema>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=loan.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loan.type.js","sourceRoot":"","sources":["../../src/types/loan.type.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiboli/types",
3
3
  "scope": "@tiboli",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "description": "Typedefinitions for Tiboli",
6
6
  "keywords": [
7
7
  "tiboli",
@@ -13,6 +13,9 @@
13
13
  "private": false,
14
14
  "main": "./dist/index.js",
15
15
  "types": "./dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
16
19
  "scripts": {
17
20
  "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
18
21
  "watch": "tsc --project tsconfig.json --watch",
package/.editorconfig DELETED
@@ -1,39 +0,0 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = tab
6
- indent_size = 4
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- # The JSON files contain newlines inconsistently
13
- [*.json]
14
- insert_final_newline = ignore
15
-
16
- # Minified JavaScript files shouldn't be changed
17
- [**.min.js]
18
- indent_style = ignore
19
- insert_final_newline = ignore
20
-
21
- # Makefiles always use tabs for indentation
22
- [Makefile]
23
- indent_style = tab
24
-
25
- # Batch files use tabs for indentation
26
- [*.bat]
27
- indent_style = tab
28
-
29
- [*.md]
30
- trim_trailing_whitespace = false
31
-
32
- [*.yml]
33
- indent_style = space
34
- indent_size = 2
35
- insert_final_newline = false
36
- [*.yaml]
37
- indent_style = space
38
- indent_size = 2
39
- insert_final_newline = false
@@ -1,59 +0,0 @@
1
- # Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We, as contributors and maintainers, pledge to make participation in this project and our community a welcoming, inclusive, and respectful experience for everyone.
6
- We are committed to ensuring that all people, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation, feel safe and valued.
7
-
8
- ## Our Standards
9
-
10
- Examples of behavior that contributes to a positive environment include:
11
-
12
- - Being respectful, kind, and patient in all interactions
13
- - Giving and gracefully accepting constructive feedback
14
- - Using inclusive language and assuming good intent
15
- - Helping others understand and grow, especially newcomers
16
- - Focusing on what is best for the community and project
17
-
18
- Examples of unacceptable behavior include:
19
-
20
- - Harassment, discrimination, or personal attacks
21
- - Trolling, insulting or derogatory comments, and personal or political fights
22
- - Publishing others’ private information without permission
23
- - Excessive negativity, sarcasm, or unconstructive criticism
24
- - Any behavior that could make others feel unsafe or unwelcome
25
-
26
- ## Our Responsibilities
27
-
28
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take fair and consistent corrective action in response to any unacceptable conduct.
29
-
30
- Maintainers have the right and responsibility to remove, edit, or reject contributions that are not aligned with this Code of Conduct (such as comments, commits, code, issues, or pull requests), and may temporarily or permanently ban contributors for behavior they deem inappropriate, threatening, or harmful.
31
-
32
- ## Scope
33
-
34
- This Code of Conduct applies both within project spaces (such as issues, pull requests, and discussions) and in public spaces when an individual is representing the project or its community.
35
-
36
- Examples include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
-
38
- ## Enforcement
39
-
40
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainers at:
41
-
42
- 📧 **[[your-contact@example.com](mailto:your-contact@example.com)]**
43
- (Replace this with your real contact email or a team alias.)
44
-
45
- All complaints will be reviewed and investigated promptly and fairly.
46
- Maintainers are obligated to respect the privacy and safety of reporters of incidents.
47
-
48
- ## Enforcement Guidelines
49
-
50
- Project maintainers will follow these steps when handling violations:
51
-
52
- 1. **Warning** – A private, written warning for minor violations.
53
- 2. **Temporary Ban** – For repeated or serious violations, temporary removal from participation.
54
- 3. **Permanent Ban** – For sustained harmful behavior, permanent removal from the community.
55
-
56
- ## Attribution
57
-
58
- This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at:
59
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)
@@ -1,148 +0,0 @@
1
- # Contributing Guidelines
2
-
3
- Thank you for your interest in contributing! 🎉
4
- We value clear communication, respectful collaboration, and clean, maintainable code.
5
- Please take a few minutes to review these guidelines before submitting your first pull request (PR).
6
-
7
- ## 🧭 Branching Strategy
8
-
9
- We follow a simplified Git Flow model:
10
-
11
- - **`main`**
12
- - Contains _production-ready_ code only.
13
- - Protected branch — no direct commits or pushes allowed.
14
- - Only receives changes via PRs from `develop` after testing and review.
15
- - Each merge triggers a release tag using the version from `package.json`.
16
-
17
- - **`develop`**
18
- - The integration branch for active development.
19
- - Receives merged `feature/*` branches.
20
- - CI ensures all builds, lints, and tests pass before promotion to `main`.
21
-
22
- - **`feature/*`**
23
- - For individual features, fixes, or small experiments.
24
- - Branch off from `develop` and merge back into `develop` via PR.
25
- - Keep them **short-lived** and **focused on one topic**.
26
-
27
- ## 🔄 Development Workflow
28
-
29
- 1. **Create a Feature Branch**
30
- From `develop`:
31
-
32
- ```bash
33
- git checkout develop
34
- git pull
35
- git checkout -b feature/your-feature-name
36
- ```
37
-
38
- 2. **Make Small, Clear Commits**
39
- - Commit frequently and keep each commit focused on a single logical change.
40
- - Avoid bundling unrelated edits in the same commit.
41
- - Use meaningful messages (see [Commit Style](#-commit-style) below).
42
- - Run tests and lint before committing:
43
-
44
- ```bash
45
- npm run lint
46
- npm test
47
- ```
48
-
49
- 3. **Push and Open a Pull Request (PR)**
50
- - Push your branch and open a PR targeting `develop`.
51
- - Clearly describe what your change does and _why_ it’s needed.
52
- - If your PR closes an issue, reference it in the description (e.g. “Fixes #42”).
53
- - Keep your PRs small — large ones are harder to review.
54
-
55
- 4. **Continuous Integration (CI)**
56
- All pushes and PRs trigger automated:
57
- - Linting
58
- - Build checks (`npm run build`)
59
- - Tests (`npm test`)
60
-
61
- 5. **Merge Process**
62
- - Wait for CI to pass and code review approval.
63
- - Avoid rebasing public branches; use `git merge develop` to stay up-to-date.
64
- - Once approved, the branch is merged into `develop`.
65
-
66
- 6. **Prepare a Release**
67
- When `develop` is stable and tested, open a PR to merge into `main`.
68
-
69
- 7. **Release & Tagging**
70
- On merge to `main`, a GitHub Action automatically:
71
- - Reads the `version` in `package.json`
72
- - Creates a tag (e.g. `v1.2.3`)
73
- - Publishes a GitHub Release with autogenerated notes
74
-
75
- ## 🧩 Versioning
76
-
77
- We use [Semantic Versioning](https://semver.org/) — `MAJOR.MINOR.PATCH`.
78
-
79
- ### Version Bump Workflow
80
-
81
- 1. Create a new branch from `develop`:
82
-
83
- ```bash
84
- git checkout -b version-bump/1.2.3
85
- ```
86
-
87
- 2. Update the `"version"` field in `package.json`.
88
- 3. Commit with:
89
-
90
- ```
91
- chore: bump version to 1.2.3
92
- ```
93
-
94
- 4. Open a PR targeting `develop`.
95
- 5. After CI and review, merge into `develop`.
96
- 6. When `develop` merges into `main`, the release workflow tags and publishes automatically.
97
-
98
- ## ✍️ Commit Style
99
-
100
- Please use clear, consistent, and meaningful commit messages.
101
- Follow this general structure:
102
-
103
- ```
104
- <type>: short description
105
- ```
106
-
107
- **Types:**
108
-
109
- - `feat:` – new feature
110
- - `fix:` – bug fix
111
- - `chore:` – maintenance, tooling, version bumps
112
- - `docs:` – documentation changes
113
- - `test:` – add or update tests
114
- - `refactor:` – code improvement without functional change
115
-
116
- **Examples:**
117
-
118
- - `feat: add search filter for book titles`
119
- - `fix: correct null pointer on user login`
120
- - `docs: update setup instructions`
121
-
122
- ## 🤝 Collaboration & Behavior
123
-
124
- We’re building a welcoming, respectful community. Please:
125
-
126
- - Be **kind**, **patient**, and **constructive** in discussions and reviews.
127
- - Avoid personal remarks — focus on the code, not the coder.
128
- - Use **inclusive language** and assume good intent.
129
- - Respect the existing code style and project conventions.
130
- - Ask before making large-scale refactors or changes that affect multiple areas.
131
- - Keep your PRs **small and focused** — it helps everyone review faster and with fewer conflicts.
132
-
133
- If you’re unsure about something, open a **Draft PR** or start a **Discussion** — collaboration is always better than guessing.
134
-
135
- ## 🧰 Building Locally
136
-
137
- ```bash
138
- npm install
139
- npm run build
140
- npm test
141
- ```
142
-
143
- Run the test suite before committing to ensure everything works as expected.
144
-
145
- ## 🙌 Thank You!
146
-
147
- Your time and contributions make this project better for everyone.
148
- We appreciate every PR, suggestion, and improvement — even small ones!
@@ -1,36 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - develop
7
- - "feature/**"
8
- pull_request:
9
- branches:
10
- - develop
11
- - main
12
-
13
- jobs:
14
- build-test:
15
- runs-on: [ubuntu-latest, self-hosted]
16
-
17
- steps:
18
- - name: Checkout code
19
- uses: actions/checkout@v4
20
-
21
- - name: Setup Node.js
22
- uses: actions/setup-node@v4
23
- with:
24
- node-version-file: .nvmrc
25
-
26
- - name: Install dependencies
27
- run: npm ci
28
-
29
- - name: Lint code
30
- run: npm run lint
31
-
32
- - name: Build TypeScript
33
- run: npm run build
34
-
35
- - name: Run tests
36
- run: npm run test
@@ -1,123 +0,0 @@
1
- name: Generate Release Tag from package.json and Publish to NPM
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- lint:
10
- runs-on: [ubuntu-latest, self-hosted]
11
- steps:
12
- - name: Checkout code
13
- uses: actions/checkout@v4
14
- - name: Setup Node.js
15
- uses: actions/setup-node@v4
16
- with:
17
- node-version-file: .nvmrc
18
- - name: Install dependencies
19
- run: npm ci
20
- - name: Lint code
21
- run: npm run lint
22
-
23
- test:
24
- runs-on: [ubuntu-latest, self-hosted]
25
- steps:
26
- - name: Checkout code
27
- uses: actions/checkout@v4
28
- - name: Setup Node.js
29
- uses: actions/setup-node@v4
30
- with:
31
- node-version-file: .nvmrc
32
- - name: Install dependencies
33
- run: npm ci
34
- - name: Run tests
35
- run: npm run test
36
-
37
- build:
38
- runs-on: [ubuntu-latest, self-hosted]
39
- needs: [lint, test]
40
- steps:
41
- - name: Checkout code
42
- uses: actions/checkout@v4
43
- - name: Setup Node.js
44
- uses: actions/setup-node@v4
45
- with:
46
- node-version-file: .nvmrc
47
- - name: Install dependencies
48
- run: npm ci
49
- - name: Run Build
50
- run: npm run build
51
-
52
- github-release:
53
- runs-on: [ubuntu-latest, self-hosted]
54
- needs: [build]
55
- permissions:
56
- contents: write
57
- steps:
58
- - name: Checkout code
59
- uses: actions/checkout@v4
60
- with:
61
- fetch-depth: 0
62
-
63
- - name: Setup Node.js
64
- uses: actions/setup-node@v4
65
- with:
66
- node-version-file: .nvmrc
67
-
68
- - name: Get version from package.json
69
- id: get_version
70
- run: |
71
- VERSION="v$(node -p "require('./package.json').version")"
72
- echo "version=$VERSION" >> $GITHUB_OUTPUT
73
-
74
- - name: Check if tag exists
75
- id: tag_check
76
- run: |
77
- if git rev-parse "${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
78
- echo "exists=true" >> $GITHUB_OUTPUT
79
- else
80
- echo "exists=false" >> $GITHUB_OUTPUT
81
- fi
82
-
83
- - name: Create GitHub release
84
- if: steps.tag_check.outputs.exists == 'false'
85
- uses: softprops/action-gh-release@v2
86
- with:
87
- tag_name: ${{ steps.get_version.outputs.version }}
88
- generate_release_notes: true
89
-
90
- npm-release:
91
- runs-on: [ubuntu-latest, self-hosted]
92
- needs: [build]
93
- permissions:
94
- contents: read
95
- id-token: write
96
- steps:
97
- - name: Checkout code
98
- uses: actions/checkout@v4
99
-
100
- - name: Setup Node.js for scoped package
101
- uses: actions/setup-node@v4
102
- with:
103
- node-version-file: .nvmrc
104
- registry-url: 'https://registry.npmjs.org/'
105
- scope: '@tiboli'
106
-
107
- - name: Verify npm configuration
108
- run: |
109
- echo "Registry:"
110
- npm config get registry
111
- echo "npmrc content:"
112
- cat ~/.npmrc || true
113
-
114
- - name: Install dependencies
115
- run: npm ci
116
-
117
- - name: Build package
118
- run: npm run build
119
-
120
- - name: Publish to npm
121
- run: npm publish --access public
122
- env:
123
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.husky/pre-commit DELETED
@@ -1 +0,0 @@
1
- npm run lint:staged
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v22.14.0
package/.prettierignore DELETED
@@ -1,3 +0,0 @@
1
- node_modules
2
- dist
3
- build
package/.prettierrc DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "useTabs": true,
3
- "tabWidth": 4,
4
- "endOfLine": "lf",
5
- "printWidth": 100,
6
- "semi": true,
7
- "singleQuote": true,
8
- "trailingComma": "es5",
9
- "overrides": [
10
- {
11
- "files": ["*.yml", "*.yaml"],
12
- "options": {
13
- "tabWidth": 2,
14
- "singleQuote": false,
15
- "useTabs": false
16
- }
17
- }
18
- ]
19
- }
package/eslint.config.mjs DELETED
@@ -1,112 +0,0 @@
1
- import { fixupConfigRules } from '@eslint/compat';
2
- import { FlatCompat } from '@eslint/eslintrc';
3
- import js from '@eslint/js';
4
- import tsParser from '@typescript-eslint/parser';
5
- import { defineConfig, globalIgnores } from 'eslint/config';
6
- import globals from 'globals';
7
-
8
- const compat = new FlatCompat({
9
- baseDirectory: import.meta.dirname,
10
- recommendedConfig: js.configs.recommended,
11
- allConfig: js.configs.all,
12
- });
13
-
14
- export default defineConfig([
15
- {
16
- languageOptions: {
17
- parser: tsParser,
18
- ecmaVersion: 2020,
19
- sourceType: 'module',
20
-
21
- parserOptions: {
22
- project: ['./tsconfig.json'],
23
- tsconfigRootDir: import.meta.dirname,
24
- },
25
- globals: globals.node,
26
- },
27
-
28
- extends: fixupConfigRules(
29
- compat.extends(
30
- 'eslint:recommended',
31
- 'plugin:@typescript-eslint/eslint-recommended',
32
- 'plugin:@typescript-eslint/recommended',
33
- 'plugin:prettier/recommended',
34
- 'plugin:import/errors',
35
- 'plugin:import/warnings',
36
- 'plugin:import/typescript'
37
- )
38
- ),
39
-
40
- rules: {
41
- '@typescript-eslint/no-floating-promises': 'error',
42
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
43
-
44
- 'no-constant-condition': [
45
- 'error',
46
- {
47
- checkLoops: false,
48
- },
49
- ],
50
-
51
- 'import/order': [
52
- 'error',
53
- {
54
- groups: ['builtin', 'external', 'internal'],
55
-
56
- pathGroups: [
57
- {
58
- pattern: '(^src)|(^test)\\/*',
59
- group: 'internal',
60
- },
61
- {
62
- pattern: '^(?!src|test).*',
63
- group: 'external',
64
- },
65
- ],
66
-
67
- alphabetize: {
68
- order: 'asc',
69
- },
70
- },
71
- ],
72
-
73
- 'import/no-unresolved': 'off',
74
-
75
- '@typescript-eslint/naming-convention': [
76
- 'warn',
77
- {
78
- selector: 'enumMember',
79
- format: ['PascalCase'],
80
- },
81
- {
82
- selector: 'variableLike',
83
- format: ['camelCase'],
84
- },
85
- {
86
- selector: 'variable',
87
- format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
88
- },
89
- {
90
- selector: 'parameter',
91
- format: ['camelCase'],
92
- leadingUnderscore: 'allow',
93
- },
94
- {
95
- selector: 'typeLike',
96
- format: ['PascalCase'],
97
- },
98
- ],
99
- '@typescript-eslint/explicit-member-accessibility': [
100
- 'error',
101
- { accessibility: 'explicit', overrides: { constructors: 'off' } },
102
- ],
103
- },
104
- },
105
- globalIgnores([
106
- '**/webpack.config.js',
107
- '**/jest.config.js',
108
- '**/jest.setup.js',
109
- '**/eslint.config.mjs',
110
- ]),
111
- globalIgnores(['**/cache', '**/input', '**/dist', '**/node_modules', '**/output', '**/test']),
112
- ]);
package/jest.config.js DELETED
@@ -1,11 +0,0 @@
1
- const { createDefaultPreset } = require("ts-jest");
2
-
3
- const tsJestTransformCfg = createDefaultPreset().transform;
4
-
5
- /** @type {import("jest").Config} **/
6
- module.exports = {
7
- testEnvironment: "node",
8
- transform: {
9
- ...tsJestTransformCfg,
10
- },
11
- };
@@ -1,10 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- export const BookSchema = z.object({
4
- id: z.int(),
5
- title: z.string(),
6
- author: z.string(),
7
- });
8
-
9
- export const BookCreationSchema = BookSchema.omit({ id: true });
10
- export const BookUpdateSchema = BookSchema.partial().required({ id: true });
@@ -1,9 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- export const CopySchema = z.object({
4
- id: z.int(),
5
- bookId: z.int(),
6
- });
7
-
8
- export const CopyCreationSchema = CopySchema.omit({ id: true });
9
- export const CopyUpdateSchema = CopySchema.partial().required({ id: true });
@@ -1,11 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- export const CustomerSchema = z.object({
4
- id: z.int(),
5
- name: z.string(),
6
- lastname: z.string(),
7
- email: z.email(),
8
- });
9
-
10
- export const CustomerCreationSchema = CustomerSchema.omit({ id: true });
11
- export const CustomerUpdateSchema = CustomerSchema.partial().required({ id: true });
@@ -1,9 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- export const GroupSchema = z.object({
4
- id: z.int(),
5
- name: z.string(),
6
- });
7
-
8
- export const GroupCreationSchema = GroupSchema.omit({ id: true });
9
- export const GroupUpdateSchema = GroupSchema.partial().required({ id: true });
@@ -1,13 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- export const LoanSchema = z.object({
4
- id: z.int(),
5
- copyId: z.int(),
6
- customerId: z.int(),
7
- lentDate: z.date(),
8
- dueDate: z.date(),
9
- returnDate: z.date(),
10
- });
11
-
12
- export const LoanCreationSchema = LoanSchema.omit({ id: true });
13
- export const LoanUpdateSchema = LoanSchema.partial().required({ id: true });
@@ -1,20 +0,0 @@
1
- import { BookSchema } from '../../src/schemas/book.schema';
2
-
3
- describe('BookSchema', () => {
4
- it('should validate a valid book object', () => {
5
- const validBook = {
6
- id: 1,
7
- title: '1984',
8
- author: 'George Orwell',
9
- };
10
- expect(() => BookSchema.parse(validBook)).not.toThrow();
11
- });
12
- it('should throw an error for an invalid book object', () => {
13
- const invalidBook = {
14
- id: 'one',
15
- title: 1984,
16
- author: 12345,
17
- };
18
- expect(() => BookSchema.parse(invalidBook)).toThrow();
19
- });
20
- });
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2017" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
4
- "module": "commonjs" /* Specify what module code is generated. */,
5
- "baseUrl": "./src" /* Specify the base directory to resolve non-relative module names. */,
6
- "paths": {
7
- "@/*": ["src/*"],
8
- "@schemas/*": ["src/schemas/*"]
9
- } /* Specify a set of entries that re-map imports to additional lookup locations. */,
10
- "outDir": "./dist" /* Specify an output folder for all emitted files. */,
11
- "declarationDir": "./dist" /* Specify the output folder for generated declaration files. */,
12
- "declaration": true,
13
- "rootDir": "./src" /* Specify the root folder within your source files. */,
14
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
15
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
16
- "strict": true /* Enable all strict type-checking options. */,
17
- "skipLibCheck": false /* Skip type checking all .d.ts files. */,
18
- "sourceMap": true /* Generates corresponding '.map' file. */
19
- },
20
- "exclude": ["test", "node_modules", "dist"]
21
- }
File without changes