@venizia/ignis-helpers 0.1.0 → 0.1.1-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.
- package/dist/common/redact.d.ts.map +1 -1
- package/dist/common/redact.js +27 -2
- package/dist/common/redact.js.map +1 -1
- package/dist/modules/env/app-env.d.ts +3 -0
- package/dist/modules/env/app-env.d.ts.map +1 -1
- package/dist/modules/env/app-env.js +5 -0
- package/dist/modules/env/app-env.js.map +1 -1
- package/dist/modules/error/index.d.ts +19 -2
- package/dist/modules/error/index.d.ts.map +1 -1
- package/dist/modules/error/index.js +24 -2
- package/dist/modules/error/index.js.map +1 -1
- package/dist/modules/error/types.d.ts +20 -4
- package/dist/modules/error/types.d.ts.map +1 -1
- package/dist/modules/error/types.js +32 -7
- package/dist/modules/error/types.js.map +1 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/logger/formatters/deep-splat.d.ts.map +1 -1
- package/dist/modules/logger/formatters/deep-splat.js +6 -1
- package/dist/modules/logger/formatters/deep-splat.js.map +1 -1
- package/dist/modules/queue/kafka/bundler/common/constants.d.ts +9 -0
- package/dist/modules/queue/kafka/bundler/common/constants.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/common/constants.js +14 -0
- package/dist/modules/queue/kafka/bundler/common/constants.js.map +1 -0
- package/dist/modules/queue/kafka/bundler/common/index.d.ts +2 -0
- package/dist/modules/queue/kafka/bundler/common/index.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/common/index.js +18 -0
- package/dist/modules/queue/kafka/bundler/common/index.js.map +1 -0
- package/dist/modules/queue/kafka/bundler/index.d.ts +3 -0
- package/dist/modules/queue/kafka/bundler/index.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/index.js +19 -0
- package/dist/modules/queue/kafka/bundler/index.js.map +1 -0
- package/dist/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts +12 -0
- package/dist/modules/queue/kafka/bundler/platformatic-wasm.plugin.d.ts.map +1 -0
- package/dist/modules/queue/kafka/bundler/platformatic-wasm.plugin.js +38 -0
- package/dist/modules/queue/kafka/bundler/platformatic-wasm.plugin.js.map +1 -0
- package/dist/modules/queue/kafka/index.d.ts +1 -0
- package/dist/modules/queue/kafka/index.d.ts.map +1 -1
- package/dist/modules/queue/kafka/index.js +1 -0
- package/dist/modules/queue/kafka/index.js.map +1 -1
- package/dist/modules/secrets/base/abstract.helper.d.ts +64 -0
- package/dist/modules/secrets/base/abstract.helper.d.ts.map +1 -0
- package/dist/modules/secrets/base/abstract.helper.js +251 -0
- package/dist/modules/secrets/base/abstract.helper.js.map +1 -0
- package/dist/modules/secrets/base/index.d.ts +2 -0
- package/dist/modules/secrets/base/index.d.ts.map +1 -0
- package/dist/modules/secrets/base/index.js +18 -0
- package/dist/modules/secrets/base/index.js.map +1 -0
- package/dist/modules/secrets/common/constants.d.ts +18 -0
- package/dist/modules/secrets/common/constants.d.ts.map +1 -0
- package/dist/modules/secrets/common/constants.js +24 -0
- package/dist/modules/secrets/common/constants.js.map +1 -0
- package/dist/modules/secrets/common/index.d.ts +3 -0
- package/dist/modules/secrets/common/index.d.ts.map +1 -0
- package/dist/modules/secrets/common/index.js +19 -0
- package/dist/modules/secrets/common/index.js.map +1 -0
- package/dist/modules/secrets/common/types.d.ts +82 -0
- package/dist/modules/secrets/common/types.d.ts.map +1 -0
- package/dist/modules/secrets/common/types.js +3 -0
- package/dist/modules/secrets/common/types.js.map +1 -0
- package/dist/modules/secrets/dotenv/dotenv.helper.d.ts +31 -0
- package/dist/modules/secrets/dotenv/dotenv.helper.d.ts.map +1 -0
- package/dist/modules/secrets/dotenv/dotenv.helper.js +45 -0
- package/dist/modules/secrets/dotenv/dotenv.helper.js.map +1 -0
- package/dist/modules/secrets/dotenv/index.d.ts +2 -0
- package/dist/modules/secrets/dotenv/index.d.ts.map +1 -0
- package/dist/modules/secrets/dotenv/index.js +18 -0
- package/dist/modules/secrets/dotenv/index.js.map +1 -0
- package/dist/modules/secrets/factory.d.ts +5 -0
- package/dist/modules/secrets/factory.d.ts.map +1 -0
- package/dist/modules/secrets/factory.js +38 -0
- package/dist/modules/secrets/factory.js.map +1 -0
- package/dist/modules/secrets/hashicorp/auth.d.ts +17 -0
- package/dist/modules/secrets/hashicorp/auth.d.ts.map +1 -0
- package/dist/modules/secrets/hashicorp/auth.js +21 -0
- package/dist/modules/secrets/hashicorp/auth.js.map +1 -0
- package/dist/modules/secrets/hashicorp/hashicorp.helper.d.ts +71 -0
- package/dist/modules/secrets/hashicorp/hashicorp.helper.d.ts.map +1 -0
- package/dist/modules/secrets/hashicorp/hashicorp.helper.js +205 -0
- package/dist/modules/secrets/hashicorp/hashicorp.helper.js.map +1 -0
- package/dist/modules/secrets/hashicorp/index.d.ts +3 -0
- package/dist/modules/secrets/hashicorp/index.d.ts.map +1 -0
- package/dist/modules/secrets/hashicorp/index.js +19 -0
- package/dist/modules/secrets/hashicorp/index.js.map +1 -0
- package/dist/modules/secrets/index.d.ts +5 -0
- package/dist/modules/secrets/index.d.ts.map +1 -0
- package/dist/modules/secrets/index.js +23 -0
- package/dist/modules/secrets/index.js.map +1 -0
- package/dist/modules/secrets/system-envs/index.d.ts +2 -0
- package/dist/modules/secrets/system-envs/index.d.ts.map +1 -0
- package/dist/modules/secrets/system-envs/index.js +18 -0
- package/dist/modules/secrets/system-envs/index.js.map +1 -0
- package/dist/modules/secrets/system-envs/system-envs.helper.d.ts +19 -0
- package/dist/modules/secrets/system-envs/system-envs.helper.d.ts.map +1 -0
- package/dist/modules/secrets/system-envs/system-envs.helper.js +37 -0
- package/dist/modules/secrets/system-envs/system-envs.helper.js.map +1 -0
- package/dist/modules/uid/helper.js +7 -7
- package/dist/modules/uid/helper.js.map +1 -1
- package/package.json +21 -3
- package/dist/modules/error/app-error.d.ts +0 -21
- package/dist/modules/error/app-error.d.ts.map +0 -1
- package/dist/modules/error/app-error.js +0 -41
- package/dist/modules/error/app-error.js.map +0 -1
- package/dist/modules/error/message-code.d.ts +0 -18
- package/dist/modules/error/message-code.d.ts.map +0 -1
- package/dist/modules/error/message-code.js +0 -44
- package/dist/modules/error/message-code.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/common/redact.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/common/redact.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,sBAA4B,KAAG,OAgD5E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,MAelD,CAAC"}
|
package/dist/common/redact.js
CHANGED
|
@@ -10,9 +10,18 @@ const SECRET_KEY_PATTERN = new RegExp([
|
|
|
10
10
|
'^(pass|password|passphrase|secret|token|apiKey|api_key|accessKey|access_key',
|
|
11
11
|
'|secretKey|secret_key|privateKey|private_key|key|cert|ca|pfx|credentials',
|
|
12
12
|
'|authorization|auth|jwtSecret|applicationSecret|connectionString)$',
|
|
13
|
+
// Vault wire spellings (snake_case). node-vault's AppRole login/response bodies carry these
|
|
14
|
+
// exact keys; `secret_id`/`role_id` are the AppRole credential pair and `client_token` is the
|
|
15
|
+
// minted session token. None are matched by the anchored options list above.
|
|
16
|
+
'|^(client_token|secret_id|role_id)$',
|
|
17
|
+
// Any `*_token` (snake_case) or `*Token` (camelCase) key - access_token, refresh_token,
|
|
18
|
+
// vaultToken, ... A preceding character is required so the bare word `token` (already covered
|
|
19
|
+
// above) is not the whole match, and so ordinary words are not swallowed.
|
|
20
|
+
'|_token$|[a-z0-9]token$',
|
|
13
21
|
// HTTP HEADER spellings. A header set is logged on every outbound request, and its names are
|
|
14
|
-
// kebab-case and often `x-`-prefixed - none of which the camelCase list above matches.
|
|
15
|
-
|
|
22
|
+
// kebab-case and often `x-`-prefixed - none of which the camelCase list above matches. `vault`
|
|
23
|
+
// is included so `X-Vault-Token` (node-vault's auth header) is caught.
|
|
24
|
+
'|^(x-)?(api|auth|access|secret|session|csrf|xsrf|vault)-(key|token|secret|id)$',
|
|
16
25
|
'|^(cookie|set-cookie|proxy-authorization|www-authenticate)$',
|
|
17
26
|
].join(''), 'i');
|
|
18
27
|
exports.REDACTED = '[REDACTED]';
|
|
@@ -32,6 +41,22 @@ const redactSecrets = (value, seen = new WeakSet()) => {
|
|
|
32
41
|
return '[Circular]';
|
|
33
42
|
}
|
|
34
43
|
seen.add(value);
|
|
44
|
+
// An Error keeps `name`/`message`/`stack` as NON-enumerable, so `Object.keys()` skips them and a
|
|
45
|
+
// naive redaction would DROP the very message the log line is about. Reproject the error into a
|
|
46
|
+
// plain object that STILL carries those fields, plus its redacted enumerable own-props
|
|
47
|
+
// (`config`/`response`/... where a nested `X-Vault-Token` or `secret_id` becomes [REDACTED]).
|
|
48
|
+
if (value instanceof Error) {
|
|
49
|
+
const source = value;
|
|
50
|
+
const result = {
|
|
51
|
+
name: value.name,
|
|
52
|
+
message: value.message,
|
|
53
|
+
stack: value.stack,
|
|
54
|
+
};
|
|
55
|
+
for (const key of Object.keys(source)) {
|
|
56
|
+
result[key] = SECRET_KEY_PATTERN.test(key) ? exports.REDACTED : (0, exports.redactSecrets)(source[key], seen);
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
35
60
|
if (Array.isArray(value)) {
|
|
36
61
|
return value.map(entry => (0, exports.redactSecrets)(entry, seen));
|
|
37
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/common/redact.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAM,kBAAkB,GAAG,IAAI,MAAM,CACnC;IACE,qDAAqD;IACrD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C;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,gBAAQ,CAAC;IAC3B,OAAO,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAfW,QAAA,oBAAoB,wBAe/B"}
|
|
@@ -35,6 +35,9 @@ export declare class ApplicationEnvironment implements IApplicationEnvironment {
|
|
|
35
35
|
transform?: (value: BeforeTransformType) => ReturnType;
|
|
36
36
|
}): ReturnType;
|
|
37
37
|
set<ValueType>(key: string, value: ValueType): void;
|
|
38
|
+
merge(opts: {
|
|
39
|
+
envs: Record<string, string>;
|
|
40
|
+
}): void;
|
|
38
41
|
isDevelopment(): boolean;
|
|
39
42
|
keys(): string[];
|
|
40
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-env.d.ts","sourceRoot":"","sources":["../../../src/modules/env/app-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD,qBAAa,WAAW;IACtB,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAEhC,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAiB;IAC5C,gGAAgG;IAChG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAE5B,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC5B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,OAAO,aAAa;IAEpC,MAAM,CAAC,QAAQ,CAAC,UAAU,g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|
65
65
|
set(key, value) {
|
|
66
66
|
this.arguments[key] = value;
|
|
67
67
|
}
|
|
68
|
+
merge(opts) {
|
|
69
|
+
for (const [key, value] of Object.entries(opts.envs)) {
|
|
70
|
+
this.arguments[key] = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
68
73
|
isDevelopment() {
|
|
69
74
|
const { NODE_ENV } = process.env;
|
|
70
75
|
return NODE_ENV === 'development';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-env.js","sourceRoot":"","sources":["../../../src/modules/env/app-env.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;aACN,UAAK,GAAG,OAAO,CAAC;aAChB,UAAK,GAAG,OAAO,CAAC;aAEhB,gBAAW,GAAG,aAAa,CAAC;IAC5C,gGAAgG;aAChF,QAAG,GAAG,KAAK,CAAC;aACZ,QAAG,GAAG,KAAK,CAAC;aAEZ,QAAG,GAAG,KAAK,CAAC;aACZ,UAAK,GAAG,OAAO,CAAC;aAChB,SAAI,GAAG,MAAM,CAAC;aACd,YAAO,GAAG,SAAS,CAAC;aAEpB,eAAU,GAAG,YAAY,CAAC;aAEnC,gBAAW,GAAG,IAAI,GAAG,CAAC;QAC3B,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,WAAW;QAChB,IAAI,CAAC,GAAG;QACR,IAAI,CAAC,GAAG;QACR,IAAI,CAAC,GAAG;QACR,IAAI,CAAC,KAAK;QACV,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,OAAO;QACZ,IAAI,CAAC,UAAU;KAChB,CAAC,CAAC;IAEH;;;;OAIG;aACI,qBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAElG,MAAM,KAAK,OAAO;QAChB,MAAM,EAAE,QAAQ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CAAC;IAED,aAAa;QACX,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;QACjC,OAAO,QAAQ,KAAK,aAAa,CAAC;IACpC,CAAC;IAED,IAAI;QACF,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;CACF;AAnDD,wDAmDC;AAEY,QAAA,sBAAsB,GAAG,IAAI,sBAAsB,CAAC;IAC/D,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,SAAS;IACvD,IAAI,EAAE,OAAO,CAAC,GAAG;CAClB,CAAC,CAAC;AAEU,QAAA,IAAI,GAAG,8BAAsB,CAAC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The error layer itself lives in `@venizia/ignis-inversion`, not here.
|
|
3
|
+
*
|
|
4
|
+
* It moved there so a browser application - which already depends on inversion for its DI, and
|
|
5
|
+
* cannot depend on helpers - raises and reads errors through the SAME class the server does.
|
|
6
|
+
* Before, inversion carried a second, divergent `ApplicationError` whose `messageCode` was never
|
|
7
|
+
* resolved. Backend code keeps importing from `@venizia/ignis-helpers` and sees no difference.
|
|
8
|
+
*
|
|
9
|
+
* Re-exported by name rather than `export *`: inversion's barrel also carries the DI container, and
|
|
10
|
+
* a blanket re-export would drag `Container`, `inject` and the rest into the helpers surface.
|
|
11
|
+
*
|
|
12
|
+
* Key registration works through this re-export: `declare module '@venizia/ignis-helpers'` merges
|
|
13
|
+
* into `IErrorKeyRegistry` exactly as augmenting inversion directly would, because merging follows
|
|
14
|
+
* the re-exported declaration. Augment whichever module the file already imports - TypeScript only
|
|
15
|
+
* treats `declare module` as an augmentation when the target is imported, and silently downgrades
|
|
16
|
+
* it to an inert ambient declaration otherwise. See `registry-augmentation.test.ts`.
|
|
17
|
+
*/
|
|
18
|
+
export { ApplicationError, ErrorScopes, getError, isApplicationError, MessageCode, } from '@venizia/ignis-inversion';
|
|
19
|
+
export type { IErrorKeyRegistry, TError, TErrorByDefinition, TErrorByField, TErrorDefinition, TErrorKey, TErrorNormalized, TErrorNormalizeTransformFn, TErrorScope, TRegisterErrors, } from '@venizia/ignis-inversion';
|
|
3
20
|
export * from './types';
|
|
4
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/error/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,0BAA0B,EAC1B,WAAW,EACX,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,cAAc,SAAS,CAAC"}
|
|
@@ -14,7 +14,29 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
exports.MessageCode = exports.isApplicationError = exports.getError = exports.ErrorScopes = exports.ApplicationError = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* The error layer itself lives in `@venizia/ignis-inversion`, not here.
|
|
20
|
+
*
|
|
21
|
+
* It moved there so a browser application - which already depends on inversion for its DI, and
|
|
22
|
+
* cannot depend on helpers - raises and reads errors through the SAME class the server does.
|
|
23
|
+
* Before, inversion carried a second, divergent `ApplicationError` whose `messageCode` was never
|
|
24
|
+
* resolved. Backend code keeps importing from `@venizia/ignis-helpers` and sees no difference.
|
|
25
|
+
*
|
|
26
|
+
* Re-exported by name rather than `export *`: inversion's barrel also carries the DI container, and
|
|
27
|
+
* a blanket re-export would drag `Container`, `inject` and the rest into the helpers surface.
|
|
28
|
+
*
|
|
29
|
+
* Key registration works through this re-export: `declare module '@venizia/ignis-helpers'` merges
|
|
30
|
+
* into `IErrorKeyRegistry` exactly as augmenting inversion directly would, because merging follows
|
|
31
|
+
* the re-exported declaration. Augment whichever module the file already imports - TypeScript only
|
|
32
|
+
* treats `declare module` as an augmentation when the target is imported, and silently downgrades
|
|
33
|
+
* it to an inert ambient declaration otherwise. See `registry-augmentation.test.ts`.
|
|
34
|
+
*/
|
|
35
|
+
var ignis_inversion_1 = require("@venizia/ignis-inversion");
|
|
36
|
+
Object.defineProperty(exports, "ApplicationError", { enumerable: true, get: function () { return ignis_inversion_1.ApplicationError; } });
|
|
37
|
+
Object.defineProperty(exports, "ErrorScopes", { enumerable: true, get: function () { return ignis_inversion_1.ErrorScopes; } });
|
|
38
|
+
Object.defineProperty(exports, "getError", { enumerable: true, get: function () { return ignis_inversion_1.getError; } });
|
|
39
|
+
Object.defineProperty(exports, "isApplicationError", { enumerable: true, get: function () { return ignis_inversion_1.isApplicationError; } });
|
|
40
|
+
Object.defineProperty(exports, "MessageCode", { enumerable: true, get: function () { return ignis_inversion_1.MessageCode; } });
|
|
19
41
|
__exportStar(require("./types"), exports);
|
|
20
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,4DAMkC;AALhC,mHAAA,gBAAgB,OAAA;AAChB,8GAAA,WAAW,OAAA;AACX,2GAAA,QAAQ,OAAA;AACR,qHAAA,kBAAkB,OAAA;AAClB,8GAAA,WAAW,OAAA;AAgBb,0CAAwB"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi';
|
|
2
|
+
/**
|
|
3
|
+
* The error RESPONSE, for OpenAPI documentation - NOT the input to `getError`.
|
|
4
|
+
*
|
|
5
|
+
* The two used to be the same type, and that conflation is what let `getError` accept anything: the
|
|
6
|
+
* schema ended in `.catchall(z.any())` so the docs could describe `extra`, and the catchall then
|
|
7
|
+
* silently swallowed every mistyped field at every throw site. The input now lives in
|
|
8
|
+
* `@venizia/ignis-inversion` as a hand-written union with no index signature; this stays here
|
|
9
|
+
* because it needs `@hono/zod-openapi`, which inversion must not depend on - it ships to browsers.
|
|
10
|
+
*/
|
|
2
11
|
export declare const ErrorSchema: z.ZodObject<{
|
|
3
|
-
name: z.ZodOptional<z.ZodString>;
|
|
4
12
|
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
5
|
-
messageCode: z.ZodOptional<z.ZodString>;
|
|
6
13
|
message: z.ZodString;
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
messageCode: z.ZodOptional<z.ZodString>;
|
|
15
|
+
normalized: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
text: z.ZodString;
|
|
17
|
+
code: z.ZodString;
|
|
18
|
+
args: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
21
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type TErrorResponse = z.infer<typeof ErrorSchema>;
|
|
9
25
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;iBAgCpB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -2,21 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ErrorSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
|
+
/**
|
|
6
|
+
* The error RESPONSE, for OpenAPI documentation - NOT the input to `getError`.
|
|
7
|
+
*
|
|
8
|
+
* The two used to be the same type, and that conflation is what let `getError` accept anything: the
|
|
9
|
+
* schema ended in `.catchall(z.any())` so the docs could describe `extra`, and the catchall then
|
|
10
|
+
* silently swallowed every mistyped field at every throw site. The input now lives in
|
|
11
|
+
* `@venizia/ignis-inversion` as a hand-written union with no index signature; this stays here
|
|
12
|
+
* because it needs `@hono/zod-openapi`, which inversion must not depend on - it ships to browsers.
|
|
13
|
+
*/
|
|
5
14
|
exports.ErrorSchema = zod_openapi_1.z
|
|
6
15
|
.object({
|
|
7
|
-
name: zod_openapi_1.z.string().optional(),
|
|
8
16
|
statusCode: zod_openapi_1.z.number().optional(),
|
|
9
|
-
messageCode: zod_openapi_1.z.string().optional(),
|
|
10
17
|
message: zod_openapi_1.z.string(),
|
|
18
|
+
/** @deprecated Read `normalized.code`. Kept until every client has migrated. */
|
|
19
|
+
messageCode: zod_openapi_1.z.string().optional(),
|
|
20
|
+
normalized: zod_openapi_1.z
|
|
21
|
+
.object({
|
|
22
|
+
text: zod_openapi_1.z.string(),
|
|
23
|
+
code: zod_openapi_1.z.string(),
|
|
24
|
+
args: zod_openapi_1.z.record(zod_openapi_1.z.string(), zod_openapi_1.z.any()),
|
|
25
|
+
})
|
|
26
|
+
.optional(),
|
|
27
|
+
extra: zod_openapi_1.z.record(zod_openapi_1.z.string(), zod_openapi_1.z.any()).optional(),
|
|
28
|
+
requestId: zod_openapi_1.z.string().optional(),
|
|
29
|
+
details: zod_openapi_1.z.record(zod_openapi_1.z.string(), zod_openapi_1.z.any()).optional(),
|
|
11
30
|
})
|
|
12
|
-
.catchall(zod_openapi_1.z.any())
|
|
13
31
|
.openapi({
|
|
14
32
|
description: 'Error Schema',
|
|
15
33
|
example: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
messageCode: '
|
|
19
|
-
|
|
34
|
+
statusCode: 409,
|
|
35
|
+
message: 'A category named %{name} already exists.',
|
|
36
|
+
messageCode: 'server.commerce.category.create.duplicate_name',
|
|
37
|
+
normalized: {
|
|
38
|
+
text: 'A category named %{name} already exists.',
|
|
39
|
+
code: 'server.commerce.category.create.duplicate_name',
|
|
40
|
+
args: { name: 'Ticket' },
|
|
41
|
+
},
|
|
42
|
+
extra: { messageArgs: { name: 'Vé' } },
|
|
43
|
+
requestId: 'abc-123-def',
|
|
44
|
+
details: { url: 'http://localhost:3000/categories', path: '/categories' },
|
|
20
45
|
},
|
|
21
46
|
});
|
|
22
47
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/error/types.ts"],"names":[],"mappings":";;;AAAA,mDAAsC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/error/types.ts"],"names":[],"mappings":";;;AAAA,mDAAsC;AAEtC;;;;;;;;GAQG;AACU,QAAA,WAAW,GAAG,eAAC;KACzB,MAAM,CAAC;IACN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
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AAEvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AAEvB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC"}
|
package/dist/modules/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./network"), exports);
|
|
|
23
23
|
__exportStar(require("./pool"), exports);
|
|
24
24
|
__exportStar(require("./queue"), exports);
|
|
25
25
|
__exportStar(require("./redis"), exports);
|
|
26
|
+
__exportStar(require("./secrets"), exports);
|
|
26
27
|
__exportStar(require("./socket"), exports);
|
|
27
28
|
__exportStar(require("./storage"), exports);
|
|
28
29
|
__exportStar(require("./uid"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AAEvB,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,wCAAsB;AACtB,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AAEvB,2CAAyB;AACzB,wCAAsB;AACtB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,wCAAsB;AACtB,kDAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-splat.d.ts","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/deep-splat.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"deep-splat.d.ts","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/deep-splat.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,SAAS,CAAC;AAmD9B;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC;CACtC,KAAG,MAqBH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,4BASpB,CAAC"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.deepSplat = exports.formatLogMessage = void 0;
|
|
7
7
|
const node_util_1 = __importDefault(require("node:util"));
|
|
8
8
|
const winston_1 = __importDefault(require("winston"));
|
|
9
|
+
const redact_1 = require("../../../common/redact");
|
|
9
10
|
/** Winston stashes the extra arguments of `logger.error(msg, ...args)` under this well-known key. */
|
|
10
11
|
const SPLAT = Symbol.for('splat');
|
|
11
12
|
/** The placeholders `util.format` understands. `%%` is an escape, not a placeholder. */
|
|
@@ -63,7 +64,11 @@ const formatLogMessage = (opts) => {
|
|
|
63
64
|
if (!isStringPlaceholder || !isInspectable) {
|
|
64
65
|
return arg;
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
+
// Redact before inspecting: any object deep-inspected into a log line (a node-vault AxiosError
|
|
68
|
+
// carrying a live `X-Vault-Token`, a driver payload with a password) is stripped of its secret
|
|
69
|
+
// KEYS here. `redactSecrets` copies non-secret fields through unchanged, so the diagnosis the
|
|
70
|
+
// line was opened for still renders at full depth.
|
|
71
|
+
return node_util_1.default.inspect((0, redact_1.redactSecrets)(arg), inspectOptions);
|
|
67
72
|
});
|
|
68
73
|
return node_util_1.default.formatWithOptions(inspectOptions, message, ...widened);
|
|
69
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-splat.js","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/deep-splat.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAA8B;
|
|
1
|
+
{"version":3,"file":"deep-splat.js","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/deep-splat.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAA8B;AAC9B,4CAAgD;AAGhD,qGAAqG;AACrG,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAElC,wFAAwF;AACxF,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,YA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G,KAAK,IAAI,CAAC;QAE9D,IAAI,CAAC,mBAAmB,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3C,OAAO,GAAG,CAAC;QACb,CAAC;QAED,+FAA+F;QAC/F,+FAA+F;QAC/F,8FAA8F;QAC9F,mDAAmD;QACnD,OAAO,mBAAI,CAAC,OAAO,CAAC,IAAA,sBAAa,EAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,OAAO,mBAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;AACrE,CAAC,CAAC;AAzBW,QAAA,gBAAgB,oBAyB3B;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG,iBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAC7C,MAAM,IAAI,GAAI,IAAgB,CAAC,KAAK,CAA+B,CAAC;IAEpE,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAgB,EAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class KafkaBundlerPluginNames {
|
|
2
|
+
static readonly PLATFORMATIC_WASM = "ignis:platformatic-wasm";
|
|
3
|
+
}
|
|
4
|
+
export declare class PlatformaticWasmSpecifiers {
|
|
5
|
+
static readonly ENTRYPOINT = "@platformatic/wasm-utils";
|
|
6
|
+
static readonly BUNDLED_ENTRYPOINT = "@platformatic/wasm-utils/bundled";
|
|
7
|
+
static readonly ENTRYPOINT_FILTER: RegExp;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,6BAA6B;CAC/D;AAED,qBAAa,0BAA0B;IACrC,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAA8B;IACxD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,sCAAsC;IACxE,MAAM,CAAC,QAAQ,CAAC,iBAAiB,SAAiC;CACnE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformaticWasmSpecifiers = exports.KafkaBundlerPluginNames = void 0;
|
|
4
|
+
class KafkaBundlerPluginNames {
|
|
5
|
+
static { this.PLATFORMATIC_WASM = 'ignis:platformatic-wasm'; }
|
|
6
|
+
}
|
|
7
|
+
exports.KafkaBundlerPluginNames = KafkaBundlerPluginNames;
|
|
8
|
+
class PlatformaticWasmSpecifiers {
|
|
9
|
+
static { this.ENTRYPOINT = '@platformatic/wasm-utils'; }
|
|
10
|
+
static { this.BUNDLED_ENTRYPOINT = '@platformatic/wasm-utils/bundled'; }
|
|
11
|
+
static { this.ENTRYPOINT_FILTER = /^@platformatic\/wasm-utils$/; }
|
|
12
|
+
}
|
|
13
|
+
exports.PlatformaticWasmSpecifiers = PlatformaticWasmSpecifiers;
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/constants.ts"],"names":[],"mappings":";;;AAAA,MAAa,uBAAuB;aAClB,sBAAiB,GAAG,yBAAyB,CAAC;;AADhE,0DAEC;AAED,MAAa,0BAA0B;aACrB,eAAU,GAAG,0BAA0B,CAAC;aACxC,uBAAkB,GAAG,kCAAkC,CAAC;aACxD,sBAAiB,GAAG,6BAA6B,CAAC;;AAHpE,gEAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/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("./constants"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/queue/kafka/bundler/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./common"), exports);
|
|
18
|
+
__exportStar(require("./platformatic-wasm.plugin"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6DAA2C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
/**
|
|
3
|
+
* platformaticWasmPlugin — Bun bundler plugin required to compile applications using the Kafka helpers.
|
|
4
|
+
*
|
|
5
|
+
* `@platformatic/kafka` reaches Kafka's CRC32C and compression codecs through
|
|
6
|
+
* `@platformatic/wasm-utils`, whose default entrypoint reads `native.wasm` from disk at module load
|
|
7
|
+
* time. `bun build --compile` embeds JavaScript only, so that read resolves against `/$bunfs` and the
|
|
8
|
+
* binary dies with ENOENT before reaching the application. The `/bundled` entrypoint exposes the same
|
|
9
|
+
* API with the wasm payload inlined; this plugin swaps one for the other at bundle time.
|
|
10
|
+
*/
|
|
11
|
+
export declare const platformaticWasmPlugin: () => BunPlugin;
|
|
12
|
+
//# sourceMappingURL=platformatic-wasm.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformatic-wasm.plugin.d.ts","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/platformatic-wasm.plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAIrC;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAAO,SAsBxC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.platformaticWasmPlugin = void 0;
|
|
4
|
+
const error_1 = require("../../../../modules/error");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
/**
|
|
8
|
+
* platformaticWasmPlugin — Bun bundler plugin required to compile applications using the Kafka helpers.
|
|
9
|
+
*
|
|
10
|
+
* `@platformatic/kafka` reaches Kafka's CRC32C and compression codecs through
|
|
11
|
+
* `@platformatic/wasm-utils`, whose default entrypoint reads `native.wasm` from disk at module load
|
|
12
|
+
* time. `bun build --compile` embeds JavaScript only, so that read resolves against `/$bunfs` and the
|
|
13
|
+
* binary dies with ENOENT before reaching the application. The `/bundled` entrypoint exposes the same
|
|
14
|
+
* API with the wasm payload inlined; this plugin swaps one for the other at bundle time.
|
|
15
|
+
*/
|
|
16
|
+
const platformaticWasmPlugin = () => ({
|
|
17
|
+
name: common_1.KafkaBundlerPluginNames.PLATFORMATIC_WASM,
|
|
18
|
+
setup(build) {
|
|
19
|
+
build.onResolve({ filter: common_1.PlatformaticWasmSpecifiers.ENTRYPOINT_FILTER }, args => {
|
|
20
|
+
try {
|
|
21
|
+
return {
|
|
22
|
+
path: Bun.resolveSync(common_1.PlatformaticWasmSpecifiers.BUNDLED_ENTRYPOINT, (0, node_path_1.dirname)(args.importer)),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw (0, error_1.getError)({
|
|
27
|
+
message: [
|
|
28
|
+
`[platformaticWasmPlugin] Failed to resolve ${common_1.PlatformaticWasmSpecifiers.BUNDLED_ENTRYPOINT}`,
|
|
29
|
+
`from ${args.importer}`,
|
|
30
|
+
`| Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
31
|
+
].join(' '),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
exports.platformaticWasmPlugin = platformaticWasmPlugin;
|
|
38
|
+
//# sourceMappingURL=platformatic-wasm.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformatic-wasm.plugin.js","sourceRoot":"","sources":["../../../../../src/modules/queue/kafka/bundler/platformatic-wasm.plugin.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAE3C,yCAAoC;AACpC,qCAA+E;AAE/E;;;;;;;;GAQG;AACI,MAAM,sBAAsB,GAAG,GAAc,EAAE,CAAC,CAAC;IACtD,IAAI,EAAE,gCAAuB,CAAC,iBAAiB;IAC/C,KAAK,CAAC,KAAK;QACT,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,mCAA0B,CAAC,iBAAiB,EAAE,EAAE,IAAI,CAAC,EAAE;YAC/E,IAAI,CAAC;gBACH,OAAO;oBACL,IAAI,EAAE,GAAG,CAAC,WAAW,CACnB,mCAA0B,CAAC,kBAAkB,EAC7C,IAAA,mBAAO,EAAC,IAAI,CAAC,QAAQ,CAAC,CACvB;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAA,gBAAQ,EAAC;oBACb,OAAO,EAAE;wBACP,8CAA8C,mCAA0B,CAAC,kBAAkB,EAAE;wBAC7F,QAAQ,IAAI,CAAC,QAAQ,EAAE;wBACvB,YAAY,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACrE,CAAC,IAAI,CAAC,GAAG,CAAC;iBACZ,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAtBU,QAAA,sBAAsB,0BAsBhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/queue/kafka/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/queue/kafka/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./admin"), exports);
|
|
18
18
|
__exportStar(require("./base"), exports);
|
|
19
|
+
__exportStar(require("./bundler"), exports);
|
|
19
20
|
__exportStar(require("./common"), exports);
|
|
20
21
|
__exportStar(require("./consumer"), exports);
|
|
21
22
|
__exportStar(require("./producer"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/queue/kafka/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,6CAA2B;AAC3B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/queue/kafka/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,6CAA2B;AAC3B,6CAA2B;AAC3B,2CAAyB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseHelper } from '../../../modules/base';
|
|
2
|
+
import type { IClock, IGetSecretOptions, ISecretLease, ISecretRotatable, ISecretsHelper, ISecretsHelperOptions, ITimerAdapter, TSecretRotationHandler } from '../common';
|
|
3
|
+
interface IRawFetchResult {
|
|
4
|
+
value: Record<string, string>;
|
|
5
|
+
lease?: {
|
|
6
|
+
leaseId: string;
|
|
7
|
+
ttlSeconds: number;
|
|
8
|
+
renewable: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class AbstractSecretsHelper extends BaseHelper implements ISecretsHelper {
|
|
12
|
+
protected readonly clock: IClock;
|
|
13
|
+
protected readonly timers: ITimerAdapter;
|
|
14
|
+
protected readonly cacheTtlSeconds: number;
|
|
15
|
+
protected readonly renewBeforeRatio: number;
|
|
16
|
+
private readonly cache;
|
|
17
|
+
private readonly leases;
|
|
18
|
+
private readonly leasePaths;
|
|
19
|
+
private readonly timerHandles;
|
|
20
|
+
private readonly rotatables;
|
|
21
|
+
private readonly rotateHandlers;
|
|
22
|
+
private readonly backoffAttempts;
|
|
23
|
+
private closed;
|
|
24
|
+
constructor(opts: ISecretsHelperOptions);
|
|
25
|
+
protected abstract fetchRaw(opts: {
|
|
26
|
+
path: string;
|
|
27
|
+
}): Promise<IRawFetchResult>;
|
|
28
|
+
protected abstract renewRaw(opts: {
|
|
29
|
+
leaseId: string;
|
|
30
|
+
ttlSeconds: number;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
ttlSeconds: number;
|
|
33
|
+
} | null>;
|
|
34
|
+
protected abstract revokeRaw(opts: {
|
|
35
|
+
leaseId: string;
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
configure(): Promise<void>;
|
|
38
|
+
getBundle(opts: {
|
|
39
|
+
path: string;
|
|
40
|
+
}): Promise<Record<string, string>>;
|
|
41
|
+
get(opts: IGetSecretOptions<string>): Promise<string>;
|
|
42
|
+
get<TValue>(opts: IGetSecretOptions<TValue>): Promise<TValue>;
|
|
43
|
+
lease(opts: {
|
|
44
|
+
path: string;
|
|
45
|
+
key: string;
|
|
46
|
+
}): Promise<ISecretLease>;
|
|
47
|
+
onRotate(handler: TSecretRotationHandler): void;
|
|
48
|
+
registerRotatable(opts: {
|
|
49
|
+
key: string;
|
|
50
|
+
target: ISecretRotatable;
|
|
51
|
+
}): void;
|
|
52
|
+
shutdown(): Promise<void>;
|
|
53
|
+
private writeCache;
|
|
54
|
+
private evictExpiredCache;
|
|
55
|
+
private clampDelayMs;
|
|
56
|
+
private armTimer;
|
|
57
|
+
private scheduleRenewal;
|
|
58
|
+
private scheduleBackoffRetry;
|
|
59
|
+
private handleRenewal;
|
|
60
|
+
private rotate;
|
|
61
|
+
private dispatchRotation;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=abstract.helper.d.ts.map
|