@arcote.tech/arc 0.1.8 → 0.1.9
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/dist/context/context.d.ts +1 -0
- package/dist/context/element.d.ts +21 -1
- package/dist/context/event.d.ts +2 -1
- package/dist/context/query-builders.d.ts +1 -0
- package/dist/data-storage/data-storage-master.d.ts +2 -0
- package/dist/database/database-mappers.d.ts +39 -0
- package/dist/database/database-store.d.ts +58 -0
- package/dist/database/index.d.ts +3 -0
- package/dist/database/schema-extraction.d.ts +12 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/interface.d.ts +1 -0
- package/dist/db/postgresAdapter.d.ts +90 -0
- package/dist/db/sqliteAdapter.d.ts +47 -3
- package/dist/elements/abstract.d.ts +28 -0
- package/dist/elements/any.d.ts +2 -0
- package/dist/elements/array.d.ts +3 -0
- package/dist/elements/blob.d.ts +2 -0
- package/dist/elements/boolean.d.ts +3 -0
- package/dist/elements/branded.d.ts +2 -0
- package/dist/elements/date.d.ts +3 -0
- package/dist/elements/default.d.ts +2 -0
- package/dist/elements/file.d.ts +2 -0
- package/dist/elements/number.d.ts +3 -0
- package/dist/elements/object.d.ts +5 -0
- package/dist/elements/optional.d.ts +2 -0
- package/dist/elements/or.d.ts +2 -0
- package/dist/elements/record.d.ts +2 -0
- package/dist/elements/string-enum.d.ts +2 -0
- package/dist/elements/string.d.ts +3 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1571 -657
- package/dist/telemetry/context.d.ts +65 -0
- package/dist/telemetry/index.d.ts +47 -0
- package/dist/telemetry/interfaces.d.ts +84 -0
- package/dist/telemetry/logger.d.ts +67 -0
- package/dist/telemetry/no-op.d.ts +54 -0
- package/dist/telemetry/tracer.d.ts +85 -0
- package/dist/utils.d.ts +0 -19
- package/dist/view/view.d.ts +5 -3
- package/package.json +1 -1
- package/dist/collection/collection.d.ts +0 -81
- package/dist/collection/index.d.ts +0 -4
- package/dist/collection/queries/abstract-collection-query.d.ts +0 -14
- package/dist/collection/queries/find.d.ts +0 -29
- package/dist/collection/queries/one-item.d.ts +0 -2
- package/dist/collection/queries/util.d.ts +0 -3
- package/dist/collection/query-builders/find-by-id.d.ts +0 -2
- package/dist/collection/query-builders/find-one.d.ts +0 -2
- package/dist/collection/query-builders/find.d.ts +0 -13
- package/dist/context/simple-query.d.ts +0 -33
- package/dist/data-storage/data-storage-builder.d.ts +0 -16
- package/dist/data-storage/query-processor.d.ts +0 -22
- package/dist/data-storage/store-state-authorized.d.ts +0 -26
- package/dist/utils/arcObjectToStoreSchema.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -2
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { DataStorage } from "../data-storage";
|
|
2
|
-
import type { FindOptions } from "../data-storage/types";
|
|
3
|
-
export type QueryFunction<T> = (dataStorage: DataStorage) => (options: FindOptions<T>) => Promise<T[]>;
|
|
4
|
-
export type QueryFunctionOne<T> = (dataStorage: DataStorage) => (options: FindOptions<T>) => Promise<T | undefined>;
|
|
5
|
-
export type SimpleQueryListener<Result> = (result: Result) => void;
|
|
6
|
-
export declare class SimpleQueryResult<T> {
|
|
7
|
-
private data;
|
|
8
|
-
constructor(data: T);
|
|
9
|
-
get(): T;
|
|
10
|
-
exists(): boolean;
|
|
11
|
-
toArray(): (T & any[]) | never[];
|
|
12
|
-
map<U>(callbackfn: (value: any, index: number, array: any[]) => U): U[];
|
|
13
|
-
}
|
|
14
|
-
export declare class SimpleQuery<T> {
|
|
15
|
-
private queryFn;
|
|
16
|
-
private options;
|
|
17
|
-
private storeName;
|
|
18
|
-
private listeners;
|
|
19
|
-
private lastResult;
|
|
20
|
-
private resultIds;
|
|
21
|
-
constructor(queryFn: QueryFunction<T> | QueryFunctionOne<T>, options: FindOptions<T>, storeName: string);
|
|
22
|
-
run(dataStorage: DataStorage): Promise<SimpleQueryResult<T>>;
|
|
23
|
-
private updateResultIds;
|
|
24
|
-
getResultIds(): Set<string>;
|
|
25
|
-
getOptions(): FindOptions<T>;
|
|
26
|
-
getStoreName(): string;
|
|
27
|
-
subscribe(listener: SimpleQueryListener<SimpleQueryResult<T>>): void;
|
|
28
|
-
unsubscribe(listener: SimpleQueryListener<SimpleQueryResult<T>>): void;
|
|
29
|
-
updateResult(newResult: SimpleQueryResult<T>): void;
|
|
30
|
-
getLastResult(): SimpleQueryResult<T>;
|
|
31
|
-
getCacheKey(): string;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=simple-query.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ArcContextAny } from "../context";
|
|
2
|
-
import type { AuthContext } from "../context/element";
|
|
3
|
-
import type { DatabaseAdapter } from "../db";
|
|
4
|
-
import type { RealTimeCommunicationAdapterFactory } from "../rtc/rtc";
|
|
5
|
-
import type { DataStorage } from "./data-storage.abstract";
|
|
6
|
-
export declare class DataStorageBuilder {
|
|
7
|
-
private dbAdapter;
|
|
8
|
-
private rtcAdapterFactory;
|
|
9
|
-
private arcContext;
|
|
10
|
-
constructor(dbAdapter: Promise<DatabaseAdapter> | DatabaseAdapter, rtcAdapterFactory: RealTimeCommunicationAdapterFactory, arcContext: ArcContextAny);
|
|
11
|
-
/**
|
|
12
|
-
* Create a DataStorage instance
|
|
13
|
-
*/
|
|
14
|
-
build(authContext: AuthContext): DataStorage;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=data-storage-builder.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SimpleQuery } from "../context/simple-query";
|
|
2
|
-
import type { ListenerEvent } from "./data-storage.abstract";
|
|
3
|
-
import type { FindOptions } from "./types";
|
|
4
|
-
export type QueryRerunCallback = <T>(query: SimpleQuery<T>) => Promise<void>;
|
|
5
|
-
export declare class QueryProcessor {
|
|
6
|
-
private activeQueries;
|
|
7
|
-
private rerunCallback?;
|
|
8
|
-
setRerunCallback(callback: QueryRerunCallback): void;
|
|
9
|
-
registerQuery<T>(query: SimpleQuery<T>): void;
|
|
10
|
-
unregisterQuery<T>(query: SimpleQuery<T>): void;
|
|
11
|
-
processStoreChange<T extends {
|
|
12
|
-
_id: string;
|
|
13
|
-
}>(storeName: string, event: ListenerEvent<T>): void;
|
|
14
|
-
private processQueryChange;
|
|
15
|
-
private rerunQuery;
|
|
16
|
-
/**
|
|
17
|
-
* Check if an item matches the query conditions
|
|
18
|
-
* This is the filtering logic moved from find.ts and find-one.ts
|
|
19
|
-
*/
|
|
20
|
-
checkItemMatchesQuery<T>(item: T, options: FindOptions<T>): boolean;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=query-processor.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ArcContextAny } from "../context";
|
|
2
|
-
import type { AuthContext } from "../context/element";
|
|
3
|
-
import type { DataStorage, QueryListenerCallback, StoreStateChange } from "./data-storage.abstract";
|
|
4
|
-
import { StoreState } from "./store-state.abstract";
|
|
5
|
-
import type { FindOptions } from "./types";
|
|
6
|
-
export declare class AuthorizedStoreState<Item extends {
|
|
7
|
-
_id: string;
|
|
8
|
-
}> extends StoreState<Item> {
|
|
9
|
-
private arcContext;
|
|
10
|
-
private authContext;
|
|
11
|
-
constructor(storeName: string, dataStorage: DataStorage, arcContext: ArcContextAny, authContext: AuthContext, deserialize?: (data: any) => Item);
|
|
12
|
-
private getElementRestrictions;
|
|
13
|
-
private checkOperationPermission;
|
|
14
|
-
private applyAuthorizationFilter;
|
|
15
|
-
find(options: FindOptions<Item>, listener?: QueryListenerCallback<Item>): Promise<Item[]>;
|
|
16
|
-
applyChange(change: StoreStateChange<Item>): Promise<{
|
|
17
|
-
from: Item | null;
|
|
18
|
-
to: Item | null;
|
|
19
|
-
}>;
|
|
20
|
-
applyChanges(changes: StoreStateChange<Item>[]): Promise<void>;
|
|
21
|
-
applySerializedChanges(changes: StoreStateChange<Item>[]): Promise<{
|
|
22
|
-
from: Item | null;
|
|
23
|
-
to: Item | null;
|
|
24
|
-
}[]>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=store-state-authorized.d.ts.map
|
package/dist/utils/index.d.ts
DELETED