@pipeline-builder/api-core 0.0.1

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 (184) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +98 -0
  3. package/lib/constants/ai-providers.d.ts +52 -0
  4. package/lib/constants/ai-providers.js +129 -0
  5. package/lib/constants/http-status.d.ts +20 -0
  6. package/lib/constants/http-status.js +26 -0
  7. package/lib/constants/index.d.ts +3 -0
  8. package/lib/constants/index.js +6 -0
  9. package/lib/constants/time.d.ts +10 -0
  10. package/lib/constants/time.js +13 -0
  11. package/lib/errors/app-errors.d.ts +30 -0
  12. package/lib/errors/app-errors.js +53 -0
  13. package/lib/errors/index.d.ts +1 -0
  14. package/lib/errors/index.js +4 -0
  15. package/lib/helpers/access-helpers.d.ts +63 -0
  16. package/lib/helpers/access-helpers.js +82 -0
  17. package/lib/helpers/crud-helpers.d.ts +9 -0
  18. package/lib/helpers/crud-helpers.js +23 -0
  19. package/lib/helpers/index.d.ts +6 -0
  20. package/lib/helpers/index.js +9 -0
  21. package/lib/helpers/org-hierarchy-http.d.ts +74 -0
  22. package/lib/helpers/org-hierarchy-http.js +144 -0
  23. package/lib/helpers/org-hierarchy.d.ts +57 -0
  24. package/lib/helpers/org-hierarchy.js +110 -0
  25. package/lib/helpers/restore-helpers.d.ts +49 -0
  26. package/lib/helpers/restore-helpers.js +78 -0
  27. package/lib/helpers/sse-helpers.d.ts +20 -0
  28. package/lib/helpers/sse-helpers.js +45 -0
  29. package/lib/index.d.ts +58 -0
  30. package/lib/index.js +71 -0
  31. package/lib/middleware/auth.d.ts +208 -0
  32. package/lib/middleware/auth.js +588 -0
  33. package/lib/middleware/index.d.ts +3 -0
  34. package/lib/middleware/index.js +6 -0
  35. package/lib/middleware/mongo-sanitize.d.ts +32 -0
  36. package/lib/middleware/mongo-sanitize.js +100 -0
  37. package/lib/middleware/step-up.d.ts +45 -0
  38. package/lib/middleware/step-up.js +138 -0
  39. package/lib/openapi/extend-zod.d.ts +1 -0
  40. package/lib/openapi/extend-zod.js +6 -0
  41. package/lib/openapi/index.d.ts +2 -0
  42. package/lib/openapi/index.js +5 -0
  43. package/lib/openapi/registry.d.ts +17 -0
  44. package/lib/openapi/registry.js +38 -0
  45. package/lib/openapi/routes/ask-routes.d.ts +7 -0
  46. package/lib/openapi/routes/ask-routes.js +62 -0
  47. package/lib/openapi/routes/billing-routes.d.ts +1 -0
  48. package/lib/openapi/routes/billing-routes.js +66 -0
  49. package/lib/openapi/routes/image-registry-routes.d.ts +7 -0
  50. package/lib/openapi/routes/image-registry-routes.js +98 -0
  51. package/lib/openapi/routes/index.d.ts +5 -0
  52. package/lib/openapi/routes/index.js +28 -0
  53. package/lib/openapi/routes/message-routes.d.ts +1 -0
  54. package/lib/openapi/routes/message-routes.js +105 -0
  55. package/lib/openapi/routes/pipeline-routes.d.ts +1 -0
  56. package/lib/openapi/routes/pipeline-routes.js +105 -0
  57. package/lib/openapi/routes/pipeline-template-routes.d.ts +1 -0
  58. package/lib/openapi/routes/pipeline-template-routes.js +61 -0
  59. package/lib/openapi/routes/plugin-routes.d.ts +1 -0
  60. package/lib/openapi/routes/plugin-routes.js +96 -0
  61. package/lib/openapi/routes/quota-routes.d.ts +1 -0
  62. package/lib/openapi/routes/quota-routes.js +62 -0
  63. package/lib/openapi/schema-registry.d.ts +25 -0
  64. package/lib/openapi/schema-registry.js +91 -0
  65. package/lib/routes/health.d.ts +41 -0
  66. package/lib/routes/health.js +82 -0
  67. package/lib/routes/index.d.ts +1 -0
  68. package/lib/routes/index.js +4 -0
  69. package/lib/services/audit-spool.d.ts +80 -0
  70. package/lib/services/audit-spool.js +172 -0
  71. package/lib/services/cache-service.d.ts +124 -0
  72. package/lib/services/cache-service.js +276 -0
  73. package/lib/services/circuit-breaker.d.ts +45 -0
  74. package/lib/services/circuit-breaker.js +138 -0
  75. package/lib/services/compliance-client.d.ts +46 -0
  76. package/lib/services/compliance-client.js +128 -0
  77. package/lib/services/compliance-event-subscriber.d.ts +16 -0
  78. package/lib/services/compliance-event-subscriber.js +72 -0
  79. package/lib/services/durable-event-bus.d.ts +96 -0
  80. package/lib/services/durable-event-bus.js +204 -0
  81. package/lib/services/entity-events.d.ts +48 -0
  82. package/lib/services/entity-events.js +79 -0
  83. package/lib/services/env-redis.d.ts +44 -0
  84. package/lib/services/env-redis.js +94 -0
  85. package/lib/services/http-client.d.ts +143 -0
  86. package/lib/services/http-client.js +335 -0
  87. package/lib/services/index.d.ts +18 -0
  88. package/lib/services/index.js +20 -0
  89. package/lib/services/leader-lock.d.ts +45 -0
  90. package/lib/services/leader-lock.js +85 -0
  91. package/lib/services/quota.d.ts +130 -0
  92. package/lib/services/quota.js +264 -0
  93. package/lib/services/remote-audit-client.d.ts +160 -0
  94. package/lib/services/remote-audit-client.js +390 -0
  95. package/lib/services/retry-strategy.d.ts +74 -0
  96. package/lib/services/retry-strategy.js +118 -0
  97. package/lib/services/scheduler.d.ts +41 -0
  98. package/lib/services/scheduler.js +86 -0
  99. package/lib/services/service-boot.d.ts +20 -0
  100. package/lib/services/service-boot.js +28 -0
  101. package/lib/services/sse-ticket-store.d.ts +51 -0
  102. package/lib/services/sse-ticket-store.js +130 -0
  103. package/lib/services/token-revocation.d.ts +52 -0
  104. package/lib/services/token-revocation.js +120 -0
  105. package/lib/testing/tier-mock.d.ts +44 -0
  106. package/lib/testing/tier-mock.js +65 -0
  107. package/lib/types/audit-events.d.ts +69 -0
  108. package/lib/types/audit-events.js +4 -0
  109. package/lib/types/catalog-metadata.d.ts +36 -0
  110. package/lib/types/catalog-metadata.js +21 -0
  111. package/lib/types/common.d.ts +255 -0
  112. package/lib/types/common.js +41 -0
  113. package/lib/types/error-codes.d.ts +54 -0
  114. package/lib/types/error-codes.js +107 -0
  115. package/lib/types/feature-flags.d.ts +36 -0
  116. package/lib/types/feature-flags.js +128 -0
  117. package/lib/types/http.d.ts +27 -0
  118. package/lib/types/http.js +4 -0
  119. package/lib/types/index.d.ts +11 -0
  120. package/lib/types/index.js +14 -0
  121. package/lib/types/permissions.d.ts +65 -0
  122. package/lib/types/permissions.js +131 -0
  123. package/lib/types/pipeline-template.d.ts +30 -0
  124. package/lib/types/pipeline-template.js +13 -0
  125. package/lib/types/pipeline.d.ts +59 -0
  126. package/lib/types/pipeline.js +31 -0
  127. package/lib/types/quota-tiers.d.ts +79 -0
  128. package/lib/types/quota-tiers.js +221 -0
  129. package/lib/types/visibility.d.ts +20 -0
  130. package/lib/types/visibility.js +22 -0
  131. package/lib/utils/alias-resolver.d.ts +37 -0
  132. package/lib/utils/alias-resolver.js +68 -0
  133. package/lib/utils/audit.d.ts +15 -0
  134. package/lib/utils/audit.js +39 -0
  135. package/lib/utils/aws-scrub.d.ts +11 -0
  136. package/lib/utils/aws-scrub.js +67 -0
  137. package/lib/utils/compliance-attributes.d.ts +6 -0
  138. package/lib/utils/compliance-attributes.js +69 -0
  139. package/lib/utils/concurrency.d.ts +9 -0
  140. package/lib/utils/concurrency.js +29 -0
  141. package/lib/utils/crash-handlers.d.ts +18 -0
  142. package/lib/utils/crash-handlers.js +36 -0
  143. package/lib/utils/env.d.ts +28 -0
  144. package/lib/utils/env.js +54 -0
  145. package/lib/utils/headers.d.ts +18 -0
  146. package/lib/utils/headers.js +21 -0
  147. package/lib/utils/identity.d.ts +40 -0
  148. package/lib/utils/identity.js +51 -0
  149. package/lib/utils/index.d.ts +17 -0
  150. package/lib/utils/index.js +20 -0
  151. package/lib/utils/logger.d.ts +38 -0
  152. package/lib/utils/logger.js +174 -0
  153. package/lib/utils/metric-emitter.d.ts +36 -0
  154. package/lib/utils/metric-emitter.js +32 -0
  155. package/lib/utils/object.d.ts +13 -0
  156. package/lib/utils/object.js +18 -0
  157. package/lib/utils/params.d.ts +150 -0
  158. package/lib/utils/params.js +206 -0
  159. package/lib/utils/response.d.ts +117 -0
  160. package/lib/utils/response.js +223 -0
  161. package/lib/utils/safe-require.d.ts +13 -0
  162. package/lib/utils/safe-require.js +19 -0
  163. package/lib/utils/secret-encryption.d.ts +176 -0
  164. package/lib/utils/secret-encryption.js +374 -0
  165. package/lib/utils/ssrf.d.ts +30 -0
  166. package/lib/utils/ssrf.js +106 -0
  167. package/lib/validation/ai-schemas.d.ts +56 -0
  168. package/lib/validation/ai-schemas.js +78 -0
  169. package/lib/validation/common-schemas.d.ts +133 -0
  170. package/lib/validation/common-schemas.js +94 -0
  171. package/lib/validation/index.d.ts +7 -0
  172. package/lib/validation/index.js +10 -0
  173. package/lib/validation/message-schemas.d.ts +160 -0
  174. package/lib/validation/message-schemas.js +156 -0
  175. package/lib/validation/middleware.d.ts +72 -0
  176. package/lib/validation/middleware.js +65 -0
  177. package/lib/validation/pipeline-schemas.d.ts +181 -0
  178. package/lib/validation/pipeline-schemas.js +101 -0
  179. package/lib/validation/pipeline-template-schemas.d.ts +155 -0
  180. package/lib/validation/pipeline-template-schemas.js +66 -0
  181. package/lib/validation/plugin-schemas.d.ts +171 -0
  182. package/lib/validation/plugin-schemas.js +81 -0
  183. package/openapi.yaml +292 -0
  184. package/package.json +167 -0
