@astram/engine 0.1.0

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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/mariadb-audit-sink.d.ts +24 -0
  3. package/dist/adapters/mariadb-audit-sink.d.ts.map +1 -0
  4. package/dist/adapters/mariadb-audit-sink.js +40 -0
  5. package/dist/adapters/mariadb-audit-sink.js.map +1 -0
  6. package/dist/adapters/mariadb-unit-of-work.d.ts +27 -0
  7. package/dist/adapters/mariadb-unit-of-work.d.ts.map +1 -0
  8. package/dist/adapters/mariadb-unit-of-work.js +58 -0
  9. package/dist/adapters/mariadb-unit-of-work.js.map +1 -0
  10. package/dist/decorators/access-bundle.decorator.d.ts +66 -0
  11. package/dist/decorators/access-bundle.decorator.d.ts.map +1 -0
  12. package/dist/decorators/access-bundle.decorator.js +76 -0
  13. package/dist/decorators/access-bundle.decorator.js.map +1 -0
  14. package/dist/decorators/object-type.decorator.d.ts +116 -0
  15. package/dist/decorators/object-type.decorator.d.ts.map +1 -0
  16. package/dist/decorators/object-type.decorator.js +146 -0
  17. package/dist/decorators/object-type.decorator.js.map +1 -0
  18. package/dist/errors.d.ts +46 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +67 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/index.d.ts +30 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +80 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/module/engine.module.d.ts +90 -0
  27. package/dist/module/engine.module.d.ts.map +1 -0
  28. package/dist/module/engine.module.js +218 -0
  29. package/dist/module/engine.module.js.map +1 -0
  30. package/dist/module/tokens.d.ts +12 -0
  31. package/dist/module/tokens.d.ts.map +1 -0
  32. package/dist/module/tokens.js +14 -0
  33. package/dist/pipe/context.d.ts +55 -0
  34. package/dist/pipe/context.d.ts.map +1 -0
  35. package/dist/pipe/context.js +18 -0
  36. package/dist/pipe/context.js.map +1 -0
  37. package/dist/pipe/record-engine.d.ts +72 -0
  38. package/dist/pipe/record-engine.d.ts.map +1 -0
  39. package/dist/pipe/record-engine.js +279 -0
  40. package/dist/pipe/record-engine.js.map +1 -0
  41. package/dist/pipe/records-service.d.ts +47 -0
  42. package/dist/pipe/records-service.d.ts.map +1 -0
  43. package/dist/pipe/records-service.js +108 -0
  44. package/dist/pipe/stages/audit.d.ts +15 -0
  45. package/dist/pipe/stages/audit.d.ts.map +1 -0
  46. package/dist/pipe/stages/audit.js +42 -0
  47. package/dist/pipe/stages/audit.js.map +1 -0
  48. package/dist/pipe/stages/derive-write-context.d.ts +22 -0
  49. package/dist/pipe/stages/derive-write-context.d.ts.map +1 -0
  50. package/dist/pipe/stages/derive-write-context.js +61 -0
  51. package/dist/pipe/stages/derive-write-context.js.map +1 -0
  52. package/dist/pipe/stages/fetch-owner.d.ts +28 -0
  53. package/dist/pipe/stages/fetch-owner.d.ts.map +1 -0
  54. package/dist/pipe/stages/fetch-owner.js +90 -0
  55. package/dist/pipe/stages/fetch-owner.js.map +1 -0
  56. package/dist/pipe/stages/junction-sync.d.ts +14 -0
  57. package/dist/pipe/stages/junction-sync.d.ts.map +1 -0
  58. package/dist/pipe/stages/junction-sync.js +63 -0
  59. package/dist/pipe/stages/junction-sync.js.map +1 -0
  60. package/dist/pipe/stages/permission-gate.d.ts +11 -0
  61. package/dist/pipe/stages/permission-gate.d.ts.map +1 -0
  62. package/dist/pipe/stages/permission-gate.js +53 -0
  63. package/dist/pipe/stages/permission-gate.js.map +1 -0
  64. package/dist/pipe/stages/validate.d.ts +11 -0
  65. package/dist/pipe/stages/validate.d.ts.map +1 -0
  66. package/dist/pipe/stages/validate.js +89 -0
  67. package/dist/pipe/stages/validate.js.map +1 -0
  68. package/dist/pipe/stages/write.d.ts +12 -0
  69. package/dist/pipe/stages/write.d.ts.map +1 -0
  70. package/dist/pipe/stages/write.js +109 -0
  71. package/dist/pipe/stages/write.js.map +1 -0
  72. package/dist/ports.d.ts +37 -0
  73. package/dist/ports.d.ts.map +1 -0
  74. package/dist/ports.js +11 -0
  75. package/dist/ports.js.map +1 -0
  76. package/dist/registry.d.ts +42 -0
  77. package/dist/registry.d.ts.map +1 -0
  78. package/dist/registry.js +184 -0
  79. package/dist/registry.js.map +1 -0
  80. package/dist/types.d.ts +207 -0
  81. package/dist/types.d.ts.map +1 -0
  82. package/dist/types.js +15 -0
  83. package/dist/types.js.map +1 -0
  84. package/package.json +49 -0
package/dist/types.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Public types for @astram/engine — the paved road.
4
+ *
5
+ * A feature contributes exactly ONE thing: a {@link ObjectType} (metadata =
6
+ * the contract). From it the engine derives the physical table shape, validation,
7
+ * the `decide()` resource identity, and the audit event. The feature then calls the
8
+ * {@link RecordEngine} facade for all CRUD — it never touches a pool/query-runner.
9
+ *
10
+ * Core types (`Principal`, `Action`, `Resource`) are imported TYPE-ONLY from
11
+ * `@astram/core` (erased at build; the CJS↔ESM lesson — no runtime require of the
12
+ * ESM-only core). Re-exported from the engine barrel so a consumer has ONE import
13
+ * surface.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@astram/engine",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "description": "Astram framework — the paved road. ONE unbypassable write pipe (resolve-schema → permission gate → derive-write-context → validate → compute → write → junction-sync → audit → emit-event) over real physical tables, that every feature's CRUD flows through. Feature code receives ONLY the RecordEngine facade — never a raw pool/DataSource/QueryRunner (the physical wall). Security-gate + audit are mandatory stages. Missing capability → a typed CapabilityNotSupportedError (the gap-flag STOP). Builds on @astram/core (metadata contract, decide(), audit) + @astram/guard (decision authority).",
6
+ "type": "commonjs",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "sideEffects": false,
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "mariadb": "^3.4.0",
24
+ "@astram/guard": "0.3.0",
25
+ "@astram/core": "1.0.0"
26
+ },
27
+ "peerDependencies": {
28
+ "@nestjs/common": "^11",
29
+ "@nestjs/core": "^11",
30
+ "reflect-metadata": "^0.2",
31
+ "rxjs": "^7"
32
+ },
33
+ "devDependencies": {
34
+ "@nestjs/common": "^11.0.0",
35
+ "@nestjs/core": "^11.0.0",
36
+ "@nestjs/testing": "^11.0.0",
37
+ "@types/node": "^22.0.0",
38
+ "reflect-metadata": "^0.2.2",
39
+ "rxjs": "^7.8.1",
40
+ "typescript": "^5.7.0",
41
+ "unplugin-swc": "^1.5.1",
42
+ "vitest": "^2.1.8"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.build.json",
46
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
47
+ "test": "vitest run"
48
+ }
49
+ }