@prisma-next/runtime-executor 0.3.0-pr.94.3 → 0.3.0-pr.95.2
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/async-iterable-result.d.ts +17 -0
- package/dist/async-iterable-result.d.ts.map +1 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/exports/index.d.ts +17 -0
- package/dist/exports/index.d.ts.map +1 -0
- package/dist/fingerprint.d.ts +2 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/guardrails/raw.d.ts +28 -0
- package/dist/guardrails/raw.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +746 -0
- package/dist/index.js.map +1 -0
- package/dist/marker.d.ts +13 -0
- package/dist/marker.d.ts.map +1 -0
- package/dist/plugins/budgets.d.ts +16 -0
- package/dist/plugins/budgets.d.ts.map +1 -0
- package/dist/plugins/lints.d.ts +11 -0
- package/dist/plugins/lints.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +27 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/runtime-core.d.ts +37 -0
- package/dist/runtime-core.d.ts.map +1 -0
- package/dist/runtime-spi.d.ts +14 -0
- package/dist/runtime-spi.d.ts.map +1 -0
- package/package.json +11 -16
- package/dist/index.d.mts +0 -167
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -563
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom async iterable result that extends AsyncIterable with a toArray() method.
|
|
3
|
+
* This provides a convenient way to collect all results from an async iterator.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AsyncIterableResult<Row> implements AsyncIterable<Row> {
|
|
6
|
+
private readonly generator;
|
|
7
|
+
private consumed;
|
|
8
|
+
private consumedBy;
|
|
9
|
+
constructor(generator: AsyncGenerator<Row, void, unknown>);
|
|
10
|
+
[Symbol.asyncIterator](): AsyncIterator<Row>;
|
|
11
|
+
/**
|
|
12
|
+
* Collects all values from the async iterator into an array.
|
|
13
|
+
* Once called, the iterator is consumed and cannot be reused.
|
|
14
|
+
*/
|
|
15
|
+
toArray(): Promise<Row[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=async-iterable-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async-iterable-result.d.ts","sourceRoot":"","sources":["../src/async-iterable-result.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,GAAG,CAAE,YAAW,aAAa,CAAC,GAAG,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqC;IAC/D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAqC;gBAE3C,SAAS,EAAE,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC;IAIzD,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC;IAmB5C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAsBhC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface RuntimeErrorEnvelope extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly category: 'PLAN' | 'CONTRACT' | 'LINT' | 'BUDGET' | 'RUNTIME';
|
|
4
|
+
readonly severity: 'error';
|
|
5
|
+
readonly details?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare function runtimeError(code: string, message: string, details?: Record<string, unknown>): RuntimeErrorEnvelope;
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAqB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,oBAAoB,CActB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { AsyncIterableResult } from '../async-iterable-result';
|
|
2
|
+
export type { RuntimeErrorEnvelope } from '../errors';
|
|
3
|
+
export { runtimeError } from '../errors';
|
|
4
|
+
export { computeSqlFingerprint } from '../fingerprint';
|
|
5
|
+
export type { BudgetFinding, LintFinding, RawGuardrailResult } from '../guardrails/raw';
|
|
6
|
+
export { evaluateRawGuardrails } from '../guardrails/raw';
|
|
7
|
+
export type { ContractMarkerRecord } from '../marker';
|
|
8
|
+
export { parseContractMarkerRow } from '../marker';
|
|
9
|
+
export type { BudgetsOptions } from '../plugins/budgets';
|
|
10
|
+
export { budgets } from '../plugins/budgets';
|
|
11
|
+
export type { LintsOptions } from '../plugins/lints';
|
|
12
|
+
export { lints } from '../plugins/lints';
|
|
13
|
+
export type { AfterExecuteResult, Log, Plugin, PluginContext, Severity, } from '../plugins/types';
|
|
14
|
+
export type { RuntimeCore, RuntimeCoreOptions, RuntimeTelemetryEvent, RuntimeVerifyOptions, TelemetryOutcome, } from '../runtime-core';
|
|
15
|
+
export { createRuntimeCore } from '../runtime-core';
|
|
16
|
+
export type { MarkerReader, MarkerStatement, RuntimeFamilyAdapter } from '../runtime-spi';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EACV,kBAAkB,EAClB,GAAG,EACH,MAAM,EACN,aAAa,EACb,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../src/fingerprint.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExecutionPlan } from '@prisma-next/contract/types';
|
|
2
|
+
export type LintSeverity = 'error' | 'warn';
|
|
3
|
+
export type BudgetSeverity = 'error' | 'warn';
|
|
4
|
+
export interface LintFinding {
|
|
5
|
+
readonly code: `LINT.${string}`;
|
|
6
|
+
readonly severity: LintSeverity;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly details?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface BudgetFinding {
|
|
11
|
+
readonly code: `BUDGET.${string}`;
|
|
12
|
+
readonly severity: BudgetSeverity;
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly details?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface RawGuardrailConfig {
|
|
17
|
+
readonly budgets?: {
|
|
18
|
+
readonly unboundedSelectSeverity?: BudgetSeverity;
|
|
19
|
+
readonly estimatedRows?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface RawGuardrailResult {
|
|
23
|
+
readonly lints: LintFinding[];
|
|
24
|
+
readonly budgets: BudgetFinding[];
|
|
25
|
+
readonly statement: 'select' | 'mutation' | 'other';
|
|
26
|
+
}
|
|
27
|
+
export declare function evaluateRawGuardrails(plan: ExecutionPlan, config?: RawGuardrailConfig): RawGuardrailResult;
|
|
28
|
+
//# sourceMappingURL=raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/guardrails/raw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,6BAA6B,CAAC;AAErF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,MAAM,EAAE,C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