@fadhilp/stateql 0.9.0 → 0.10.1
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/README.md +149 -5
- package/dist/src/adapters.d.ts +7 -2
- package/dist/src/adapters.js +167 -0
- package/dist/src/cli.js +66 -3
- package/dist/src/connection.d.ts +1 -0
- package/dist/src/connection.js +18 -2
- package/dist/src/index.d.ts +2 -1
- package/dist/src/migrations.js +44 -0
- package/dist/src/mongodb.d.ts +4 -2
- package/dist/src/mongodb.js +53 -2
- package/dist/src/redis.d.ts +44 -0
- package/dist/src/redis.js +395 -0
- package/dist/src/sqlite-process.js +41 -0
- package/dist/src/stateql.d.ts +18 -4
- package/dist/src/stateql.js +650 -62
- package/dist/src/store.d.ts +25 -2
- package/dist/src/store.js +116 -12
- package/dist/src/table-editor.d.ts +5 -0
- package/dist/src/table-editor.js +22 -0
- package/dist/src/types.d.ts +80 -3
- package/package.json +4 -2
package/dist/src/stateql.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TableChange } from "./table-editor.js";
|
|
2
|
-
import type { ActorLinkData, ActorResolutionData, ActorsData, ActorUnlinkData, AliasData, ApplyData, BatchCommand, CommandExecutionContext, CommandOrigin, BatchOptions, CapabilitiesData, CloseSessionData, ColumnsData, CommitTransactionData, ConnectOptions, ConnectionData, CountData, DisconnectData, DoctorData, ExecData, ExecOptions, ExecutionOptions, ExportData, FilterOptions, HistoryData, HistoryOptions, OperationData, PlanData, PlanOptions, ProfileData, ProfilesData, ProfileOptions, MongoExecOptions, MongoPlanOptions, MongoQueryOptions, MongoReadCommand, MongoWriteCommand, PurgeData, QueryOptions, RemovedProfileData, Response, ResultData, RollbackTransactionData, RowsData, RowsOptions, Column, StateQLActorOptions, StateQLOptions, StateQLSnapshot, StatusData, SessionData, SessionsData, SessionSummaryData, TransactionData } from "./types.js";
|
|
2
|
+
import type { ActorLinkData, ActorResolutionData, ActorsData, ActorUnlinkData, AliasData, ApplyData, BatchCommand, CommandExecutionContext, CommandOrigin, BatchOptions, CapabilitiesData, CatalogObject, DescribeObjectData, ListObjectsData, ListObjectsFilter, CloseSessionData, ColumnsData, CommitTransactionData, ConnectOptions, ConnectionData, CountData, DisconnectData, DoctorData, ExecData, ExecOptions, ExecutionOptions, ExportData, FilterOptions, HistoryData, HistoryOptions, OperationData, PlanData, PlanOptions, ProfileData, ProfilesData, ProfileOptions, ProfileUpdateOptions, MongoExecOptions, MongoPlanOptions, MongoQueryOptions, MongoReadCommand, MongoWriteCommand, RedisCommand, RedisExecOptions, RedisPlanOptions, RedisQueryOptions, PurgeData, QueryOptions, RemovedProfileData, Response, ResultData, RollbackTransactionData, RowsData, RowsOptions, Column, StateQLActorOptions, StateQLOptions, StateQLSnapshot, StateQLSnapshotOptions, StatusData, SessionData, SessionsData, SessionSummaryData, TransactionData } from "./types.js";
|
|
3
3
|
export declare class StateQL {
|
|
4
4
|
static forActor(options: StateQLActorOptions): StateQL;
|
|
5
5
|
private readonly store;
|
|
@@ -26,13 +26,12 @@ export declare class StateQL {
|
|
|
26
26
|
[Symbol.dispose](): void;
|
|
27
27
|
connect(target?: string, options?: ConnectOptions): Promise<Response<ConnectionData>>;
|
|
28
28
|
addProfile(name: string, target?: string, options?: ProfileOptions): Promise<Response<ProfileData>>;
|
|
29
|
+
updateProfile(name: string, changes: ProfileUpdateOptions): Promise<Response<ProfileData>>;
|
|
29
30
|
listProfiles(): Promise<Response<ProfilesData>>;
|
|
30
31
|
showProfile(name: string): Promise<Response<ProfileData>>;
|
|
31
32
|
removeProfile(name: string): Promise<Response<RemovedProfileData>>;
|
|
32
33
|
disconnect(): Promise<Response<DisconnectData>>;
|
|
33
|
-
snapshot(options?:
|
|
34
|
-
historyLimit?: number;
|
|
35
|
-
}): StateQLSnapshot;
|
|
34
|
+
snapshot(options?: StateQLSnapshotOptions): StateQLSnapshot;
|
|
36
35
|
status(): Promise<Response<StatusData>>;
|
|
37
36
|
linkActor(session: string, actorId: string): Promise<Response<ActorLinkData>>;
|
|
38
37
|
unlinkActor(session: string, actorId: string): Promise<Response<ActorUnlinkData>>;
|
|
@@ -45,6 +44,7 @@ export declare class StateQL {
|
|
|
45
44
|
closeSession(): Promise<Response<CloseSessionData>>;
|
|
46
45
|
query(sql: string, options?: QueryOptions): Promise<Response<ResultData>>;
|
|
47
46
|
mongoQuery(command: MongoReadCommand, options?: MongoQueryOptions): Promise<Response<ResultData>>;
|
|
47
|
+
redisQuery(command: RedisCommand, options?: RedisQueryOptions): Promise<Response<ResultData>>;
|
|
48
48
|
show(idOrAlias: string): Promise<Response<ResultData>>;
|
|
49
49
|
filter(idOrAlias: string, predicate: string, options?: FilterOptions): Promise<Response<ResultData>>;
|
|
50
50
|
rows(idOrAlias: string, options?: RowsOptions): Promise<Response<RowsData>>;
|
|
@@ -82,20 +82,30 @@ export declare class StateQL {
|
|
|
82
82
|
planTableUpdate(token: string, changes: TableChange, options?: ExecutionOptions & {
|
|
83
83
|
origin?: CommandOrigin;
|
|
84
84
|
}): Promise<Response<PlanData>>;
|
|
85
|
+
planTableUpdates(changes: Array<{
|
|
86
|
+
row_token: string;
|
|
87
|
+
changes: TableChange;
|
|
88
|
+
}>, options?: ExecutionOptions & {
|
|
89
|
+
origin?: CommandOrigin;
|
|
90
|
+
}): Promise<Response<PlanData>>;
|
|
85
91
|
private editableMetadata;
|
|
86
92
|
private panelResult;
|
|
87
93
|
private fullResultRows;
|
|
88
94
|
exportResult(idOrAlias: string, output: string, format?: "json" | "jsonl" | "csv"): Promise<Response<ExportData>>;
|
|
89
95
|
exec(sql: string, options?: ExecOptions): Promise<Response<ExecData>>;
|
|
90
96
|
mongoExec(command: MongoWriteCommand, options?: MongoExecOptions): Promise<Response<ExecData>>;
|
|
97
|
+
redisExec(command: RedisCommand, options?: RedisExecOptions): Promise<Response<ExecData>>;
|
|
91
98
|
receipt(id: string): Promise<Response<OperationData>>;
|
|
92
99
|
beginTransaction(isolation?: string): Promise<Response<TransactionData>>;
|
|
93
100
|
transactionStatus(id?: string): Promise<Response<TransactionData>>;
|
|
94
101
|
commitTransaction(id?: string, options?: ExecutionOptions): Promise<Response<CommitTransactionData>>;
|
|
95
102
|
rollbackTransaction(id?: string): Promise<Response<RollbackTransactionData>>;
|
|
96
103
|
inspect(kind: string, table?: string, options?: ExecutionOptions): Promise<Response<unknown>>;
|
|
104
|
+
listObjects(filter?: ListObjectsFilter, options?: ExecutionOptions): Promise<Response<ListObjectsData>>;
|
|
105
|
+
describeObject(object: CatalogObject, options?: ExecutionOptions): Promise<Response<DescribeObjectData>>;
|
|
97
106
|
plan(sql: string, options?: PlanOptions): Promise<Response<PlanData>>;
|
|
98
107
|
mongoPlan(command: MongoWriteCommand, options?: MongoPlanOptions): Promise<Response<PlanData>>;
|
|
108
|
+
redisPlan(command: RedisCommand, options?: RedisPlanOptions): Promise<Response<PlanData>>;
|
|
99
109
|
apply(planId: string, options?: ExecutionOptions): Promise<Response<ApplyData>>;
|
|
100
110
|
history(limit?: number, options?: HistoryOptions): Promise<Response<HistoryData>>;
|
|
101
111
|
doctor(): Promise<Response<DoctorData>>;
|
|
@@ -105,12 +115,15 @@ export declare class StateQL {
|
|
|
105
115
|
batch(commands: Iterable<BatchCommand> | AsyncIterable<BatchCommand>, options?: BatchOptions): AsyncGenerator<Response<unknown>>;
|
|
106
116
|
private performExec;
|
|
107
117
|
private performMongoExec;
|
|
118
|
+
private performRedisExec;
|
|
119
|
+
private performTableBatch;
|
|
108
120
|
private batchFailure;
|
|
109
121
|
private withResult;
|
|
110
122
|
private rejectDuringStagedTransaction;
|
|
111
123
|
private requireResult;
|
|
112
124
|
private requireConnection;
|
|
113
125
|
private requireMongoConnection;
|
|
126
|
+
private requireRedisConnection;
|
|
114
127
|
private rejectMongoSql;
|
|
115
128
|
private requireActiveTransaction;
|
|
116
129
|
private requireSelectedSession;
|
|
@@ -120,6 +133,7 @@ export declare class StateQL {
|
|
|
120
133
|
private resolveCredential;
|
|
121
134
|
private openAdapter;
|
|
122
135
|
private openMongoAdapter;
|
|
136
|
+
private openRedisAdapter;
|
|
123
137
|
private executionContext;
|
|
124
138
|
private resultData;
|
|
125
139
|
private cacheValid;
|