@bazariodev/docket 0.0.0-stage → 0.0.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 (88) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +443 -2
  4. package/dist/browser/constants.d.cts +14 -0
  5. package/dist/browser/constants.d.ts +14 -0
  6. package/dist/browser/index.cjs +192 -0
  7. package/dist/browser/index.cjs.map +1 -0
  8. package/dist/browser/index.d.cts +29 -0
  9. package/dist/browser/index.d.ts +29 -0
  10. package/dist/browser/index.js +187 -0
  11. package/dist/browser/index.js.map +1 -0
  12. package/dist/chunk-7ld72rnl.js +376 -0
  13. package/dist/chunk-7ld72rnl.js.map +1 -0
  14. package/dist/chunk-B-SP8Od_.js +437 -0
  15. package/dist/chunk-B-SP8Od_.js.map +1 -0
  16. package/dist/chunk-BLf-eCDO.cjs +53 -0
  17. package/dist/chunk-BLf-eCDO.cjs.map +1 -0
  18. package/dist/chunk-Bvq4tF_F.cjs +440 -0
  19. package/dist/chunk-Bvq4tF_F.cjs.map +1 -0
  20. package/dist/chunk-CEhpwtwJ.cjs +379 -0
  21. package/dist/chunk-CEhpwtwJ.cjs.map +1 -0
  22. package/dist/chunk-CSS3f4_M.js +46 -0
  23. package/dist/chunk-CSS3f4_M.js.map +1 -0
  24. package/dist/chunk-CXZYNALm.cjs +124 -0
  25. package/dist/chunk-CXZYNALm.cjs.map +1 -0
  26. package/dist/chunk-DYcNnkOV.js +50 -0
  27. package/dist/chunk-DYcNnkOV.js.map +1 -0
  28. package/dist/chunk-DqK_3eFr.cjs +53 -0
  29. package/dist/chunk-DqK_3eFr.cjs.map +1 -0
  30. package/dist/chunk-LRCHwVuE.js +110 -0
  31. package/dist/chunk-LRCHwVuE.js.map +1 -0
  32. package/dist/constants.d.cts +6 -0
  33. package/dist/constants.d.ts +6 -0
  34. package/dist/core/constants.d.cts +43 -0
  35. package/dist/core/constants.d.ts +43 -0
  36. package/dist/core/errors.d.cts +8 -0
  37. package/dist/core/errors.d.ts +8 -0
  38. package/dist/devtools/index.cjs +37 -0
  39. package/dist/devtools/index.cjs.map +1 -0
  40. package/dist/devtools/index.d.cts +11 -0
  41. package/dist/devtools/index.d.ts +11 -0
  42. package/dist/devtools/index.js +35 -0
  43. package/dist/devtools/index.js.map +1 -0
  44. package/dist/export/index.cjs +111 -0
  45. package/dist/export/index.cjs.map +1 -0
  46. package/dist/export/index.d.cts +49 -0
  47. package/dist/export/index.d.ts +49 -0
  48. package/dist/export/index.js +109 -0
  49. package/dist/export/index.js.map +1 -0
  50. package/dist/history/constants.d.cts +35 -0
  51. package/dist/history/constants.d.ts +35 -0
  52. package/dist/history/index.cjs +1196 -0
  53. package/dist/history/index.cjs.map +1 -0
  54. package/dist/history/index.d.cts +113 -0
  55. package/dist/history/index.d.ts +113 -0
  56. package/dist/history/index.js +1194 -0
  57. package/dist/history/index.js.map +1 -0
  58. package/dist/index.cjs +14 -0
  59. package/dist/index.cjs.map +1 -0
  60. package/dist/index.d.cts +158 -0
  61. package/dist/index.d.ts +158 -0
  62. package/dist/index.js +6 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/indexeddb/index.cjs +15 -0
  65. package/dist/indexeddb/index.cjs.map +1 -0
  66. package/dist/indexeddb/index.d.cts +46 -0
  67. package/dist/indexeddb/index.d.ts +46 -0
  68. package/dist/indexeddb/index.js +13 -0
  69. package/dist/indexeddb/index.js.map +1 -0
  70. package/dist/redaction/index.cjs +154 -0
  71. package/dist/redaction/index.cjs.map +1 -0
  72. package/dist/redaction/index.d.cts +70 -0
  73. package/dist/redaction/index.d.ts +70 -0
  74. package/dist/redaction/index.js +152 -0
  75. package/dist/redaction/index.js.map +1 -0
  76. package/dist/sip/constants.d.cts +5 -0
  77. package/dist/sip/constants.d.ts +5 -0
  78. package/dist/sip/index.cjs +336 -0
  79. package/dist/sip/index.cjs.map +1 -0
  80. package/dist/sip/index.d.cts +34 -0
  81. package/dist/sip/index.d.ts +34 -0
  82. package/dist/sip/index.js +333 -0
  83. package/dist/sip/index.js.map +1 -0
  84. package/dist/storage/constants.d.cts +11 -0
  85. package/dist/storage/constants.d.ts +11 -0
  86. package/dist/storage/contracts.d.cts +35 -0
  87. package/dist/storage/contracts.d.ts +35 -0
  88. package/package.json +127 -3
