@docstack/client 0.0.1 → 0.0.2
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/attribute.d.ts +4 -4
- package/lib/core/class.d.ts +3 -3
- package/lib/core/crypto-engine/index.d.ts +5 -5
- package/lib/core/query-engine/executor.d.ts +1 -1
- package/lib/core/query-engine/index.d.ts +3 -3
- package/lib/core/stack.d.ts +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -8237
- package/lib/index.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +11 -3
- package/webpack.config.js +62 -0
- package/lib/core/attribute.js +0 -296
- package/lib/core/attribute.js.map +0 -1
- package/lib/core/class.js +0 -540
- package/lib/core/class.js.map +0 -1
- package/lib/core/crypto-engine/index.js +0 -130
- package/lib/core/crypto-engine/index.js.map +0 -1
- package/lib/core/crypto-engine/utils.js +0 -76
- package/lib/core/crypto-engine/utils.js.map +0 -1
- package/lib/core/datamodel/index.js +0 -1186
- package/lib/core/datamodel/index.js.map +0 -1
- package/lib/core/domain.js +0 -285
- package/lib/core/domain.js.map +0 -1
- package/lib/core/index.js +0 -379
- package/lib/core/index.js.map +0 -1
- package/lib/core/job-engine/index.js +0 -116
- package/lib/core/job-engine/index.js.map +0 -1
- package/lib/core/policy-engine/index.js +0 -150
- package/lib/core/policy-engine/index.js.map +0 -1
- package/lib/core/query-engine/accumulators.js +0 -258
- package/lib/core/query-engine/accumulators.js.map +0 -1
- package/lib/core/query-engine/evaluator.js +0 -179
- package/lib/core/query-engine/evaluator.js.map +0 -1
- package/lib/core/query-engine/executor.js +0 -405
- package/lib/core/query-engine/executor.js.map +0 -1
- package/lib/core/query-engine/index.js +0 -4
- package/lib/core/query-engine/index.js.map +0 -1
- package/lib/core/query-engine/parser.js +0 -515
- package/lib/core/query-engine/parser.js.map +0 -1
- package/lib/core/query-engine/planner.js +0 -330
- package/lib/core/query-engine/planner.js.map +0 -1
- package/lib/core/stack.js +0 -1507
- package/lib/core/stack.js.map +0 -1
- package/lib/core/test-utils/docstack.js +0 -222
- package/lib/core/test-utils/docstack.js.map +0 -1
- package/lib/core/trigger/index.js +0 -81
- package/lib/core/trigger/index.js.map +0 -1
- package/lib/plugins/pouchdb.js +0 -403
- package/lib/plugins/pouchdb.js.map +0 -1
- package/lib/utils/crypto/index.js +0 -34
- package/lib/utils/crypto/index.js.map +0 -1
- package/lib/utils/index.js +0 -58
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/logger/index.js +0 -20
- package/lib/utils/logger/index.js.map +0 -1
- package/lib/utils/logger/transport.js +0 -28
- package/lib/utils/logger/transport.js.map +0 -1
- package/lib/workers/dataModel.js +0 -48
- package/lib/workers/dataModel.js.map +0 -1
package/lib/core/attribute.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SafeParseReturnType } from "zod";
|
|
2
2
|
import Class from "./class.js";
|
|
3
3
|
import { Attribute as Attribute_, AttributeModel, AttributeType, AttributeTypeConfig } from "@docstack/shared";
|
|
4
4
|
/**
|
|
@@ -35,7 +35,7 @@ declare class Attribute extends Attribute_ {
|
|
|
35
35
|
/** The underlying AttributeModel containing type and configuration. */
|
|
36
36
|
model: AttributeModel;
|
|
37
37
|
/** Zod schema for runtime validation of this field. */
|
|
38
|
-
field:
|
|
38
|
+
field: any;
|
|
39
39
|
/** Reference to the parent Class that owns this attribute. */
|
|
40
40
|
class: Class | null;
|
|
41
41
|
/** Default value to use when the field is not provided. */
|
|
@@ -120,7 +120,7 @@ declare class Attribute extends Attribute_ {
|
|
|
120
120
|
* }
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
validate: (data: any) => Promise<
|
|
123
|
+
validate: (data: any) => Promise<SafeParseReturnType<any, any>>;
|
|
124
124
|
/**
|
|
125
125
|
* Adds an attribute to its parent class and persists to the database.
|
|
126
126
|
* Used internally by {@link Attribute.create}.
|
|
@@ -138,7 +138,7 @@ declare class Attribute extends Attribute_ {
|
|
|
138
138
|
* @returns Object with attribute name as key and default/null value
|
|
139
139
|
*/
|
|
140
140
|
getEmpty: () => {
|
|
141
|
-
[x: string]:
|
|
141
|
+
[x: string]: any;
|
|
142
142
|
};
|
|
143
143
|
/**
|
|
144
144
|
* Returns the attribute name.
|
package/lib/core/class.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Class as Class_, TriggerModel } from "@docstack/shared";
|
|
2
2
|
import { Stack, ClassModel, AttributeModel, Document } from "@docstack/shared";
|
|
3
|
-
import Attribute from "./attribute
|
|
3
|
+
import Attribute from "./attribute";
|
|
4
4
|
import { Logger } from 'winston';
|
|
5
|
-
import { Trigger } from "./trigger/index
|
|
5
|
+
import { Trigger } from "./trigger/index";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Represents a data class (schema definition) in the DocStack database.
|
|
@@ -44,7 +44,7 @@ declare class Class extends Class_ {
|
|
|
44
44
|
/** The raw schema definition from the ClassModel. */
|
|
45
45
|
schema: ClassModel["schema"];
|
|
46
46
|
/** Zod schema for runtime validation of document data. */
|
|
47
|
-
schemaZOD: z.ZodObject
|
|
47
|
+
schemaZOD: z.ZodObject<any, any, any>;
|
|
48
48
|
/** The unique identifier for this class (e.g., 'Task', 'Class-123'). */
|
|
49
49
|
id?: string;
|
|
50
50
|
/** The underlying ClassModel document. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Document } from "@docstack/shared";
|
|
2
|
-
import Class from "../class
|
|
3
|
-
import type ClientStack from "../stack
|
|
4
|
-
import { EncryptedPayload } from "./utils
|
|
2
|
+
import Class from "../class";
|
|
3
|
+
import type ClientStack from "../stack";
|
|
4
|
+
import { EncryptedPayload } from "./utils";
|
|
5
5
|
/**
|
|
6
6
|
* Engine for handling document-level encryption and decryption.
|
|
7
7
|
*
|
|
@@ -117,5 +117,5 @@ export declare class CryptoEngine {
|
|
|
117
117
|
*/
|
|
118
118
|
decryptDocument(document: Document, classObj?: Class, encryptedKeys?: string[]): Promise<void>;
|
|
119
119
|
}
|
|
120
|
-
export type { EncryptedPayload } from "./utils
|
|
121
|
-
export { wrapDocumentKey, unwrapDocumentKey } from "./utils
|
|
120
|
+
export type { EncryptedPayload } from "./utils";
|
|
121
|
+
export { wrapDocumentKey, unwrapDocumentKey } from "./utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { parse } from "./parser
|
|
1
|
+
export { parse } from "./parser";
|
|
2
2
|
export type { SelectAST, UnionAST } from "@docstack/shared";
|
|
3
|
-
export { createPlan } from "./planner
|
|
4
|
-
export { executePlan } from "./executor
|
|
3
|
+
export { createPlan } from "./planner";
|
|
4
|
+
export { executePlan } from "./executor";
|
package/lib/core/stack.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Class from "./class
|
|
2
|
-
import Domain from "./domain
|
|
1
|
+
import Class from "./class";
|
|
2
|
+
import Domain from "./domain";
|
|
3
3
|
import { Stack, StackOptions, AuthSessionProof, ClientCredentials, CachedClass, ClassModelPropagationStart, ClassModelPropagationComplete, CachedDomain, DomainModel } from "@docstack/shared";
|
|
4
4
|
import { SystemDoc, Patch, ClassModel, Document, RelationDocument } from "@docstack/shared";
|
|
5
|
-
import type { SelectAST, UnionAST } from "./query-engine
|
|
6
|
-
import { JobEngine } from "./job-engine
|
|
7
|
-
import { PolicyEngine } from "./policy-engine
|
|
8
|
-
import { CryptoEngine } from "./crypto-engine
|
|
5
|
+
import type { SelectAST, UnionAST } from "./query-engine";
|
|
6
|
+
import { JobEngine } from "./job-engine";
|
|
7
|
+
import { PolicyEngine } from "./policy-engine";
|
|
8
|
+
import { CryptoEngine } from "./crypto-engine";
|
|
9
9
|
export declare const BASE_SCHEMA: ClassModel["schema"];
|
|
10
10
|
export declare const CLASS_SCHEMA: ClassModel["schema"];
|
|
11
11
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DocStack } from "./core/";
|
|
2
|
-
export { ClientStack, Class, Domain, Attribute, Trigger, DocStack } from "./core/
|
|
2
|
+
export { ClientStack, Class, Domain, Attribute, Trigger, DocStack } from "./core/";
|
|
3
3
|
export type { AttributeType, DocstackReady, StackConfig, StackOptions } from "@docstack/shared";
|
|
4
4
|
export default DocStack;
|