semanticdb-v2 2.0.0-alpha.4 → 2.0.0-alpha.6
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/README.md +190 -17
- package/dist/cache/redis-query-cache.esm.js +1 -1
- package/dist/cache/redis-query-cache.js +1 -1
- package/dist/cache/types.d.ts +2 -0
- package/dist/compiler/compile-cte.d.ts +1 -1
- package/dist/errors.d.ts +2 -1
- package/dist/executor/components.d.ts +8 -3
- package/dist/executor/connection-registry.d.ts +2 -2
- package/dist/executor/execute-query.d.ts +6 -1
- package/dist/executor/federated-execution.d.ts +37 -0
- package/dist/executor/fetch-entities.d.ts +5 -1
- package/dist/executor/result-hydrator/types.d.ts +2 -0
- package/dist/executor/total.d.ts +11 -0
- package/dist/executor/types.d.ts +41 -6
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/locales/en-US.d.ts +2 -0
- package/dist/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/i18n/registry.d.ts +13 -0
- package/dist/i18n/types.d.ts +9 -0
- package/dist/index.d.ts +11 -8
- package/dist/logicform-types.d.ts +44 -12
- package/dist/normalizer/core.d.ts +5 -0
- package/dist/normalizer/default-pred-name.d.ts +2 -0
- package/dist/normalizer/index.d.ts +1 -0
- package/dist/normalizer/pred-expression.d.ts +6 -0
- package/dist/normalizer/property-resolve.d.ts +1 -0
- package/dist/operators/builtins/period-name.d.ts +2 -1
- package/dist/operators/builtins/query-expression.d.ts +3 -0
- package/dist/operators/index.d.ts +2 -1
- package/dist/operators/registry.d.ts +1 -1
- package/dist/operators/resolve.d.ts +3 -0
- package/dist/operators/types.d.ts +55 -15
- package/dist/physical/clickhouse-provider.d.ts +14 -2
- package/dist/physical/connection.d.ts +57 -15
- package/dist/physical/dameng-provider.d.ts +61 -0
- package/dist/physical/databricks-provider.d.ts +83 -0
- package/dist/physical/display-query.d.ts +3 -0
- package/dist/physical/doris-provider.d.ts +2 -1
- package/dist/physical/duckdb-coordinator-provider.d.ts +37 -0
- package/dist/physical/gbase-provider.d.ts +11 -0
- package/dist/physical/index.d.ts +21 -9
- package/dist/physical/load-driver.d.ts +1 -0
- package/dist/physical/maxcompute-provider.d.ts +37 -0
- package/dist/physical/mysql-protocol-provider.d.ts +21 -6
- package/dist/physical/mysql-provider.d.ts +2 -1
- package/dist/physical/oracle-provider.d.ts +15 -4
- package/dist/physical/postgresql-provider.d.ts +18 -4
- package/dist/physical/provider.d.ts +16 -1
- package/dist/physical/snowflake-provider.d.ts +15 -3
- package/dist/physical/sqlserver-provider.d.ts +65 -0
- package/dist/physical/starrocks-provider.d.ts +2 -1
- package/dist/planner/build-lineage.d.ts +1 -1
- package/dist/planner/create-logical-plan.d.ts +7 -0
- package/dist/planner/index.d.ts +4 -2
- package/dist/planner/mapping-granularity.d.ts +7 -0
- package/dist/planner/rewrite-nested-components.d.ts +8 -0
- package/dist/planner/select-schema-mapping.d.ts +16 -2
- package/dist/planner/semantics/index.d.ts +0 -3
- package/dist/planner/semantics/periods.d.ts +13 -0
- package/dist/planner/semantics/registry-defaults.d.ts +2 -1
- package/dist/planner/types.d.ts +80 -12
- package/dist/plugins/hierarchy/index.d.ts +1 -1
- package/dist/plugins/hierarchy/mapping-granularity.d.ts +4 -0
- package/dist/plugins/hierarchy/types.d.ts +17 -0
- package/dist/plugins/index.d.ts +10 -1
- package/dist/{planner/semantics → plugins}/observation/classification.d.ts +1 -1
- package/dist/plugins/observation/index.d.ts +17 -0
- package/dist/{planner/semantics → plugins}/observation/operator-policy.d.ts +2 -3
- package/dist/plugins/observation/periods.d.ts +18 -0
- package/dist/{planner/semantics → plugins}/observation/rule.d.ts +1 -1
- package/dist/{planner/semantics → plugins}/observation/types.d.ts +1 -1
- package/dist/plugins/property-hierarchy/index.d.ts +11 -0
- package/dist/plugins/recursive/index.d.ts +26 -0
- package/dist/plugins/temporal/index.d.ts +13 -0
- package/dist/plugins/types.d.ts +165 -1
- package/dist/plugins/validity/classification.d.ts +5 -0
- package/dist/plugins/validity/index.d.ts +15 -0
- package/dist/plugins/validity/periods.d.ts +15 -0
- package/dist/plugins/validity/query-policy.d.ts +3 -0
- package/dist/plugins/validity/rule.d.ts +2 -0
- package/dist/plugins/validity/semantic-types.d.ts +3 -0
- package/dist/schema/dependent-projection.d.ts +8 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema-mappings/freshness.d.ts +1 -1
- package/dist/schema-mappings/granularity.d.ts +5 -0
- package/dist/schema-mappings/index.d.ts +2 -1
- package/dist/schema-mappings/registry.d.ts +5 -3
- package/dist/schema-mappings/types.d.ts +43 -0
- package/dist/schema-mappings/yiask.d.ts +6 -2
- package/dist/semantic-types/index.d.ts +5 -3
- package/dist/semantic-types/registry.d.ts +2 -0
- package/dist/semantic-types/resolve-schema.d.ts +1 -1
- package/dist/semantic-types/types.d.ts +6 -13
- package/dist/semantic-types/validate-resolved-schema.d.ts +2 -5
- package/dist/semanticdb.esm.js +4 -3
- package/dist/semanticdb.js +4 -3
- package/package.json +47 -5
- package/dist/planner/semantics/lifecycle/classification.d.ts +0 -7
- package/dist/planner/semantics/lifecycle/index.d.ts +0 -3
- package/dist/planner/semantics/lifecycle/query-policy.d.ts +0 -3
- package/dist/planner/semantics/lifecycle/rule.d.ts +0 -2
- package/dist/planner/semantics/observation/index.d.ts +0 -4
- package/dist/semantic-types/builtins/end-date.d.ts +0 -2
- package/dist/semantic-types/builtins/start-date.d.ts +0 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { LogicformType } from '../logicform-types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SemanticDBPlugin } from '../plugins/index';
|
|
3
|
+
import type { SchemaMappingDefinition, SchemaMappingRegistry, SchemaMappingSelection } from '../schema-mappings/index';
|
|
3
4
|
import type { ResolvedSemanticSchema } from '../semantic-types/index';
|
|
5
|
+
import { type OperatorRegistry } from '../operators/index';
|
|
4
6
|
export interface PredMappingRewrite {
|
|
5
7
|
readonly predIndex: number;
|
|
6
8
|
readonly column: string;
|
|
@@ -9,6 +11,18 @@ export interface SelectedSchemaMapping {
|
|
|
9
11
|
readonly mapping: SchemaMappingDefinition;
|
|
10
12
|
readonly logicform: LogicformType;
|
|
11
13
|
readonly predRewrites: readonly PredMappingRewrite[];
|
|
14
|
+
readonly selection: SchemaMappingSelection;
|
|
15
|
+
}
|
|
16
|
+
export interface MappedPropertySource {
|
|
17
|
+
readonly column: string;
|
|
18
|
+
readonly sourceRef?: string;
|
|
12
19
|
}
|
|
13
20
|
export declare const mappedPropertyColumn: (mapping: SchemaMappingDefinition, schema: ResolvedSemanticSchema, reference: string) => string | undefined;
|
|
14
|
-
export declare const
|
|
21
|
+
export declare const mappedPropertySource: (mapping: SchemaMappingDefinition, schema: ResolvedSemanticSchema, reference: string) => MappedPropertySource | undefined;
|
|
22
|
+
export declare const selectSchemaMapping: (logicform: LogicformType, schema: ResolvedSemanticSchema, mappings: SchemaMappingRegistry, options?: {
|
|
23
|
+
readonly preferredConnectionId?: string;
|
|
24
|
+
readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
|
|
25
|
+
/** Extra plugins used by this execution; must also be supplied when registering plugin grains. */
|
|
26
|
+
readonly plugins?: readonly SemanticDBPlugin[];
|
|
27
|
+
readonly operators?: OperatorRegistry;
|
|
28
|
+
}) => SelectedSchemaMapping;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export * from './observation/index';
|
|
2
|
-
export * from './lifecycle/index';
|
|
3
1
|
export { PlannerSemanticRegistry } from './registry';
|
|
4
2
|
export type { PlannerSemanticResolution, PlannerSemanticQueryContext, PlannerSemanticRule, PlannerSemanticRuleContext, } from './registry';
|
|
5
|
-
export { createPlannerSemanticRegistry } from './registry-defaults';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TimeGranularity } from '../../semantic-types/index';
|
|
2
|
+
export interface Period {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly start: string;
|
|
5
|
+
readonly end: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PeriodErrorContext {
|
|
8
|
+
readonly codePrefix: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const isTimeGranularity: (value: unknown) => value is TimeGranularity;
|
|
12
|
+
/** Expand one bounded time condition into natural boundaries at the requested granularity. */
|
|
13
|
+
export declare const resolvePeriods: (condition: unknown, granularity: TimeGranularity, context: PeriodErrorContext) => readonly Period[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { PlannerSemanticRegistry } from './registry';
|
|
2
|
-
|
|
2
|
+
import type { SemanticDBPlugin } from '../../plugins/index';
|
|
3
|
+
export declare const createPlannerSemanticRegistry: (plugins?: readonly SemanticDBPlugin[]) => PlannerSemanticRegistry;
|
package/dist/planner/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CoreComputeProvider } from '../physical/index';
|
|
|
2
2
|
import type { LogicformType } from '../logicform-types';
|
|
3
3
|
import type { ResultProperty } from '../operators/index';
|
|
4
4
|
import type { ComparableCategoryDefinition, TimeGranularity } from '../semantic-types/index';
|
|
5
|
+
import type { QueryOperatorDefinition } from '../plugins/index';
|
|
5
6
|
export interface FieldReferencePlan {
|
|
6
7
|
readonly schemaId: string;
|
|
7
8
|
readonly property: string;
|
|
@@ -20,24 +21,33 @@ export interface LogicalQuerySubquery {
|
|
|
20
21
|
readonly kind: 'logicform-subquery';
|
|
21
22
|
readonly plan: LogicalPlan;
|
|
22
23
|
}
|
|
23
|
-
export interface
|
|
24
|
-
readonly kind: '
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
export interface LogicalQueryOperator {
|
|
25
|
+
readonly kind: 'query-operator';
|
|
26
|
+
readonly operator: string;
|
|
27
|
+
readonly value: unknown;
|
|
28
|
+
readonly sources?: readonly {
|
|
29
|
+
readonly schemaId: string;
|
|
30
|
+
readonly source: string;
|
|
31
|
+
readonly connectionId?: string;
|
|
32
|
+
}[];
|
|
33
|
+
/** Capability selected during planning; omitted only by manually constructed plans. */
|
|
34
|
+
readonly definition?: QueryOperatorDefinition;
|
|
32
35
|
}
|
|
33
36
|
export interface LogicalOrdinalQuery {
|
|
34
37
|
readonly kind: 'ordinal-query';
|
|
35
38
|
readonly comparable: ComparableCategoryDefinition;
|
|
36
39
|
readonly condition: unknown;
|
|
37
40
|
}
|
|
41
|
+
export interface LogicalExpressionQuery {
|
|
42
|
+
readonly kind: 'expression-query';
|
|
43
|
+
readonly expression: Expression;
|
|
44
|
+
readonly condition: unknown;
|
|
45
|
+
readonly properties: readonly string[];
|
|
46
|
+
}
|
|
38
47
|
export declare const isLogicalQuerySubquery: (value: unknown) => value is LogicalQuerySubquery;
|
|
39
|
-
export declare const
|
|
48
|
+
export declare const isLogicalQueryOperator: (value: unknown) => value is LogicalQueryOperator;
|
|
40
49
|
export declare const isLogicalOrdinalQuery: (value: unknown) => value is LogicalOrdinalQuery;
|
|
50
|
+
export declare const isLogicalExpressionQuery: (value: unknown) => value is LogicalExpressionQuery;
|
|
41
51
|
export type Expression = {
|
|
42
52
|
readonly kind: 'array-element';
|
|
43
53
|
readonly schemaId: string;
|
|
@@ -111,17 +121,45 @@ export interface JoinPlan {
|
|
|
111
121
|
readonly sourceColumn: string;
|
|
112
122
|
readonly sourceSql?: string;
|
|
113
123
|
readonly sourceTimestampColumn?: string;
|
|
114
|
-
readonly sourceTimestampGranularity?: TimeGranularity;
|
|
115
124
|
readonly targetSchemaId: string;
|
|
125
|
+
/** Physical connection selected for the target Schema mapping. */
|
|
126
|
+
readonly targetConnectionId?: string;
|
|
116
127
|
readonly targetSource: string;
|
|
117
128
|
readonly targetSourceSql?: string;
|
|
118
129
|
readonly targetAlias: string;
|
|
119
130
|
readonly targetColumn: string;
|
|
120
131
|
readonly targetSql?: string;
|
|
121
132
|
readonly targetTimestampColumn?: string;
|
|
122
|
-
readonly
|
|
133
|
+
readonly temporalCondition?: TemporalJoinConditionPlan;
|
|
123
134
|
readonly sourceArrayExpansionPath?: string;
|
|
124
135
|
}
|
|
136
|
+
export type TemporalJoinConditionPlan = {
|
|
137
|
+
readonly kind: 'date-bucket-equal';
|
|
138
|
+
readonly sourceColumn: string;
|
|
139
|
+
readonly targetColumn: string;
|
|
140
|
+
readonly sourceGranularity: TimeGranularity;
|
|
141
|
+
readonly targetGranularity: TimeGranularity;
|
|
142
|
+
} | {
|
|
143
|
+
readonly kind: 'point-in-interval';
|
|
144
|
+
readonly pointSide: 'source' | 'target';
|
|
145
|
+
readonly pointColumn: string;
|
|
146
|
+
readonly intervalSide: 'source' | 'target';
|
|
147
|
+
readonly startColumn: string;
|
|
148
|
+
readonly endColumn: string;
|
|
149
|
+
};
|
|
150
|
+
export interface EnrichmentJoinPlan {
|
|
151
|
+
readonly kind: 'enrichment-left';
|
|
152
|
+
readonly id: string;
|
|
153
|
+
readonly source: string;
|
|
154
|
+
readonly sourceSql?: string;
|
|
155
|
+
readonly alias: string;
|
|
156
|
+
readonly baseAlias: string;
|
|
157
|
+
readonly keys: readonly {
|
|
158
|
+
readonly baseColumn: string;
|
|
159
|
+
readonly targetColumn: string;
|
|
160
|
+
}[];
|
|
161
|
+
readonly temporalCondition?: TemporalJoinConditionPlan;
|
|
162
|
+
}
|
|
125
163
|
export interface ArrayExpansionPlan {
|
|
126
164
|
readonly path: string;
|
|
127
165
|
readonly sourceAlias: string;
|
|
@@ -144,6 +182,25 @@ export interface GroupLimitPlan {
|
|
|
144
182
|
readonly partitionBy: readonly string[];
|
|
145
183
|
readonly orderBy: readonly OrderPlan[];
|
|
146
184
|
}
|
|
185
|
+
export interface PeriodSourcePlan {
|
|
186
|
+
readonly alias: string;
|
|
187
|
+
readonly labelColumn: string;
|
|
188
|
+
readonly asOfColumn: string;
|
|
189
|
+
readonly sourceAlias: string;
|
|
190
|
+
readonly periods: readonly {
|
|
191
|
+
readonly label: string;
|
|
192
|
+
readonly asOf: string;
|
|
193
|
+
}[];
|
|
194
|
+
readonly match: {
|
|
195
|
+
readonly kind: 'interval';
|
|
196
|
+
readonly startColumn: string;
|
|
197
|
+
readonly endColumn: string;
|
|
198
|
+
} | {
|
|
199
|
+
readonly kind: 'latest';
|
|
200
|
+
readonly lookupAlias: string;
|
|
201
|
+
readonly timestampColumn: string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
147
204
|
export type RowIdentityPlan = {
|
|
148
205
|
readonly kind: 'group';
|
|
149
206
|
readonly names: readonly string[];
|
|
@@ -161,6 +218,8 @@ export type RowIdentityPlan = {
|
|
|
161
218
|
export interface LogicalPlan {
|
|
162
219
|
readonly schemaId: string;
|
|
163
220
|
readonly source: string;
|
|
221
|
+
/** Physical connection selected for this plan's source mapping. */
|
|
222
|
+
readonly connectionId?: string;
|
|
164
223
|
/** Trusted derived-table SQL supplied by the selected physical mapping. */
|
|
165
224
|
readonly sourceSql?: string;
|
|
166
225
|
/** Physical mapping selected by the Planner for this logical Schema. */
|
|
@@ -175,7 +234,11 @@ export interface LogicalPlan {
|
|
|
175
234
|
readonly fields: Readonly<Record<string, string>>;
|
|
176
235
|
readonly fieldReferences?: Readonly<Record<string, FieldReferencePlan>>;
|
|
177
236
|
readonly joins?: readonly JoinPlan[];
|
|
237
|
+
/** Physical extensions of this mapping, added only when a mapped property uses them. */
|
|
238
|
+
readonly enrichmentJoins?: readonly EnrichmentJoinPlan[];
|
|
178
239
|
readonly arrayExpansions?: readonly ArrayExpansionPlan[];
|
|
240
|
+
/** Generated period rows matched to a source by a plugin-selected generic strategy. */
|
|
241
|
+
readonly periodSource?: PeriodSourcePlan;
|
|
179
242
|
readonly projections: readonly ProjectionPlan[];
|
|
180
243
|
readonly columnProperties?: readonly ResultProperty[];
|
|
181
244
|
readonly groupBy: readonly ProjectionPlan[];
|
|
@@ -204,6 +267,11 @@ export interface QueryLineage {
|
|
|
204
267
|
readonly schemaName: string;
|
|
205
268
|
readonly physicalTable: string;
|
|
206
269
|
readonly provider: CoreComputeProvider['kind'];
|
|
270
|
+
readonly connectionId?: string;
|
|
271
|
+
readonly connections?: readonly {
|
|
272
|
+
readonly connectionId: string;
|
|
273
|
+
readonly provider: CoreComputeProvider['kind'];
|
|
274
|
+
}[];
|
|
207
275
|
};
|
|
208
276
|
readonly outputs: readonly LineageOutput[];
|
|
209
277
|
readonly filters: readonly LineageColumnSource[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SemanticDBPlugin } from '../types';
|
|
2
|
-
export type { HierarchyDefinition, HierarchyLevelDefinition, ResolvedHierarchyDefinition, } from './types';
|
|
2
|
+
export type { HierarchyDefinition, HierarchyLevelDefinition, ResolvedHierarchyDefinition, SchemaMappingHierarchyGranularity, } from './types';
|
|
3
3
|
export declare const hierarchyPlugin: SemanticDBPlugin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MappingGranularityPlugin } from '../types';
|
|
2
|
+
import type { SchemaMappingHierarchyGranularity } from './types';
|
|
3
|
+
export declare const isMappingHierarchyGranularity: (value: unknown) => value is SchemaMappingHierarchyGranularity;
|
|
4
|
+
export declare const hierarchyMappingGranularity: MappingGranularityPlugin;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
export interface SchemaMappingHierarchyGranularity {
|
|
2
|
+
readonly kind: 'hierarchy';
|
|
3
|
+
/** Physical level name or synonym declared by the referenced hierarchy Schema. */
|
|
4
|
+
readonly level: string;
|
|
5
|
+
}
|
|
6
|
+
declare module '../../schema-mappings/types' {
|
|
7
|
+
interface SchemaMappingGranularityExtensions {
|
|
8
|
+
readonly hierarchy: SchemaMappingHierarchyGranularity;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
1
11
|
export interface HierarchyLevelDefinition {
|
|
2
12
|
readonly name: string;
|
|
3
13
|
readonly syno?: readonly string[];
|
|
@@ -17,6 +27,13 @@ export interface ResolvedHierarchyDefinition extends Omit<HierarchyDefinition, '
|
|
|
17
27
|
readonly storage: 'compact' | 'zero-padded';
|
|
18
28
|
}
|
|
19
29
|
declare module '../../semantic-types/types' {
|
|
30
|
+
interface SemanticPropertyDraft {
|
|
31
|
+
/** Default hierarchy level for an Entity relation. */
|
|
32
|
+
readonly level?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ResolvedSemanticProperty {
|
|
35
|
+
readonly level?: string;
|
|
36
|
+
}
|
|
20
37
|
interface SemanticSchemaMetadata {
|
|
21
38
|
readonly hierarchy?: HierarchyDefinition;
|
|
22
39
|
}
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { SemanticDBPlugin } from './types';
|
|
2
|
-
|
|
2
|
+
import type { LogicformType } from '../logicform-types';
|
|
3
|
+
import type { ResolvedSemanticSchema } from '../semantic-types/index';
|
|
4
|
+
export type { LegacySchemaPluginContext, MappingGranularityContext, MappingGranularityPlugin, QueryOperatorAuthorizeContext, QueryOperatorCompileContext, QueryOperatorDefinition, QueryOperatorNormalizeContext, QueryOperatorPhysicalSource, QueryOperatorPlanContext, QueryOperatorPlanResult, PropertyMetadataPlugin, SchemaMetadataPlugin, SemanticDBPlugin, OutputHandlerContext, OutputHandlerDefinition, IntervalSemanticProperties, IntervalSemanticsDefinition, PlannerPeriodDefinition, PlannerPeriodEvaluation, RelationSemanticsDefinition, RelationTemporalPlan, TimeWatermarkLogicformContext, SchemaMappingPlugin, } from './types';
|
|
5
|
+
export type { SchemaMappingHierarchyGranularity } from './hierarchy/index';
|
|
6
|
+
export type { RecursiveQueryType } from './recursive/index';
|
|
3
7
|
/** Built-in capabilities are composed here; feature implementations live in their own folders. */
|
|
4
8
|
export declare const builtinPlugins: readonly SemanticDBPlugin[];
|
|
5
9
|
export declare const resolvePlugins: (plugins?: readonly SemanticDBPlugin[]) => readonly SemanticDBPlugin[];
|
|
10
|
+
export declare const findQueryOperator: (name: string, plugins?: readonly SemanticDBPlugin[]) => import("./types").QueryOperatorDefinition | undefined;
|
|
11
|
+
export declare const findOutputHandler: (type: string, plugins?: readonly SemanticDBPlugin[]) => import("./types").OutputHandlerDefinition | undefined;
|
|
12
|
+
export declare const resolveIntervalSemanticProperties: (schema: ResolvedSemanticSchema, plugins?: readonly SemanticDBPlugin[]) => import("./types").IntervalSemanticProperties | undefined;
|
|
13
|
+
export declare const resolveRelationTemporalPlan: (sourceSchema: ResolvedSemanticSchema, targetSchema: ResolvedSemanticSchema, plugins?: readonly SemanticDBPlugin[]) => import("./types").RelationTemporalPlan | undefined;
|
|
14
|
+
export declare const resolvePlannerPeriodEvaluation: (logicform: LogicformType, schema: ResolvedSemanticSchema, plugins?: readonly SemanticDBPlugin[]) => import("./types").PlannerPeriodEvaluation | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResolvedSemanticProperty, ResolvedSemanticSchema } from '
|
|
1
|
+
import type { ResolvedSemanticProperty, ResolvedSemanticSchema } from '../../semantic-types/index';
|
|
2
2
|
export declare const isObservationProperty: (property: ResolvedSemanticProperty | undefined, schema?: Pick<ResolvedSemanticSchema, "temporalSemantics">) => boolean;
|
|
3
3
|
export declare const observationProperties: (schema: Pick<ResolvedSemanticSchema, "properties" | "temporalSemantics">) => readonly ResolvedSemanticProperty[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SemanticDBPlugin } from '../types';
|
|
2
|
+
type SchemaTemporalSemantics = 'normal' | 'snapshot';
|
|
3
|
+
export { isObservationProperty, observationProperties } from './classification';
|
|
4
|
+
export { resolveObservationOperatorPolicy, type ObservationOperatorPolicy, } from './operator-policy';
|
|
5
|
+
export { removeObservationTimeCondition, resolveObservationPeriodSpec, } from './periods';
|
|
6
|
+
export type { ObservationPeriodMetric, ObservationPeriodSpec } from './periods';
|
|
7
|
+
export { observationSemanticRule } from './rule';
|
|
8
|
+
export type { ObservationOperator, ObservationTemporalMetadata } from './types';
|
|
9
|
+
declare module '../../semantic-types/types' {
|
|
10
|
+
interface SemanticSchemaMetadata {
|
|
11
|
+
readonly temporalSemantics?: SchemaTemporalSemantics;
|
|
12
|
+
}
|
|
13
|
+
interface ResolvedSemanticSchemaMetadata {
|
|
14
|
+
readonly temporalSemantics?: SchemaTemporalSemantics;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare const observationPlugin: SemanticDBPlugin;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { PredItemType } from '
|
|
2
|
-
import type { OperatorDefinition } from '
|
|
1
|
+
import type { PredItemType } from '../../logicform-types';
|
|
2
|
+
import type { OperatorDefinition } from '../../operators/index';
|
|
3
3
|
declare const periodBoundaryOperator = "$periodValue";
|
|
4
4
|
export interface ObservationOperatorPolicy {
|
|
5
5
|
readonly operator: typeof periodBoundaryOperator;
|
|
6
6
|
readonly boundary: 'start' | 'end';
|
|
7
7
|
readonly implicit: boolean;
|
|
8
8
|
}
|
|
9
|
-
/** Resolves the point-selection policy without changing the caller LogicForm. */
|
|
10
9
|
export declare const resolveObservationOperatorPolicy: (pred: Pick<PredItemType, "operator" | "args">, operator?: OperatorDefinition) => ObservationOperatorPolicy;
|
|
11
10
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LogicformType, PredItemType, QueryType } from '../../logicform-types';
|
|
2
|
+
import type { ResolvedSemanticProperty, ResolvedSemanticSchema } from '../../semantic-types/index';
|
|
3
|
+
export interface ObservationPeriodMetric {
|
|
4
|
+
readonly pred: PredItemType;
|
|
5
|
+
readonly effectivePred: PredItemType;
|
|
6
|
+
}
|
|
7
|
+
export interface ObservationPeriodSpec {
|
|
8
|
+
readonly group: PredItemType;
|
|
9
|
+
readonly timestamp: ResolvedSemanticProperty;
|
|
10
|
+
readonly boundary: 'start' | 'end';
|
|
11
|
+
readonly metrics: readonly ObservationPeriodMetric[];
|
|
12
|
+
readonly periods: readonly {
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly asOf: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
export declare const removeObservationTimeCondition: (query: QueryType | undefined, timestamp: ResolvedSemanticProperty) => QueryType | undefined;
|
|
18
|
+
export declare const resolveObservationPeriodSpec: (logicform: LogicformType, schema: ResolvedSemanticSchema) => ObservationPeriodSpec | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PlannerSemanticRule } from '
|
|
1
|
+
import type { PlannerSemanticRule } from '../../planner/index';
|
|
2
2
|
export declare const observationSemanticRule: PlannerSemanticRule;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ResultPropertyTemporalMetadata } from '
|
|
1
|
+
import type { ResultPropertyTemporalMetadata } from '../../operators/index';
|
|
2
2
|
export type ObservationTemporalMetadata = ResultPropertyTemporalMetadata;
|
|
3
3
|
export type ObservationOperator = '$periodValue';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PropertyHierarchyDefinition } from '../../semantic-types/index';
|
|
2
|
+
import type { SemanticDBPlugin } from '../types';
|
|
3
|
+
type PropertyHierarchyMetadata = PropertyHierarchyDefinition;
|
|
4
|
+
declare module '../../semantic-types/types' {
|
|
5
|
+
interface SemanticPropertyDraft {
|
|
6
|
+
/** Same-Schema drill relationship. `up` identifies the single-valued parent Property. */
|
|
7
|
+
readonly hierarchy?: PropertyHierarchyMetadata;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare const propertyHierarchyPlugin: SemanticDBPlugin;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SemanticDBPlugin } from '../types';
|
|
2
|
+
import type { QueryValueType } from '../../logicform-types';
|
|
3
|
+
export interface RecursiveQueryType {
|
|
4
|
+
readonly schema?: string;
|
|
5
|
+
readonly root?: QueryValueType;
|
|
6
|
+
readonly roots?: QueryValueType[];
|
|
7
|
+
readonly includeSelf?: boolean;
|
|
8
|
+
readonly idProperty?: string;
|
|
9
|
+
readonly parentProperty?: string;
|
|
10
|
+
}
|
|
11
|
+
declare module '../../logicform-types' {
|
|
12
|
+
interface QueryOperatorExtensions {
|
|
13
|
+
readonly $recursive?: QueryValueType | RecursiveQueryType;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare module '../../semantic-types/types' {
|
|
17
|
+
interface SemanticSchemaMetadata {
|
|
18
|
+
/** Property that stores a tree node's parent id. */
|
|
19
|
+
readonly parentProperty?: string;
|
|
20
|
+
}
|
|
21
|
+
interface ResolvedSemanticSchemaMetadata {
|
|
22
|
+
/** Canonical logical name of the Property that stores a tree node's parent id. */
|
|
23
|
+
readonly parentProperty?: string;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare const recursivePlugin: SemanticDBPlugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SemanticDBPlugin } from '../types';
|
|
2
|
+
declare module '../../semantic-types/types' {
|
|
3
|
+
interface SemanticPropertyDraft {
|
|
4
|
+
readonly timeWatermark?: TimeWatermarkPolicy;
|
|
5
|
+
}
|
|
6
|
+
interface SemanticSchemaMetadata {
|
|
7
|
+
readonly timeWatermark?: TimeWatermarkPolicy;
|
|
8
|
+
}
|
|
9
|
+
interface ResolvedSemanticSchemaMetadata {
|
|
10
|
+
readonly timeWatermark?: TimeWatermarkPolicy;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const temporalPlugin: SemanticDBPlugin;
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -1,20 +1,184 @@
|
|
|
1
1
|
import type { OperatorDefinition } from '../operators/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocaleDefinition } from '../i18n/types';
|
|
3
|
+
import type { PlannerSemanticRule } from '../planner/semantics/registry';
|
|
4
|
+
import type { CoreComputeProvider, DataRow } from '../physical/provider';
|
|
5
|
+
import type { LogicformType, PredItemType, QueryType } from '../logicform-types';
|
|
6
|
+
import type { SchemaMappingDefinition, SchemaMappingItem } from '../schema-mappings/types';
|
|
7
|
+
import type { ResolvedSemanticProperty, ResolvedSemanticSchema, SemanticSchemaDraft, SemanticTypeDefinition, TimeWatermarkPolicy } from '../semantic-types/types';
|
|
3
8
|
export interface SchemaMetadataPlugin {
|
|
4
9
|
readonly keys: readonly string[];
|
|
5
10
|
readonly resolve: (schema: SemanticSchemaDraft, properties: readonly ResolvedSemanticProperty[]) => Readonly<Record<string, unknown>>;
|
|
6
11
|
}
|
|
12
|
+
export interface PropertyMetadataPlugin {
|
|
13
|
+
readonly keys: readonly string[];
|
|
14
|
+
readonly resolve: (property: SemanticSchemaDraft['properties'][number], resolved: ResolvedSemanticProperty, schema: SemanticSchemaDraft) => Readonly<Record<string, unknown>>;
|
|
15
|
+
readonly resolveAll?: (properties: readonly ResolvedSemanticProperty[], drafts: readonly SemanticSchemaDraft['properties'][number][], schema: SemanticSchemaDraft) => readonly ResolvedSemanticProperty[];
|
|
16
|
+
}
|
|
7
17
|
export interface LegacySchemaPluginContext {
|
|
8
18
|
readonly source: Readonly<Record<string, unknown>>;
|
|
9
19
|
readonly properties: readonly SemanticSchemaDraft['properties'][number][];
|
|
10
20
|
}
|
|
21
|
+
export interface MappingGranularityContext {
|
|
22
|
+
readonly schema: ResolvedSemanticSchema;
|
|
23
|
+
readonly mapping: SchemaMappingDefinition;
|
|
24
|
+
readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
|
|
25
|
+
}
|
|
26
|
+
export interface MappingGranularityPlugin {
|
|
27
|
+
/** Object-grain discriminator; one plugin owns each kind. */
|
|
28
|
+
readonly kind: string;
|
|
29
|
+
readonly isGranularity: (value: unknown) => boolean;
|
|
30
|
+
readonly validateItem?: (item: SchemaMappingItem, context: MappingGranularityContext) => string | undefined;
|
|
31
|
+
/** Reject a grouped source when it cannot preserve a requested dimension or filter. */
|
|
32
|
+
readonly candidateReason?: (logicform: LogicformType, context: MappingGranularityContext) => string | undefined;
|
|
33
|
+
/** True only for a computed grouping this plugin can verify in candidateReason. */
|
|
34
|
+
readonly supportsGroupby?: (group: PredItemType) => boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface SchemaMappingPlugin {
|
|
37
|
+
readonly validate?: (mapping: SchemaMappingDefinition) => string | undefined;
|
|
38
|
+
readonly candidateReason?: (logicform: LogicformType, context: MappingGranularityContext) => string | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface QueryOperatorNormalizeContext {
|
|
41
|
+
readonly schema: ResolvedSemanticSchema;
|
|
42
|
+
readonly property: ResolvedSemanticProperty;
|
|
43
|
+
readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
|
|
44
|
+
readonly normalizeValue: (value: unknown, schema: ResolvedSemanticSchema, property: ResolvedSemanticProperty) => Promise<unknown>;
|
|
45
|
+
}
|
|
46
|
+
export interface QueryOperatorPlanContext {
|
|
47
|
+
readonly schema: ResolvedSemanticSchema;
|
|
48
|
+
readonly property: ResolvedSemanticProperty;
|
|
49
|
+
readonly connectionId: string;
|
|
50
|
+
readonly resolveSchema?: (schemaId: string) => ResolvedSemanticSchema;
|
|
51
|
+
readonly resolveMapping: (schemaId: string, preferredConnectionId?: string) => SchemaMappingDefinition;
|
|
52
|
+
}
|
|
53
|
+
export interface QueryOperatorCompileContext {
|
|
54
|
+
readonly field: string;
|
|
55
|
+
readonly provider: CoreComputeProvider;
|
|
56
|
+
readonly bind: (value: unknown) => string;
|
|
57
|
+
readonly renderSource: (source: string, sourceSql?: string) => string;
|
|
58
|
+
}
|
|
59
|
+
export interface QueryOperatorAuthorizeContext {
|
|
60
|
+
readonly schema: ResolvedSemanticSchema;
|
|
61
|
+
readonly property: ResolvedSemanticProperty;
|
|
62
|
+
readonly resolveSchema: (schemaId: string) => ResolvedSemanticSchema;
|
|
63
|
+
readonly assertSchemaAllowed: (schemaId: string) => void;
|
|
64
|
+
readonly assertPropertyAllowed: (schema: ResolvedSemanticSchema, property: ResolvedSemanticProperty) => void;
|
|
65
|
+
readonly hasRowPermissions: (schemaId: string) => boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface QueryOperatorPhysicalSource {
|
|
68
|
+
readonly schemaId: string;
|
|
69
|
+
readonly source: string;
|
|
70
|
+
readonly connectionId?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface QueryOperatorPlanResult {
|
|
73
|
+
readonly value: unknown;
|
|
74
|
+
readonly sources?: readonly QueryOperatorPhysicalSource[];
|
|
75
|
+
}
|
|
76
|
+
export interface OutputHandlerContext {
|
|
77
|
+
readonly rows: readonly DataRow[];
|
|
78
|
+
readonly logicform: LogicformType;
|
|
79
|
+
readonly schema: ResolvedSemanticSchema;
|
|
80
|
+
}
|
|
81
|
+
export interface OutputHandlerDefinition {
|
|
82
|
+
readonly type: string;
|
|
83
|
+
readonly handle: (context: OutputHandlerContext) => unknown;
|
|
84
|
+
}
|
|
85
|
+
export interface TimeWatermarkLogicformContext {
|
|
86
|
+
readonly logicform: LogicformType;
|
|
87
|
+
readonly rootSchema: ResolvedSemanticSchema;
|
|
88
|
+
readonly rootProperty: ResolvedSemanticProperty;
|
|
89
|
+
readonly requestedUpperBound: Date;
|
|
90
|
+
readonly now: Date;
|
|
91
|
+
readonly defaultPolicy?: TimeWatermarkPolicy;
|
|
92
|
+
readonly resolveSchema: (schemaId: string) => ResolvedSemanticSchema;
|
|
93
|
+
readonly inferPropertyPath: (sourceSchema: ResolvedSemanticSchema, sourceProperty: string, targetSchema: ResolvedSemanticSchema) => string | undefined;
|
|
94
|
+
}
|
|
95
|
+
/** Stable interval roles used by generic point-in-interval planning. */
|
|
96
|
+
export interface IntervalSemanticProperties {
|
|
97
|
+
readonly id: ResolvedSemanticProperty;
|
|
98
|
+
readonly timestamp: ResolvedSemanticProperty;
|
|
99
|
+
readonly start: ResolvedSemanticProperty;
|
|
100
|
+
readonly end: ResolvedSemanticProperty;
|
|
101
|
+
}
|
|
102
|
+
export interface IntervalSemanticsDefinition {
|
|
103
|
+
readonly resolve: (schema: ResolvedSemanticSchema) => IntervalSemanticProperties | undefined;
|
|
104
|
+
}
|
|
105
|
+
export type RelationTemporalPlan = {
|
|
106
|
+
readonly kind: 'date-bucket-equal';
|
|
107
|
+
readonly sourceTimestamp: ResolvedSemanticProperty;
|
|
108
|
+
readonly targetTimestamp: ResolvedSemanticProperty;
|
|
109
|
+
} | {
|
|
110
|
+
readonly kind: 'point-in-interval';
|
|
111
|
+
readonly point: ResolvedSemanticProperty;
|
|
112
|
+
readonly start: ResolvedSemanticProperty;
|
|
113
|
+
readonly end: ResolvedSemanticProperty;
|
|
114
|
+
};
|
|
115
|
+
export interface RelationSemanticsDefinition {
|
|
116
|
+
readonly plan: (context: {
|
|
117
|
+
readonly sourceSchema: ResolvedSemanticSchema;
|
|
118
|
+
readonly targetSchema: ResolvedSemanticSchema;
|
|
119
|
+
}) => RelationTemporalPlan | undefined;
|
|
120
|
+
}
|
|
121
|
+
export interface PlannerPeriodEvaluation {
|
|
122
|
+
readonly group: PredItemType;
|
|
123
|
+
readonly property: ResolvedSemanticProperty;
|
|
124
|
+
readonly periods: readonly {
|
|
125
|
+
readonly label: string;
|
|
126
|
+
readonly asOf: string;
|
|
127
|
+
}[];
|
|
128
|
+
readonly source: {
|
|
129
|
+
readonly kind: 'interval';
|
|
130
|
+
readonly start: ResolvedSemanticProperty;
|
|
131
|
+
readonly end: ResolvedSemanticProperty;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: 'latest';
|
|
134
|
+
readonly timestamp: ResolvedSemanticProperty;
|
|
135
|
+
};
|
|
136
|
+
readonly rewriteQuery?: (query: QueryType | undefined) => QueryType | undefined;
|
|
137
|
+
readonly rewritePred?: (pred: PredItemType) => PredItemType;
|
|
138
|
+
}
|
|
139
|
+
export interface PlannerPeriodDefinition {
|
|
140
|
+
readonly resolve: (logicform: LogicformType, schema: ResolvedSemanticSchema) => PlannerPeriodEvaluation | undefined;
|
|
141
|
+
}
|
|
142
|
+
/** A field-level query Operator spanning normalization, planning, and SQL compilation. */
|
|
143
|
+
export interface QueryOperatorDefinition {
|
|
144
|
+
readonly name: string;
|
|
145
|
+
/** Validate the full field condition before this exclusive Operator is normalized. */
|
|
146
|
+
readonly validateCondition?: (condition: Readonly<Record<string, unknown>>) => void;
|
|
147
|
+
readonly normalize: (value: unknown, context: QueryOperatorNormalizeContext) => unknown;
|
|
148
|
+
readonly authorize?: (value: unknown, context: QueryOperatorAuthorizeContext) => void;
|
|
149
|
+
readonly plan: (value: unknown, context: QueryOperatorPlanContext) => QueryOperatorPlanResult;
|
|
150
|
+
readonly compile: (value: unknown, context: QueryOperatorCompileContext) => string;
|
|
151
|
+
}
|
|
11
152
|
export interface SemanticDBPlugin {
|
|
12
153
|
/** Stable name used for diagnostics and duplicate detection. */
|
|
13
154
|
readonly name: string;
|
|
14
155
|
readonly schemaMetadata?: SchemaMetadataPlugin;
|
|
156
|
+
readonly propertyMetadata?: PropertyMetadataPlugin;
|
|
157
|
+
/** Prepare canonical v2 Schema metadata before Properties are resolved. */
|
|
158
|
+
readonly prepareSchema?: (schema: SemanticSchemaDraft) => SemanticSchemaDraft;
|
|
159
|
+
/** Validate invariants that require the complete resolved Schema. */
|
|
160
|
+
readonly validateResolvedSchema?: (schema: ResolvedSemanticSchema) => void;
|
|
15
161
|
/** Legacy-only Schema fields removed after normalizeLegacySchema runs. */
|
|
16
162
|
readonly legacySchemaKeys?: readonly string[];
|
|
17
163
|
readonly normalizeLegacySchema?: (context: LegacySchemaPluginContext) => Readonly<Record<string, unknown>>;
|
|
18
164
|
readonly resolveEntityFilterProperty?: (schema: ResolvedSemanticSchema) => ResolvedSemanticProperty | undefined;
|
|
19
165
|
readonly operators?: readonly OperatorDefinition[];
|
|
166
|
+
readonly semanticTypes?: readonly SemanticTypeDefinition[];
|
|
167
|
+
/** Planner-level semantic rewrites contributed by this capability. */
|
|
168
|
+
readonly plannerSemantics?: readonly PlannerSemanticRule[];
|
|
169
|
+
readonly queryOperators?: readonly QueryOperatorDefinition[];
|
|
170
|
+
/** Translations owned by this capability. Explicit execution locales override these. */
|
|
171
|
+
readonly locales?: readonly LocaleDefinition[];
|
|
172
|
+
readonly outputHandlers?: readonly OutputHandlerDefinition[];
|
|
173
|
+
/** Build the internal query used to resolve a shared temporal data watermark. */
|
|
174
|
+
readonly createTimeWatermarkLogicform?: (context: TimeWatermarkLogicformContext) => LogicformType;
|
|
175
|
+
readonly mappingGranularity?: MappingGranularityPlugin;
|
|
176
|
+
/** Extend physical mapping validation and candidate selection beyond granularity. */
|
|
177
|
+
readonly schemaMapping?: SchemaMappingPlugin;
|
|
178
|
+
/** Recognize a Schema whose rows own half-open validity intervals. */
|
|
179
|
+
readonly intervalSemantics?: IntervalSemanticsDefinition;
|
|
180
|
+
/** Add temporal conditions to a logical relation without coupling the core to a model. */
|
|
181
|
+
readonly relationSemantics?: RelationSemanticsDefinition;
|
|
182
|
+
/** Turn a bounded time group into a generic generated-period source. */
|
|
183
|
+
readonly plannerPeriod?: PlannerPeriodDefinition;
|
|
20
184
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ResolvedSemanticSchema } from '../../semantic-types/index';
|
|
2
|
+
import type { IntervalSemanticProperties } from '../types';
|
|
3
|
+
export type ValidityProperties = IntervalSemanticProperties;
|
|
4
|
+
/** Recognize a stable entity whose physical rows are valid over half-open intervals. */
|
|
5
|
+
export declare const resolveValidityProperties: (schema: ResolvedSemanticSchema) => ValidityProperties | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SemanticDBPlugin } from '../types';
|
|
2
|
+
declare module '../../operators/types' {
|
|
3
|
+
interface ResultPropertyTemporalMetadataExtensions {
|
|
4
|
+
readonly validity: {
|
|
5
|
+
readonly kind: 'validity';
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export { resolveValidityProperties } from './classification';
|
|
10
|
+
export type { ValidityProperties } from './classification';
|
|
11
|
+
export { applyValidityQuery } from './query-policy';
|
|
12
|
+
export { hasValidityTimeGroup, removeValidityTimeCondition, resolveValidityPeriodSpec, } from './periods';
|
|
13
|
+
export type { ValidityPeriod, ValidityPeriodSpec } from './periods';
|
|
14
|
+
export { validitySemanticRule } from './rule';
|
|
15
|
+
export declare const validityPlugin: SemanticDBPlugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LogicformType, PredItemType, QueryType } from '../../logicform-types';
|
|
2
|
+
import type { TimeGranularity } from '../../semantic-types/index';
|
|
3
|
+
import type { ValidityProperties } from './classification';
|
|
4
|
+
export interface ValidityPeriod {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly asOf: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ValidityPeriodSpec {
|
|
9
|
+
readonly group: PredItemType;
|
|
10
|
+
readonly granularity: TimeGranularity;
|
|
11
|
+
readonly periods: readonly ValidityPeriod[];
|
|
12
|
+
}
|
|
13
|
+
export declare const hasValidityTimeGroup: (logicform: LogicformType, properties: ValidityProperties) => boolean;
|
|
14
|
+
export declare const removeValidityTimeCondition: (query: QueryType | undefined, properties: ValidityProperties) => QueryType | undefined;
|
|
15
|
+
export declare const resolveValidityPeriodSpec: (logicform: LogicformType, properties: ValidityProperties) => ValidityPeriodSpec | undefined;
|