@docstack/client 0.0.3 → 0.0.4
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/lib/core/class.d.ts +1 -1
- package/lib/core/domain.d.ts +8 -7
- package/package.json +1 -1
package/lib/core/class.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ declare class Class extends Class_ {
|
|
|
140
140
|
getName: () => string;
|
|
141
141
|
getStack: () => ClientStack;
|
|
142
142
|
getDescription: () => string;
|
|
143
|
-
getType: () => "
|
|
143
|
+
getType: () => "~self" | "class";
|
|
144
144
|
getId: () => string;
|
|
145
145
|
/**
|
|
146
146
|
* Builds the schema object from the current attributes.
|
package/lib/core/domain.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Document, Domain as Domain_, DomainModel, Stack, DomainRelationValidation, DomainRelationParams, Class, RelationDocument } from "@docstack/shared";
|
|
2
|
+
import ClientStack from "./stack";
|
|
2
3
|
import { Logger } from "winston";
|
|
3
4
|
/**
|
|
4
5
|
* Represents a relationship definition between two Classes in the DocStack database.
|
|
@@ -31,7 +32,7 @@ import { Logger } from "winston";
|
|
|
31
32
|
*/
|
|
32
33
|
declare class Domain extends Domain_ {
|
|
33
34
|
/** Reference to the parent stack instance. */
|
|
34
|
-
stack:
|
|
35
|
+
stack: ClientStack | undefined;
|
|
35
36
|
/** The name of this domain (e.g., 'ProjectTasks'). */
|
|
36
37
|
name: string;
|
|
37
38
|
/** The domain type (typically 'domain'). */
|
|
@@ -53,12 +54,12 @@ declare class Domain extends Domain_ {
|
|
|
53
54
|
static logger: Logger;
|
|
54
55
|
logger: Logger;
|
|
55
56
|
private constructor();
|
|
56
|
-
getStack: () =>
|
|
57
|
+
getStack: () => ClientStack;
|
|
57
58
|
getName: () => string;
|
|
58
59
|
setId: (id: string) => void;
|
|
59
60
|
setModel: (model?: DomainModel) => void;
|
|
60
61
|
build: () => Promise<Domain>;
|
|
61
|
-
init: (stack:
|
|
62
|
+
init: (stack: ClientStack | null, id: string | null, name: string, type: DomainModel["~class"], relation: typeof this.relation, sourceClass: Class, targetClass: Class, description?: string) => void;
|
|
62
63
|
/**
|
|
63
64
|
* Gets a Domain instance without persisting it to the database.
|
|
64
65
|
* Use this for working with existing domain models or for testing.
|
|
@@ -75,7 +76,7 @@ declare class Domain extends Domain_ {
|
|
|
75
76
|
* @param schema - Optional schema definition
|
|
76
77
|
* @returns A new Domain instance (not persisted)
|
|
77
78
|
*/
|
|
78
|
-
static get: (stack:
|
|
79
|
+
static get: (stack: ClientStack, id: string | null, name: string, type: DomainModel["~class"], relation: "1:1" | "1:N" | "N:1" | "N:N", sourceClass: Class, targetClass: Class, description?: string, schema?: DomainModel["schema"]) => Domain;
|
|
79
80
|
/**
|
|
80
81
|
* Creates a new domain and persists it to the database.
|
|
81
82
|
* This is the primary factory method for creating new domains.
|
|
@@ -99,7 +100,7 @@ declare class Domain extends Domain_ {
|
|
|
99
100
|
* );
|
|
100
101
|
* ```
|
|
101
102
|
*/
|
|
102
|
-
static create: (stack:
|
|
103
|
+
static create: (stack: ClientStack, id: string | null, name: string, type: DomainModel["~class"], relation: "1:1" | "1:N" | "N:1" | "N:N", sourceClass: Class, targetClass: Class, description?: string, schema?: DomainModel["schema"]) => Promise<Domain>;
|
|
103
104
|
/**
|
|
104
105
|
* Builds a Domain instance from an existing DomainModel document.
|
|
105
106
|
* Fetches the source and target classes and hydrates the domain.
|
|
@@ -109,7 +110,7 @@ declare class Domain extends Domain_ {
|
|
|
109
110
|
* @returns The hydrated Domain instance
|
|
110
111
|
* @throws Error if source or target class is not found
|
|
111
112
|
*/
|
|
112
|
-
static buildFromModel: (stack:
|
|
113
|
+
static buildFromModel: (stack: ClientStack, domainModel: DomainModel) => Promise<Domain>;
|
|
113
114
|
/**
|
|
114
115
|
* Fetches a domain by its name.
|
|
115
116
|
* This is the most common way to retrieve an existing domain.
|
|
@@ -126,7 +127,7 @@ declare class Domain extends Domain_ {
|
|
|
126
127
|
* }
|
|
127
128
|
* ```
|
|
128
129
|
*/
|
|
129
|
-
static fetch: (stack:
|
|
130
|
+
static fetch: (stack: ClientStack, domainName: string) => Promise<Domain>;
|
|
130
131
|
/**
|
|
131
132
|
* Returns the current DomainModel representation of this domain.
|
|
132
133
|
* @returns The DomainModel document
|