@gorules/zen-engine 1.0.0-beta.10 → 1.0.0-beta.11

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 (2) hide show
  1. package/index.d.ts +46 -0
  2. package/package.json +10 -10
package/index.d.ts CHANGED
@@ -310,6 +310,51 @@ export interface PolicyReferenceSite {
310
310
  kind: PolicyReferenceKind;
311
311
  }
312
312
 
313
+ /** What kind of content a `PolicySearchHit` matched. */
314
+ export type PolicySearchHitKind =
315
+ | 'document'
316
+ | 'heading'
317
+ | 'paragraph'
318
+ | 'listItem'
319
+ | 'codeBlock'
320
+ | 'expression'
321
+ | 'expressionKey'
322
+ | 'tableColumn'
323
+ | 'tableCell'
324
+ | 'matchKey'
325
+ | 'matchCondition'
326
+ | 'matchValue'
327
+ | 'assertionOutput'
328
+ | 'assertionCondition'
329
+ | 'dataModel'
330
+ | 'dataModelProperty'
331
+ | 'dictionary'
332
+ | 'dictionaryEntry'
333
+ | 'graphNode'
334
+ | 'switchCondition'
335
+ | 'function';
336
+
337
+ /**
338
+ * One ranked fuzzy-search hit returned by `search()`. Location fields are
339
+ * populated per kind: policy hits carry `blockId` (plus `expressionId`,
340
+ * `row`/`column` for table cells), graph hits carry `nodeId`. `span` is a
341
+ * character range within `text` (which may be a snippet of long sources).
342
+ */
343
+ export interface PolicySearchHit {
344
+ path: string;
345
+ blockId?: string;
346
+ nodeId?: string;
347
+ expressionId?: string;
348
+ row?: number;
349
+ column?: string;
350
+ kind: PolicySearchHitKind;
351
+ text: string;
352
+ /** Human context for the hit, e.g. column name, entity, or node name. */
353
+ context?: string;
354
+ span: PolicySpan;
355
+ score: number;
356
+ }
357
+
313
358
  /**
314
359
  * One node in the transitive dependency tree returned by `dependencies()`.
315
360
  * Each node names a property; `writtenBy` is the block that produces it
@@ -418,6 +463,7 @@ export declare class Workspace {
418
463
  prepareRename(cursor: PolicyExpressionCursor): PolicyPrepareRenameResult | null
419
464
  rename(req: PolicyRenameRequest): PolicyEngineEdit[]
420
465
  references(target: any): PolicyReferenceSite[]
466
+ search(query: string, limit?: number | undefined | null): PolicySearchHit[]
421
467
  inputSkeleton(req: PolicyScopeRequest): unknown
422
468
  dependencies(target: string, document?: string | undefined | null): PolicyDependencyNode
423
469
  evaluate(req: PolicyEvaluateRequest): PolicyEvaluationResult
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gorules/zen-engine",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "main": "index.js",
5
5
  "browser": "browser.js",
6
6
  "types": "./index.d.ts",
@@ -101,15 +101,15 @@
101
101
  "resolutions": {
102
102
  "form-data@^4.0.0": "4.0.4"
103
103
  },
104
- "gitHead": "ad97b340b3cb9fb1731d4652c12cbe9ea3fa2ec0",
104
+ "gitHead": "e17a808baee7140cba9b6e0689e55dded7ee1133",
105
105
  "optionalDependencies": {
106
- "@gorules/zen-engine-darwin-x64": "1.0.0-beta.10",
107
- "@gorules/zen-engine-linux-x64-gnu": "1.0.0-beta.10",
108
- "@gorules/zen-engine-linux-x64-musl": "1.0.0-beta.10",
109
- "@gorules/zen-engine-win32-x64-msvc": "1.0.0-beta.10",
110
- "@gorules/zen-engine-linux-arm64-gnu": "1.0.0-beta.10",
111
- "@gorules/zen-engine-linux-arm64-musl": "1.0.0-beta.10",
112
- "@gorules/zen-engine-darwin-arm64": "1.0.0-beta.10",
113
- "@gorules/zen-engine-wasm32-wasi": "1.0.0-beta.10"
106
+ "@gorules/zen-engine-darwin-x64": "1.0.0-beta.11",
107
+ "@gorules/zen-engine-linux-x64-gnu": "1.0.0-beta.11",
108
+ "@gorules/zen-engine-linux-x64-musl": "1.0.0-beta.11",
109
+ "@gorules/zen-engine-win32-x64-msvc": "1.0.0-beta.11",
110
+ "@gorules/zen-engine-linux-arm64-gnu": "1.0.0-beta.11",
111
+ "@gorules/zen-engine-linux-arm64-musl": "1.0.0-beta.11",
112
+ "@gorules/zen-engine-darwin-arm64": "1.0.0-beta.11",
113
+ "@gorules/zen-engine-wasm32-wasi": "1.0.0-beta.11"
114
114
  }
115
115
  }