@abloatai/transaction 0.59.2 → 0.60.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/dist/auth/apiKey.d.ts +10 -11
- package/dist/auth/apiKey.d.ts.map +1 -1
- package/dist/auth/apiKey.js +15 -29
- package/dist/auth/apiKey.js.map +1 -1
- package/dist/auth/browserCredentialSafety.js +1 -1
- package/dist/auth/browserCredentialSafety.js.map +1 -1
- package/dist/auth/capability.d.ts +15 -15
- package/dist/auth/capabilityLifecycle.d.ts +3 -3
- package/dist/auth/capabilityLifecycle.d.ts.map +1 -1
- package/dist/auth/capabilityLifecycle.js +2 -1
- package/dist/auth/capabilityLifecycle.js.map +1 -1
- package/dist/auth/credentialEndpoint.js +1 -1
- package/dist/auth/credentialEndpoint.js.map +1 -1
- package/dist/auth/credentialResult.d.ts +2 -1
- package/dist/auth/credentialResult.d.ts.map +1 -1
- package/dist/auth/credentialResult.js.map +1 -1
- package/dist/auth/credentialSource.js.map +1 -1
- package/dist/auth/identity.js.map +1 -1
- package/dist/auth/schemas.d.ts +5 -5
- package/dist/auth/sessionIssuanceProtocol.d.ts +8 -8
- package/dist/auth/sessionIssuanceProtocol.d.ts.map +1 -1
- package/dist/branches.d.ts +38 -38
- package/dist/claims/contract.d.ts +27 -27
- package/dist/claims/eventContract.d.ts +18 -18
- package/dist/claims/events.d.ts +1 -1
- package/dist/claims/events.d.ts.map +1 -1
- package/dist/claims/routes.d.ts +9 -9
- package/dist/claims/routes.d.ts.map +1 -1
- package/dist/claims/trace.d.ts.map +1 -1
- package/dist/claims/trace.js.map +1 -1
- package/dist/client/ablo.d.ts +11 -8
- package/dist/client/ablo.d.ts.map +1 -1
- package/dist/client/ablo.js +5 -6
- package/dist/client/ablo.js.map +1 -1
- package/dist/client/resources/httpResources.d.ts +1 -169
- package/dist/client/resources/httpResources.d.ts.map +1 -1
- package/dist/client/resources/httpResources.js +1 -1
- package/dist/client/resources/httpResources.js.map +1 -1
- package/dist/client/resources/modelOperations.d.ts +6 -15
- package/dist/client/resources/modelOperations.d.ts.map +1 -1
- package/dist/client/resources/where.d.ts +12 -12
- package/dist/client/surface.d.ts +1 -1
- package/dist/client/surface.d.ts.map +1 -1
- package/dist/client/surface.js +2 -4
- package/dist/client/surface.js.map +1 -1
- package/dist/commit/confirmation/commitEnvelope.d.ts +7 -7
- package/dist/commit/confirmation/httpCommitEnvelope.d.ts +1 -1
- package/dist/commit/confirmation/pendingWrite.d.ts +5 -5
- package/dist/commit/contract.d.ts +249 -249
- package/dist/commit/contract.d.ts.map +1 -1
- package/dist/coordination/index.d.ts +2 -2
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +3 -4
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/schema.d.ts +57 -101
- package/dist/coordination/schema.d.ts.map +1 -1
- package/dist/coordination/schema.js +7 -69
- package/dist/coordination/schema.js.map +1 -1
- package/dist/environment.d.ts +3 -3
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js.map +1 -1
- package/dist/errorCodes.d.ts +4 -5
- package/dist/errorCodes.d.ts.map +1 -1
- package/dist/errorCodes.js +3 -8
- package/dist/errorCodes.js.map +1 -1
- package/dist/errorObservation.d.ts +14 -14
- package/dist/errors.d.ts +11 -11
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/keys/index.d.ts +1 -1
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js.map +1 -1
- package/dist/observation/contract.d.ts +34 -34
- package/dist/observation/feedContract.d.ts +86 -86
- package/dist/observation/persistence/syncDeltaRow.d.ts +23 -23
- package/dist/observation/persistence/syncDeltaRow.d.ts.map +1 -1
- package/dist/pricing.d.ts +12 -12
- package/dist/schema/audit.js.map +1 -1
- package/dist/schema/ddl.js.map +1 -1
- package/dist/schema/ddlLock.js.map +1 -1
- package/dist/schema/deployment/contracts.d.ts +64 -64
- package/dist/schema/deployment/index.js.map +1 -1
- package/dist/schema/deployment/reconcile.js.map +1 -1
- package/dist/schema/diff.js.map +1 -1
- package/dist/schema/field.d.ts +1 -1
- package/dist/schema/field.d.ts.map +1 -1
- package/dist/schema/loadStrategy.d.ts +2 -2
- package/dist/schema/loadStrategy.d.ts.map +1 -1
- package/dist/schema/openapi.js.map +1 -1
- package/dist/schema/relation.d.ts +3 -3
- package/dist/schema/relation.d.ts.map +1 -1
- package/dist/schema/residency.d.ts +1 -1
- package/dist/schema/roles.d.ts +1 -1
- package/dist/schema/roles.d.ts.map +1 -1
- package/dist/schema/roles.js.map +1 -1
- package/dist/schema/schema.d.ts +1 -1
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/serialize.js.map +1 -1
- package/dist/schema/sugar.d.ts.map +1 -1
- package/dist/schema/tenancy.d.ts +2 -2
- package/dist/server/storageMode.d.ts +1 -1
- package/dist/sessions/client.d.ts +29 -0
- package/dist/sessions/client.d.ts.map +1 -0
- package/dist/sessions/client.js +69 -0
- package/dist/sessions/client.js.map +1 -0
- package/dist/sessions/contract.d.ts +97 -0
- package/dist/sessions/contract.d.ts.map +1 -0
- package/dist/sessions/contract.js +5 -0
- package/dist/sessions/contract.js.map +1 -0
- package/dist/{auth/sessionMint.d.ts → sessions/create.d.ts} +4 -4
- package/dist/sessions/create.d.ts.map +1 -0
- package/dist/{auth/sessionMint.js → sessions/create.js} +11 -10
- package/dist/sessions/create.js.map +1 -0
- package/dist/sessions/handler.d.ts +23 -0
- package/dist/sessions/handler.d.ts.map +1 -0
- package/dist/sessions/handler.js +55 -0
- package/dist/sessions/handler.js.map +1 -0
- package/dist/sessions/index.d.ts +14 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/dist/sessions/index.js +14 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/{transport/connection/credentialLifecycle.d.ts → sessions/lifecycle.d.ts} +6 -6
- package/dist/sessions/lifecycle.d.ts.map +1 -0
- package/dist/{transport/connection/credentialLifecycle.js → sessions/lifecycle.js} +5 -5
- package/dist/sessions/lifecycle.js.map +1 -0
- package/dist/sessions/source.d.ts +24 -0
- package/dist/sessions/source.d.ts.map +1 -0
- package/dist/sessions/source.js +56 -0
- package/dist/sessions/source.js.map +1 -0
- package/dist/source/adapters/adapterProfile.d.ts +6 -6
- package/dist/source/adapters/conformance.js.map +1 -1
- package/dist/source/adapters/contract.d.ts +14 -14
- package/dist/source/adapters/kysely.js.map +1 -1
- package/dist/source/adapters/memory.js.map +1 -1
- package/dist/source/adapters/prisma.js.map +1 -1
- package/dist/source/connector/client.d.ts.map +1 -1
- package/dist/source/connector/client.js.map +1 -1
- package/dist/source/connector/protocol.d.ts.map +1 -1
- package/dist/source/delivery/pushQueue.d.ts.map +1 -1
- package/dist/source/delivery/pushQueue.js.map +1 -1
- package/dist/source/endpoint/signing.d.ts +4 -4
- package/dist/source/endpoint/signing.d.ts.map +1 -1
- package/dist/source/outbox/contract.d.ts +4 -4
- package/dist/testing/fixtures/httpResponses.d.ts +2 -2
- package/dist/testing/fixtures/httpResponses.d.ts.map +1 -1
- package/dist/testing/fixtures/httpResponses.js.map +1 -1
- package/dist/transport/connection/index.d.ts +0 -1
- package/dist/transport/connection/index.d.ts.map +1 -1
- package/dist/transport/connection/index.js +0 -1
- package/dist/transport/connection/index.js.map +1 -1
- package/dist/transport/connection/manager.d.ts +1 -1
- package/dist/transport/connection/manager.d.ts.map +1 -1
- package/dist/transport/connection/manager.js.map +1 -1
- package/dist/transport/connection/networkProbe.d.ts +5 -18
- package/dist/transport/connection/networkProbe.d.ts.map +1 -1
- package/dist/transport/connection/networkProbe.js.map +1 -1
- package/dist/transport/http/client.d.ts +11 -19
- package/dist/transport/http/client.d.ts.map +1 -1
- package/dist/transport/http/client.js +12 -14
- package/dist/transport/http/client.js.map +1 -1
- package/dist/transport/http/options.d.ts +4 -1
- package/dist/transport/http/options.d.ts.map +1 -1
- package/dist/transport/http/transport.d.ts +4 -10
- package/dist/transport/http/transport.d.ts.map +1 -1
- package/dist/transport/http/transport.js +9 -51
- package/dist/transport/http/transport.js.map +1 -1
- package/dist/transport/websocket/commitFrames.d.ts +1 -2
- package/dist/transport/websocket/commitFrames.d.ts.map +1 -1
- package/dist/transport/websocket/commitFrames.js.map +1 -1
- package/dist/transport/websocket/frameHandlers.d.ts +0 -14
- package/dist/transport/websocket/frameHandlers.d.ts.map +1 -1
- package/dist/transport/websocket/frameHandlers.js +1 -71
- package/dist/transport/websocket/frameHandlers.js.map +1 -1
- package/dist/transport/websocket/heartbeat.d.ts.map +1 -1
- package/dist/transport/websocket/heartbeat.js.map +1 -1
- package/dist/transport/websocket/session.d.ts.map +1 -1
- package/dist/transport/websocket/session.js +72 -32
- package/dist/transport/websocket/session.js.map +1 -1
- package/dist/transport/websocket/sessionContract.d.ts +3 -14
- package/dist/transport/websocket/sessionContract.d.ts.map +1 -1
- package/dist/transport/websocket/transport.d.ts +5 -42
- package/dist/transport/websocket/transport.d.ts.map +1 -1
- package/dist/transport/websocket/transport.js +14 -101
- package/dist/transport/websocket/transport.js.map +1 -1
- package/dist/wire/accountResponses.d.ts +31 -31
- package/dist/wire/auth.d.ts +3 -3
- package/dist/wire/bootstrapReason.d.ts +2 -2
- package/dist/wire/dataSourceResponses.d.ts +2 -2
- package/dist/wire/dataSourceResponses.d.ts.map +1 -1
- package/dist/wire/frames.d.ts +8 -8
- package/dist/wire/inboundFrames.d.ts +53 -63
- package/dist/wire/inboundFrames.d.ts.map +1 -1
- package/dist/wire/inboundFrames.js +1 -6
- package/dist/wire/inboundFrames.js.map +1 -1
- package/dist/wire/listEnvelope.js.map +1 -1
- package/dist/wire/modelResponses.d.ts +2 -2
- package/dist/wire/modelShape.d.ts +4 -4
- package/dist/wire/pricing.d.ts +3 -3
- package/dist/wire/protocolVersion.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/auth/apiKey.ts +25 -44
- package/src/auth/browserCredentialSafety.ts +1 -1
- package/src/auth/capabilityLifecycle.ts +3 -2
- package/src/auth/credentialEndpoint.ts +1 -1
- package/src/auth/credentialResult.ts +2 -0
- package/src/claims/events.ts +1 -2
- package/src/client/ablo.ts +15 -10
- package/src/client/resources/httpResources.ts +2 -174
- package/src/client/resources/modelOperations.ts +0 -10
- package/src/client/surface.ts +2 -4
- package/src/coordination/index.ts +2 -9
- package/src/coordination/schema.ts +7 -81
- package/src/errorCodes.ts +3 -12
- package/src/sessions/client.ts +121 -0
- package/src/sessions/contract.ts +116 -0
- package/src/{auth/sessionMint.ts → sessions/create.ts} +13 -12
- package/src/sessions/handler.ts +96 -0
- package/src/sessions/index.ts +13 -0
- package/src/{transport/connection/credentialLifecycle.ts → sessions/lifecycle.ts} +5 -5
- package/src/sessions/source.ts +94 -0
- package/src/transport/connection/index.ts +0 -1
- package/src/transport/connection/manager.ts +1 -1
- package/src/transport/http/client.ts +21 -31
- package/src/transport/http/options.ts +4 -1
- package/src/transport/http/transport.ts +14 -74
- package/src/transport/websocket/commitFrames.ts +0 -2
- package/src/transport/websocket/frameHandlers.ts +0 -102
- package/src/transport/websocket/session.ts +88 -33
- package/src/transport/websocket/sessionContract.ts +3 -12
- package/src/transport/websocket/transport.ts +13 -137
- package/src/wire/inboundFrames.ts +0 -6
- package/dist/auth/sessionMint.d.ts.map +0 -1
- package/dist/auth/sessionMint.js.map +0 -1
- package/dist/transport/connection/credentialLifecycle.d.ts.map +0 -1
- package/dist/transport/connection/credentialLifecycle.js.map +0 -1
|
@@ -59,27 +59,27 @@ export type InboundFrameContract =
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const WS_INBOUND_FRAMES: {
|
|
61
61
|
readonly ping: {
|
|
62
|
-
readonly validation:
|
|
63
|
-
readonly where:
|
|
62
|
+
readonly validation: "handler";
|
|
63
|
+
readonly where: "dispatchWsFrame — ignored, no payload";
|
|
64
64
|
};
|
|
65
65
|
readonly pong: {
|
|
66
|
-
readonly validation:
|
|
67
|
-
readonly where:
|
|
66
|
+
readonly validation: "handler";
|
|
67
|
+
readonly where: "dispatchWsFrame — ignored, no payload";
|
|
68
68
|
};
|
|
69
69
|
readonly delta: {
|
|
70
|
-
readonly validation:
|
|
71
|
-
readonly where:
|
|
70
|
+
readonly validation: "handler";
|
|
71
|
+
readonly where: "the materialiser parses each delta as it applies it";
|
|
72
72
|
readonly checkedBy: z.ZodObject<{
|
|
73
73
|
id: z.ZodNumber;
|
|
74
74
|
actionType: z.ZodEnum<{
|
|
75
75
|
A: "A";
|
|
76
|
-
C: "C";
|
|
77
|
-
D: "D";
|
|
78
|
-
G: "G";
|
|
79
76
|
I: "I";
|
|
80
|
-
S: "S";
|
|
81
77
|
U: "U";
|
|
78
|
+
D: "D";
|
|
82
79
|
V: "V";
|
|
80
|
+
C: "C";
|
|
81
|
+
G: "G";
|
|
82
|
+
S: "S";
|
|
83
83
|
}>;
|
|
84
84
|
modelName: z.ZodString;
|
|
85
85
|
modelId: z.ZodString;
|
|
@@ -95,16 +95,16 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
95
95
|
}, z.core.$strip>;
|
|
96
96
|
};
|
|
97
97
|
readonly sync_response: {
|
|
98
|
-
readonly validation:
|
|
99
|
-
readonly where:
|
|
98
|
+
readonly validation: "handler";
|
|
99
|
+
readonly where: "the reactive engine validates it while advancing its resume cursor";
|
|
100
100
|
};
|
|
101
101
|
readonly bootstrap_response: {
|
|
102
|
-
readonly validation:
|
|
103
|
-
readonly where:
|
|
102
|
+
readonly validation: "handler";
|
|
103
|
+
readonly where: "the reactive engine validates the bootstrap payload as it applies it";
|
|
104
104
|
};
|
|
105
105
|
readonly mutation_result: {
|
|
106
|
-
readonly validation:
|
|
107
|
-
readonly where:
|
|
106
|
+
readonly validation: "handler";
|
|
107
|
+
readonly where: "handleMutationResult — it validates missingIds alongside the payload before this can parse";
|
|
108
108
|
readonly checkedBy: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
109
|
status: z.ZodLiteral<"queued">;
|
|
110
110
|
statusAt: z.ZodISODateTime;
|
|
@@ -122,11 +122,11 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
122
122
|
projectId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
123
123
|
branchId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
124
124
|
syncGroups: z.ZodArray<z.ZodString>;
|
|
125
|
-
operations: z.ZodArray<z.ZodTemplateLiteral<`${string}.
|
|
125
|
+
operations: z.ZodArray<z.ZodTemplateLiteral<`${string}.update` | `${string}.read` | `${string}.create` | `${string}.delete`>>;
|
|
126
126
|
participantKind: z.ZodEnum<{
|
|
127
|
+
user: "user";
|
|
127
128
|
agent: "agent";
|
|
128
129
|
system: "system";
|
|
129
|
-
user: "user";
|
|
130
130
|
}>;
|
|
131
131
|
participantId: z.ZodString;
|
|
132
132
|
deliveryPartition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
@@ -138,11 +138,11 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
138
138
|
operationResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
139
139
|
transactionId: z.ZodString;
|
|
140
140
|
outcome: z.ZodEnum<{
|
|
141
|
-
archived: "archived";
|
|
142
|
-
created: "created";
|
|
143
141
|
deleted: "deleted";
|
|
144
|
-
|
|
142
|
+
created: "created";
|
|
145
143
|
updated: "updated";
|
|
144
|
+
archived: "archived";
|
|
145
|
+
unarchived: "unarchived";
|
|
146
146
|
}>;
|
|
147
147
|
row: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
148
148
|
}, z.core.$strict>>>;
|
|
@@ -163,11 +163,11 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
163
163
|
projectId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
164
164
|
branchId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
165
165
|
syncGroups: z.ZodArray<z.ZodString>;
|
|
166
|
-
operations: z.ZodArray<z.ZodTemplateLiteral<`${string}.
|
|
166
|
+
operations: z.ZodArray<z.ZodTemplateLiteral<`${string}.update` | `${string}.read` | `${string}.create` | `${string}.delete`>>;
|
|
167
167
|
participantKind: z.ZodEnum<{
|
|
168
|
+
user: "user";
|
|
168
169
|
agent: "agent";
|
|
169
170
|
system: "system";
|
|
170
|
-
user: "user";
|
|
171
171
|
}>;
|
|
172
172
|
participantId: z.ZodString;
|
|
173
173
|
deliveryPartition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
@@ -179,23 +179,19 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
179
179
|
operationResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
180
180
|
transactionId: z.ZodString;
|
|
181
181
|
outcome: z.ZodEnum<{
|
|
182
|
-
archived: "archived";
|
|
183
|
-
created: "created";
|
|
184
182
|
deleted: "deleted";
|
|
185
|
-
|
|
183
|
+
created: "created";
|
|
186
184
|
updated: "updated";
|
|
185
|
+
archived: "archived";
|
|
186
|
+
unarchived: "unarchived";
|
|
187
187
|
}>;
|
|
188
188
|
row: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
189
|
}, z.core.$strict>>>;
|
|
190
190
|
}, z.core.$strict>], "status">;
|
|
191
191
|
};
|
|
192
|
-
readonly claim_ack: {
|
|
193
|
-
readonly validation: 'handler';
|
|
194
|
-
readonly where: 'handleClaimAck narrows field by field, because a rejection carries a typed capability error it has to re-raise as CapabilityError';
|
|
195
|
-
};
|
|
196
192
|
readonly subscription_ack: {
|
|
197
|
-
readonly validation:
|
|
198
|
-
readonly where:
|
|
193
|
+
readonly validation: "handler";
|
|
194
|
+
readonly where: "handleSubscriptionAck";
|
|
199
195
|
readonly checkedBy: z.ZodObject<{
|
|
200
196
|
success: z.ZodBoolean;
|
|
201
197
|
syncGroups: z.ZodArray<z.ZodString>;
|
|
@@ -208,12 +204,12 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
208
204
|
}, z.core.$strip>;
|
|
209
205
|
};
|
|
210
206
|
readonly presence_update: {
|
|
211
|
-
readonly validation:
|
|
207
|
+
readonly validation: "schema";
|
|
212
208
|
readonly payload: z.ZodObject<{
|
|
213
209
|
kind: z.ZodEnum<{
|
|
214
210
|
enter: "enter";
|
|
215
|
-
leave: "leave";
|
|
216
211
|
update: "update";
|
|
212
|
+
leave: "leave";
|
|
217
213
|
}>;
|
|
218
214
|
userId: z.ZodString;
|
|
219
215
|
syncGroups: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -234,9 +230,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
234
230
|
}, z.core.$strip>>;
|
|
235
231
|
isAgent: z.ZodOptional<z.ZodBoolean>;
|
|
236
232
|
participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
233
|
+
user: "user";
|
|
237
234
|
agent: "agent";
|
|
238
235
|
system: "system";
|
|
239
|
-
user: "user";
|
|
240
236
|
}>>>;
|
|
241
237
|
activeClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
242
238
|
entityType: z.ZodString;
|
|
@@ -244,24 +240,24 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
244
240
|
field: z.ZodOptional<z.ZodString>;
|
|
245
241
|
fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
246
242
|
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
247
|
-
fenceToken: z.ZodOptional<z.ZodNumber>;
|
|
248
|
-
acquiredAt: z.ZodOptional<z.ZodNumber>;
|
|
249
243
|
claimId: z.ZodString;
|
|
250
244
|
description: z.ZodOptional<z.ZodString>;
|
|
251
245
|
declaredAt: z.ZodNumber;
|
|
252
246
|
expiresAt: z.ZodNumber;
|
|
253
247
|
onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
248
|
onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
|
|
249
|
+
user: "user";
|
|
255
250
|
agent: "agent";
|
|
256
251
|
system: "system";
|
|
257
|
-
user: "user";
|
|
258
252
|
}>>>>;
|
|
259
253
|
capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
254
|
+
fenceToken: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
acquiredAt: z.ZodOptional<z.ZodNumber>;
|
|
260
256
|
status: z.ZodOptional<z.ZodEnum<{
|
|
261
257
|
active: "active";
|
|
262
|
-
canceled: "canceled";
|
|
263
258
|
committed: "committed";
|
|
264
259
|
expired: "expired";
|
|
260
|
+
canceled: "canceled";
|
|
265
261
|
}>>;
|
|
266
262
|
error: z.ZodOptional<z.ZodObject<{
|
|
267
263
|
code: z.ZodString;
|
|
@@ -281,9 +277,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
281
277
|
expiresAt: z.ZodNumber;
|
|
282
278
|
onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
279
|
onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
|
|
280
|
+
user: "user";
|
|
284
281
|
agent: "agent";
|
|
285
282
|
system: "system";
|
|
286
|
-
user: "user";
|
|
287
283
|
}>>>>;
|
|
288
284
|
capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
285
|
}, z.core.$strip>>;
|
|
@@ -292,21 +288,15 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
292
288
|
delegatedFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
289
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
294
290
|
};
|
|
295
|
-
readonly claim_expired: {
|
|
296
|
-
readonly validation: 'schema';
|
|
297
|
-
readonly payload: z.ZodObject<{
|
|
298
|
-
claimId: z.ZodString;
|
|
299
|
-
}, z.core.$strip>;
|
|
300
|
-
};
|
|
301
291
|
readonly claim_rejected: {
|
|
302
|
-
readonly validation:
|
|
292
|
+
readonly validation: "schema";
|
|
303
293
|
readonly payload: z.ZodObject<{
|
|
304
294
|
claimId: z.ZodString;
|
|
305
295
|
reason: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
306
|
-
capability_denied: "capability_denied";
|
|
307
296
|
conflict: "conflict";
|
|
308
|
-
coordination_unavailable: "coordination_unavailable";
|
|
309
297
|
expired: "expired";
|
|
298
|
+
coordination_unavailable: "coordination_unavailable";
|
|
299
|
+
capability_denied: "capability_denied";
|
|
310
300
|
invalid_target: "invalid_target";
|
|
311
301
|
preempted: "preempted";
|
|
312
302
|
}>>>;
|
|
@@ -319,9 +309,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
319
309
|
}, z.core.$strip>>;
|
|
320
310
|
heldBy: z.ZodOptional<z.ZodString>;
|
|
321
311
|
heldByKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
312
|
+
user: "user";
|
|
322
313
|
agent: "agent";
|
|
323
314
|
system: "system";
|
|
324
|
-
user: "user";
|
|
325
315
|
}>>>;
|
|
326
316
|
heldByClaimId: z.ZodOptional<z.ZodString>;
|
|
327
317
|
heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
@@ -337,9 +327,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
337
327
|
expiresAt: z.ZodNumber;
|
|
338
328
|
onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
339
329
|
onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
|
|
330
|
+
user: "user";
|
|
340
331
|
agent: "agent";
|
|
341
332
|
system: "system";
|
|
342
|
-
user: "user";
|
|
343
333
|
}>>>>;
|
|
344
334
|
capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
345
335
|
}, z.core.$strip>>;
|
|
@@ -347,7 +337,7 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
347
337
|
}, z.core.$strip>;
|
|
348
338
|
};
|
|
349
339
|
readonly claim_acquired: {
|
|
350
|
-
readonly validation:
|
|
340
|
+
readonly validation: "schema";
|
|
351
341
|
readonly payload: z.ZodObject<{
|
|
352
342
|
claimId: z.ZodString;
|
|
353
343
|
fenceToken: z.ZodOptional<z.ZodNumber>;
|
|
@@ -362,7 +352,7 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
362
352
|
}, z.core.$strip>;
|
|
363
353
|
};
|
|
364
354
|
readonly claim_queued: {
|
|
365
|
-
readonly validation:
|
|
355
|
+
readonly validation: "schema";
|
|
366
356
|
readonly payload: z.ZodObject<{
|
|
367
357
|
claimId: z.ZodString;
|
|
368
358
|
target: z.ZodOptional<z.ZodObject<{
|
|
@@ -374,9 +364,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
374
364
|
}, z.core.$strip>>;
|
|
375
365
|
heldBy: z.ZodOptional<z.ZodString>;
|
|
376
366
|
heldByKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
367
|
+
user: "user";
|
|
377
368
|
agent: "agent";
|
|
378
369
|
system: "system";
|
|
379
|
-
user: "user";
|
|
380
370
|
}>>>;
|
|
381
371
|
heldByClaimId: z.ZodOptional<z.ZodString>;
|
|
382
372
|
heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
@@ -392,26 +382,26 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
392
382
|
expiresAt: z.ZodNumber;
|
|
393
383
|
onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
394
384
|
onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
|
|
385
|
+
user: "user";
|
|
395
386
|
agent: "agent";
|
|
396
387
|
system: "system";
|
|
397
|
-
user: "user";
|
|
398
388
|
}>>>>;
|
|
399
389
|
capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
400
390
|
}, z.core.$strip>>;
|
|
401
391
|
message: z.ZodOptional<z.ZodString>;
|
|
402
392
|
position: z.ZodNumber;
|
|
403
393
|
reason: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
404
|
-
capability_denied: "capability_denied";
|
|
405
394
|
conflict: "conflict";
|
|
406
|
-
coordination_unavailable: "coordination_unavailable";
|
|
407
395
|
expired: "expired";
|
|
396
|
+
coordination_unavailable: "coordination_unavailable";
|
|
397
|
+
capability_denied: "capability_denied";
|
|
408
398
|
invalid_target: "invalid_target";
|
|
409
399
|
preempted: "preempted";
|
|
410
400
|
}>>>>;
|
|
411
401
|
}, z.core.$strip>;
|
|
412
402
|
};
|
|
413
403
|
readonly claim_granted: {
|
|
414
|
-
readonly validation:
|
|
404
|
+
readonly validation: "schema";
|
|
415
405
|
readonly payload: z.ZodObject<{
|
|
416
406
|
claimId: z.ZodString;
|
|
417
407
|
fenceToken: z.ZodOptional<z.ZodNumber>;
|
|
@@ -426,7 +416,7 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
426
416
|
}, z.core.$strip>;
|
|
427
417
|
};
|
|
428
418
|
readonly claim_lost: {
|
|
429
|
-
readonly validation:
|
|
419
|
+
readonly validation: "schema";
|
|
430
420
|
readonly payload: z.ZodObject<{
|
|
431
421
|
claimId: z.ZodString;
|
|
432
422
|
reason: z.ZodEnum<{
|
|
@@ -443,7 +433,7 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
443
433
|
}, z.core.$strip>;
|
|
444
434
|
};
|
|
445
435
|
readonly claim_queue: {
|
|
446
|
-
readonly validation:
|
|
436
|
+
readonly validation: "schema";
|
|
447
437
|
readonly payload: z.ZodObject<{
|
|
448
438
|
target: z.ZodObject<{
|
|
449
439
|
type: z.ZodString;
|
|
@@ -463,9 +453,9 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
463
453
|
description: z.ZodDefault<z.ZodString>;
|
|
464
454
|
heldBy: z.ZodOptional<z.ZodString>;
|
|
465
455
|
participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
|
|
456
|
+
user: "user";
|
|
466
457
|
agent: "agent";
|
|
467
458
|
system: "system";
|
|
468
|
-
user: "user";
|
|
469
459
|
}>>>;
|
|
470
460
|
position: z.ZodNumber;
|
|
471
461
|
expiresAt: z.ZodNumber;
|
|
@@ -473,13 +463,13 @@ export declare const WS_INBOUND_FRAMES: {
|
|
|
473
463
|
}, z.core.$strip>;
|
|
474
464
|
};
|
|
475
465
|
readonly claim_heartbeat_ack: {
|
|
476
|
-
readonly validation:
|
|
466
|
+
readonly validation: "schema";
|
|
477
467
|
readonly payload: z.ZodObject<{
|
|
478
468
|
claimId: z.ZodString;
|
|
479
469
|
status: z.ZodEnum<{
|
|
470
|
+
queued: "queued";
|
|
480
471
|
held: "held";
|
|
481
472
|
lost: "lost";
|
|
482
|
-
queued: "queued";
|
|
483
473
|
}>;
|
|
484
474
|
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
485
475
|
position: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inboundFrames.d.ts","sourceRoot":"","sources":["../../src/wire/inboundFrames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"inboundFrames.d.ts","sourceRoot":"","sources":["../../src/wire/inboundFrames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;kCAKZ,CAAC;AACzB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,0CAA0C;AAC1C,MAAM,MAAM,oBAAoB;AAC9B,wDAAwD;AACtD;IAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAA;CAAE;AAChE;;;;;;GAMG;GACD;IACE,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QA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AC,gBAAgB,CAAC,CAAC;AAEpB,4DAA4D;AAC5D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,gBAAgB,GACrB,IAAI,IAAI,wBAAwB,CAElC"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { z } from 'zod';
|
|
26
26
|
import { commitReceiptSchema } from '../commit/contract.js';
|
|
27
27
|
import { clientSyncDeltaSchema } from '../observation/contract.js';
|
|
28
|
-
import { claimAcquiredSchema,
|
|
28
|
+
import { claimAcquiredSchema, claimGrantedSchema, claimHeartbeatAckPayloadSchema, claimLostSchema, claimQueuedSchema, claimQueueSchema, claimRejectionSchema, presenceUpdateSchema, subscriptionAckPayloadSchema, } from '../coordination/schema.js';
|
|
29
29
|
/**
|
|
30
30
|
* The envelope itself: a type and a payload. `catchall` keeps the extra keys,
|
|
31
31
|
* because the oldest delta form puts a delta's own fields at the top level
|
|
@@ -76,10 +76,6 @@ export const WS_INBOUND_FRAMES = {
|
|
|
76
76
|
checkedBy: commitReceiptSchema,
|
|
77
77
|
},
|
|
78
78
|
// ── Requests we made ───────────────────────────────────────────────────
|
|
79
|
-
claim_ack: {
|
|
80
|
-
validation: 'handler',
|
|
81
|
-
where: 'handleClaimAck narrows field by field, because a rejection carries a typed capability error it has to re-raise as CapabilityError',
|
|
82
|
-
},
|
|
83
79
|
subscription_ack: {
|
|
84
80
|
validation: 'handler',
|
|
85
81
|
// Not parsed at dispatch because the handler must first claim the oldest
|
|
@@ -90,7 +86,6 @@ export const WS_INBOUND_FRAMES = {
|
|
|
90
86
|
},
|
|
91
87
|
// ── Coordination ───────────────────────────────────────────────────────
|
|
92
88
|
presence_update: { validation: 'schema', payload: presenceUpdateSchema },
|
|
93
|
-
claim_expired: { validation: 'schema', payload: claimExpiredSchema },
|
|
94
89
|
claim_rejected: { validation: 'schema', payload: claimRejectionSchema },
|
|
95
90
|
claim_acquired: { validation: 'schema', payload: claimAcquiredSchema },
|
|
96
91
|
claim_queued: { validation: 'schema', payload: claimQueuedSchema },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inboundFrames.js","sourceRoot":"","sources":["../../src/wire/inboundFrames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"inboundFrames.js","sourceRoot":"","sources":["../../src/wire/inboundFrames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,8BAA8B,EAC9B,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC;KACD,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAoBzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,0EAA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,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CAAC;AACL,CAAC;AAMD;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"listEnvelope.js","sourceRoot":"","sources":["../../src/wire/listEnvelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAErC,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAsB,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAExF;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAI,UAAwB;IAC5D,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;QACpC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;QACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CAAC;AACL,CAAC;AAMD;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAkB,EAClB,OAA0D,EAAE;IAE5D,OAAO;QACL,MAAM,EAAE,MAAM;QACd,IAAI;QACJ,QAAQ,EAAE,IAAI,CAAC,OAAO,IAAI,KAAK;QAC/B,WAAW,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -34,15 +34,15 @@ export declare const modelReadResponseSchema: z.ZodObject<{
|
|
|
34
34
|
id: z.ZodString;
|
|
35
35
|
actor: z.ZodString;
|
|
36
36
|
participantKind: z.ZodPreprocess<z.ZodEnum<{
|
|
37
|
+
user: "user";
|
|
37
38
|
agent: "agent";
|
|
38
39
|
system: "system";
|
|
39
|
-
user: "user";
|
|
40
40
|
}>>;
|
|
41
41
|
onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
42
|
onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
|
|
43
|
+
user: "user";
|
|
43
44
|
agent: "agent";
|
|
44
45
|
system: "system";
|
|
45
|
-
user: "user";
|
|
46
46
|
}>>>>;
|
|
47
47
|
capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
48
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -25,23 +25,23 @@ import { z } from 'zod';
|
|
|
25
25
|
* narrow one of these; they do not add a member.
|
|
26
26
|
*/
|
|
27
27
|
export declare const fieldTypeSchema: z.ZodEnum<{
|
|
28
|
+
string: "string";
|
|
29
|
+
number: "number";
|
|
28
30
|
boolean: "boolean";
|
|
29
31
|
date: "date";
|
|
30
32
|
enum: "enum";
|
|
31
33
|
json: "json";
|
|
32
|
-
number: "number";
|
|
33
|
-
string: "string";
|
|
34
34
|
}>;
|
|
35
35
|
export type FieldType = z.infer<typeof fieldTypeSchema>;
|
|
36
36
|
/** One field of a model, as the schema artifact records it. */
|
|
37
37
|
export declare const fieldMetaSchema: z.ZodObject<{
|
|
38
38
|
type: z.ZodEnum<{
|
|
39
|
+
string: "string";
|
|
40
|
+
number: "number";
|
|
39
41
|
boolean: "boolean";
|
|
40
42
|
date: "date";
|
|
41
43
|
enum: "enum";
|
|
42
44
|
json: "json";
|
|
43
|
-
number: "number";
|
|
44
|
-
string: "string";
|
|
45
45
|
}>;
|
|
46
46
|
isOptional: z.ZodBoolean;
|
|
47
47
|
isIndexed: z.ZodBoolean;
|
package/dist/wire/pricing.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
export declare const planTierSchema: z.ZodEnum<{
|
|
10
|
-
enterprise: "enterprise";
|
|
11
10
|
free: "free";
|
|
12
11
|
scale: "scale";
|
|
12
|
+
enterprise: "enterprise";
|
|
13
13
|
}>;
|
|
14
14
|
export type PlanTier = z.infer<typeof planTierSchema>;
|
|
15
15
|
/**
|
|
@@ -24,10 +24,10 @@ export type PlanTier = z.infer<typeof planTierSchema>;
|
|
|
24
24
|
* the act of connecting.
|
|
25
25
|
*/
|
|
26
26
|
export declare const meterEventSchema: z.ZodEnum<{
|
|
27
|
-
"api.bootstraps": "api.bootstraps";
|
|
28
|
-
"api.claim_creates": "api.claim_creates";
|
|
29
27
|
"api.commit_ops": "api.commit_ops";
|
|
30
28
|
"api.model_reads": "api.model_reads";
|
|
29
|
+
"api.claim_creates": "api.claim_creates";
|
|
30
|
+
"api.bootstraps": "api.bootstraps";
|
|
31
31
|
}>;
|
|
32
32
|
export type MeterEvent = z.infer<typeof meterEventSchema>;
|
|
33
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocolVersion.d.ts","sourceRoot":"","sources":["../../src/wire/protocolVersion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"protocolVersion.d.ts","sourceRoot":"","sources":["../../src/wire/protocolVersion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,cAAe,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,eAAe,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,sBAAsB,GAAG,IAAI,CAO/B;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,wBAAwB,GAAG,IAAI,CAGjC;AAED,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abloatai/transaction",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "The headless Ablo transaction client and canonical contracts for reads, commits, confirmation, claims, and durable observation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -97,6 +97,11 @@
|
|
|
97
97
|
"import": "./dist/auth/*.js",
|
|
98
98
|
"default": "./dist/auth/*.js"
|
|
99
99
|
},
|
|
100
|
+
"./sessions": {
|
|
101
|
+
"types": "./dist/sessions/index.d.ts",
|
|
102
|
+
"import": "./dist/sessions/index.js",
|
|
103
|
+
"default": "./dist/sessions/index.js"
|
|
104
|
+
},
|
|
100
105
|
"./keys": {
|
|
101
106
|
"types": "./dist/keys/index.d.ts",
|
|
102
107
|
"import": "./dist/keys/index.js",
|
package/src/auth/apiKey.ts
CHANGED
|
@@ -17,15 +17,18 @@ import { classifyCredentialKind } from './credentialKind.js';
|
|
|
17
17
|
import { ABLO_DEFAULT_BASE_URL } from './hostedEndpoints.js';
|
|
18
18
|
import { normalizeAbloBaseUrl } from './baseUrl.js';
|
|
19
19
|
import type { KeyEnvironment } from '../environment.js';
|
|
20
|
-
import { isCredentialEndpoint
|
|
20
|
+
import { isCredentialEndpoint } from './credentialEndpoint.js';
|
|
21
21
|
import {
|
|
22
22
|
credentialToken,
|
|
23
23
|
type CredentialProvider,
|
|
24
|
+
type CredentialProviderResult,
|
|
24
25
|
} from './credentialResult.js';
|
|
26
|
+
import type { SessionSource } from '../sessions/contract.js';
|
|
25
27
|
import {
|
|
26
28
|
assertBrowserSafety,
|
|
27
29
|
protectBrowserCredentialProvider,
|
|
28
30
|
} from './browserCredentialSafety.js';
|
|
31
|
+
import { resolveSessionCredential } from '../sessions/source.js';
|
|
29
32
|
export { assertBrowserSafety };
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -40,22 +43,18 @@ export type { CredentialProvider } from './credentialResult.js';
|
|
|
40
43
|
* The client options that decide a credential.
|
|
41
44
|
*
|
|
42
45
|
* This is the ONE declaration of that set. The resolvers below read it, and the
|
|
43
|
-
* transport configs that accept these options derive from it rather than
|
|
44
|
-
* the fields again
|
|
45
|
-
* runtime, named in an error message, and absent from the type a caller writes
|
|
46
|
-
* against.
|
|
46
|
+
* transport configs that accept these options derive from it rather than
|
|
47
|
+
* listing the fields again.
|
|
47
48
|
*/
|
|
48
49
|
export interface AuthClientOptions {
|
|
49
50
|
readonly apiKey?: string | CredentialProvider | null;
|
|
50
|
-
/** A
|
|
51
|
-
readonly
|
|
51
|
+
/** A scoped session, its renewal provider, or a browser session endpoint. */
|
|
52
|
+
readonly session?: SessionSource | null;
|
|
52
53
|
/** A token the caller already has, used as-is. */
|
|
53
54
|
readonly authToken?: string | null;
|
|
54
55
|
readonly baseURL?: string | null;
|
|
55
56
|
readonly dangerouslyAllowBrowser?: boolean;
|
|
56
57
|
readonly fetch?: typeof globalThis.fetch;
|
|
57
|
-
readonly authTimeoutMs?: number;
|
|
58
|
-
readonly allowCrossOriginAuthEndpoint?: boolean;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
export interface AuthResolveInput {
|
|
@@ -83,45 +82,20 @@ export function readProcessEnv(): Record<string, string | undefined> {
|
|
|
83
82
|
export function resolveApiKey(
|
|
84
83
|
input: AuthResolveInput,
|
|
85
84
|
): string | CredentialProvider | null {
|
|
86
|
-
// `authEndpoint` is the option that names a session-mint route: a URL the
|
|
87
|
-
// client exchanges for a short-lived token, or an async resolver for custom
|
|
88
|
-
// exchanges. It is resolved into a `CredentialProvider` here — the single point
|
|
89
|
-
// shared by every client variant (WebSocket, HTTP, and protocol clients) — so
|
|
90
|
-
// every downstream consumer sees the same resolver and the credential
|
|
91
|
-
// lifecycle drives renewal off it.
|
|
92
|
-
const endpoint = input.options.authEndpoint;
|
|
93
85
|
const configured = input.options.apiKey;
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
const session = input.options.session;
|
|
87
|
+
if (session != null) {
|
|
88
|
+
if (configured != null || input.options.authToken != null) {
|
|
96
89
|
throw new AbloValidationError(
|
|
97
|
-
'Ablo: pass
|
|
98
|
-
|
|
99
|
-
'which credential to use.',
|
|
100
|
-
{ code: 'invalid_options', param: 'authEndpoint' },
|
|
90
|
+
'Ablo: pass `session`, `apiKey`, or `authToken` — not more than one.',
|
|
91
|
+
{ code: 'invalid_options', param: 'session' },
|
|
101
92
|
);
|
|
102
93
|
}
|
|
103
|
-
|
|
104
|
-
return protectBrowserCredentialProvider(
|
|
105
|
-
endpoint,
|
|
106
|
-
input.options.dangerouslyAllowBrowser,
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
if (!isCredentialEndpoint(endpoint)) {
|
|
110
|
-
throw new AbloValidationError(
|
|
111
|
-
'`authEndpoint` expects a URL or path (e.g. \'/api/ablo-session\') or an ' +
|
|
112
|
-
'async resolver — a key string belongs in `apiKey`.',
|
|
113
|
-
{ code: 'invalid_options', param: 'authEndpoint' },
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
return protectBrowserCredentialProvider(createEndpointCredentialResolver(endpoint, {
|
|
117
|
-
fetch: input.options.fetch,
|
|
118
|
-
timeoutMs: input.options.authTimeoutMs,
|
|
119
|
-
allowCrossOrigin: input.options.allowCrossOriginAuthEndpoint,
|
|
120
|
-
}), input.options.dangerouslyAllowBrowser);
|
|
94
|
+
return resolveSessionCredential(session, input.options);
|
|
121
95
|
}
|
|
122
96
|
if (typeof configured === 'string' && isCredentialEndpoint(configured)) {
|
|
123
97
|
throw new AbloValidationError(
|
|
124
|
-
'`apiKey`
|
|
98
|
+
'`apiKey` does not accept an endpoint. Use `session: { endpoint }`.',
|
|
125
99
|
{ code: 'invalid_options', param: 'apiKey' },
|
|
126
100
|
);
|
|
127
101
|
}
|
|
@@ -139,8 +113,8 @@ export function resolveApiKey(
|
|
|
139
113
|
* needs: an async `() => token | null`, or `null` when auth is static — a plain
|
|
140
114
|
* long-lived key string with no refresh, which is the common case.
|
|
141
115
|
*
|
|
142
|
-
*
|
|
143
|
-
* SDK then drives the whole credential lifecycle
|
|
116
|
+
* A renewable session or browser session endpoint resolves to a credential
|
|
117
|
+
* provider, and the SDK then drives the whole credential lifecycle
|
|
144
118
|
* from it: mint-before-connect, the proactive refresh timer with its
|
|
145
119
|
* wake/online/focus re-mint, and the reactive `credential_stale` re-mint. The
|
|
146
120
|
* resolver follows the provider contract end to end: resolve a token,
|
|
@@ -434,8 +408,15 @@ export function rejectRemovedDatabaseUrlOption(options: object): void {
|
|
|
434
408
|
export async function resolveApiKeyValue(
|
|
435
409
|
apiKey: string | CredentialProvider | null,
|
|
436
410
|
): Promise<string | null> {
|
|
411
|
+
return credentialToken(await resolveCredentialValue(apiKey));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/** Resolve without discarding session expiry metadata needed by live clients. */
|
|
415
|
+
export async function resolveCredentialValue(
|
|
416
|
+
apiKey: string | CredentialProvider | null,
|
|
417
|
+
): Promise<CredentialProviderResult> {
|
|
437
418
|
if (apiKey == null) return null;
|
|
438
|
-
if (typeof apiKey === 'function') return
|
|
419
|
+
if (typeof apiKey === 'function') return apiKey();
|
|
439
420
|
return apiKey;
|
|
440
421
|
}
|
|
441
422
|
|
|
@@ -42,7 +42,7 @@ export function protectBrowserCredentialProvider(
|
|
|
42
42
|
function throwBrowserSecretError(): never {
|
|
43
43
|
throw new AbloAuthenticationError(
|
|
44
44
|
'A secret `sk_` credential reached the browser. Keep it server-side and ' +
|
|
45
|
-
'configure the browser with `
|
|
45
|
+
'configure the browser with `session: { endpoint }` instead.',
|
|
46
46
|
{ code: 'browser_apikey_blocked' },
|
|
47
47
|
);
|
|
48
48
|
}
|