@kubun/store-connector 0.17.2 → 0.18.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.
- package/lib/api-types.d.ts +434 -0
- package/lib/api-types.js +2 -0
- package/lib/api.d.ts +2 -324
- package/lib/api.js +26 -880
- package/lib/document-sweep.d.ts +8 -0
- package/lib/document-sweep.js +46 -0
- package/lib/entity-trim.d.ts +4 -0
- package/lib/entity-trim.js +36 -0
- package/lib/index.d.ts +5 -2
- package/lib/index.js +3 -0
- package/lib/migrations.js +51 -1
- package/lib/observation-records.d.ts +52 -0
- package/lib/observation-records.js +310 -0
- package/lib/operations.d.ts +4 -0
- package/lib/operations.js +223 -0
- package/lib/pending-auth.d.ts +4 -0
- package/lib/pending-auth.js +69 -0
- package/lib/projection-watches.d.ts +4 -0
- package/lib/projection-watches.js +265 -0
- package/lib/retention.d.ts +4 -0
- package/lib/retention.js +193 -0
- package/lib/serialization.d.ts +63 -0
- package/lib/serialization.js +79 -0
- package/lib/store-context.d.ts +11 -0
- package/lib/store-context.js +1 -0
- package/lib/sweep-state.d.ts +5 -0
- package/lib/sweep-state.js +180 -0
- package/lib/sync-state.d.ts +4 -0
- package/lib/sync-state.js +107 -0
- package/lib/tables.d.ts +73 -0
- package/package.json +13 -7
package/lib/tables.d.ts
CHANGED
|
@@ -13,6 +13,45 @@ export type ConnectorSyncStateTable = {
|
|
|
13
13
|
incarnation: string | null;
|
|
14
14
|
};
|
|
15
15
|
export type ConnectorSyncState = Selectable<ConnectorSyncStateTable>;
|
|
16
|
+
export type ConnectorSweepReceiptTable = {
|
|
17
|
+
owner_did: string;
|
|
18
|
+
connector_name: string;
|
|
19
|
+
partition: string;
|
|
20
|
+
provenance: string;
|
|
21
|
+
sequence: number;
|
|
22
|
+
model_id: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
keep: string;
|
|
25
|
+
source_fetch_hlc: string;
|
|
26
|
+
predicate: string | null;
|
|
27
|
+
kind: string;
|
|
28
|
+
complete: number;
|
|
29
|
+
created_at: number;
|
|
30
|
+
committed_at: number | null;
|
|
31
|
+
};
|
|
32
|
+
export type ConnectorSweepCandidateTable = {
|
|
33
|
+
owner_did: string;
|
|
34
|
+
connector_name: string;
|
|
35
|
+
partition: string;
|
|
36
|
+
provenance: string;
|
|
37
|
+
document_id: string;
|
|
38
|
+
source_id: string;
|
|
39
|
+
model_id: string;
|
|
40
|
+
state: string;
|
|
41
|
+
attempts: number;
|
|
42
|
+
apply_failures: number;
|
|
43
|
+
last_error: string | null;
|
|
44
|
+
updated_at: number;
|
|
45
|
+
next_attempt_at: number;
|
|
46
|
+
};
|
|
47
|
+
export type ConnectorSweepCheckpointTable = {
|
|
48
|
+
owner_did: string;
|
|
49
|
+
connector_name: string;
|
|
50
|
+
partition: string;
|
|
51
|
+
provenance: string;
|
|
52
|
+
receipt_sequence: number;
|
|
53
|
+
updated_at: number;
|
|
54
|
+
};
|
|
16
55
|
export type ConnectorPendingAuthTable = {
|
|
17
56
|
state: string;
|
|
18
57
|
code_verifier: string;
|
|
@@ -34,6 +73,8 @@ export type ConnectorPendingAuthTable = {
|
|
|
34
73
|
redirect_url: string;
|
|
35
74
|
/** JSON-encoded `Array<string>`. See `PendingAuthRecord.scopes`. */
|
|
36
75
|
scopes: string;
|
|
76
|
+
/** Null means the request predates incremental-mode tracking. */
|
|
77
|
+
is_incremental: number;
|
|
37
78
|
expires_at: number;
|
|
38
79
|
};
|
|
39
80
|
export type ConnectorPendingAuth = Selectable<ConnectorPendingAuthTable>;
|
|
@@ -89,9 +130,41 @@ export type ConnectorProjectionWatchTable = {
|
|
|
89
130
|
updated_at: number;
|
|
90
131
|
};
|
|
91
132
|
export type ConnectorProjectionWatch = Selectable<ConnectorProjectionWatchTable>;
|
|
133
|
+
export type ConnectorEntityTrimTable = {
|
|
134
|
+
document_id: string;
|
|
135
|
+
owner_did: string;
|
|
136
|
+
connector_name: string;
|
|
137
|
+
trimmed_fields: string;
|
|
138
|
+
updated_at: number;
|
|
139
|
+
};
|
|
140
|
+
export type ConnectorEntityTrim = Selectable<ConnectorEntityTrimTable>;
|
|
141
|
+
export type ConnectorObservationRecordTable = {
|
|
142
|
+
type: string;
|
|
143
|
+
owner: string;
|
|
144
|
+
id: string;
|
|
145
|
+
op_hash: string;
|
|
146
|
+
hlc: string;
|
|
147
|
+
op_jwt: string;
|
|
148
|
+
payload: Uint8Array | null;
|
|
149
|
+
};
|
|
150
|
+
export type ConnectorObservationRepairTable = {
|
|
151
|
+
document_id: string;
|
|
152
|
+
owner: string;
|
|
153
|
+
fetch_hlc: string;
|
|
154
|
+
decision_hlc: string;
|
|
155
|
+
present: number;
|
|
156
|
+
value_digest: string | null;
|
|
157
|
+
written_at: number;
|
|
158
|
+
};
|
|
92
159
|
export type ConnectorTables = {
|
|
160
|
+
kubun_connector_sweep_receipt: ConnectorSweepReceiptTable;
|
|
161
|
+
kubun_connector_sweep_candidate: ConnectorSweepCandidateTable;
|
|
162
|
+
kubun_connector_sweep_checkpoint: ConnectorSweepCheckpointTable;
|
|
163
|
+
kubun_connector_observation_records: ConnectorObservationRecordTable;
|
|
164
|
+
kubun_connector_observation_repair: ConnectorObservationRepairTable;
|
|
93
165
|
kubun_connector_sync_state: ConnectorSyncStateTable;
|
|
94
166
|
kubun_connector_pending_auth: ConnectorPendingAuthTable;
|
|
95
167
|
kubun_connector_operation: ConnectorOperationTable;
|
|
96
168
|
kubun_connector_projection_watch: ConnectorProjectionWatchTable;
|
|
169
|
+
kubun_connector_entity_trim: ConnectorEntityTrimTable;
|
|
97
170
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/store-connector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,14 +15,20 @@
|
|
|
15
15
|
"LICENSE.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@kubun/db
|
|
20
|
-
"
|
|
18
|
+
"@kokuin/token": "^0.5.1",
|
|
19
|
+
"@kubun/db": "^0.18.0",
|
|
20
|
+
"@kubun/db-adapter": "^0.18.0",
|
|
21
|
+
"@kubun/records": "^0.18.0",
|
|
22
|
+
"kysely": "^0.29.7"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
|
-
"@kubun/db-better-sqlite": "^0.
|
|
24
|
-
"@kubun/db-postgres": "^0.
|
|
25
|
-
"@
|
|
25
|
+
"@kubun/db-better-sqlite": "^0.18.0",
|
|
26
|
+
"@kubun/db-postgres": "^0.18.0",
|
|
27
|
+
"@kubun/id": "^0.18.0",
|
|
28
|
+
"@kubun/mutation": "^0.18.0",
|
|
29
|
+
"@kubun/protocol": "^0.18.0",
|
|
30
|
+
"@kubun/store-graph": "^0.18.0",
|
|
31
|
+
"@testcontainers/postgresql": "^12.2.1"
|
|
26
32
|
},
|
|
27
33
|
"publishConfig": {
|
|
28
34
|
"access": "public"
|