@machinemetrics/mm-erp-sdk 0.1.8-beta.3 → 0.1.8-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.
- package/dist/{config-152LkbTv.js → config-qat9zgOl.js} +2 -2
- package/dist/{config-152LkbTv.js.map → config-qat9zgOl.js.map} +1 -1
- package/dist/{connector-factory-wivcyMhC.js → connector-factory-C2czCs9v.js} +2 -2
- package/dist/{connector-factory-wivcyMhC.js.map → connector-factory-C2czCs9v.js.map} +1 -1
- package/dist/{hashed-cache-manager-BnviJzB7.js → hashed-cache-manager-CzyFSt2B.js} +4 -4
- package/dist/{hashed-cache-manager-BnviJzB7.js.map → hashed-cache-manager-CzyFSt2B.js.map} +1 -1
- package/dist/{index-DNqHWa8F.js → index-B9wo8pld.js} +2 -2
- package/dist/{index-DNqHWa8F.js.map → index-B9wo8pld.js.map} +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/{logger-HAWySEbs.js → logger-Db8CkwR6.js} +11 -83
- package/dist/{logger-HAWySEbs.js.map → logger-Db8CkwR6.js.map} +1 -1
- package/dist/mm-erp-sdk.js +24 -234
- package/dist/mm-erp-sdk.js.map +1 -1
- package/dist/services/data-sync-service/jobs/clean-up-expired-cache.js +4 -4
- package/dist/services/data-sync-service/jobs/from-erp.js +4 -4
- package/dist/services/data-sync-service/jobs/retry-failed-labor-tickets.js +3 -3
- package/dist/services/data-sync-service/jobs/run-migrations.js +1 -1
- package/dist/services/data-sync-service/jobs/to-erp.d.ts.map +1 -1
- package/dist/services/data-sync-service/jobs/to-erp.js +3 -3
- package/dist/services/data-sync-service/jobs/to-erp.js.map +1 -1
- package/dist/services/reporting-service/logger.d.ts.map +1 -1
- package/dist/types/erp-types.d.ts +1 -2
- package/dist/types/erp-types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/timezone.d.ts +7 -0
- package/dist/utils/timezone.d.ts.map +1 -1
- package/package.json +1 -3
- package/src/index.ts +5 -27
- package/src/services/data-sync-service/jobs/to-erp.ts +1 -2
- package/src/services/reporting-service/logger.ts +11 -94
- package/src/types/erp-types.ts +0 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/mm-labor-ticket-helpers.ts +2 -2
- package/src/utils/timezone.ts +28 -0
- package/dist/services/psql-erp-service/configuration.d.ts +0 -10
- package/dist/services/psql-erp-service/configuration.d.ts.map +0 -1
- package/dist/services/psql-erp-service/index.d.ts +0 -19
- package/dist/services/psql-erp-service/index.d.ts.map +0 -1
- package/dist/services/psql-erp-service/internal/psql-config.d.ts +0 -28
- package/dist/services/psql-erp-service/internal/psql-config.d.ts.map +0 -1
- package/dist/services/psql-erp-service/internal/psql-labor-ticket-operations.d.ts +0 -40
- package/dist/services/psql-erp-service/internal/psql-labor-ticket-operations.d.ts.map +0 -1
- package/dist/services/psql-erp-service/internal/types/psql-types.d.ts +0 -15
- package/dist/services/psql-erp-service/internal/types/psql-types.d.ts.map +0 -1
- package/dist/services/psql-erp-service/psql-helpers.d.ts +0 -32
- package/dist/services/psql-erp-service/psql-helpers.d.ts.map +0 -1
- package/dist/services/psql-erp-service/psql-service.d.ts +0 -36
- package/dist/services/psql-erp-service/psql-service.d.ts.map +0 -1
- package/src/services/psql-erp-service/configuration.ts +0 -9
- package/src/services/psql-erp-service/index.ts +0 -28
- package/src/services/psql-erp-service/internal/psql-config.ts +0 -13
- package/src/services/psql-erp-service/internal/psql-labor-ticket-operations.ts +0 -58
- package/src/services/psql-erp-service/internal/types/psql-types.ts +0 -17
- package/src/services/psql-erp-service/psql-helpers.ts +0 -90
- package/src/services/psql-erp-service/psql-service.ts +0 -178
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../../../config-
|
|
2
|
-
import { H as HashedCacheManager } from "../../../hashed-cache-manager-
|
|
3
|
-
import { S as SQLiteCoordinator } from "../../../index-
|
|
4
|
-
import { l as logger } from "../../../logger-
|
|
1
|
+
import "../../../config-qat9zgOl.js";
|
|
2
|
+
import { H as HashedCacheManager } from "../../../hashed-cache-manager-CzyFSt2B.js";
|
|
3
|
+
import { S as SQLiteCoordinator } from "../../../index-B9wo8pld.js";
|
|
4
|
+
import { l as logger } from "../../../logger-Db8CkwR6.js";
|
|
5
5
|
logger.level = process.env.LOG_LEVEL || "info";
|
|
6
6
|
const main = async () => {
|
|
7
7
|
const cacheManager = new HashedCacheManager();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../../../config-
|
|
2
|
-
import { l as logger } from "../../../logger-
|
|
3
|
-
import { S as SQLiteCoordinator } from "../../../index-
|
|
4
|
-
import { c as createConnectorFromPath } from "../../../connector-factory-
|
|
1
|
+
import "../../../config-qat9zgOl.js";
|
|
2
|
+
import { l as logger } from "../../../logger-Db8CkwR6.js";
|
|
3
|
+
import { S as SQLiteCoordinator } from "../../../index-B9wo8pld.js";
|
|
4
|
+
import { c as createConnectorFromPath } from "../../../connector-factory-C2czCs9v.js";
|
|
5
5
|
logger.level = process.env.LOG_LEVEL || "info";
|
|
6
6
|
const main = async () => {
|
|
7
7
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../../config-
|
|
2
|
-
import { l as logger } from "../../../logger-
|
|
3
|
-
import { c as createConnectorFromPath } from "../../../connector-factory-
|
|
1
|
+
import "../../../config-qat9zgOl.js";
|
|
2
|
+
import { l as logger } from "../../../logger-Db8CkwR6.js";
|
|
3
|
+
import { c as createConnectorFromPath } from "../../../connector-factory-C2czCs9v.js";
|
|
4
4
|
logger.level = process.env.LOG_LEVEL || "info";
|
|
5
5
|
const main = async () => {
|
|
6
6
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import knex from "knex";
|
|
2
|
-
import { l as logger } from "../../../logger-
|
|
2
|
+
import { l as logger } from "../../../logger-Db8CkwR6.js";
|
|
3
3
|
import { c as config } from "../../../knexfile-1qKKIORB.js";
|
|
4
4
|
logger.level = process.env.LOG_LEVEL || "info";
|
|
5
5
|
const db = knex(config.local);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-erp.d.ts","sourceRoot":"","sources":["../../../../src/services/data-sync-service/jobs/to-erp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"to-erp.d.ts","sourceRoot":"","sources":["../../../../src/services/data-sync-service/jobs/to-erp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAQvB,QAAA,MAAM,IAAI,qBAoCT,CAAC;AAoBF,eAAe,IAAI,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../../config-
|
|
2
|
-
import { l as logger } from "../../../logger-
|
|
3
|
-
import { c as createConnectorFromPath } from "../../../connector-factory-
|
|
1
|
+
import "../../../config-qat9zgOl.js";
|
|
2
|
+
import { l as logger } from "../../../logger-Db8CkwR6.js";
|
|
3
|
+
import { c as createConnectorFromPath } from "../../../connector-factory-C2czCs9v.js";
|
|
4
4
|
logger.level = process.env.LOG_LEVEL || "info";
|
|
5
5
|
const main = async () => {
|
|
6
6
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-erp.js","sources":["../../../../src/services/data-sync-service/jobs/to-erp.ts"],"sourcesContent":["import \"dotenv/config\";\n\nimport logger from \"
|
|
1
|
+
{"version":3,"file":"to-erp.js","sources":["../../../../src/services/data-sync-service/jobs/to-erp.ts"],"sourcesContent":["import \"dotenv/config\";\n\nimport logger from \"../../reporting-service/logger\";\nimport { createConnectorFromPath } from \"../../../utils/connector-factory\";\n\n// Configure the logger with the correct log level\nlogger.level = process.env.LOG_LEVEL || \"info\";\n\nconst main = async () => {\n try {\n logger.info('Worker for job \"to-erp\" online');\n logger.info(\"==========Starting to-erp job cycle==========\");\n\n // Get the connector path from the environment variable\n const connectorPath = process.env.CONNECTOR_PATH;\n\n if (!connectorPath) {\n throw new Error(\"Connector path not provided in environment variables\");\n }\n\n // Create a new connector instance for this job\n const connector = await createConnectorFromPath(connectorPath);\n\n await connector.syncToERP();\n await connector.syncToERPCompleted();\n\n logger.info(\"==========Completed to-erp job cycle==========\");\n } catch (error) {\n const errorDetails = {\n message: error instanceof Error ? error.message : String(error),\n stack: error instanceof Error ? error.stack : undefined,\n name: error instanceof Error ? error.name : undefined,\n ...(error && typeof error === \"object\" ? error : {}), // Include all enumerable properties if it's an object\n };\n logger.error('Worker for job \"to-erp\" had an error', {\n error: errorDetails,\n connectorPath: process.env.CONNECTOR_PATH,\n });\n\n // Also log to console for immediate visibility\n console.error(\"to-erp job error:\", error);\n\n throw error; // Rethrow so Bree can handle it properly\n }\n};\n\n// Cross-platform module detection fix for Bree compatibility\n// Windows: process.argv[1] uses backslashes, import.meta.url uses forward slashes\n// Linux/Mac: both use forward slashes, so this normalization is safe\nconst normalizedArgv1 = process.argv[1].replace(/\\\\/g, '/');\nconst fileUrl = normalizedArgv1.startsWith('/') ? \n `file://${normalizedArgv1}` : // Unix: file:// + /path = file:///path\n `file:///${normalizedArgv1}`; // Windows: file:/// + C:/path = file:///C:/path\nconst isMainModule = import.meta.url === fileUrl;\n\nif (isMainModule) {\n // This is called when Bree runs this file as a worker\n try {\n await main();\n } catch {\n process.exitCode = 1; // prefer exitCode so stdout/stderr can flush\n }\n}\n\nexport default main;\n"],"names":[],"mappings":";;;AAMA,OAAO,QAAQ,QAAQ,IAAI,aAAa;AAExC,MAAM,OAAO,YAAY;AACvB,MAAI;AACF,WAAO,KAAK,gCAAgC;AAC5C,WAAO,KAAK,+CAA+C;AAG3D,UAAM,gBAAgB,QAAQ,IAAI;AAElC,QAAI,CAAC,eAAe;AAClB,YAAM,IAAI,MAAM,sDAAsD;AAAA,IACxE;AAGA,UAAM,YAAY,MAAM,wBAAwB,aAAa;AAE7D,UAAM,UAAU,UAAA;AAChB,UAAM,UAAU,mBAAA;AAEhB,WAAO,KAAK,gDAAgD;AAAA,EAC9D,SAAS,OAAO;AACd,UAAM,eAAe;AAAA,MACnB,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D,OAAO,iBAAiB,QAAQ,MAAM,QAAQ;AAAA,MAC9C,MAAM,iBAAiB,QAAQ,MAAM,OAAO;AAAA,MAC5C,GAAI,SAAS,OAAO,UAAU,WAAW,QAAQ,CAAA;AAAA;AAAA,IAAC;AAEpD,WAAO,MAAM,wCAAwC;AAAA,MACnD,OAAO;AAAA,MACP,eAAe,QAAQ,IAAI;AAAA,IAAA,CAC5B;AAGD,YAAQ,MAAM,qBAAqB,KAAK;AAExC,UAAM;AAAA,EACR;AACF;AAKA,MAAM,kBAAkB,QAAQ,KAAK,CAAC,EAAE,QAAQ,OAAO,GAAG;AAC1D,MAAM,UAAU,gBAAgB,WAAW,GAAG,IAC5C,UAAU,eAAe;AAAA;AAAA,EACzB,WAAW,eAAe;AAAA;AAC5B,MAAM,eAAe,YAAY,QAAQ;AAEzC,IAAI,cAAc;AAEhB,MAAI;AACF,UAAM,KAAA;AAAA,EACR,QAAQ;AACN,YAAQ,WAAW;AAAA,EACrB;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/services/reporting-service/logger.ts"],"names":[],"mappings":"AA+DA,QAAA,MAAM,MAAM,0BAaV,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/services/reporting-service/logger.ts"],"names":[],"mappings":"AA+DA,QAAA,MAAM,MAAM,0BAaV,CAAC;AAGH,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,SAgChE,CAAC;AAKF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erp-types.d.ts","sourceRoot":"","sources":["../../src/types/erp-types.ts"],"names":[],"mappings":"AACA,oBAAY,OAAO;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"erp-types.d.ts","sourceRoot":"","sources":["../../src/types/erp-types.ts"],"names":[],"mappings":"AACA,oBAAY,OAAO;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED,oBAAY,UAAU;IACpB,SAAS,IAAA;IACT,KAAK,IAAA;IACL,cAAc,IAAA;IACd,WAAW,IAAA;IACX,qBAAqB,IAAA;IACrB,OAAO,IAAA;IACP,OAAO,IAAA;IACP,aAAa,IAAA;CAEd;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC/B,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { addNewFieldFromExternalSource, addNewFieldFromLookupField, } from "./da
|
|
|
11
11
|
* Timezone and time-related utilities
|
|
12
12
|
*/
|
|
13
13
|
export { getTimezoneOffsetAndPersist } from "./time-utils";
|
|
14
|
-
export { formatDateWithTZOffset, convertToLocalTime } from "./timezone";
|
|
14
|
+
export { formatDateWithTZOffset, convertToLocalTime, toISOWithOffset } from "./timezone";
|
|
15
15
|
export { applyTimezoneOffsetsToFields } from "./time-utils";
|
|
16
16
|
export * from "./time-utils";
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAC5D,cAAc,cAAc,CAAC;AAE7B;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,YAAY,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEpF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAE7C;;GAEG;AACH,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjF;;GAEG;AACH,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACzH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D;;GAEG;AACH,cAAc,2BAA2B,CAAC;AAE1C;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE;;GAEG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/utils/timezone.d.ts
CHANGED
|
@@ -18,4 +18,11 @@ export declare const convertToLocalTime: (zuluTime: string | Date | null | undef
|
|
|
18
18
|
* @returns The formatted date string in format: YYYY-MM-DDTHH:mm:ss+/-HH:MM
|
|
19
19
|
*/
|
|
20
20
|
export declare const formatDateWithTZOffset: (date: string | null | undefined, timezoneOffset: number) => string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Formats a Date object as an ISO string with the specified timezone offset
|
|
23
|
+
* @param date The Date object to format (should be a Date that has been shifted by convertToLocalTime)
|
|
24
|
+
* @param timezoneOffset The timezone offset in hours
|
|
25
|
+
* @returns ISO string with offset in format: YYYY-MM-DDTHH:mm:ss.SSS±HH:MM
|
|
26
|
+
*/
|
|
27
|
+
export declare const toISOWithOffset: (date: Date, timezoneOffset: number) => string;
|
|
21
28
|
//# sourceMappingURL=timezone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timezone.d.ts","sourceRoot":"","sources":["../../src/utils/timezone.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,MAAM,CA6CxD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,EAC1C,gBAAgB,MAAM,KACrB,IAAI,GAAG,SAIT,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,gBAAgB,MAAM,KACrB,MAAM,GAAG,SAgBX,CAAC"}
|
|
1
|
+
{"version":3,"file":"timezone.d.ts","sourceRoot":"","sources":["../../src/utils/timezone.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,MAAM,CA6CxD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,EAC1C,gBAAgB,MAAM,KACrB,IAAI,GAAG,SAIT,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,gBAAgB,MAAM,KACrB,MAAM,GAAG,SAgBX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,gBAAgB,MAAM,KAAG,MAoBpE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@machinemetrics/mm-erp-sdk",
|
|
3
3
|
"description": "A library for syncing data between MachineMetrics and ERP systems",
|
|
4
|
-
"version": "0.1.8-beta.
|
|
4
|
+
"version": " 0.1.8-beta.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "machinemetrics",
|
|
7
7
|
"main": "dist/mm-erp-sdk.js",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@azure/msal-node": "^2.12.0",
|
|
21
21
|
"@ladjs/graceful": "^4.2.0",
|
|
22
|
-
"aws-sdk": "^2.1691.0",
|
|
23
22
|
"axios": "^1.7.3",
|
|
24
23
|
"axios-retry": "^4.5.0",
|
|
25
24
|
"better-sqlite3": "^11.3.0",
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
"knex": "^3.1.0",
|
|
30
29
|
"lodash": "^4.17.21",
|
|
31
30
|
"mssql": "^11.0.1",
|
|
32
|
-
"odbc": "^2.4.8",
|
|
33
31
|
"winston": "^3.14.0",
|
|
34
32
|
"winston-daily-rotate-file": "^5.0.0",
|
|
35
33
|
"xxhashjs": "^0.2.2",
|
package/src/index.ts
CHANGED
|
@@ -17,13 +17,13 @@ export type { ERPApiConfig } from "./services/erp-api-services/types";
|
|
|
17
17
|
// MM API client and types
|
|
18
18
|
export { MMApiClient } from "./services/mm-api-service";
|
|
19
19
|
export { MMReceiveLaborTicket } from "./services/mm-api-service";
|
|
20
|
-
export type {
|
|
20
|
+
export type {
|
|
21
21
|
MMReceiveLaborTicketReason,
|
|
22
22
|
MMReceiveLaborTicketWorkOrderOperation,
|
|
23
23
|
IToRESTApiObject,
|
|
24
24
|
} from "./services/mm-api-service";
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export {
|
|
27
27
|
MMSendPerson,
|
|
28
28
|
MMSendResource,
|
|
29
29
|
MMSendPart,
|
|
@@ -57,11 +57,7 @@ export { getInitialLoadComplete, setInitialLoadComplete } from "./utils";
|
|
|
57
57
|
// HTTP client factory and types for custom API integrations
|
|
58
58
|
export { HTTPClientFactory } from "./utils/http-client";
|
|
59
59
|
export { HTTPError } from "./utils/http-client";
|
|
60
|
-
export type {
|
|
61
|
-
HTTPResponse,
|
|
62
|
-
HTTPClient,
|
|
63
|
-
HTTPRequestConfig,
|
|
64
|
-
} from "./utils/http-client";
|
|
60
|
+
export type { HTTPResponse, HTTPClient, HTTPRequestConfig } from "./utils/http-client";
|
|
65
61
|
|
|
66
62
|
// Application initialization utilities
|
|
67
63
|
export { ApplicationInitializer } from "./utils/application-initializer";
|
|
@@ -81,7 +77,7 @@ export type { WriteEntitiesToMMResult } from "./utils";
|
|
|
81
77
|
export { MMBatchValidationError } from "./utils";
|
|
82
78
|
|
|
83
79
|
// API services
|
|
84
|
-
export type { APIResponse } from
|
|
80
|
+
export type { APIResponse } from './services/erp-api-services/types';
|
|
85
81
|
export { RestAPIService } from "./services/erp-api-services/rest/rest-api-service";
|
|
86
82
|
export { ErrorHandler, GraphQLError } from "./services/erp-api-services/errors";
|
|
87
83
|
export type {
|
|
@@ -109,18 +105,6 @@ export {
|
|
|
109
105
|
} from "./services/sql-server-erp-service";
|
|
110
106
|
export type { SQLInput } from "./services/sql-server-erp-service";
|
|
111
107
|
|
|
112
|
-
// PSQL (Pervasive) services
|
|
113
|
-
export {
|
|
114
|
-
PsqlService,
|
|
115
|
-
PsqlLaborTicketOperations,
|
|
116
|
-
formatPsqlDate,
|
|
117
|
-
formatPsqlTime,
|
|
118
|
-
combinePsqlDateTime,
|
|
119
|
-
isPsqlDateEmpty,
|
|
120
|
-
cleanPsqlCharField,
|
|
121
|
-
} from "./services/psql-erp-service";
|
|
122
|
-
export type { PsqlConfiguration } from "./services/psql-erp-service";
|
|
123
|
-
|
|
124
108
|
// Record tracking services
|
|
125
109
|
export { RecordTrackingManager } from "./services/caching-service/record-tracking-manager";
|
|
126
110
|
export type { RecordTrackingObject } from "./services/caching-service/record-tracking-manager";
|
|
@@ -129,10 +113,4 @@ export type { RecordTrackingObject } from "./services/caching-service/record-tra
|
|
|
129
113
|
export { default as knexDatabaseConfig } from "./knexfile";
|
|
130
114
|
|
|
131
115
|
// MM Connector Logging
|
|
132
|
-
export {
|
|
133
|
-
MMConnectorLogger,
|
|
134
|
-
FileLogDeduper,
|
|
135
|
-
LogEntry,
|
|
136
|
-
type LogLevelString,
|
|
137
|
-
type LogResponse,
|
|
138
|
-
} from "./utils";
|
|
116
|
+
export { MMConnectorLogger, FileLogDeduper, LogEntry, type LogLevelString, type LogResponse } from './utils';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
|
|
3
|
-
import logger from "
|
|
4
|
-
import { SQLiteCoordinator } from "../../sqlite-service";
|
|
3
|
+
import logger from "../../reporting-service/logger";
|
|
5
4
|
import { createConnectorFromPath } from "../../../utils/connector-factory";
|
|
6
5
|
|
|
7
6
|
// Configure the logger with the correct log level
|
|
@@ -76,105 +76,22 @@ const logger = createLogger({
|
|
|
76
76
|
],
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
// Helper function to create a file transport with shared configuration
|
|
80
|
-
const createFileTransport = (): DailyRotateFile => {
|
|
81
|
-
return new DailyRotateFile({
|
|
82
|
-
filename: path.join(logDirectory, "%DATE%.log"),
|
|
83
|
-
datePattern: "YYYY-MM-DD",
|
|
84
|
-
zippedArchive: true,
|
|
85
|
-
maxSize: "20m",
|
|
86
|
-
maxFiles: "14d",
|
|
87
|
-
format: logFormat,
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// Rotate mitigation helper: attaches rotate handler to transport and recursively attaches to replacements
|
|
92
|
-
function attachRotateMitigation(
|
|
93
|
-
transport: DailyRotateFile,
|
|
94
|
-
opts: { logLevel: string; nodeEnv: string }
|
|
95
|
-
) {
|
|
96
|
-
const { logLevel, nodeEnv } = opts;
|
|
97
|
-
let isRefreshing = false;
|
|
98
|
-
transport.on("rotate", (_old: string, _new: string) => {
|
|
99
|
-
if (isRefreshing) return;
|
|
100
|
-
isRefreshing = true;
|
|
101
|
-
(logger as any).silent = true;
|
|
102
|
-
|
|
103
|
-
const REFRESH_TIMEOUT_MS = 10000;
|
|
104
|
-
let timeout: NodeJS.Timeout | null = setTimeout(() => {
|
|
105
|
-
(logger as any).silent = false;
|
|
106
|
-
isRefreshing = false;
|
|
107
|
-
console.warn(
|
|
108
|
-
'[logger] Refresh timeout: resuming logging after 10s without "new" event.'
|
|
109
|
-
);
|
|
110
|
-
}, REFRESH_TIMEOUT_MS);
|
|
111
|
-
|
|
112
|
-
// Close and clear existing file transports
|
|
113
|
-
const existing = (logger.transports || []).filter(
|
|
114
|
-
(t: any) => t instanceof DailyRotateFile
|
|
115
|
-
);
|
|
116
|
-
for (const t of existing) {
|
|
117
|
-
const s = (t as any).logStream;
|
|
118
|
-
if (s && typeof s.end === "function") {
|
|
119
|
-
try {
|
|
120
|
-
s.end();
|
|
121
|
-
} catch {}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
logger.clear();
|
|
125
|
-
|
|
126
|
-
// Create replacement, attach mitigation for future rotations
|
|
127
|
-
const next = createFileTransport();
|
|
128
|
-
next.on("new", () => {
|
|
129
|
-
if (timeout) {
|
|
130
|
-
clearTimeout(timeout);
|
|
131
|
-
timeout = null;
|
|
132
|
-
}
|
|
133
|
-
(logger as any).silent = false;
|
|
134
|
-
isRefreshing = false;
|
|
135
|
-
});
|
|
136
|
-
attachRotateMitigation(next, opts);
|
|
137
|
-
|
|
138
|
-
logger.add(next);
|
|
139
|
-
if (nodeEnv !== "production") {
|
|
140
|
-
logger.add(
|
|
141
|
-
new transports.Console({
|
|
142
|
-
format: format.combine(
|
|
143
|
-
format.timestamp(),
|
|
144
|
-
format.splat(),
|
|
145
|
-
baseFormat,
|
|
146
|
-
format.colorize({ all: true })
|
|
147
|
-
),
|
|
148
|
-
})
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
logger.level = logLevel;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
79
|
// Function to reconfigure the logger once CoreConfiguration is available
|
|
156
80
|
export const configureLogger = (logLevel: string, nodeEnv: string) => {
|
|
157
|
-
// Remove existing transports
|
|
158
|
-
try {
|
|
159
|
-
const existingFileTransports = (logger.transports || []).filter(
|
|
160
|
-
(t: any) => t instanceof DailyRotateFile
|
|
161
|
-
);
|
|
162
|
-
for (const t of existingFileTransports) {
|
|
163
|
-
const s = (t as any).logStream;
|
|
164
|
-
if (s && typeof s.end === "function") {
|
|
165
|
-
try {
|
|
166
|
-
s.end();
|
|
167
|
-
} catch {}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
} catch {}
|
|
171
|
-
|
|
81
|
+
// Remove existing transports
|
|
172
82
|
logger.clear();
|
|
173
83
|
|
|
174
84
|
// Add file transport
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
85
|
+
logger.add(
|
|
86
|
+
new DailyRotateFile({
|
|
87
|
+
filename: path.join(logDirectory, "%DATE%.log"),
|
|
88
|
+
datePattern: "YYYY-MM-DD",
|
|
89
|
+
zippedArchive: true,
|
|
90
|
+
maxSize: "20m",
|
|
91
|
+
maxFiles: "14d",
|
|
92
|
+
format: logFormat,
|
|
93
|
+
})
|
|
94
|
+
);
|
|
178
95
|
|
|
179
96
|
// Add console transport in non-production environments
|
|
180
97
|
if (nodeEnv !== "production") {
|
package/src/types/erp-types.ts
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
* Timezone and time-related utilities
|
|
16
16
|
*/
|
|
17
17
|
export { getTimezoneOffsetAndPersist } from "./time-utils";
|
|
18
|
-
export { formatDateWithTZOffset, convertToLocalTime } from "./timezone";
|
|
18
|
+
export { formatDateWithTZOffset, convertToLocalTime, toISOWithOffset } from "./timezone";
|
|
19
19
|
export { applyTimezoneOffsetsToFields } from "./time-utils";
|
|
20
20
|
export * from "./time-utils";
|
|
21
21
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { convertToLocalTime } from "./timezone";
|
|
1
|
+
import { convertToLocalTime, toISOWithOffset } from "./timezone";
|
|
2
2
|
import { MMReceiveLaborTicket } from "../services/mm-api-service/types/receive-types";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -22,7 +22,7 @@ export function convertLaborTicketToLocalTimezone(
|
|
|
22
22
|
|
|
23
23
|
timeFields.forEach((field) => {
|
|
24
24
|
const localTime = convertToLocalTime(laborTicket[field], timezoneOffset);
|
|
25
|
-
laborTicket[field] = localTime
|
|
25
|
+
laborTicket[field] = localTime ? toISOWithOffset(localTime, timezoneOffset) : null;
|
|
26
26
|
});
|
|
27
27
|
return laborTicket;
|
|
28
28
|
}
|
package/src/utils/timezone.ts
CHANGED
|
@@ -94,3 +94,31 @@ export const formatDateWithTZOffset = (
|
|
|
94
94
|
// Append the timezone offset
|
|
95
95
|
return `${isoDate}${sign}${hours}:${minutes}`;
|
|
96
96
|
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Formats a Date object as an ISO string with the specified timezone offset
|
|
100
|
+
* @param date The Date object to format (should be a Date that has been shifted by convertToLocalTime)
|
|
101
|
+
* @param timezoneOffset The timezone offset in hours
|
|
102
|
+
* @returns ISO string with offset in format: YYYY-MM-DDTHH:mm:ss.SSS±HH:MM
|
|
103
|
+
*/
|
|
104
|
+
export const toISOWithOffset = (date: Date, timezoneOffset: number): string => {
|
|
105
|
+
const sign = timezoneOffset >= 0 ? "+" : "-";
|
|
106
|
+
const abs = Math.abs(timezoneOffset);
|
|
107
|
+
const hours = Math.floor(abs);
|
|
108
|
+
const minutes = Math.round((abs - hours) * 60);
|
|
109
|
+
const pad2 = (n: number) => n.toString().padStart(2, "0");
|
|
110
|
+
const pad3 = (n: number) => n.toString().padStart(3, "0");
|
|
111
|
+
|
|
112
|
+
// Use UTC getters since convertToLocalTime shifts the Date's internal timestamp
|
|
113
|
+
// The UTC components of the shifted Date represent the local wall time
|
|
114
|
+
const yyyy = date.getUTCFullYear();
|
|
115
|
+
const MM = pad2(date.getUTCMonth() + 1);
|
|
116
|
+
const dd = pad2(date.getUTCDate());
|
|
117
|
+
const HH = pad2(date.getUTCHours());
|
|
118
|
+
const mm = pad2(date.getUTCMinutes());
|
|
119
|
+
const ss = pad2(date.getUTCSeconds());
|
|
120
|
+
const SSS = pad3(date.getUTCMilliseconds());
|
|
121
|
+
const off = `${sign}${pad2(hours)}:${pad2(minutes)}`;
|
|
122
|
+
|
|
123
|
+
return `${yyyy}-${MM}-${dd}T${HH}:${mm}:${ss}.${SSS}${off}`;
|
|
124
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/services/psql-erp-service/configuration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PsqlService } from "./psql-service";
|
|
2
|
-
import { PsqlLaborTicketOperations } from "./internal/psql-labor-ticket-operations";
|
|
3
|
-
/**
|
|
4
|
-
* A class to manage interactions with PSQL (Pervasive) databases via ODBC
|
|
5
|
-
*/
|
|
6
|
-
export { PsqlService };
|
|
7
|
-
/**
|
|
8
|
-
* Labor ticket operations for PSQL (Phase 2)
|
|
9
|
-
*/
|
|
10
|
-
export { PsqlLaborTicketOperations };
|
|
11
|
-
/**
|
|
12
|
-
* Configuration interface for PSQL connections
|
|
13
|
-
*/
|
|
14
|
-
export type { PsqlConfiguration } from "./configuration";
|
|
15
|
-
/**
|
|
16
|
-
* Helper functions for PSQL data formatting
|
|
17
|
-
*/
|
|
18
|
-
export { formatPsqlDate, formatPsqlTime, combinePsqlDateTime, isPsqlDateEmpty, cleanPsqlCharField, } from "./psql-helpers";
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/psql-erp-service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;GAEG;AACH,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC;;GAEG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const PsqlConfigSchema: z.ZodObject<{
|
|
3
|
-
host: z.ZodString;
|
|
4
|
-
port: z.ZodString;
|
|
5
|
-
database: z.ZodString;
|
|
6
|
-
username: z.ZodString;
|
|
7
|
-
password: z.ZodString;
|
|
8
|
-
connectionTimeout: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
requestTimeout: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
password: string;
|
|
12
|
-
database: string;
|
|
13
|
-
port: string;
|
|
14
|
-
connectionTimeout: string;
|
|
15
|
-
requestTimeout: string;
|
|
16
|
-
host: string;
|
|
17
|
-
username: string;
|
|
18
|
-
}, {
|
|
19
|
-
password: string;
|
|
20
|
-
database: string;
|
|
21
|
-
port: string;
|
|
22
|
-
host: string;
|
|
23
|
-
username: string;
|
|
24
|
-
connectionTimeout?: string | undefined;
|
|
25
|
-
requestTimeout?: string | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
export type PsqlConfig = z.infer<typeof PsqlConfigSchema>;
|
|
28
|
-
//# sourceMappingURL=psql-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psql-config.d.ts","sourceRoot":"","sources":["../../../../src/services/psql-erp-service/internal/psql-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PSQL Labor Ticket Operations
|
|
3
|
-
*
|
|
4
|
-
* Phase 2: This will handle INSERT/UPDATE/DELETE operations for labor tickets
|
|
5
|
-
* Phase 1: Placeholder - throws errors if called
|
|
6
|
-
*/
|
|
7
|
-
import { PsqlService } from "../psql-service";
|
|
8
|
-
import { MMReceiveLaborTicket } from "../../../services/mm-api-service";
|
|
9
|
-
export declare class PsqlLaborTicketOperations {
|
|
10
|
-
private service;
|
|
11
|
-
constructor(service: PsqlService);
|
|
12
|
-
/**
|
|
13
|
-
* Create labor ticket in START_LABOR table
|
|
14
|
-
*
|
|
15
|
-
* Phase 2 Implementation Notes:
|
|
16
|
-
* - Will use prepared statements with parameter binding
|
|
17
|
-
* - Insert into START_LABOR table
|
|
18
|
-
* - Return GUID as erpUid
|
|
19
|
-
*
|
|
20
|
-
* @param laborTicket Labor ticket from MachineMetrics
|
|
21
|
-
* @returns Labor ticket and ERP unique ID
|
|
22
|
-
*/
|
|
23
|
-
createLaborTicket(laborTicket: MMReceiveLaborTicket): Promise<{
|
|
24
|
-
laborTicket: MMReceiveLaborTicket;
|
|
25
|
-
erpUid: string;
|
|
26
|
-
}>;
|
|
27
|
-
/**
|
|
28
|
-
* Update labor ticket (move from START_LABOR to COMPLETED_LABOR)
|
|
29
|
-
*
|
|
30
|
-
* Phase 2 Implementation Notes:
|
|
31
|
-
* - Insert into COMPLETED_LABOR
|
|
32
|
-
* - Delete from START_LABOR
|
|
33
|
-
* - Should be done in a transaction
|
|
34
|
-
*
|
|
35
|
-
* @param laborTicket Labor ticket to update
|
|
36
|
-
* @returns Updated labor ticket
|
|
37
|
-
*/
|
|
38
|
-
updateLaborTicket(laborTicket: MMReceiveLaborTicket): Promise<MMReceiveLaborTicket>;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=psql-labor-ticket-operations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psql-labor-ticket-operations.d.ts","sourceRoot":"","sources":["../../../../src/services/psql-erp-service/internal/psql-labor-ticket-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAGxE,qBAAa,yBAAyB;IACxB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW;IAExC;;;;;;;;;;OAUG;IACG,iBAAiB,CACrB,WAAW,EAAE,oBAAoB,GAChC,OAAO,CAAC;QAAE,WAAW,EAAE,oBAAoB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IASjE;;;;;;;;;;OAUG;IACG,iBAAiB,CACrB,WAAW,EAAE,oBAAoB,GAChC,OAAO,CAAC,oBAAoB,CAAC;CAQjC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PSQL-specific type definitions
|
|
3
|
-
*/
|
|
4
|
-
export interface PsqlConnectionOptions {
|
|
5
|
-
connectionString: string;
|
|
6
|
-
}
|
|
7
|
-
export interface OdbcError {
|
|
8
|
-
state: string;
|
|
9
|
-
message: string;
|
|
10
|
-
code?: number;
|
|
11
|
-
}
|
|
12
|
-
export interface OdbcErrorResponse extends Error {
|
|
13
|
-
odbcErrors?: OdbcError[];
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=psql-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psql-types.d.ts","sourceRoot":"","sources":["../../../../../src/services/psql-erp-service/internal/types/psql-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC9C,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper functions for PSQL/Pervasive database operations
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Formats a date from PSQL YYMMDD format to ISO date string
|
|
6
|
-
* @param psqlDate Date in YYMMDD format (e.g., "250105" for Jan 5, 2025)
|
|
7
|
-
* @returns ISO date string (e.g., "2025-01-05") or null if invalid
|
|
8
|
-
*/
|
|
9
|
-
export declare function formatPsqlDate(psqlDate: string): string | null;
|
|
10
|
-
/**
|
|
11
|
-
* Formats a time from PSQL HHMM format to HH:MM:SS
|
|
12
|
-
* @param psqlTime Time in HHMM format (e.g., "1430" for 2:30 PM)
|
|
13
|
-
* @returns Time string in HH:MM:SS format or null if invalid
|
|
14
|
-
*/
|
|
15
|
-
export declare function formatPsqlTime(psqlTime: string): string | null;
|
|
16
|
-
/**
|
|
17
|
-
* Combines PSQL date and time into ISO datetime string
|
|
18
|
-
* @param psqlDate Date in YYMMDD format
|
|
19
|
-
* @param psqlTime Time in HHMM format
|
|
20
|
-
* @returns ISO datetime string or null if invalid
|
|
21
|
-
*/
|
|
22
|
-
export declare function combinePsqlDateTime(psqlDate: string, psqlTime: string): string | null;
|
|
23
|
-
/**
|
|
24
|
-
* Helper to check if a PSQL date is "empty" (000000 or blank)
|
|
25
|
-
*/
|
|
26
|
-
export declare function isPsqlDateEmpty(psqlDate: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Clean and trim PSQL CHAR field (removes trailing spaces)
|
|
29
|
-
* PSQL CHAR fields are fixed-width and padded with spaces
|
|
30
|
-
*/
|
|
31
|
-
export declare function cleanPsqlCharField(value: string | null | undefined): string;
|
|
32
|
-
//# sourceMappingURL=psql-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psql-helpers.d.ts","sourceRoot":"","sources":["../../../src/services/psql-erp-service/psql-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuB9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CASf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAK3E"}
|