@@ -0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ var common = require('../chunk-CXZYNALm.cjs');
4
+ var constants = require('../chunk-BLf-eCDO.cjs');
5
+
6
+ function createRedactor(
7
+ policy = {},
8
+ { createRedactor: createValueRedactor, TEXT_RULES: providerTextRules } = {},
9
+ ) {
10
+ if (typeof createValueRedactor !== 'function')
11
+ throw new TypeError('A value redactor factory is required');
12
+ if (!Array.isArray(policy.text) && !providerTextRules)
13
+ throw new TypeError('Default text rules are required');
14
+ const limits = common.resolveLimits(policy.limits);
15
+ const version = policy.version ?? '1';
16
+ if (
17
+ typeof version !== 'string' ||
18
+ !version ||
19
+ version.length > limits.maxStringLength
20
+ )
21
+ throw new TypeError('Invalid redaction version');
22
+ const { fields, unknownFields, hash, text } = policy;
23
+ const textRules = text ?? Object.values(providerTextRules);
24
+ const engine = createValueRedactor({
25
+ fields,
26
+ unknownFields,
27
+ hash:
28
+ typeof hash === 'function' ? (value) => hash.call(policy, value) : hash,
29
+ limits: { ...limits, maxOutputSize: limits.maxRecordSize },
30
+ text: text
31
+ ? textRules.map(({ name, pattern, requiresHash, replace }) => ({
32
+ name,
33
+ pattern,
34
+ requiresHash,
35
+ replace:
36
+ typeof replace === 'function'
37
+ ? function (match) {
38
+ return replace.call(this, match, api);
39
+ }
40
+ : replace,
41
+ }))
42
+ : textRules,
43
+ });
44
+ let active;
45
+ const api = {
46
+ version,
47
+ limits,
48
+ mask: engine.mask,
49
+ redactText(value) {
50
+ return (active?.walk ?? engine.createSession()).redactText(value);
51
+ },
52
+
53
+ redactValue(value) {
54
+ const walk = engine.createSession();
55
+ const result = walk.redactValue(value);
56
+ if (active && walk.truncated) active.truncated = true;
57
+ return JSON.stringify(result).length <= limits.maxRecordSize
58
+ ? result
59
+ : constants.MARKERS.LIMIT;
60
+ },
61
+
62
+ redact(draft) {
63
+ const previous = active;
64
+ const walk = engine.createSession();
65
+ active = { walk, truncated: false };
66
+ try {
67
+ let didTruncate = false;
68
+ const record = {};
69
+ for (const key of [
70
+ 'runId',
71
+ 'seq',
72
+ 'at',
73
+ 'level',
74
+ 'area',
75
+ 'scope',
76
+ 'message',
77
+ ])
78
+ common.define(
79
+ record,
80
+ key,
81
+ typeof draft[key] === 'string' && !['runId', 'level'].includes(key)
82
+ ? walk.redactText(draft[key])
83
+ : draft[key],
84
+ );
85
+ record.redactionVersion = version;
86
+ if (draft.context) record.context = walk.redactValue(draft.context);
87
+ const data = draft.data;
88
+ if (common.isError(data)) {
89
+ const converted = walk.redactValue(data);
90
+ record.error =
91
+ typeof converted === 'string'
92
+ ? { name: 'Error', message: converted }
93
+ : converted;
94
+ } else if (data !== undefined) {
95
+ if (
96
+ data &&
97
+ typeof data === 'object' &&
98
+ !Array.isArray(data) &&
99
+ [Object.prototype, null].includes(Object.getPrototypeOf(data))
100
+ ) {
101
+ const error =
102
+ walk.fieldRule('error') === 'drop'
103
+ ? undefined
104
+ : common.own(data, 'error');
105
+ const promoted = common.isError(error);
106
+ if (promoted) {
107
+ const converted = walk.redactError(error, 'error');
108
+ if (converted !== undefined) record.error = converted;
109
+ }
110
+ const values = {};
111
+ let count = 0;
112
+ for (const key of Reflect.ownKeys(data)) {
113
+ if (++count > limits.maxKeys) {
114
+ common.define(values, '[truncated]', constants.MARKERS.LIMIT);
115
+ didTruncate = true;
116
+ break;
117
+ }
118
+ if (key === 'error' && promoted) continue;
119
+ const descriptor = Object.getOwnPropertyDescriptor(data, key);
120
+ if (typeof key === 'string' && descriptor?.enumerable)
121
+ Object.defineProperty(values, key, descriptor);
122
+ }
123
+ const converted = walk.redactValue(values);
124
+ record.fields =
125
+ converted &&
126
+ typeof converted === 'object' &&
127
+ !Array.isArray(converted)
128
+ ? converted
129
+ : { value: converted };
130
+ } else record.fields = { value: walk.redactValue(data) };
131
+ }
132
+ if (walk.truncated || active.truncated || didTruncate)
133
+ record.truncated = true;
134
+ if (JSON.stringify(record).length > limits.maxRecordSize) {
135
+ delete record.fields;
136
+ delete record.context;
137
+ delete record.error;
138
+ record.fields = { value: constants.MARKERS.LIMIT };
139
+ record.truncated = true;
140
+ if (JSON.stringify(record).length > limits.maxRecordSize)
141
+ throw new TypeError('Record headers exceed size limit');
142
+ }
143
+ return record;
144
+ } finally {
145
+ active = previous;
146
+ }
147
+ },
148
+ };
149
+ if (engine.hash) api.hash = engine.hash;
150
+ return Object.freeze(api);
151
+ }
152
+
153
+ exports.createRedactor = createRedactor;
154
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/redaction/index.js"],"sourcesContent":["import { define, isError, own, resolveLimits } from '../core/common.js';\nimport { MARKERS } from '../core/constants.js';\n\nexport function createRedactor(\n policy = {},\n { createRedactor: createValueRedactor, TEXT_RULES: providerTextRules } = {},\n) {\n if (typeof createValueRedactor !== 'function')\n throw new TypeError('A value redactor factory is required');\n if (!Array.isArray(policy.text) && !providerTextRules)\n throw new TypeError('Default text rules are required');\n const limits = resolveLimits(policy.limits);\n const version = policy.version ?? '1';\n if (\n typeof version !== 'string' ||\n !version ||\n version.length > limits.maxStringLength\n )\n throw new TypeError('Invalid redaction version');\n const { fields, unknownFields, hash, text } = policy;\n const textRules = text ?? Object.values(providerTextRules);\n const engine = createValueRedactor({\n fields,\n unknownFields,\n hash:\n typeof hash === 'function' ? (value) => hash.call(policy, value) : hash,\n limits: { ...limits, maxOutputSize: limits.maxRecordSize },\n text: text\n ? textRules.map(({ name, pattern, requiresHash, replace }) => ({\n name,\n pattern,\n requiresHash,\n replace:\n typeof replace === 'function'\n ? function (match) {\n return replace.call(this, match, api);\n }\n : replace,\n }))\n : textRules,\n });\n let active;\n const api = {\n version,\n limits,\n mask: engine.mask,\n redactText(value) {\n return (active?.walk ?? engine.createSession()).redactText(value);\n },\n\n redactValue(value) {\n const walk = engine.createSession();\n const result = walk.redactValue(value);\n if (active && walk.truncated) active.truncated = true;\n return JSON.stringify(result).length <= limits.maxRecordSize\n ? result\n : MARKERS.LIMIT;\n },\n\n redact(draft) {\n const previous = active;\n const walk = engine.createSession();\n active = { walk, truncated: false };\n try {\n let didTruncate = false;\n const record = {};\n for (const key of [\n 'runId',\n 'seq',\n 'at',\n 'level',\n 'area',\n 'scope',\n 'message',\n ])\n define(\n record,\n key,\n typeof draft[key] === 'string' && !['runId', 'level'].includes(key)\n ? walk.redactText(draft[key])\n : draft[key],\n );\n record.redactionVersion = version;\n if (draft.context) record.context = walk.redactValue(draft.context);\n const data = draft.data;\n if (isError(data)) {\n const converted = walk.redactValue(data);\n record.error =\n typeof converted === 'string'\n ? { name: 'Error', message: converted }\n : converted;\n } else if (data !== undefined) {\n if (\n data &&\n typeof data === 'object' &&\n !Array.isArray(data) &&\n [Object.prototype, null].includes(Object.getPrototypeOf(data))\n ) {\n const error =\n walk.fieldRule('error') === 'drop'\n ? undefined\n : own(data, 'error');\n const promoted = isError(error);\n if (promoted) {\n const converted = walk.redactError(error, 'error');\n if (converted !== undefined) record.error = converted;\n }\n const values = {};\n let count = 0;\n for (const key of Reflect.ownKeys(data)) {\n if (++count > limits.maxKeys) {\n define(values, '[truncated]', MARKERS.LIMIT);\n didTruncate = true;\n break;\n }\n if (key === 'error' && promoted) continue;\n const descriptor = Object.getOwnPropertyDescriptor(data, key);\n if (typeof key === 'string' && descriptor?.enumerable)\n Object.defineProperty(values, key, descriptor);\n }\n const converted = walk.redactValue(values);\n record.fields =\n converted &&\n typeof converted === 'object' &&\n !Array.isArray(converted)\n ? converted\n : { value: converted };\n } else record.fields = { value: walk.redactValue(data) };\n }\n if (walk.truncated || active.truncated || didTruncate)\n record.truncated = true;\n if (JSON.stringify(record).length > limits.maxRecordSize) {\n delete record.fields;\n delete record.context;\n delete record.error;\n record.fields = { value: MARKERS.LIMIT };\n record.truncated = true;\n if (JSON.stringify(record).length > limits.maxRecordSize)\n throw new TypeError('Record headers exceed size limit');\n }\n return record;\n } finally {\n active = previous;\n }\n },\n };\n if (engine.hash) api.hash = engine.hash;\n return Object.freeze(api);\n}\n"],"names":["resolveLimits","MARKERS","define","isError","own"],"mappings":";;;;;AAGO,SAAS,cAAc;AAC9B,EAAE,MAAM,GAAG,EAAE;AACb,EAAE,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,EAAE;AAC7E,EAAE;AACF,EAAE,IAAI,OAAO,mBAAmB,KAAK,UAAU;AAC/C,IAAI,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC;AAC/D,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB;AACvD,IAAI,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC;AAC1D,EAAE,MAAM,MAAM,GAAGA,oBAAa,CAAC,MAAM,CAAC,MAAM,CAAC;AAC7C,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,GAAG;AACvC,EAAE;AACF,IAAI,OAAO,OAAO,KAAK,QAAQ;AAC/B,IAAI,CAAC,OAAO;AACZ,IAAI,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B;AACA,IAAI,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC;AACpD,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM;AACtD,EAAE,MAAM,SAAS,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;AAC5D,EAAE,MAAM,MAAM,GAAG,mBAAmB,CAAC;AACrC,IAAI,MAAM;AACV,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,MAAM,OAAO,IAAI,KAAK,UAAU,G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CAAC;AACL,GAAG;AACH,EAAE,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACzC,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;AAC3B;;"}
@@ -0,0 +1,70 @@
1
+ import type { LogValue, Redactor, SerializedError } from "../index.cjs";
2
+
3
+ export type FieldRule = 'keep' | 'drop' | 'mask' | 'hash';
4
+ export type RedactionLimits = Readonly<Partial<Redactor['limits']>>;
5
+ export type TextRule = Readonly<{
6
+ name: string;
7
+ pattern: RegExp;
8
+ requiresHash?: boolean;
9
+ replace(this: TextRule, match: string, redactor: Redactor): string;
10
+ }>;
11
+ export type RedactionPolicy = Readonly<{
12
+ version?: string;
13
+ hash?: (this: RedactionPolicy, value: string) => string;
14
+ fields?: Readonly<Record<string, FieldRule>>;
15
+ unknownFields?: 'keep' | 'drop';
16
+ text?: readonly TextRule[];
17
+ limits?: RedactionLimits;
18
+ }>;
19
+ export type ValueRedactionSession = Readonly<{
20
+ redactValue: (this: ValueRedactionSession, value: unknown) => LogValue;
21
+ redactText: (this: ValueRedactionSession, text: string) => string;
22
+ redactError: (
23
+ this: ValueRedactionSession,
24
+ value: unknown,
25
+ field: string,
26
+ ) => SerializedError | undefined;
27
+ fieldRule: (
28
+ this: ValueRedactionSession,
29
+ name: string,
30
+ ) => FieldRule | undefined;
31
+ truncated: boolean;
32
+ }>;
33
+ export type ValueRedactor = Readonly<{
34
+ limits: Readonly<{
35
+ maxDepth: number;
36
+ maxStringLength: number;
37
+ maxArrayLength: number;
38
+ maxKeys: number;
39
+ maxNodes: number;
40
+ maxOutputSize: number;
41
+ }>;
42
+ mask: (value: string) => string;
43
+ redactValue: (value: unknown) => LogValue;
44
+ redactText: (text: string) => string;
45
+ hash?: (value: string) => string;
46
+ createSession: () => ValueRedactionSession;
47
+ }>;
48
+ export type ValueTextRule = Readonly<{
49
+ name: string;
50
+ pattern: RegExp;
51
+ requiresHash?: boolean;
52
+ replace: (match: string, redactor: ValueRedactor) => string;
53
+ }>;
54
+ export type CreateValueRedactor = (
55
+ policy: Readonly<{
56
+ fields?: Readonly<Record<string, FieldRule>>;
57
+ unknownFields?: 'keep' | 'drop';
58
+ hash?: (value: string) => string;
59
+ limits?: Readonly<RedactionLimits & { maxOutputSize?: number }>;
60
+ text?: readonly ValueTextRule[];
61
+ }>,
62
+ ) => ValueRedactor;
63
+ export type RedactorProviders = Readonly<{
64
+ createRedactor: CreateValueRedactor;
65
+ TEXT_RULES?: Readonly<Record<string, ValueTextRule>>;
66
+ }>;
67
+ export declare function createRedactor(
68
+ policy: RedactionPolicy | undefined,
69
+ providers: RedactorProviders,
70
+ ): Redactor;
@@ -0,0 +1,70 @@
1
+ import type { LogValue, Redactor, SerializedError } from '../index.js';
2
+
3
+ export type FieldRule = 'keep' | 'drop' | 'mask' | 'hash';
4
+ export type RedactionLimits = Readonly<Partial<Redactor['limits']>>;
5
+ export type TextRule = Readonly<{
6
+ name: string;
7
+ pattern: RegExp;
8
+ requiresHash?: boolean;
9
+ replace(this: TextRule, match: string, redactor: Redactor): string;
10
+ }>;
11
+ export type RedactionPolicy = Readonly<{
12
+ version?: string;
13
+ hash?: (this: RedactionPolicy, value: string) => string;
14
+ fields?: Readonly<Record<string, FieldRule>>;
15
+ unknownFields?: 'keep' | 'drop';
16
+ text?: readonly TextRule[];
17
+ limits?: RedactionLimits;
18
+ }>;
19
+ export type ValueRedactionSession = Readonly<{
20
+ redactValue: (this: ValueRedactionSession, value: unknown) => LogValue;
21
+ redactText: (this: ValueRedactionSession, text: string) => string;
22
+ redactError: (
23
+ this: ValueRedactionSession,
24
+ value: unknown,
25
+ field: string,
26
+ ) => SerializedError | undefined;
27
+ fieldRule: (
28
+ this: ValueRedactionSession,
29
+ name: string,
30
+ ) => FieldRule | undefined;
31
+ truncated: boolean;
32
+ }>;
33
+ export type ValueRedactor = Readonly<{
34
+ limits: Readonly<{
35
+ maxDepth: number;
36
+ maxStringLength: number;
37
+ maxArrayLength: number;
38
+ maxKeys: number;
39
+ maxNodes: number;
40
+ maxOutputSize: number;
41
+ }>;
42
+ mask: (value: string) => string;
43
+ redactValue: (value: unknown) => LogValue;
44
+ redactText: (text: string) => string;
45
+ hash?: (value: string) => string;
46
+ createSession: () => ValueRedactionSession;
47
+ }>;
48
+ export type ValueTextRule = Readonly<{
49
+ name: string;
50
+ pattern: RegExp;
51
+ requiresHash?: boolean;
52
+ replace: (match: string, redactor: ValueRedactor) => string;
53
+ }>;
54
+ export type CreateValueRedactor = (
55
+ policy: Readonly<{
56
+ fields?: Readonly<Record<string, FieldRule>>;
57
+ unknownFields?: 'keep' | 'drop';
58
+ hash?: (value: string) => string;
59
+ limits?: Readonly<RedactionLimits & { maxOutputSize?: number }>;
60
+ text?: readonly ValueTextRule[];
61
+ }>,
62
+ ) => ValueRedactor;
63
+ export type RedactorProviders = Readonly<{
64
+ createRedactor: CreateValueRedactor;
65
+ TEXT_RULES?: Readonly<Record<string, ValueTextRule>>;
66
+ }>;
67
+ export declare function createRedactor(
68
+ policy: RedactionPolicy | undefined,
69
+ providers: RedactorProviders,
70
+ ): Redactor;
@@ -0,0 +1,152 @@
1
+ import { r as resolveLimits, d as define, i as isError, o as own } from '../chunk-LRCHwVuE.js';
2
+ import { M as MARKERS } from '../chunk-CSS3f4_M.js';
3
+
4
+ function createRedactor(
5
+ policy = {},
6
+ { createRedactor: createValueRedactor, TEXT_RULES: providerTextRules } = {},
7
+ ) {
8
+ if (typeof createValueRedactor !== 'function')
9
+ throw new TypeError('A value redactor factory is required');
10
+ if (!Array.isArray(policy.text) && !providerTextRules)
11
+ throw new TypeError('Default text rules are required');
12
+ const limits = resolveLimits(policy.limits);
13
+ const version = policy.version ?? '1';
14
+ if (
15
+ typeof version !== 'string' ||
16
+ !version ||
17
+ version.length > limits.maxStringLength
18
+ )
19
+ throw new TypeError('Invalid redaction version');
20
+ const { fields, unknownFields, hash, text } = policy;
21
+ const textRules = text ?? Object.values(providerTextRules);
22
+ const engine = createValueRedactor({
23
+ fields,
24
+ unknownFields,
25
+ hash:
26
+ typeof hash === 'function' ? (value) => hash.call(policy, value) : hash,
27
+ limits: { ...limits, maxOutputSize: limits.maxRecordSize },
28
+ text: text
29
+ ? textRules.map(({ name, pattern, requiresHash, replace }) => ({
30
+ name,
31
+ pattern,
32
+ requiresHash,
33
+ replace:
34
+ typeof replace === 'function'
35
+ ? function (match) {
36
+ return replace.call(this, match, api);
37
+ }
38
+ : replace,
39
+ }))
40
+ : textRules,
41
+ });
42
+ let active;
43
+ const api = {
44
+ version,
45
+ limits,
46
+ mask: engine.mask,
47
+ redactText(value) {
48
+ return (active?.walk ?? engine.createSession()).redactText(value);
49
+ },
50
+
51
+ redactValue(value) {
52
+ const walk = engine.createSession();
53
+ const result = walk.redactValue(value);
54
+ if (active && walk.truncated) active.truncated = true;
55
+ return JSON.stringify(result).length <= limits.maxRecordSize
56
+ ? result
57
+ : MARKERS.LIMIT;
58
+ },
59
+
60
+ redact(draft) {
61
+ const previous = active;
62
+ const walk = engine.createSession();
63
+ active = { walk, truncated: false };
64
+ try {
65
+ let didTruncate = false;
66
+ const record = {};
67
+ for (const key of [
68
+ 'runId',
69
+ 'seq',
70
+ 'at',
71
+ 'level',
72
+ 'area',
73
+ 'scope',
74
+ 'message',
75
+ ])
76
+ define(
77
+ record,
78
+ key,
79
+ typeof draft[key] === 'string' && !['runId', 'level'].includes(key)
80
+ ? walk.redactText(draft[key])
81
+ : draft[key],
82
+ );
83
+ record.redactionVersion = version;
84
+ if (draft.context) record.context = walk.redactValue(draft.context);
85
+ const data = draft.data;
86
+ if (isError(data)) {
87
+ const converted = walk.redactValue(data);
88
+ record.error =
89
+ typeof converted === 'string'
90
+ ? { name: 'Error', message: converted }
91
+ : converted;
92
+ } else if (data !== undefined) {
93
+ if (
94
+ data &&
95
+ typeof data === 'object' &&
96
+ !Array.isArray(data) &&
97
+ [Object.prototype, null].includes(Object.getPrototypeOf(data))
98
+ ) {
99
+ const error =
100
+ walk.fieldRule('error') === 'drop'
101
+ ? undefined
102
+ : own(data, 'error');
103
+ const promoted = isError(error);
104
+ if (promoted) {
105
+ const converted = walk.redactError(error, 'error');
106
+ if (converted !== undefined) record.error = converted;
107
+ }
108
+ const values = {};
109
+ let count = 0;
110
+ for (const key of Reflect.ownKeys(data)) {
111
+ if (++count > limits.maxKeys) {
112
+ define(values, '[truncated]', MARKERS.LIMIT);
113
+ didTruncate = true;
114
+ break;
115
+ }
116
+ if (key === 'error' && promoted) continue;
117
+ const descriptor = Object.getOwnPropertyDescriptor(data, key);
118
+ if (typeof key === 'string' && descriptor?.enumerable)
119
+ Object.defineProperty(values, key, descriptor);
120
+ }
121
+ const converted = walk.redactValue(values);
122
+ record.fields =
123
+ converted &&
124
+ typeof converted === 'object' &&
125
+ !Array.isArray(converted)
126
+ ? converted
127
+ : { value: converted };
128
+ } else record.fields = { value: walk.redactValue(data) };
129
+ }
130
+ if (walk.truncated || active.truncated || didTruncate)
131
+ record.truncated = true;
132
+ if (JSON.stringify(record).length > limits.maxRecordSize) {
133
+ delete record.fields;
134
+ delete record.context;
135
+ delete record.error;
136
+ record.fields = { value: MARKERS.LIMIT };
137
+ record.truncated = true;
138
+ if (JSON.stringify(record).length > limits.maxRecordSize)
139
+ throw new TypeError('Record headers exceed size limit');
140
+ }
141
+ return record;
142
+ } finally {
143
+ active = previous;
144
+ }
145
+ },
146
+ };
147
+ if (engine.hash) api.hash = engine.hash;
148
+ return Object.freeze(api);
149
+ }
150
+
151
+ export { createRedactor };
152
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/redaction/index.js"],"sourcesContent":["import { define, isError, own, resolveLimits } from '../core/common.js';\nimport { MARKERS } from '../core/constants.js';\n\nexport function createRedactor(\n policy = {},\n { createRedactor: createValueRedactor, TEXT_RULES: providerTextRules } = {},\n) {\n if (typeof createValueRedactor !== 'function')\n throw new TypeError('A value redactor factory is required');\n if (!Array.isArray(policy.text) && !providerTextRules)\n throw new TypeError('Default text rules are required');\n const limits = resolveLimits(policy.limits);\n const version = policy.version ?? '1';\n if (\n typeof version !== 'string' ||\n !version ||\n version.length > limits.maxStringLength\n )\n throw new TypeError('Invalid redaction version');\n const { fields, unknownFields, hash, text } = policy;\n const textRules = text ?? Object.values(providerTextRules);\n const engine = createValueRedactor({\n fields,\n unknownFields,\n hash:\n typeof hash === 'function' ? (value) => hash.call(policy, value) : hash,\n limits: { ...limits, maxOutputSize: limits.maxRecordSize },\n text: text\n ? textRules.map(({ name, pattern, requiresHash, replace }) => ({\n name,\n pattern,\n requiresHash,\n replace:\n typeof replace === 'function'\n ? function (match) {\n return replace.call(this, match, api);\n }\n : replace,\n }))\n : textRules,\n });\n let active;\n const api = {\n version,\n limits,\n mask: engine.mask,\n redactText(value) {\n return (active?.walk ?? engine.createSession()).redactText(value);\n },\n\n redactValue(value) {\n const walk = engine.createSession();\n const result = walk.redactValue(value);\n if (active && walk.truncated) active.truncated = true;\n return JSON.stringify(result).length <= limits.maxRecordSize\n ? result\n : MARKERS.LIMIT;\n },\n\n redact(draft) {\n const previous = active;\n const walk = engine.createSession();\n active = { walk, truncated: false };\n try {\n let didTruncate = false;\n const record = {};\n for (const key of [\n 'runId',\n 'seq',\n 'at',\n 'level',\n 'area',\n 'scope',\n 'message',\n ])\n define(\n record,\n key,\n typeof draft[key] === 'string' && !['runId', 'level'].includes(key)\n ? walk.redactText(draft[key])\n : draft[key],\n );\n record.redactionVersion = version;\n if (draft.context) record.context = walk.redactValue(draft.context);\n const data = draft.data;\n if (isError(data)) {\n const converted = walk.redactValue(data);\n record.error =\n typeof converted === 'string'\n ? { name: 'Error', message: converted }\n : converted;\n } else if (data !== undefined) {\n if (\n data &&\n typeof data === 'object' &&\n !Array.isArray(data) &&\n [Object.prototype, null].includes(Object.getPrototypeOf(data))\n ) {\n const error =\n walk.fieldRule('error') === 'drop'\n ? undefined\n : own(data, 'error');\n const promoted = isError(error);\n if (promoted) {\n const converted = walk.redactError(error, 'error');\n if (converted !== undefined) record.error = converted;\n }\n const values = {};\n let count = 0;\n for (const key of Reflect.ownKeys(data)) {\n if (++count > limits.maxKeys) {\n define(values, '[truncated]', MARKERS.LIMIT);\n didTruncate = true;\n break;\n }\n if (key === 'error' && promoted) continue;\n const descriptor = Object.getOwnPropertyDescriptor(data, key);\n if (typeof key === 'string' && descriptor?.enumerable)\n Object.defineProperty(values, key, descriptor);\n }\n const converted = walk.redactValue(values);\n record.fields =\n converted &&\n typeof converted === 'object' &&\n !Array.isArray(converted)\n ? converted\n : { value: converted };\n } else record.fields = { value: walk.redactValue(data) };\n }\n if (walk.truncated || active.truncated || didTruncate)\n record.truncated = true;\n if (JSON.stringify(record).length > limits.maxRecordSize) {\n delete record.fields;\n delete record.context;\n delete record.error;\n record.fields = { value: MARKERS.LIMIT };\n record.truncated = true;\n if (JSON.stringify(record).length > limits.maxRecordSize)\n throw new TypeError('Record headers exceed size limit');\n }\n return record;\n } finally {\n active = previous;\n }\n },\n };\n if (engine.hash) api.hash = engine.hash;\n return Object.freeze(api);\n}\n"],"names":[],"mappings":";;;AAGO,SAAS,cAAc;AAC9B,EAAE,MAAM,GAAG,EAAE;AACb,EAAE,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,EAAE;AAC7E,EAAE;AACF,EAAE,IAAI,OAAO,mBAAmB,KAAK,UAAU;AAC/C,IAAI,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC;AAC/D,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB;AACvD,IAAI,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC;AAC1D,EAAE,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;AAC7C,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,GAAG;AACvC,EAAE;AACF,IAAI,OAA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AAO,MAAM,CAAC,OAAO;AAC/B,UAAU,OAAO,MAAM,CAAC,KAAK;AAC7B,UAAU,MAAM,CAAC,MAAM,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE;AAClD,UAAU,MAAM,CAAC,SAAS,GAAG,IAAI;AACjC,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,aAAa;AAClE,YAAY,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC;AACnE,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,MAAM,CAAC,SAAS;AAChB,QAAQ,MAAM,GAAG,QAAQ;AACzB,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH,EAAE,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACzC,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;AAC3B;;"}
@@ -0,0 +1,5 @@
1
+ export const SIP_ERRORS: Readonly<{
2
+ CALLBACK: "SIP display-name callback must return a string without controls";
3
+ RESULT_LIMIT: "SIP display name exceeds maxStringLength";
4
+ OUTPUT_LIMIT: "SIP output exceeds its size limit";
5
+ }>;
@@ -0,0 +1,5 @@
1
+ export const SIP_ERRORS: Readonly<{
2
+ CALLBACK: "SIP display-name callback must return a string without controls";
3
+ RESULT_LIMIT: "SIP display name exceeds maxStringLength";
4
+ OUTPUT_LIMIT: "SIP output exceeds its size limit";
5
+ }>;