@naisys/erp 3.0.0-beta.3 → 3.0.0-beta.4

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.

Potentially problematic release.


This version of @naisys/erp might be problematic. Click here for more details.

Files changed (96) hide show
  1. package/package.json +9 -6
  2. package/dist/api-reference.d.ts +0 -10
  3. package/dist/audit.d.ts +0 -5
  4. package/dist/auth-middleware.d.ts +0 -18
  5. package/dist/dbConfig.d.ts +0 -5
  6. package/dist/erpDb.d.ts +0 -10
  7. package/dist/erpServer.d.ts +0 -10
  8. package/dist/error-handler.d.ts +0 -7
  9. package/dist/generated/prisma/client.d.ts +0 -154
  10. package/dist/generated/prisma/commonInputTypes.d.ts +0 -637
  11. package/dist/generated/prisma/enums.d.ts +0 -59
  12. package/dist/generated/prisma/internal/class.d.ts +0 -406
  13. package/dist/generated/prisma/internal/prismaNamespace.d.ts +0 -2722
  14. package/dist/generated/prisma/models/Attachment.d.ts +0 -1455
  15. package/dist/generated/prisma/models/AuditLog.d.ts +0 -1359
  16. package/dist/generated/prisma/models/Field.d.ts +0 -1880
  17. package/dist/generated/prisma/models/FieldAttachment.d.ts +0 -1245
  18. package/dist/generated/prisma/models/FieldRecord.d.ts +0 -1625
  19. package/dist/generated/prisma/models/FieldSet.d.ts +0 -1577
  20. package/dist/generated/prisma/models/FieldValue.d.ts +0 -1908
  21. package/dist/generated/prisma/models/Item.d.ts +0 -1858
  22. package/dist/generated/prisma/models/ItemInstance.d.ts +0 -1987
  23. package/dist/generated/prisma/models/LaborTicket.d.ts +0 -1867
  24. package/dist/generated/prisma/models/Operation.d.ts +0 -2578
  25. package/dist/generated/prisma/models/OperationDependency.d.ts +0 -1434
  26. package/dist/generated/prisma/models/OperationFieldRef.d.ts +0 -1539
  27. package/dist/generated/prisma/models/OperationRun.d.ts +0 -2563
  28. package/dist/generated/prisma/models/OperationRunComment.d.ts +0 -1366
  29. package/dist/generated/prisma/models/Order.d.ts +0 -1931
  30. package/dist/generated/prisma/models/OrderRevision.d.ts +0 -1962
  31. package/dist/generated/prisma/models/OrderRun.d.ts +0 -2310
  32. package/dist/generated/prisma/models/SchemaVersion.d.ts +0 -985
  33. package/dist/generated/prisma/models/Session.d.ts +0 -1213
  34. package/dist/generated/prisma/models/Step.d.ts +0 -2180
  35. package/dist/generated/prisma/models/StepRun.d.ts +0 -1963
  36. package/dist/generated/prisma/models/User.d.ts +0 -11819
  37. package/dist/generated/prisma/models/UserPermission.d.ts +0 -1348
  38. package/dist/generated/prisma/models/WorkCenter.d.ts +0 -1657
  39. package/dist/generated/prisma/models/WorkCenterUser.d.ts +0 -1390
  40. package/dist/generated/prisma/models.d.ts +0 -28
  41. package/dist/hateoas.d.ts +0 -7
  42. package/dist/route-helpers.d.ts +0 -318
  43. package/dist/routes/admin.d.ts +0 -3
  44. package/dist/routes/audit.d.ts +0 -3
  45. package/dist/routes/auth.d.ts +0 -3
  46. package/dist/routes/dispatch.d.ts +0 -3
  47. package/dist/routes/inventory.d.ts +0 -3
  48. package/dist/routes/item-fields.d.ts +0 -3
  49. package/dist/routes/item-instances.d.ts +0 -3
  50. package/dist/routes/items.d.ts +0 -3
  51. package/dist/routes/labor-tickets.d.ts +0 -3
  52. package/dist/routes/operation-dependencies.d.ts +0 -3
  53. package/dist/routes/operation-field-refs.d.ts +0 -3
  54. package/dist/routes/operation-run-comments.d.ts +0 -3
  55. package/dist/routes/operation-run-transitions.d.ts +0 -3
  56. package/dist/routes/operation-runs.d.ts +0 -112
  57. package/dist/routes/operations.d.ts +0 -3
  58. package/dist/routes/order-revision-transitions.d.ts +0 -3
  59. package/dist/routes/order-revisions.d.ts +0 -51
  60. package/dist/routes/order-run-transitions.d.ts +0 -3
  61. package/dist/routes/order-runs.d.ts +0 -58
  62. package/dist/routes/orders.d.ts +0 -3
  63. package/dist/routes/root.d.ts +0 -3
  64. package/dist/routes/schemas.d.ts +0 -3
  65. package/dist/routes/step-field-attachments.d.ts +0 -3
  66. package/dist/routes/step-fields.d.ts +0 -100
  67. package/dist/routes/step-run-fields.d.ts +0 -3
  68. package/dist/routes/step-run-transitions.d.ts +0 -3
  69. package/dist/routes/step-runs.d.ts +0 -332
  70. package/dist/routes/steps.d.ts +0 -3
  71. package/dist/routes/user-permissions.d.ts +0 -3
  72. package/dist/routes/users.d.ts +0 -57
  73. package/dist/routes/work-centers.d.ts +0 -3
  74. package/dist/schema-registry.d.ts +0 -3
  75. package/dist/services/attachment-service.d.ts +0 -33
  76. package/dist/services/field-ref-service.d.ts +0 -96
  77. package/dist/services/field-service.d.ts +0 -49
  78. package/dist/services/field-value-service.d.ts +0 -61
  79. package/dist/services/item-instance-service.d.ts +0 -152
  80. package/dist/services/item-service.d.ts +0 -47
  81. package/dist/services/labor-ticket-service.d.ts +0 -40
  82. package/dist/services/log-file-service.d.ts +0 -4
  83. package/dist/services/operation-dependency-service.d.ts +0 -33
  84. package/dist/services/operation-run-comment-service.d.ts +0 -17
  85. package/dist/services/operation-run-service.d.ts +0 -126
  86. package/dist/services/operation-service.d.ts +0 -47
  87. package/dist/services/order-revision-service.d.ts +0 -53
  88. package/dist/services/order-run-service.d.ts +0 -138
  89. package/dist/services/order-service.d.ts +0 -15
  90. package/dist/services/revision-diff-service.d.ts +0 -3
  91. package/dist/services/step-run-service.d.ts +0 -172
  92. package/dist/services/step-service.d.ts +0 -104
  93. package/dist/services/user-service.d.ts +0 -185
  94. package/dist/services/work-center-service.d.ts +0 -29
  95. package/dist/supervisorAuth.d.ts +0 -3
  96. package/dist/userService.d.ts +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naisys/erp",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "NAISYS ERP - Web UI for AI-driven order and work management",