package/package.json ADDED
@@ -0,0 +1,167 @@
1
+ {
2
+ "name": "@pipeline-builder/api-core",
3
+ "description": "Core server-side utilities (auth middleware, response helpers, error codes, quota service, HTTP client, logging, AI provider catalog) shared by every Pipeline Builder backend service.",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/mwashburn160/pipeline-builder.git"
7
+ },
8
+ "devDependencies": {
9
+ "@jest/globals": "30.4.1",
10
+ "@stylistic/eslint-plugin": "^2",
11
+ "@types/express": "5.0.6",
12
+ "@types/jsonwebtoken": "9.0.10",
13
+ "@types/node": "26.1.2",
14
+ "@typescript-eslint/eslint-plugin": "^8",
15
+ "@typescript-eslint/parser": "^8",
16
+ "@typescript/native": "npm:typescript@^7.0.2",
17
+ "eslint": "^9",
18
+ "eslint-import-resolver-typescript": "^4.4.4",
19
+ "eslint-plugin-import": "^2.32.0",
20
+ "jest": "30.4.2",
21
+ "jest-junit": "^17",
22
+ "ts-jest": "29.4.12",
23
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
24
+ },
25
+ "dependencies": {
26
+ "@asteasolutions/zod-to-openapi": "9.1.0",
27
+ "@aws-sdk/client-kms": "3.1101.0",
28
+ "@aws-sdk/client-sts": "3.1101.0",
29
+ "@aws-sdk/credential-providers": "3.1101.0",
30
+ "express": "5.2.1",
31
+ "ioredis": "6.0.0",
32
+ "jsonwebtoken": "9.0.3",
33
+ "winston": "3.19.0",
34
+ "zod": "4.4.3"
35
+ },
36
+ "keywords": [
37
+ "ci-cd",
38
+ "cicd",
39
+ "continuous-delivery",
40
+ "devops",
41
+ "self-service",
42
+ "platform-engineering",
43
+ "internal-developer-platform",
44
+ "developer-platform",
45
+ "aws",
46
+ "aws-cdk",
47
+ "cdk",
48
+ "codepipeline",
49
+ "codebuild",
50
+ "cloudformation",
51
+ "pipeline",
52
+ "pipeline-as-code",
53
+ "infrastructure-as-code",
54
+ "iac",
55
+ "compliance",
56
+ "policy-as-code",
57
+ "governance",
58
+ "golden-paths",
59
+ "multi-tenant",
60
+ "rbac",
61
+ "ai",
62
+ "ai-pipeline-generation",
63
+ "llm",
64
+ "bedrock",
65
+ "plugins",
66
+ "plugin-marketplace",
67
+ "containerized",
68
+ "docker",
69
+ "kubernetes",
70
+ "typescript",
71
+ "cli"
72
+ ],
73
+ "engines": {
74
+ "node": ">= 24.14.0"
75
+ },
76
+ "devEngines": {
77
+ "packageManager": {
78
+ "name": "pnpm",
79
+ "version": ">=10",
80
+ "onFail": "ignore"
81
+ }
82
+ },
83
+ "main": "lib/index.js",
84
+ "license": "Apache-2.0",
85
+ "homepage": "https://mwashburn160.github.io/pipeline-builder/",
86
+ "publishConfig": {
87
+ "access": "public",
88
+ "registry": "https://registry.npmjs.org/"
89
+ },
90
+ "version": "0.0.1",
91
+ "bugs": {
92
+ "url": "https://github.com/mwashburn160/pipeline-builder/issues"
93
+ },
94
+ "jest": {
95
+ "coverageProvider": "v8",
96
+ "testMatch": [
97
+ "<rootDir>/@(src|test)/**/*(*.)@(spec|test).ts?(x)",
98
+ "<rootDir>/@(src|test)/**/__tests__/**/*.ts?(x)"
99
+ ],
100
+ "clearMocks": true,
101
+ "collectCoverage": true,
102
+ "coverageReporters": [
103
+ "json",
104
+ "lcov",
105
+ "clover",
106
+ "cobertura",
107
+ "text"
108
+ ],
109
+ "coverageDirectory": "coverage",
110
+ "coveragePathIgnorePatterns": [
111
+ "/node_modules/"
112
+ ],
113
+ "testPathIgnorePatterns": [
114
+ "/node_modules/"
115
+ ],
116
+ "watchPathIgnorePatterns": [
117
+ "/node_modules/"
118
+ ],
119
+ "reporters": [
120
+ "default",
121
+ [
122
+ "jest-junit",
123
+ {
124
+ "outputDirectory": "test-reports"
125
+ }
126
+ ]
127
+ ],
128
+ "transform": {
129
+ "^.+\\.[t]sx?$": [
130
+ "ts-jest",
131
+ {
132
+ "useESM": true,
133
+ "tsconfig": "tsconfig.dev.json",
134
+ "diagnostics": {
135
+ "ignoreCodes": [
136
+ 151002
137
+ ]
138
+ }
139
+ }
140
+ ]
141
+ },
142
+ "extensionsToTreatAsEsm": [
143
+ ".ts",
144
+ ".tsx"
145
+ ],
146
+ "moduleNameMapper": {
147
+ "^uuid$": "<rootDir>/../../jest-uuid-stub.js",
148
+ "^(\\.{1,2}/.*)\\.js$": "$1"
149
+ }
150
+ },
151
+ "types": "lib/index.d.ts",
152
+ "type": "module",
153
+ "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm dlx projen\".",
154
+ "scripts": {
155
+ "build": "pnpm dlx projen build",
156
+ "compile": "pnpm dlx projen compile",
157
+ "default": "pnpm dlx projen default",
158
+ "eslint": "pnpm dlx projen eslint",
159
+ "package": "pnpm dlx projen package",
160
+ "post-compile": "pnpm dlx projen post-compile",
161
+ "pre-compile": "pnpm dlx projen pre-compile",
162
+ "test": "pnpm dlx projen test",
163
+ "test:watch": "pnpm dlx projen test:watch",
164
+ "watch": "pnpm dlx projen watch",
165
+ "projen": "pnpm dlx projen"
166
+ }
167
+ }