@etohq/audit 1.5.1-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Etohq
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Audit Module
@@ -0,0 +1,6 @@
1
+ import { AuditLogModuleService } from "./services";
2
+ declare const _default: import("@etohq/types").ModuleExports<typeof AuditLogModuleService> & {
3
+ linkable: Record<string, any>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;;;;AAEjD,wBAEE"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@etohq/framework/utils");
4
+ const _services_1 = require("./services");
5
+ exports.default = (0, utils_1.Module)(utils_1.Modules.AUDIT_LOG, {
6
+ service: _services_1.AuditLogModuleService,
7
+ });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,kDAAwD;AACxD,yCAAiD;AAEjD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,SAAS,EAAE;IACvC,OAAO,EAAE,iCAAqB;CAC/B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const joinerConfig: Omit<import("@etohq/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys"> & Required<Pick<import("@etohq/types").ModuleJoinerConfig, "serviceName" | "primaryKeys" | "alias" | "linkableKeys">>;
2
+ //# sourceMappingURL=joiner-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joiner-config.d.ts","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,iOAWvB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.joinerConfig = void 0;
4
+ const utils_1 = require("@etohq/framework/utils");
5
+ const models_1 = require("./models");
6
+ exports.joinerConfig = (0, utils_1.defineJoinerConfig)(utils_1.Modules.AUDIT_LOG, {
7
+ models: [models_1.AuditLog],
8
+ linkableKeys: {
9
+ audit_log_id: models_1.AuditLog.name,
10
+ },
11
+ alias: [
12
+ {
13
+ name: ["audit_log", "audit_logs"],
14
+ entity: "AuditLog",
15
+ },
16
+ ],
17
+ });
18
+ //# sourceMappingURL=joiner-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joiner-config.js","sourceRoot":"","sources":["../src/joiner-config.ts"],"names":[],"mappings":";;;AAAA,kDAAqE;AACrE,qCAAoC;AAEvB,QAAA,YAAY,GAAG,IAAA,0BAAkB,EAAC,eAAO,CAAC,SAAS,EAAE;IAChE,MAAM,EAAE,CAAC,iBAAQ,CAAC;IAClB,YAAY,EAAE;QACZ,YAAY,EAAE,iBAAQ,CAAC,IAAI;KAC5B;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;YACjC,MAAM,EAAE,UAAU;SACnB;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const AuditLog: import("@etohq/framework/utils").DmlEntity<import("@etohq/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@etohq/framework/utils").PrimaryKeyModifier<string, import("@etohq/framework/utils").IdProperty>;
3
+ entity_id: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
4
+ connected_account_id: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
5
+ action_type: import("@etohq/framework/utils").TextProperty;
6
+ details: import("@etohq/framework/utils").NullableModifier<Record<string, unknown>, import("@etohq/framework/utils").JSONProperty>;
7
+ performed_by: import("@etohq/framework/utils").NullableModifier<string, import("@etohq/framework/utils").TextProperty>;
8
+ created_at: import("@etohq/framework/utils").DateTimeProperty;
9
+ }>, "AuditLog">;
10
+ //# sourceMappingURL=audit-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../src/models/audit-log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;;eAUnB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuditLog = void 0;
4
+ const utils_1 = require("@etohq/framework/utils");
5
+ exports.AuditLog = utils_1.model.define("AuditLog", {
6
+ id: utils_1.model.id({
7
+ prefix: "audlog"
8
+ }).primaryKey(),
9
+ entity_id: utils_1.model.text().nullable(),
10
+ connected_account_id: utils_1.model.text().nullable(),
11
+ action_type: utils_1.model.text(), // Changed to text for agnosticism
12
+ details: utils_1.model.json().nullable(),
13
+ performed_by: utils_1.model.text().nullable(),
14
+ created_at: utils_1.model.dateTime().defaultNow(),
15
+ });
16
+ //# sourceMappingURL=audit-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../../src/models/audit-log.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAElC,QAAA,QAAQ,GAAG,aAAK,CAAC,MAAM,CAAC,UAAU,EAAE;IAC/C,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC;QACX,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC,UAAU,EAAE;IACf,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAClC,oBAAoB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC7C,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,kCAAkC;IAC7D,OAAO,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,aAAK,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE;CAC1C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./audit-log";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
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("./audit-log"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1,21 @@
1
+ import { AuditLogDTO, DAL, IAuditModuleService } from "@etohq/framework/types";
2
+ import { ModulesSdkUtils } from "@etohq/framework/utils";
3
+ import { AuditLog } from "../models";
4
+ /**
5
+ * Internal dependency injection for AuditModuleService.
6
+ * Must provide baseRepository as per ModulesSdkUtils.EtoService convention.
7
+ */
8
+ type InjectedDependencies = {
9
+ baseRepository: DAL.RepositoryService<typeof AuditLog>;
10
+ };
11
+ declare const AuditModuleService_base: ModulesSdkUtils.EtoServiceReturnType<{
12
+ AuditLog: {
13
+ dto: AuditLogDTO;
14
+ };
15
+ }>;
16
+ export default class AuditModuleService extends AuditModuleService_base implements IAuditModuleService {
17
+ protected readonly baseRepository_: DAL.RepositoryService<typeof AuditLog>;
18
+ constructor({ baseRepository }: InjectedDependencies);
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=audit-log-module-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-module-service.d.ts","sourceRoot":"","sources":["../../src/services/audit-log-module-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,GAAG,EACH,mBAAmB,EACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;;;GAGG;AACH,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,GAAG,CAAC,iBAAiB,CAAC,OAAO,QAAQ,CAAC,CAAA;CACvD,CAAA;;cAQa;QAAE,GAAG,EAAE,WAAW,CAAA;KAAE;;AAFlC,MAAM,CAAC,OAAO,OAAO,kBACnB,SAAQ,uBAGR,YAAW,mBAAmB;IAE9B,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAC,OAAO,QAAQ,CAAC,CAAA;gBAE9D,EAAE,cAAc,EAAE,EAAE,oBAAoB;CAOrD"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@etohq/framework/utils");
4
+ const models_1 = require("../models");
5
+ const generateMethodForModels = {
6
+ AuditLog: models_1.AuditLog,
7
+ };
8
+ class AuditModuleService extends utils_1.ModulesSdkUtils.EtoService(generateMethodForModels) {
9
+ constructor({ baseRepository }) {
10
+ // @ts-ignore
11
+ super(...arguments);
12
+ this.baseRepository_ = baseRepository;
13
+ }
14
+ }
15
+ exports.default = AuditModuleService;
16
+ //# sourceMappingURL=audit-log-module-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-module-service.js","sourceRoot":"","sources":["../../src/services/audit-log-module-service.ts"],"names":[],"mappings":";;AAKA,kDAAwD;AACxD,sCAAoC;AAUpC,MAAM,uBAAuB,GAAG;IAC9B,QAAQ,EAAR,iBAAQ;CACT,CAAA;AAED,MAAqB,kBACnB,SAAQ,uBAAe,CAAC,UAAU,CAE/B,uBAAuB,CAAC;IAK3B,YAAY,EAAE,cAAc,EAAwB;QAClD,aAAa;QACb,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QACnB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAA;IACvC,CAAC;CAGF;AAfD,qCAeC"}
@@ -0,0 +1,2 @@
1
+ export { default as AuditLogModuleService } from "./audit-log-module-service";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AuditLogModuleService = void 0;
7
+ var audit_log_module_service_1 = require("./audit-log-module-service");
8
+ Object.defineProperty(exports, "AuditLogModuleService", { enumerable: true, get: function () { return __importDefault(audit_log_module_service_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA8E;AAArE,kJAAA,OAAO,OAAyB"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/joiner-config.ts","../src/models/audit-log.ts","../src/models/index.ts","../src/services/audit-log-module-service.ts","../src/services/index.ts"],"version":"5.8.3"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@etohq/audit",
3
+ "version": "1.5.1-alpha.4",
4
+ "description": "Eto Audit module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "!dist/**/__tests__",
10
+ "!dist/**/__mocks__",
11
+ "!dist/**/__fixtures__"
12
+ ],
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/etohq/eto",
19
+ "directory": "packages/core/modules/audit"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "author": "Eto",
25
+ "license": "MIT",
26
+ "devDependencies": {
27
+ "@mikro-orm/cli": "6.4.3",
28
+ "@mikro-orm/core": "6.4.3",
29
+ "@mikro-orm/migrations": "6.4.3",
30
+ "@mikro-orm/postgresql": "6.4.3",
31
+ "@swc/core": "1.7.28",
32
+ "@swc/jest": "0.2.36",
33
+ "@types/jest": "29.5.14",
34
+ "awilix": "8.0.1",
35
+ "jest": "29.7.0",
36
+ "rimraf": "5.0.2",
37
+ "tsc-alias": "1.8.6",
38
+ "typescript": "5.8.3",
39
+ "@etohq/framework": "1.5.1-alpha.4",
40
+ "@etohq/test-utils": "1.5.1-alpha.4"
41
+ },
42
+ "peerDependencies": {
43
+ "@mikro-orm/core": "6.4.3",
44
+ "@mikro-orm/migrations": "6.4.3",
45
+ "@mikro-orm/postgresql": "6.4.3",
46
+ "awilix": "8.0.1",
47
+ "@etohq/framework": "1.5.1-alpha.4"
48
+ },
49
+ "scripts": {
50
+ "watch": "tsc --build --watch",
51
+ "watch:test": "tsc --build tsconfig.spec.json --watch",
52
+ "build": "rimraf dist && tsc --build && npm run resolve:aliases",
53
+ "resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
54
+ "test": "jest --runInBand --bail --passWithNoTests --forceExit -- src",
55
+ "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
56
+ "migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:create --initial",
57
+ "migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:create",
58
+ "migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm migration:up",
59
+ "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts eto-mikro-orm cache:clear"
60
+ }
61
+ }