5
5
  "type": "module",
6
6
  "main": "dist/erpServer.js",
@@ -30,20 +30,23 @@
30
30
  "client-dist",
31
31
  "bin",
32
32
  "!dist/**/*.map",
33
+ "!dist/**/*.d.ts",
34
+ "!dist/**/*.d.ts.map",
33
35
  "!dist/**/tests",
34
36
  "!dist/**/*.test.*"
35
37
  ],
36
38
  "dependencies": {
37
39
  "@fastify/cookie": "^11.0.2",
38
40
  "@fastify/cors": "^11.2.0",
41
+ "@fastify/multipart": "^9.4.0",
39
42
  "@fastify/rate-limit": "^10.3.0",
40
43
  "@fastify/static": "^9.0.0",
41
44
  "@fastify/swagger": "^9.7.0",
42
- "@naisys/erp-shared": "3.0.0-beta.3",
43
- "@naisys/common": "3.0.0-beta.3",
44
- "@naisys/common-node": "3.0.0-beta.3",
45
- "@naisys/hub-database": "3.0.0-beta.3",
46
- "@naisys/supervisor-database": "3.0.0-beta.3",
45
+ "@naisys/erp-shared": "3.0.0-beta.4",
46
+ "@naisys/common": "3.0.0-beta.4",
47
+ "@naisys/common-node": "3.0.0-beta.4",
48
+ "@naisys/hub-database": "3.0.0-beta.4",
49
+ "@naisys/supervisor-database": "3.0.0-beta.4",
47
50
  "@prisma/adapter-better-sqlite3": "^7.5.0",
48
51
  "@prisma/client": "^7.5.0",
49
52
  "@scalar/fastify-api-reference": "^1.48.7",
@@ -1,10 +0,0 @@
1
- import type { FastifyInstance } from "fastify";
2
- /**
3
- * Registers Scalar API reference routes for the ERP service.
4
- *
5
- * Can't register @scalar/fastify-api-reference twice in the same process
6
- * (Fastify deduplicates fp() plugins by name), so we serve the Scalar
7
- * standalone JS bundle and a minimal HTML page manually.
8
- */
9
- export declare function registerApiReference(fastify: FastifyInstance): void;
10
- //# sourceMappingURL=api-reference.d.ts.map
package/dist/audit.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { PrismaClient } from "./generated/prisma/client.js";
2
- type PrismaTransaction = Parameters<Parameters<PrismaClient["$transaction"]>[0]>[0];
3
- export declare function writeAuditEntry(erpTx: PrismaTransaction, entityType: string, entityId: number, action: string, field: string, oldValue: string | null, newValue: string | null, userId: number): Promise<void>;
4
- export {};
5
- //# sourceMappingURL=audit.d.ts.map
@@ -1,18 +0,0 @@
1
- import { AuthCache } from "@naisys/common";
2
- import type { ErpPermission } from "@naisys/erp-shared";
3
- import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify";
4
- export interface ErpUser {
5
- id: number;
6
- username: string;
7
- permissions: ErpPermission[];
8
- }
9
- declare module "fastify" {
10
- interface FastifyRequest {
11
- erpUser?: ErpUser;
12
- }
13
- }
14
- export declare const authCache: AuthCache<ErpUser>;
15
- export declare function hasPermission(user: ErpUser | undefined, permission: ErpPermission): boolean;
16
- export declare function requirePermission(permission: ErpPermission): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
17
- export declare function registerAuthMiddleware(fastify: FastifyInstance): void;
18
- //# sourceMappingURL=auth-middleware.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare function erpDbPath(): string;
2
- export declare function erpDbUrl(): string;
3
- /** We run migration scripts if this is greater than what's in the schema_version table */
4
- export declare const ERP_DB_VERSION = 43;
5
- //# sourceMappingURL=dbConfig.d.ts.map
package/dist/erpDb.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { PrismaClient } from "./generated/prisma/client.js";
2
- /**
3
- * Initialize the ERP database connection and run SQLite pragmas.
4
- * Must be called after the database directory/file exists (i.e. after migrations).
5
- */
6
- export declare function initErpDb(): Promise<void>;
7
- /** Lazily initialized Prisma client. First access creates the connection. */
8
- declare const erpDb: PrismaClient;
9
- export default erpDb;
10
- //# sourceMappingURL=erpDb.d.ts.map
@@ -1,10 +0,0 @@
1
- import "dotenv/config";
2
- import "./schema-registry.js";
3
- import { type FastifyPluginAsync } from "fastify";
4
- export { enableSupervisorAuth } from "./supervisorAuth.js";
5
- /**
6
- * Fastify plugin that registers ERP routes and static files.
7
- * Can be used standalone or registered inside another Fastify app (e.g. supervisor).
8
- */
9
- export declare const erpPlugin: FastifyPluginAsync;
10
- //# sourceMappingURL=erpServer.d.ts.map
@@ -1,7 +0,0 @@
1
- import type { ErrorResponse } from "@naisys/erp-shared";
2
- import type { FastifyReply } from "fastify";
3
- export declare function notFound(reply: FastifyReply, message: string): ErrorResponse;
4
- export declare function conflict(reply: FastifyReply, message: string): ErrorResponse;
5
- export declare function unauthorized(reply: FastifyReply, message: string): ErrorResponse;
6
- export declare function unprocessable(reply: FastifyReply, message: string): ErrorResponse;
7
- //# sourceMappingURL=error-handler.d.ts.map
@@ -1,154 +0,0 @@
1
- import * as runtime from "@prisma/client/runtime/client";
2
- import * as $Class from "./internal/class.js";
3
- import * as Prisma from "./internal/prismaNamespace.js";
4
- export * as $Enums from './enums.js';
5
- export * from "./enums.js";
6
- /**
7
- * ## Prisma Client
8
- *
9
- * Type-safe database client for TypeScript
10
- * @example
11
- * ```
12
- * const prisma = new PrismaClient({
13
- * adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL })
14
- * })
15
- * // Fetch zero or more Orders
16
- * const orders = await prisma.order.findMany()
17
- * ```
18
- *
19
- * Read more in our [docs](https://pris.ly/d/client).
20
- */
21
- export declare const PrismaClient: $Class.PrismaClientConstructor;
22
- export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>;
23
- export { Prisma };
24
- /**
25
- * Model Order
26
- *
27
- */
28
- export type Order = Prisma.OrderModel;
29
- /**
30
- * Model OrderRevision
31
- *
32
- */
33
- export type OrderRevision = Prisma.OrderRevisionModel;
34
- /**
35
- * Model Operation
36
- *
37
- */
38
- export type Operation = Prisma.OperationModel;
39
- /**
40
- * Model OperationFieldRef
41
- *
42
- */
43
- export type OperationFieldRef = Prisma.OperationFieldRefModel;
44
- /**
45
- * Model OperationDependency
46
- *
47
- */
48
- export type OperationDependency = Prisma.OperationDependencyModel;
49
- /**
50
- * Model WorkCenter
51
- *
52
- */
53
- export type WorkCenter = Prisma.WorkCenterModel;
54
- /**
55
- * Model WorkCenterUser
56
- *
57
- */
58
- export type WorkCenterUser = Prisma.WorkCenterUserModel;
59
- /**
60
- * Model FieldSet
61
- *
62
- */
63
- export type FieldSet = Prisma.FieldSetModel;
64
- /**
65
- * Model FieldRecord
66
- *
67
- */
68
- export type FieldRecord = Prisma.FieldRecordModel;
69
- /**
70
- * Model Field
71
- *
72
- */
73
- export type Field = Prisma.FieldModel;
74
- /**
75
- * Model Step
76
- *
77
- */
78
- export type Step = Prisma.StepModel;
79
- /**
80
- * Model OrderRun
81
- *
82
- */
83
- export type OrderRun = Prisma.OrderRunModel;
84
- /**
85
- * Model OperationRun
86
- *
87
- */
88
- export type OperationRun = Prisma.OperationRunModel;
89
- /**
90
- * Model StepRun
91
- *
92
- */
93
- export type StepRun = Prisma.StepRunModel;
94
- /**
95
- * Model FieldValue
96
- *
97
- */
98
- export type FieldValue = Prisma.FieldValueModel;
99
- /**
100
- * Model Item
101
- *
102
- */
103
- export type Item = Prisma.ItemModel;
104
- /**
105
- * Model ItemInstance
106
- *
107
- */
108
- export type ItemInstance = Prisma.ItemInstanceModel;
109
- /**
110
- * Model User
111
- *
112
- */
113
- export type User = Prisma.UserModel;
114
- /**
115
- * Model UserPermission
116
- *
117
- */
118
- export type UserPermission = Prisma.UserPermissionModel;
119
- /**
120
- * Model Session
121
- *
122
- */
123
- export type Session = Prisma.SessionModel;
124
- /**
125
- * Model SchemaVersion
126
- *
127
- */
128
- export type SchemaVersion = Prisma.SchemaVersionModel;
129
- /**
130
- * Model LaborTicket
131
- *
132
- */
133
- export type LaborTicket = Prisma.LaborTicketModel;
134
- /**
135
- * Model AuditLog
136
- *
137
- */
138
- export type AuditLog = Prisma.AuditLogModel;
139
- /**
140
- * Model Attachment
141
- *
142
- */
143
- export type Attachment = Prisma.AttachmentModel;
144
- /**
145
- * Model FieldAttachment
146
- *
147
- */
148
- export type FieldAttachment = Prisma.FieldAttachmentModel;
149
- /**
150
- * Model OperationRunComment
151
- *
152
- */
153
- export type OperationRunComment = Prisma.OperationRunCommentModel;
154
- //# sourceMappingURL=client.d.ts.map