@dbml/parse 9.0.0-optional-ref.4 → 9.0.0-optional-ref.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.
@@ -10,7 +10,7 @@ export default class ProgramInterpreter {
10
10
  private filepath;
11
11
  private errors;
12
12
  private warnings;
13
- private hints;
13
+ private infos;
14
14
  private db;
15
15
  constructor(compiler: Compiler, symbol: ProgramSymbol, filepath: Filepath);
16
16
  interpret(): Report<SchemaElement | SchemaElement[] | undefined>;
@@ -1,3 +1,4 @@
1
+ import { TextEdit } from '../../compiler';
1
2
  import { Filepath } from './filepath';
2
3
  import { SyntaxNode } from './nodes';
3
4
  import { SyntaxToken } from './tokens';
@@ -125,7 +126,6 @@ export declare class CompileError extends Error {
125
126
  nodeOrToken: Readonly<SyntaxNode | SyntaxToken>;
126
127
  start: Readonly<number>;
127
128
  end: Readonly<number>;
128
- relatedLocations?: RelatedLocation[];
129
129
  constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken);
130
130
  toWarning(): CompileWarning;
131
131
  get filepath(): Filepath;
@@ -136,14 +136,13 @@ export declare class CompileWarning extends Error {
136
136
  nodeOrToken: Readonly<SyntaxNode | SyntaxToken>;
137
137
  start: Readonly<number>;
138
138
  end: Readonly<number>;
139
- relatedLocations?: RelatedLocation[];
140
139
  constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken);
141
140
  get filepath(): Filepath;
142
141
  }
143
142
  export interface QuickFix {
144
143
  title: string;
145
144
  filepath: Filepath;
146
- edits: import('../../compiler/queries/transform/applyTextEdits').TextEdit[];
145
+ edits: TextEdit[];
147
146
  }
148
147
  export declare class CompileInfo extends Error {
149
148
  code: Readonly<CompileErrorCode>;
@@ -152,10 +151,8 @@ export declare class CompileInfo extends Error {
152
151
  start: Readonly<number>;
153
152
  end: Readonly<number>;
154
153
  quickFixes?: QuickFix[];
155
- relatedLocations?: RelatedLocation[];
156
154
  constructor(code: number, message: string, nodeOrToken: SyntaxNode | SyntaxToken, options?: {
157
155
  quickFixes?: QuickFix[];
158
- relatedLocations?: RelatedLocation[];
159
156
  });
160
157
  get filepath(): Filepath;
161
158
  }
@@ -3,16 +3,16 @@ export default class Report<T> {
3
3
  private value;
4
4
  private errors;
5
5
  private warnings?;
6
- private hints?;
7
- static create<T>(value: T, errors?: CompileError[], warnings?: CompileWarning[], hints?: CompileInfo[]): Report<T>;
8
- constructor(value: T, errors?: CompileError[], warnings?: CompileWarning[], hints?: CompileInfo[]);
6
+ private infos?;
7
+ static create<T>(value: T, errors?: CompileError[], warnings?: CompileWarning[], infos?: CompileInfo[]): Report<T>;
8
+ constructor(value: T, errors?: CompileError[], warnings?: CompileWarning[], infos?: CompileInfo[]);
9
9
  filter<S extends symbol>(filteredValue: S): Report<undefined | Exclude<T, S>>;
10
10
  hasValue<S>(value: S): this is Report<S>;
11
11
  getFiltered<S extends symbol | undefined | null>(filteredValue: S): Exclude<T, S> | undefined;
12
12
  getValue(): T;
13
13
  getErrors(): CompileError[];
14
14
  getWarnings(): CompileWarning[];
15
- getHints(): CompileInfo[];
15
+ getInfos(): CompileInfo[];
16
16
  chainFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => Report<U>, filteredValue: S): Report<U | undefined>;
17
17
  chain<U>(fn: (_: T) => Report<U>): Report<U>;
18
18
  mapFiltered<S extends symbol | undefined | null, U>(fn: (_: Exclude<T, S>) => U, filteredValue: S): Report<U | undefined>;
@@ -149,6 +149,7 @@ export declare class ColumnSymbol extends NodeSymbol {
149
149
  get originalSymbol(): NodeSymbol;
150
150
  qualifiedName(compiler: Compiler): string;
151
151
  pk(compiler: Compiler): boolean;
152
+ isUniqueSet(compiler: Compiler): boolean;
152
153
  unique(compiler: Compiler): boolean;
153
154
  nullable(compiler: Compiler): boolean;
154
155
  isNotNullSet(compiler: Compiler): boolean | undefined;
@@ -11,7 +11,7 @@ export { CompileError, CompileErrorCode, } from './core/types/errors';
11
11
  export type { Position, } from './core/types';
12
12
  export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, } from './compiler/index';
13
13
  export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, } from './core/types/schemaJson';
14
- export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
14
+ export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
15
15
  export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
16
16
  export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
17
17
  export * from './compiler/projectLayout/layout';
@@ -1,9 +1,8 @@
1
1
  import { default as Compiler } from '../../compiler';
2
2
  import { Filepath } from '../../core/types/filepath';
3
- import { RelatedLocation } from '../../core/types/errors';
4
3
  import { MarkerData } from '../types';
5
4
  export interface Diagnostic {
6
- type: 'error' | 'warning' | 'hint';
5
+ type: 'error' | 'warning' | 'info';
7
6
  text: string;
8
7
  startRow: number;
9
8
  startColumn: number;
@@ -11,7 +10,6 @@ export interface Diagnostic {
11
10
  endColumn: number;
12
11
  code?: string | number;
13
12
  filepath: Filepath;
14
- relatedLocations?: RelatedLocation[];
15
13
  }
16
14
  export default class DBMLDiagnosticsProvider {
17
15
  private compiler;
@@ -29,9 +27,9 @@ export default class DBMLDiagnosticsProvider {
29
27
  */
30
28
  provideWarnings(filepath?: Filepath): Diagnostic[];
31
29
  /**
32
- * Get only hints from the current compilation
30
+ * Get only infos from the current compilation
33
31
  */
34
- provideHints(filepath?: Filepath): Diagnostic[];
32
+ provideInfos(filepath?: Filepath): Diagnostic[];
35
33
  /**
36
34
  * Convert Monaco markers format (for editor integration)
37
35
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@dbml/parse",
4
- "version": "9.0.0-optional-ref.4",
4
+ "version": "9.0.0-optional-ref.6",
5
5
  "description": "DBML parser v2",
6
6
  "author": "Holistics <dev@holistics.io>",
7
7
  "license": "Apache-2.0",
@@ -50,5 +50,5 @@
50
50
  "engines": {
51
51
  "node": ">=18"
52
52
  },
53
- "gitHead": "14171e298fb3503fc9c703da67d3102a7272e3ce"
53
+ "gitHead": "9d8aa4b58c6ceae262252ea590e05e3e966c10e6"
54
54
  }