@ontrails/core 1.0.0-beta.2 → 1.0.0-beta.21
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/CHANGELOG.md +283 -5
- package/README.md +113 -33
- package/package.json +11 -1
- package/src/activation-provenance.ts +111 -0
- package/src/activation-source-compatibility.ts +430 -0
- package/src/activation-source-projection.ts +221 -0
- package/src/activation-source.ts +91 -0
- package/src/blob-ref.ts +51 -0
- package/src/branded.ts +1 -1
- package/src/compose-batch.ts +69 -0
- package/src/compose-schema.ts +36 -0
- package/src/context.ts +44 -10
- package/src/contour.ts +346 -0
- package/src/derive.ts +59 -18
- package/src/detours.ts +8 -0
- package/src/draft.ts +342 -0
- package/src/error-projection.ts +51 -0
- package/src/errors.ts +309 -48
- package/src/execute.ts +1577 -0
- package/src/fire.ts +1169 -0
- package/src/index.ts +477 -32
- package/src/internal/fork-ctx.ts +69 -0
- package/src/layer-projection.ts +193 -0
- package/src/layer.ts +43 -6
- package/src/observe.ts +361 -0
- package/src/path-security.ts +1 -1
- package/src/permits.ts +12 -0
- package/src/redaction/patterns.ts +6 -3
- package/src/resilience.ts +11 -11
- package/src/resource-config.ts +792 -0
- package/src/resource.ts +194 -0
- package/src/result.ts +36 -4
- package/src/run.ts +76 -0
- package/src/schedule-runtime.ts +689 -0
- package/src/schedule.ts +326 -0
- package/src/serialization.ts +119 -39
- package/src/signal-diagnostics.ts +633 -0
- package/src/signal-ref.ts +87 -0
- package/src/signal.ts +104 -0
- package/src/store/accessor-protocol.ts +56 -0
- package/src/store/index.ts +4 -0
- package/src/structured-examples.ts +248 -0
- package/src/surface-derivation.ts +91 -0
- package/src/surface-filter.ts +176 -0
- package/src/surface-versioning.ts +42 -0
- package/src/topo.ts +769 -57
- package/src/tracing.ts +345 -0
- package/src/trail.ts +1161 -29
- package/src/trails/derive-trail.ts +842 -0
- package/src/trails/index.ts +9 -0
- package/src/trails/ingest.ts +139 -0
- package/src/trails-db.ts +208 -0
- package/src/transport-error-map.ts +174 -0
- package/src/type-utils.ts +87 -0
- package/src/types.ts +254 -12
- package/src/validate-established-topo.ts +69 -0
- package/src/validate-topo.ts +442 -35
- package/src/validation.ts +152 -4
- package/src/version-marker.ts +716 -0
- package/src/version-resolution.ts +308 -0
- package/src/version-runtime.ts +120 -0
- package/src/webhook.ts +278 -0
- package/src/workspace.ts +1 -1
- package/src/zod-wrappers.ts +72 -0
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/adapters.d.ts +0 -39
- package/dist/adapters.d.ts.map +0 -1
- package/dist/adapters.js +0 -2
- package/dist/adapters.js.map +0 -1
- package/dist/blob-ref.d.ts +0 -20
- package/dist/blob-ref.d.ts.map +0 -1
- package/dist/blob-ref.js +0 -22
- package/dist/blob-ref.js.map +0 -1
- package/dist/branded.d.ts +0 -36
- package/dist/branded.d.ts.map +0 -1
- package/dist/branded.js +0 -89
- package/dist/branded.js.map +0 -1
- package/dist/collections.d.ts +0 -31
- package/dist/collections.d.ts.map +0 -1
- package/dist/collections.js +0 -60
- package/dist/collections.js.map +0 -1
- package/dist/context.d.ts +0 -10
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -15
- package/dist/context.js.map +0 -1
- package/dist/derive.d.ts +0 -33
- package/dist/derive.d.ts.map +0 -1
- package/dist/derive.js +0 -122
- package/dist/derive.js.map +0 -1
- package/dist/errors.d.ts +0 -83
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -142
- package/dist/errors.js.map +0 -1
- package/dist/event.d.ts +0 -45
- package/dist/event.d.ts.map +0 -1
- package/dist/event.js +0 -17
- package/dist/event.js.map +0 -1
- package/dist/fetch.d.ts +0 -15
- package/dist/fetch.d.ts.map +0 -1
- package/dist/fetch.js +0 -102
- package/dist/fetch.js.map +0 -1
- package/dist/guards.d.ts +0 -17
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -25
- package/dist/guards.js.map +0 -1
- package/dist/health.d.ts +0 -18
- package/dist/health.d.ts.map +0 -1
- package/dist/health.js +0 -5
- package/dist/health.js.map +0 -1
- package/dist/hike.d.ts +0 -36
- package/dist/hike.d.ts.map +0 -1
- package/dist/hike.js +0 -20
- package/dist/hike.js.map +0 -1
- package/dist/index.d.ts +0 -34
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/job.d.ts +0 -24
- package/dist/job.d.ts.map +0 -1
- package/dist/job.js +0 -17
- package/dist/job.js.map +0 -1
- package/dist/layer.d.ts +0 -17
- package/dist/layer.d.ts.map +0 -1
- package/dist/layer.js +0 -21
- package/dist/layer.js.map +0 -1
- package/dist/path-security.d.ts +0 -28
- package/dist/path-security.d.ts.map +0 -1
- package/dist/path-security.js +0 -63
- package/dist/path-security.js.map +0 -1
- package/dist/patterns/bulk.d.ts +0 -15
- package/dist/patterns/bulk.d.ts.map +0 -1
- package/dist/patterns/bulk.js +0 -14
- package/dist/patterns/bulk.js.map +0 -1
- package/dist/patterns/change.d.ts +0 -10
- package/dist/patterns/change.d.ts.map +0 -1
- package/dist/patterns/change.js +0 -10
- package/dist/patterns/change.js.map +0 -1
- package/dist/patterns/date-range.d.ts +0 -10
- package/dist/patterns/date-range.d.ts.map +0 -1
- package/dist/patterns/date-range.js +0 -10
- package/dist/patterns/date-range.js.map +0 -1
- package/dist/patterns/index.d.ts +0 -9
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/patterns/index.js +0 -9
- package/dist/patterns/index.js.map +0 -1
- package/dist/patterns/pagination.d.ts +0 -18
- package/dist/patterns/pagination.d.ts.map +0 -1
- package/dist/patterns/pagination.js +0 -18
- package/dist/patterns/pagination.js.map +0 -1
- package/dist/patterns/progress.d.ts +0 -11
- package/dist/patterns/progress.d.ts.map +0 -1
- package/dist/patterns/progress.js +0 -11
- package/dist/patterns/progress.js.map +0 -1
- package/dist/patterns/sorting.d.ts +0 -13
- package/dist/patterns/sorting.d.ts.map +0 -1
- package/dist/patterns/sorting.js +0 -10
- package/dist/patterns/sorting.js.map +0 -1
- package/dist/patterns/status.d.ts +0 -15
- package/dist/patterns/status.d.ts.map +0 -1
- package/dist/patterns/status.js +0 -9
- package/dist/patterns/status.js.map +0 -1
- package/dist/patterns/timestamps.d.ts +0 -10
- package/dist/patterns/timestamps.d.ts.map +0 -1
- package/dist/patterns/timestamps.js +0 -10
- package/dist/patterns/timestamps.js.map +0 -1
- package/dist/redaction/index.d.ts +0 -4
- package/dist/redaction/index.d.ts.map +0 -1
- package/dist/redaction/index.js +0 -3
- package/dist/redaction/index.js.map +0 -1
- package/dist/redaction/patterns.d.ts +0 -9
- package/dist/redaction/patterns.d.ts.map +0 -1
- package/dist/redaction/patterns.js +0 -39
- package/dist/redaction/patterns.js.map +0 -1
- package/dist/redaction/redactor.d.ts +0 -27
- package/dist/redaction/redactor.d.ts.map +0 -1
- package/dist/redaction/redactor.js +0 -89
- package/dist/redaction/redactor.js.map +0 -1
- package/dist/resilience.d.ts +0 -34
- package/dist/resilience.d.ts.map +0 -1
- package/dist/resilience.js +0 -164
- package/dist/resilience.js.map +0 -1
- package/dist/result.d.ts +0 -57
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -145
- package/dist/result.js.map +0 -1
- package/dist/serialization.d.ts +0 -27
- package/dist/serialization.d.ts.map +0 -1
- package/dist/serialization.js +0 -115
- package/dist/serialization.js.map +0 -1
- package/dist/topo.d.ts +0 -18
- package/dist/topo.d.ts.map +0 -1
- package/dist/topo.js +0 -74
- package/dist/topo.js.map +0 -1
- package/dist/trail.d.ts +0 -83
- package/dist/trail.d.ts.map +0 -1
- package/dist/trail.js +0 -16
- package/dist/trail.js.map +0 -1
- package/dist/types.d.ts +0 -46
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/validate-topo.d.ts +0 -24
- package/dist/validate-topo.d.ts.map +0 -1
- package/dist/validate-topo.js +0 -108
- package/dist/validate-topo.js.map +0 -1
- package/dist/validation.d.ts +0 -27
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -134
- package/dist/validation.js.map +0 -1
- package/dist/workspace.d.ts +0 -25
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -57
- package/dist/workspace.js.map +0 -1
- package/src/__tests__/blob-ref.test.ts +0 -103
- package/src/__tests__/branded.test.ts +0 -148
- package/src/__tests__/collections.test.ts +0 -126
- package/src/__tests__/context.test.ts +0 -66
- package/src/__tests__/derive.test.ts +0 -159
- package/src/__tests__/errors.test.ts +0 -309
- package/src/__tests__/event.test.ts +0 -82
- package/src/__tests__/fetch.test.ts +0 -217
- package/src/__tests__/guards.test.ts +0 -102
- package/src/__tests__/hike.test.ts +0 -117
- package/src/__tests__/job.test.ts +0 -98
- package/src/__tests__/layer.test.ts +0 -224
- package/src/__tests__/path-security.test.ts +0 -114
- package/src/__tests__/patterns.test.ts +0 -273
- package/src/__tests__/redaction.test.ts +0 -244
- package/src/__tests__/resilience.test.ts +0 -246
- package/src/__tests__/result.test.ts +0 -155
- package/src/__tests__/serialization.test.ts +0 -236
- package/src/__tests__/topo.test.ts +0 -184
- package/src/__tests__/trail.test.ts +0 -179
- package/src/__tests__/validate-topo.test.ts +0 -201
- package/src/__tests__/validation.test.ts +0 -283
- package/src/__tests__/workspace.test.ts +0 -183
- package/src/adapters.ts +0 -68
- package/src/event.ts +0 -77
- package/src/health.ts +0 -23
- package/src/hike.ts +0 -77
- package/src/job.ts +0 -20
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
package/dist/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Result
|
|
2
|
-
export { Result } from './result.js';
|
|
3
|
-
// Errors
|
|
4
|
-
export { TrailsError, ValidationError, AmbiguousError, AssertionError, NotFoundError, AlreadyExistsError, ConflictError, PermissionError, TimeoutError, RateLimitError, NetworkError, InternalError, AuthError, CancelledError, exitCodeMap, statusCodeMap, jsonRpcCodeMap, retryableMap, isRetryable, isTrailsError, } from './errors.js';
|
|
5
|
-
// Context factory
|
|
6
|
-
export { createTrailContext } from './context.js';
|
|
7
|
-
// Trail
|
|
8
|
-
export { trail } from './trail.js';
|
|
9
|
-
// Hike
|
|
10
|
-
export { hike } from './hike.js';
|
|
11
|
-
// Event
|
|
12
|
-
export { event } from './event.js';
|
|
13
|
-
// Topo
|
|
14
|
-
export { topo } from './topo.js';
|
|
15
|
-
// Topo validation
|
|
16
|
-
export { validateTopo } from './validate-topo.js';
|
|
17
|
-
// Layer
|
|
18
|
-
export { composeLayers } from './layer.js';
|
|
19
|
-
// Derive
|
|
20
|
-
export { deriveFields } from './derive.js';
|
|
21
|
-
// Validation
|
|
22
|
-
export { validateInput, validateOutput, formatZodIssues, zodToJsonSchema, } from './validation.js';
|
|
23
|
-
// Serialization
|
|
24
|
-
export { serializeError, deserializeError } from './serialization.js';
|
|
25
|
-
// Resilience
|
|
26
|
-
export { retry, withTimeout, shouldRetry, getBackoffDelay, } from './resilience.js';
|
|
27
|
-
// Fetch — fromFetch is available as Result.fromFetch()
|
|
28
|
-
// Branded types
|
|
29
|
-
export { brand, unbrand, uuid, email, nonEmptyString, positiveInt, shortId, hashId, } from './branded.js';
|
|
30
|
-
// Path Security
|
|
31
|
-
export { securePath, isPathSafe, resolveSafePath } from './path-security.js';
|
|
32
|
-
// Workspace
|
|
33
|
-
export { findWorkspaceRoot, isInsideWorkspace, getRelativePath, } from './workspace.js';
|
|
34
|
-
// Guards
|
|
35
|
-
export { isDefined, isNonEmptyString, isPlainObject, hasProperty, assertNever, } from './guards.js';
|
|
36
|
-
// Collections
|
|
37
|
-
export { chunk, dedupe, groupBy, sortBy, isNonEmptyArray, } from './collections.js';
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS;AACT,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AAcrB,kBAAkB;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,QAAQ;AACR,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,kBAAkB;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,QAAQ;AACR,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgB3C,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,aAAa;AACb,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,gBAAgB;AAChB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtE,aAAa;AACb,OAAO,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,uDAAuD;AAEvD,gBAAgB;AAChB,OAAO,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,cAAc,EACd,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,cAAc,CAAC;AAStB,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,YAAY;AACZ,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,SAAS;AACT,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,cAAc;AACd,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
|
package/dist/job.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Proof: job-style output schema composes from existing pattern helpers.
|
|
4
|
-
* No dedicated `kind: "job"` needed — regular trails with status+progress output work.
|
|
5
|
-
*/
|
|
6
|
-
export declare const jobOutputSchema: z.ZodObject<{
|
|
7
|
-
completedAt: z.ZodOptional<z.ZodString>;
|
|
8
|
-
error: z.ZodOptional<z.ZodString>;
|
|
9
|
-
jobId: z.ZodString;
|
|
10
|
-
result: z.ZodOptional<z.ZodUnknown>;
|
|
11
|
-
startedAt: z.ZodOptional<z.ZodString>;
|
|
12
|
-
status: z.ZodEnum<{
|
|
13
|
-
cancelled: "cancelled";
|
|
14
|
-
pending: "pending";
|
|
15
|
-
running: "running";
|
|
16
|
-
completed: "completed";
|
|
17
|
-
failed: "failed";
|
|
18
|
-
}>;
|
|
19
|
-
current: z.ZodNumber;
|
|
20
|
-
percentage: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
total: z.ZodNumber;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export type JobOutput = z.infer<typeof jobOutputSchema>;
|
|
24
|
-
//# sourceMappingURL=job.d.ts.map
|
package/dist/job.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;iBAQ1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/job.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { progressFields } from './patterns/progress.js';
|
|
3
|
-
import { statusFields } from './patterns/status.js';
|
|
4
|
-
/**
|
|
5
|
-
* Proof: job-style output schema composes from existing pattern helpers.
|
|
6
|
-
* No dedicated `kind: "job"` needed — regular trails with status+progress output work.
|
|
7
|
-
*/
|
|
8
|
-
export const jobOutputSchema = z.object({
|
|
9
|
-
...progressFields().shape,
|
|
10
|
-
...statusFields().shape,
|
|
11
|
-
completedAt: z.string().optional(),
|
|
12
|
-
error: z.string().optional(),
|
|
13
|
-
jobId: z.string(),
|
|
14
|
-
result: z.unknown().optional(),
|
|
15
|
-
startedAt: z.string().optional(),
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=job.js.map
|
package/dist/job.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,GAAG,cAAc,EAAE,CAAC,KAAK;IACzB,GAAG,YAAY,EAAE,CAAC,KAAK;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
package/dist/layer.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Trail } from './trail.js';
|
|
2
|
-
import type { Implementation } from './types.js';
|
|
3
|
-
/** A composable middleware that wraps trail implementations */
|
|
4
|
-
export interface Layer {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly description?: string | undefined;
|
|
7
|
-
/** Wrap a trail's implementation, returning a new implementation */
|
|
8
|
-
wrap<I, O>(trail: Trail<I, O>, implementation: Implementation<I, O>): Implementation<I, O>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Apply layers outermost-first: layers[0] wraps layers[1] wraps ... wraps
|
|
12
|
-
* the base implementation.
|
|
13
|
-
*
|
|
14
|
-
* An empty layers array returns the implementation unchanged.
|
|
15
|
-
*/
|
|
16
|
-
export declare const composeLayers: <I, O>(layers: readonly Layer[], trail: Trail<I, O>, implementation: Implementation<I, O>) => Implementation<I, O>;
|
|
17
|
-
//# sourceMappingURL=layer.d.ts.map
|
package/dist/layer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,+DAA+D;AAC/D,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,oEAAoE;IACpE,IAAI,CAAC,CAAC,EAAE,CAAC,EACP,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAClB,cAAc,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GACnC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACzB;AAMD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,CAAC,EAChC,QAAQ,SAAS,KAAK,EAAE,EACxB,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAClB,gBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,KACnC,cAAc,CAAC,CAAC,EAAE,CAAC,CAUrB,CAAC"}
|
package/dist/layer.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// Composition
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
/**
|
|
5
|
-
* Apply layers outermost-first: layers[0] wraps layers[1] wraps ... wraps
|
|
6
|
-
* the base implementation.
|
|
7
|
-
*
|
|
8
|
-
* An empty layers array returns the implementation unchanged.
|
|
9
|
-
*/
|
|
10
|
-
export const composeLayers = (layers, trail, implementation) => {
|
|
11
|
-
// Fold right so layers[0] is the outermost wrapper
|
|
12
|
-
let result = implementation;
|
|
13
|
-
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
14
|
-
const layer = layers[i];
|
|
15
|
-
if (layer) {
|
|
16
|
-
result = layer.wrap(trail, result);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=layer.js.map
|
package/dist/layer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layer.js","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAmBA,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAwB,EACxB,KAAkB,EAClB,cAAoC,EACd,EAAE;IACxB,mDAAmD;IACnD,IAAI,MAAM,GAAG,cAAc,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/path-security.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path security utilities for preventing path traversal attacks.
|
|
3
|
-
*
|
|
4
|
-
* All functions are runtime-agnostic (Node / Bun compatible).
|
|
5
|
-
*/
|
|
6
|
-
import { PermissionError } from './errors.js';
|
|
7
|
-
import { Result } from './result.js';
|
|
8
|
-
/**
|
|
9
|
-
* Resolves `userPath` relative to `basePath` and ensures it stays within
|
|
10
|
-
* the base directory. Returns the resolved absolute path on success, or a
|
|
11
|
-
* `PermissionError` if the path escapes.
|
|
12
|
-
*
|
|
13
|
-
* Uses lexical path comparison (not `realpath`). Does not follow symlinks —
|
|
14
|
-
* if an attacker can create symlinks inside `basePath`, those could point
|
|
15
|
-
* outside the base. Use `realpath` before calling in symlink-sensitive environments.
|
|
16
|
-
*/
|
|
17
|
-
export declare const securePath: (basePath: string, userPath: string) => Result<string, PermissionError>;
|
|
18
|
-
/**
|
|
19
|
-
* Returns `true` if `userPath` (resolved against `basePath`) stays within
|
|
20
|
-
* `basePath`.
|
|
21
|
-
*/
|
|
22
|
-
export declare const isPathSafe: (basePath: string, userPath: string) => boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Joins multiple path segments, resolves them against `basePath`, and
|
|
25
|
-
* validates the result stays within the base directory.
|
|
26
|
-
*/
|
|
27
|
-
export declare const resolveSafePath: (basePath: string, ...segments: string[]) => Result<string, PermissionError>;
|
|
28
|
-
//# sourceMappingURL=path-security.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-security.d.ts","sourceRoot":"","sources":["../src/path-security.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAmBrC;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,MAAM,CAAC,MAAM,EAAE,eAAe,CAgBhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,KAAG,OAI/D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,UAAU,MAAM,EAChB,GAAG,UAAU,MAAM,EAAE,KACpB,MAAM,CAAC,MAAM,EAAE,eAAe,CAchC,CAAC"}
|
package/dist/path-security.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path security utilities for preventing path traversal attacks.
|
|
3
|
-
*
|
|
4
|
-
* All functions are runtime-agnostic (Node / Bun compatible).
|
|
5
|
-
*/
|
|
6
|
-
import { resolve, relative, normalize, isAbsolute } from 'node:path';
|
|
7
|
-
import { PermissionError } from './errors.js';
|
|
8
|
-
import { Result } from './result.js';
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Internal
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
/** Returns true when `target` is equal to or a descendant of `base`. */
|
|
13
|
-
const isWithin = (base, target) => {
|
|
14
|
-
const rel = relative(base, target);
|
|
15
|
-
// Empty string means they are the same directory.
|
|
16
|
-
// A relative path starting with ".." means it escapes.
|
|
17
|
-
// An absolute path means a completely different tree.
|
|
18
|
-
return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
|
|
19
|
-
};
|
|
20
|
-
// ---------------------------------------------------------------------------
|
|
21
|
-
// Public API
|
|
22
|
-
// ---------------------------------------------------------------------------
|
|
23
|
-
/**
|
|
24
|
-
* Resolves `userPath` relative to `basePath` and ensures it stays within
|
|
25
|
-
* the base directory. Returns the resolved absolute path on success, or a
|
|
26
|
-
* `PermissionError` if the path escapes.
|
|
27
|
-
*
|
|
28
|
-
* Uses lexical path comparison (not `realpath`). Does not follow symlinks —
|
|
29
|
-
* if an attacker can create symlinks inside `basePath`, those could point
|
|
30
|
-
* outside the base. Use `realpath` before calling in symlink-sensitive environments.
|
|
31
|
-
*/
|
|
32
|
-
export const securePath = (basePath, userPath) => {
|
|
33
|
-
const base = resolve(basePath);
|
|
34
|
-
const resolved = resolve(base, userPath);
|
|
35
|
-
if (!isWithin(base, resolved)) {
|
|
36
|
-
return Result.err(new PermissionError(`Path traversal detected: "${userPath}" escapes "${basePath}"`, {
|
|
37
|
-
context: { basePath: base, resolved, userPath },
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
return Result.ok(resolved);
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Returns `true` if `userPath` (resolved against `basePath`) stays within
|
|
44
|
-
* `basePath`.
|
|
45
|
-
*/
|
|
46
|
-
export const isPathSafe = (basePath, userPath) => {
|
|
47
|
-
const base = resolve(basePath);
|
|
48
|
-
const resolved = resolve(base, userPath);
|
|
49
|
-
return isWithin(base, resolved);
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Joins multiple path segments, resolves them against `basePath`, and
|
|
53
|
-
* validates the result stays within the base directory.
|
|
54
|
-
*/
|
|
55
|
-
export const resolveSafePath = (basePath, ...segments) => {
|
|
56
|
-
const base = resolve(basePath);
|
|
57
|
-
const joined = resolve(base, ...segments.map((s) => normalize(s)));
|
|
58
|
-
if (!isWithin(base, joined)) {
|
|
59
|
-
return Result.err(new PermissionError(`Path traversal detected: segments escape "${basePath}"`, { context: { basePath: base, resolved: joined, segments } }));
|
|
60
|
-
}
|
|
61
|
-
return Result.ok(joined);
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=path-security.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-security.js","sourceRoot":"","sources":["../src/path-security.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,wEAAwE;AACxE,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,MAAc,EAAW,EAAE;IACzD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,kDAAkD;IAClD,uDAAuD;IACvD,sDAAsD;IACtD,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,QAAgB,EACiB,EAAE;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEzC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,GAAG,CACf,IAAI,eAAe,CACjB,6BAA6B,QAAQ,cAAc,QAAQ,GAAG,EAC9D;YACE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAChD,CACF,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,QAAgB,EAAW,EAAE;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,QAAgB,EAChB,GAAG,QAAkB,EACY,EAAE;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,GAAG,CACf,IAAI,eAAe,CACjB,6CAA6C,QAAQ,GAAG,EACxD,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAC5D,CACF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC,CAAC"}
|
package/dist/patterns/bulk.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bulk operation schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Bulk operation output wrapper for a given item schema. */
|
|
6
|
-
export declare const bulkOutput: <T>(itemSchema: z.ZodType<T>) => z.ZodObject<{
|
|
7
|
-
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
|
-
index: z.ZodNumber;
|
|
9
|
-
message: z.ZodString;
|
|
10
|
-
}, z.core.$strip>>>;
|
|
11
|
-
failed: z.ZodNumber;
|
|
12
|
-
items: z.ZodArray<z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>>;
|
|
13
|
-
succeeded: z.ZodNumber;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
//# sourceMappingURL=bulk.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../../src/patterns/bulk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6DAA6D;AAC7D,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;;;;iBAQlD,CAAC"}
|
package/dist/patterns/bulk.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bulk operation schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Bulk operation output wrapper for a given item schema. */
|
|
6
|
-
export const bulkOutput = (itemSchema) => z.object({
|
|
7
|
-
errors: z
|
|
8
|
-
.array(z.object({ index: z.number(), message: z.string() }))
|
|
9
|
-
.optional(),
|
|
10
|
-
failed: z.number(),
|
|
11
|
-
items: z.array(itemSchema),
|
|
12
|
-
succeeded: z.number(),
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=bulk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../src/patterns/bulk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,UAAwB,EAAE,EAAE,CACxD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SAC3D,QAAQ,EAAE;IACb,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Change-tracking schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Before/after change output for a given schema. */
|
|
6
|
-
export declare const changeOutput: <T>(schema: z.ZodType<T>) => z.ZodObject<{
|
|
7
|
-
after: z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>;
|
|
8
|
-
before: z.ZodOptional<z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>>;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
//# sourceMappingURL=change.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../src/patterns/change.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qDAAqD;AACrD,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;iBAIhD,CAAC"}
|
package/dist/patterns/change.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Change-tracking schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Before/after change output for a given schema. */
|
|
6
|
-
export const changeOutput = (schema) => z.object({
|
|
7
|
-
after: schema,
|
|
8
|
-
before: schema.optional(),
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=change.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"change.js","sourceRoot":"","sources":["../../src/patterns/change.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qDAAqD;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAI,MAAoB,EAAE,EAAE,CACtD,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date-range schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Optional since/until date-range fields. */
|
|
6
|
-
export declare const dateRangeFields: () => z.ZodObject<{
|
|
7
|
-
since: z.ZodOptional<z.ZodString>;
|
|
8
|
-
until: z.ZodOptional<z.ZodString>;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
//# sourceMappingURL=date-range.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-range.d.ts","sourceRoot":"","sources":["../../src/patterns/date-range.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8CAA8C;AAC9C,eAAO,MAAM,eAAe;;;iBAIxB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Date-range schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Optional since/until date-range fields. */
|
|
6
|
-
export const dateRangeFields = () => z.object({
|
|
7
|
-
since: z.string().optional(),
|
|
8
|
-
until: z.string().optional(),
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=date-range.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-range.js","sourceRoot":"","sources":["../../src/patterns/date-range.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8CAA8C;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}
|
package/dist/patterns/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { paginationFields, paginatedOutput } from './pagination.js';
|
|
2
|
-
export { bulkOutput } from './bulk.js';
|
|
3
|
-
export { timestampFields } from './timestamps.js';
|
|
4
|
-
export { dateRangeFields } from './date-range.js';
|
|
5
|
-
export { sortFields } from './sorting.js';
|
|
6
|
-
export { statusFields } from './status.js';
|
|
7
|
-
export { changeOutput } from './change.js';
|
|
8
|
-
export { progressFields } from './progress.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/patterns/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { paginationFields, paginatedOutput } from './pagination.js';
|
|
2
|
-
export { bulkOutput } from './bulk.js';
|
|
3
|
-
export { timestampFields } from './timestamps.js';
|
|
4
|
-
export { dateRangeFields } from './date-range.js';
|
|
5
|
-
export { sortFields } from './sorting.js';
|
|
6
|
-
export { statusFields } from './status.js';
|
|
7
|
-
export { changeOutput } from './change.js';
|
|
8
|
-
export { progressFields } from './progress.js';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/patterns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pagination schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Common pagination input fields. */
|
|
6
|
-
export declare const paginationFields: () => z.ZodObject<{
|
|
7
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
8
|
-
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
-
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
/** Paginated output wrapper for a given item schema. */
|
|
12
|
-
export declare const paginatedOutput: <T>(itemSchema: z.ZodType<T>) => z.ZodObject<{
|
|
13
|
-
hasMore: z.ZodBoolean;
|
|
14
|
-
items: z.ZodArray<z.ZodType<T, unknown, z.core.$ZodTypeInternals<T, unknown>>>;
|
|
15
|
-
nextCursor: z.ZodOptional<z.ZodString>;
|
|
16
|
-
total: z.ZodNumber;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/patterns/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,eAAO,MAAM,gBAAgB;;;;iBAKzB,CAAC;AAEL,wDAAwD;AACxD,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;iBAMvD,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pagination schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Common pagination input fields. */
|
|
6
|
-
export const paginationFields = () => z.object({
|
|
7
|
-
cursor: z.string().optional(),
|
|
8
|
-
limit: z.number().optional().default(20),
|
|
9
|
-
offset: z.number().optional().default(0),
|
|
10
|
-
});
|
|
11
|
-
/** Paginated output wrapper for a given item schema. */
|
|
12
|
-
export const paginatedOutput = (itemSchema) => z.object({
|
|
13
|
-
hasMore: z.boolean(),
|
|
14
|
-
items: z.array(itemSchema),
|
|
15
|
-
nextCursor: z.string().optional(),
|
|
16
|
-
total: z.number(),
|
|
17
|
-
});
|
|
18
|
-
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/patterns/pagination.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CACzC,CAAC,CAAC;AAEL,wDAAwD;AACxD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,UAAwB,EAAE,EAAE,CAC7D,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Progress tracking fields. */
|
|
6
|
-
export declare const progressFields: () => z.ZodObject<{
|
|
7
|
-
current: z.ZodNumber;
|
|
8
|
-
percentage: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
total: z.ZodNumber;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/patterns/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,eAAO,MAAM,cAAc;;;;iBAKvB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Progress schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Progress tracking fields. */
|
|
6
|
-
export const progressFields = () => z.object({
|
|
7
|
-
current: z.number(),
|
|
8
|
-
percentage: z.number().optional(),
|
|
9
|
-
total: z.number(),
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/patterns/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CACjC,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sorting schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Sort fields constrained to a set of allowed column names. */
|
|
6
|
-
export declare const sortFields: <const T extends string>(allowedFields: [T, ...T[]]) => z.ZodObject<{
|
|
7
|
-
sortBy: z.ZodOptional<z.ZodEnum<{ [k_1 in T]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>>;
|
|
8
|
-
sortOrder: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
9
|
-
asc: "asc";
|
|
10
|
-
desc: "desc";
|
|
11
|
-
}>>>;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
//# sourceMappingURL=sorting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../src/patterns/sorting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gEAAgE;AAChE,eAAO,MAAM,UAAU,GAAI,KAAK,CAAC,CAAC,SAAS,MAAM,EAC/C,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;;;;;;iBAKxB,CAAC"}
|
package/dist/patterns/sorting.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sorting schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Sort fields constrained to a set of allowed column names. */
|
|
6
|
-
export const sortFields = (allowedFields) => z.object({
|
|
7
|
-
sortBy: z.enum(allowedFields).optional(),
|
|
8
|
-
sortOrder: z.enum(['asc', 'desc']).optional().default('asc'),
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=sorting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sorting.js","sourceRoot":"","sources":["../../src/patterns/sorting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,aAA0B,EAC1B,EAAE,CACF,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAC7D,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Standard workflow status field. */
|
|
6
|
-
export declare const statusFields: () => z.ZodObject<{
|
|
7
|
-
status: z.ZodEnum<{
|
|
8
|
-
cancelled: "cancelled";
|
|
9
|
-
pending: "pending";
|
|
10
|
-
running: "running";
|
|
11
|
-
completed: "completed";
|
|
12
|
-
failed: "failed";
|
|
13
|
-
}>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/patterns/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,eAAO,MAAM,YAAY;;;;;;;;iBAGrB,CAAC"}
|
package/dist/patterns/status.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Standard workflow status field. */
|
|
6
|
-
export const statusFields = () => z.object({
|
|
7
|
-
status: z.enum(['pending', 'running', 'completed', 'failed', 'cancelled']),
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/patterns/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAC/B,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;CAC3E,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timestamp schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Standard createdAt / updatedAt fields. */
|
|
6
|
-
export declare const timestampFields: () => z.ZodObject<{
|
|
7
|
-
createdAt: z.ZodString;
|
|
8
|
-
updatedAt: z.ZodString;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
//# sourceMappingURL=timestamps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamps.d.ts","sourceRoot":"","sources":["../../src/patterns/timestamps.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6CAA6C;AAC7C,eAAO,MAAM,eAAe;;;iBAIxB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timestamp schema helpers for @ontrails/core/patterns
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/** Standard createdAt / updatedAt fields. */
|
|
6
|
-
export const timestampFields = () => z.object({
|
|
7
|
-
createdAt: z.string(),
|
|
8
|
-
updatedAt: z.string(),
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=timestamps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamps.js","sourceRoot":"","sources":["../../src/patterns/timestamps.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6CAA6C;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,CAAC,CAAC,MAAM,CAAC;IACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/redaction/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/redaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default redaction patterns and sensitive key lists.
|
|
3
|
-
*
|
|
4
|
-
* These are used by {@link createRedactor} to strip secrets from strings
|
|
5
|
-
* and object values before they reach logs, traces, or error payloads.
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_PATTERNS: RegExp[];
|
|
8
|
-
export declare const DEFAULT_SENSITIVE_KEYS: string[];
|
|
9
|
-
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/redaction/patterns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAkBpC,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAW1C,CAAC"}
|