@intersystems-community/ascot 0.2.0 → 0.3.0

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.
@@ -29,6 +29,22 @@ export interface PropertyInfo {
29
29
  collection?: CollectionKind,
30
30
  multidimensional: boolean,
31
31
  }
32
+ /**
33
+ * # Variants
34
+ *
35
+ * ## `"one"`
36
+ *
37
+ * ## `"many"`
38
+ *
39
+ * ## `"parent"`
40
+ *
41
+ * ## `"children"`
42
+ */
43
+ export type Cardinality = 'one' | 'many' | 'parent' | 'children';
44
+ export interface RelationshipInfo {
45
+ t?: string,
46
+ cardinality?: Cardinality,
47
+ }
32
48
  /**
33
49
  * # Variants
34
50
  *
@@ -74,7 +90,7 @@ export interface MemberKindProperty {
74
90
  }
75
91
  export interface MemberKindRelationship {
76
92
  tag: 'relationship',
77
- val: string | undefined,
93
+ val: RelationshipInfo,
78
94
  }
79
95
  export interface MemberKindForeignKey {
80
96
  tag: 'foreign-key',
@@ -1,6 +1,7 @@
1
1
  /** @module Interface iris:ascot/imported **/
2
2
  export type RoutineSource = import('./iris-ascot-common.js').RoutineSource;
3
3
  export type ClassInfo = import('./iris-ascot-common.js').ClassInfo;
4
+ export type Option<T> = { tag: 'none' } | { tag: 'some', val: T };
4
5
 
5
6
  export class IrisConnection {
6
7
  /**
@@ -9,5 +10,5 @@ export class IrisConnection {
9
10
  private constructor();
10
11
  getCls(cls: string): Promise<ClassInfo | undefined>;
11
12
  getInc(name: string): Promise<RoutineSource | undefined>;
12
- getIntOrMac(name: string): Promise<RoutineSource | undefined>;
13
+ getIntOrMac(name: string): Promise<Option<RoutineSource | undefined>>;
13
14
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intersystems-community/ascot",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "ascot, a type checker and code intelligence engine for InterSystems ObjectScript, for Node and other JS consumers.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "keywords": [
@@ -28,11 +28,14 @@
28
28
  "node": ">=24"
29
29
  },
30
30
  "scripts": {
31
- "build": "bash scripts/build.sh"
31
+ "build": "bash scripts/build.sh",
32
+ "format": "prettier --write .",
33
+ "format:check": "prettier --check ."
32
34
  },
33
35
  "devDependencies": {
34
36
  "@bytecodealliance/jco": "^1.37.0",
35
37
  "@types/node": "^26.6.5",
38
+ "prettier": "3.9.10",
36
39
  "typescript": "^7.0.2"
37
40
  }
38
41
  }