@abloatai/transaction 0.52.0 → 0.54.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 +0 -6
- package/dist/auth/apiKey.d.ts.map +1 -1
- package/dist/auth/apiKey.js +13 -60
- package/dist/auth/apiKey.js.map +1 -1
- package/dist/auth/baseUrl.d.ts +38 -0
- package/dist/auth/baseUrl.d.ts.map +1 -0
- package/dist/auth/baseUrl.js +126 -0
- package/dist/auth/baseUrl.js.map +1 -0
- package/dist/auth/capability.js +1 -1
- package/dist/auth/index.d.ts +5 -5
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/branches.d.ts +31 -30
- package/dist/branches.d.ts.map +1 -1
- package/dist/branches.js +2 -4
- package/dist/branches.js.map +1 -1
- package/dist/errorCodes.d.ts +4 -1
- package/dist/errorCodes.d.ts.map +1 -1
- package/dist/errorCodes.js +4 -1
- package/dist/errorCodes.js.map +1 -1
- package/dist/errorObservation.d.ts.map +1 -1
- package/dist/errorObservation.js +9 -1
- package/dist/errorObservation.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/httpResources.d.ts +34 -2
- package/dist/resources/httpResources.d.ts.map +1 -1
- package/dist/resources/httpResources.js +10 -1
- package/dist/resources/httpResources.js.map +1 -1
- package/dist/resources/modelOperations.d.ts +12 -0
- package/dist/resources/modelOperations.d.ts.map +1 -1
- package/dist/resources/modelOperations.js.map +1 -1
- package/dist/resources/where.d.ts +67 -2
- package/dist/resources/where.d.ts.map +1 -1
- package/dist/resources/where.js +73 -0
- package/dist/resources/where.js.map +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/openapi.d.ts.map +1 -1
- package/dist/schema/openapi.js +59 -14
- package/dist/schema/openapi.js.map +1 -1
- package/dist/schema/schema.d.ts +1 -1
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js +1 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/server/adapter.d.ts +2 -0
- package/dist/server/adapter.d.ts.map +1 -1
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/readConfig.d.ts +109 -57
- package/dist/server/readConfig.d.ts.map +1 -1
- package/dist/server/readConfig.js +19 -5
- package/dist/server/readConfig.js.map +1 -1
- package/dist/source/adapters/kysely.d.ts.map +1 -1
- package/dist/source/adapters/kysely.js +64 -6
- package/dist/source/adapters/kysely.js.map +1 -1
- package/dist/source/contract.d.ts.map +1 -1
- package/dist/source/contract.js +2 -0
- package/dist/source/contract.js.map +1 -1
- package/dist/source/types.d.ts +21 -3
- package/dist/source/types.d.ts.map +1 -1
- package/dist/source/types.js.map +1 -1
- package/dist/transport/httpClient.d.ts +7 -2
- package/dist/transport/httpClient.d.ts.map +1 -1
- package/dist/transport/httpClient.js +4 -2
- package/dist/transport/httpClient.js.map +1 -1
- package/dist/transport/httpTransport.d.ts.map +1 -1
- package/dist/transport/httpTransport.js +29 -7
- package/dist/transport/httpTransport.js.map +1 -1
- package/dist/wire/accountResponses.d.ts +18 -13
- package/dist/wire/accountResponses.d.ts.map +1 -1
- package/dist/wire/accountResponses.js +3 -9
- package/dist/wire/accountResponses.js.map +1 -1
- package/dist/wire/auth.d.ts +1 -1
- package/dist/wire/auth.js +3 -3
- package/dist/wire/claims.d.ts +1 -0
- package/dist/wire/claims.d.ts.map +1 -1
- package/dist/wire/claims.js +7 -1
- package/dist/wire/claims.js.map +1 -1
- package/dist/wire/index.d.ts +1 -1
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +1 -1
- package/dist/wire/index.js.map +1 -1
- package/dist/wire/listEnvelope.d.ts +20 -0
- package/dist/wire/listEnvelope.d.ts.map +1 -1
- package/dist/wire/listEnvelope.js +20 -0
- package/dist/wire/listEnvelope.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/apiKey.ts +13 -61
- package/src/auth/baseUrl.ts +144 -0
- package/src/auth/capability.ts +1 -1
- package/src/auth/index.ts +5 -5
- package/src/branches.ts +2 -4
- package/src/errorCodes.ts +19 -1
- package/src/errorObservation.ts +9 -1
- package/src/index.ts +2 -0
- package/src/resources/httpResources.ts +44 -2
- package/src/resources/modelOperations.ts +12 -0
- package/src/resources/where.ts +70 -4
- package/src/schema/index.ts +3 -0
- package/src/schema/openapi.ts +60 -14
- package/src/schema/schema.ts +3 -0
- package/src/server/adapter.ts +2 -0
- package/src/server/index.ts +8 -2
- package/src/server/readConfig.ts +111 -57
- package/src/source/adapters/kysely.ts +73 -8
- package/src/source/contract.ts +2 -0
- package/src/source/types.ts +21 -3
- package/src/transport/httpClient.ts +17 -4
- package/src/transport/httpTransport.ts +29 -7
- package/src/wire/accountResponses.ts +3 -9
- package/src/wire/auth.ts +3 -3
- package/src/wire/claims.ts +7 -1
- package/src/wire/index.ts +7 -1
- package/src/wire/listEnvelope.ts +23 -0
package/dist/wire/claims.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../src/wire/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,C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'./errorEnvelope.js';
|
|
19
19
|
export type { ErrorEnvelope } from './errorEnvelope.js';
|
|
20
|
-
export { listEnvelopeSchema, listEnvelope } from './listEnvelope.js';
|
|
20
|
+
export { listEnvelopeSchema, listEnvelope, CURSOR_PARAM, CURSOR_PARAM_ALIAS, CURSOR_PARAM_NAMES, } from './listEnvelope.js';
|
|
21
21
|
export type { ListEnvelope } from './listEnvelope.js';
|
|
22
22
|
export { claimEventSchema } from './claimEvent.js';
|
|
23
23
|
export type { ClaimEvent } from './claimEvent.js';
|
package/dist/wire/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,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,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,WAAW,CAAC"}
|
package/dist/wire/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* typed error and serialize it back out.
|
|
17
17
|
*/
|
|
18
18
|
export { errorEnvelopeSchema, errorEnvelope, statusForType, INTERNAL_ERROR_PUBLIC_MESSAGE, } from './errorEnvelope.js';
|
|
19
|
-
export { listEnvelopeSchema, listEnvelope } from './listEnvelope.js';
|
|
19
|
+
export { listEnvelopeSchema, listEnvelope, CURSOR_PARAM, CURSOR_PARAM_ALIAS, CURSOR_PARAM_NAMES, } from './listEnvelope.js';
|
|
20
20
|
// The `GET /v1/logs` feed — the two arms, their envelope, and the cursor that
|
|
21
21
|
// carries a position in each.
|
|
22
22
|
export { claimEventSchema } from './claimEvent.js';
|
package/dist/wire/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wire/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,8EAA8E;AAC9E,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,6EAA6E;AAC7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EACrB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,4BAA4B,EAC5B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAqB/B,2EAA2E;AAC3E,wEAAwE;AACxE,sBAAsB;AACtB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,0BAA0B,CAAC;AAclC,4EAA4E;AAC5E,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAS5B,+EAA+E;AAC/E,qDAAqD;AACrD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,WAAW,CAAC"}
|
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
* generic type parameter carries the row type of `data`.
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
+
/**
|
|
13
|
+
* The query parameter a caller resumes a collection with, and the single alias
|
|
14
|
+
* retained for it.
|
|
15
|
+
*
|
|
16
|
+
* Declared beside the envelope that issues `next_cursor`, because the parameter
|
|
17
|
+
* and the field it consumes are one contract and both planes read them: the
|
|
18
|
+
* server to know which names are taken, the spec generator to document them,
|
|
19
|
+
* the client to send one. When the name lived in each of those separately, this
|
|
20
|
+
* spec described `starting_after` for a model list and `cursor` for a commit
|
|
21
|
+
* record list — the same concept under two names, in one document.
|
|
22
|
+
*
|
|
23
|
+
* `starting_after` is the spelling used through 0.52.0. It borrowed a name whose
|
|
24
|
+
* established meaning elsewhere is a row id, while this value has always been an
|
|
25
|
+
* opaque token bound to the sort it was issued for.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CURSOR_PARAM = "cursor";
|
|
28
|
+
/** @deprecated The pre-0.53.0 spelling of {@link CURSOR_PARAM}. */
|
|
29
|
+
export declare const CURSOR_PARAM_ALIAS = "starting_after";
|
|
30
|
+
/** Both names a cursor may arrive under, for reserving them in a query string. */
|
|
31
|
+
export declare const CURSOR_PARAM_NAMES: readonly string[];
|
|
12
32
|
/**
|
|
13
33
|
* Builds the authoritative list-envelope schema for a row schema. Keeping the
|
|
14
34
|
* item validator generic lets every endpoint share the same envelope contract
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listEnvelope.d.ts","sourceRoot":"","sources":["../../src/wire/listEnvelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;kBAO7D;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAC5C,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC3D,YAAY,CAAC,CAAC,CAAC,CAOjB"}
|
|
1
|
+
{"version":3,"file":"listEnvelope.d.ts","sourceRoot":"","sources":["../../src/wire/listEnvelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAuC,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;;;;;kBAO7D;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAC5C,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC3D,YAAY,CAAC,CAAC,CAAC,CAOjB"}
|
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
* generic type parameter carries the row type of `data`.
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
+
/**
|
|
13
|
+
* The query parameter a caller resumes a collection with, and the single alias
|
|
14
|
+
* retained for it.
|
|
15
|
+
*
|
|
16
|
+
* Declared beside the envelope that issues `next_cursor`, because the parameter
|
|
17
|
+
* and the field it consumes are one contract and both planes read them: the
|
|
18
|
+
* server to know which names are taken, the spec generator to document them,
|
|
19
|
+
* the client to send one. When the name lived in each of those separately, this
|
|
20
|
+
* spec described `starting_after` for a model list and `cursor` for a commit
|
|
21
|
+
* record list — the same concept under two names, in one document.
|
|
22
|
+
*
|
|
23
|
+
* `starting_after` is the spelling used through 0.52.0. It borrowed a name whose
|
|
24
|
+
* established meaning elsewhere is a row id, while this value has always been an
|
|
25
|
+
* opaque token bound to the sort it was issued for.
|
|
26
|
+
*/
|
|
27
|
+
export const CURSOR_PARAM = 'cursor';
|
|
28
|
+
/** @deprecated The pre-0.53.0 spelling of {@link CURSOR_PARAM}. */
|
|
29
|
+
export const CURSOR_PARAM_ALIAS = 'starting_after';
|
|
30
|
+
/** Both names a cursor may arrive under, for reserving them in a query string. */
|
|
31
|
+
export const CURSOR_PARAM_NAMES = [CURSOR_PARAM, CURSOR_PARAM_ALIAS];
|
|
12
32
|
/**
|
|
13
33
|
* Builds the authoritative list-envelope schema for a row schema. Keeping the
|
|
14
34
|
* item validator generic lets every endpoint share the same envelope contract
|
|
@@ -1 +1 @@
|
|
|
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;;;;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"}
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abloatai/transaction",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.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",
|
package/src/auth/apiKey.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
import { AbloAuthenticationError, AbloValidationError } from '../errors.js';
|
|
16
16
|
import { classifyCredentialKind } from './credentialKind.js';
|
|
17
|
-
import {
|
|
17
|
+
import { ABLO_DEFAULT_BASE_URL } from './hostedEndpoints.js';
|
|
18
|
+
import { normalizeAbloBaseUrl } from './baseUrl.js';
|
|
18
19
|
import type { KeyEnvironment } from '../environment.js';
|
|
19
20
|
import { isCredentialEndpoint, createEndpointCredentialResolver } from './credentialEndpoint.js';
|
|
20
21
|
import {
|
|
@@ -393,55 +394,8 @@ export async function warnIfCliKeyMismatch(
|
|
|
393
394
|
// re-exported here so existing import paths keep working.
|
|
394
395
|
export { ABLO_HOSTED_API_DOMAIN, ABLO_HOSTED_HTTP_BASE_URL, ABLO_DEFAULT_BASE_URL } from './hostedEndpoints.js';
|
|
395
396
|
|
|
396
|
-
const LEGACY_HOSTED_API_HOSTS = new Set([
|
|
397
|
-
'mesh.ablo.finance',
|
|
398
|
-
'mesh-staging.ablo.finance',
|
|
399
|
-
'api.ablo.finance',
|
|
400
|
-
'sync-staging.ablo.finance',
|
|
401
|
-
]);
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Normalizes older hosted host names to the current public API domain.
|
|
405
|
-
* Self-hosted or custom URLs pass through unchanged; only the retired
|
|
406
|
-
* first-party host names are rewritten.
|
|
407
|
-
*/
|
|
408
|
-
export function normalizeAbloHostedBaseUrl(rawUrl: string): string {
|
|
409
|
-
const trimmed = rawUrl.trim();
|
|
410
|
-
if (!trimmed) return trimmed;
|
|
411
|
-
|
|
412
|
-
// A scheme-less value (e.g. `api-staging.abloatai.com`) is treated as a
|
|
413
|
-
// relative URL: `new URL()` throws on it, and a later `fetch` would resolve it
|
|
414
|
-
// against the current page — producing a 404 from the app's own origin.
|
|
415
|
-
// Prepending a scheme makes the base absolute. `https` matches
|
|
416
|
-
// {@link ABLO_HOSTED_HTTP_BASE_URL}; the socket layer derives `wss` from it.
|
|
417
|
-
// An existing scheme (ws, wss, http, or https) is preserved untouched.
|
|
418
|
-
const schemed = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
419
|
-
|
|
420
|
-
try {
|
|
421
|
-
const url = new URL(schemed);
|
|
422
|
-
// Canonicalize the scheme to the HTTP family: accept all four schemes
|
|
423
|
-
// (http, https, ws, wss), normalize at this single entry point, and let
|
|
424
|
-
// each layer derive its own protocol (the socket layer maps http to ws and
|
|
425
|
-
// https to wss; fetch uses the URL as-is). Without this, a `ws://` base URL
|
|
426
|
-
// reaches HTTP consumers un-normalized and the client fails at startup
|
|
427
|
-
// instead of connecting.
|
|
428
|
-
if (url.protocol === 'ws:') url.protocol = 'http:';
|
|
429
|
-
if (url.protocol === 'wss:') url.protocol = 'https:';
|
|
430
|
-
|
|
431
|
-
if (!LEGACY_HOSTED_API_HOSTS.has(url.hostname)) {
|
|
432
|
-
return url.toString().replace(/\/+$/, '');
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
url.hostname = ABLO_HOSTED_API_DOMAIN;
|
|
436
|
-
if (url.protocol === 'http:') url.protocol = 'https:';
|
|
437
|
-
return url.toString().replace(/\/+$/, '');
|
|
438
|
-
} catch {
|
|
439
|
-
return schemed;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
397
|
export function resolveBaseURL(input: AuthResolveInput): string {
|
|
444
|
-
return
|
|
398
|
+
return normalizeAbloBaseUrl(input.options.baseURL ?? ABLO_DEFAULT_BASE_URL);
|
|
445
399
|
}
|
|
446
400
|
|
|
447
401
|
/**
|
|
@@ -499,17 +453,15 @@ export function resolveBootstrapBaseUrl(input: {
|
|
|
499
453
|
readonly url: string;
|
|
500
454
|
readonly bootstrapBaseUrl?: string;
|
|
501
455
|
}): string {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const url = normalizeAbloHostedBaseUrl(input.url);
|
|
512
|
-
return ensureApiSuffix(url.replace(/^ws/, 'http'));
|
|
456
|
+
// Both paths go through `normalizeAbloBaseUrl`, which canonicalizes ws to
|
|
457
|
+
// http and wss to https. That matters most on the override, which legitimately
|
|
458
|
+
// arrives with a WebSocket scheme when a caller derives it as `${baseUrl}/api`
|
|
459
|
+
// from a WebSocket base URL: this URL is used for HTTP fetches (identity
|
|
460
|
+
// resolution, credential exchange, and bootstrap), and `fetch` rejects ws and
|
|
461
|
+
// wss outright.
|
|
462
|
+
// `||`, not `??`: an empty override is an absent override, and should fall
|
|
463
|
+
// through to the client's own URL rather than to the hosted default.
|
|
464
|
+
return ensureApiSuffix(normalizeAbloBaseUrl(input.bootstrapBaseUrl || input.url));
|
|
513
465
|
}
|
|
514
466
|
|
|
515
467
|
/**
|
|
@@ -533,7 +485,7 @@ function ensureApiSuffix(httpBase: string): string {
|
|
|
533
485
|
u.pathname = `${u.pathname.replace(/\/+$/, '')}/api`;
|
|
534
486
|
return u.toString().replace(/\/+$/, '');
|
|
535
487
|
} catch {
|
|
536
|
-
// Should be unreachable after `
|
|
488
|
+
// Should be unreachable after `normalizeAbloBaseUrl`, which yields an
|
|
537
489
|
// absolute URL, but fall back to a string check rather than throwing.
|
|
538
490
|
return trimmed.endsWith("/api") ? trimmed : `${trimmed}/api`;
|
|
539
491
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base URL every credential is sent to, and the rules it has to satisfy.
|
|
3
|
+
*
|
|
4
|
+
* `baseURL` is the only client option that decides *where* an API key travels.
|
|
5
|
+
* Every request the SDK makes attaches the resolved credential as a bearer
|
|
6
|
+
* token against this origin, so an unchecked value here is an exfiltration
|
|
7
|
+
* primitive: one stray environment variable and a live `sk_` is posted to
|
|
8
|
+
* somebody else's host, in cleartext if the scheme says so.
|
|
9
|
+
*
|
|
10
|
+
* That check belongs beside the option, not in each application that sets it.
|
|
11
|
+
* A consumer who has to re-derive "must be HTTPS, must not embed credentials,
|
|
12
|
+
* must not carry a query" writes it once per codebase at best, and never at
|
|
13
|
+
* worst. Normalization and validation are therefore the same pass, at the one
|
|
14
|
+
* point both transports funnel through.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { AbloValidationError } from '../errors.js';
|
|
18
|
+
import { ABLO_DEFAULT_BASE_URL } from './hostedEndpoints.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Is this host the local machine?
|
|
22
|
+
*
|
|
23
|
+
* Loopback is the one place plaintext carries no risk: the request never
|
|
24
|
+
* reaches a network, so there is nothing between the process and the server to
|
|
25
|
+
* read the token. This is the same boundary browsers draw when they decide
|
|
26
|
+
* which plaintext origins count as trustworthy, which is why `ablo dev` can
|
|
27
|
+
* serve `http://127.0.0.1:8080` without an override while any other host has
|
|
28
|
+
* to prove itself with TLS.
|
|
29
|
+
*
|
|
30
|
+
* `.localhost` names are included because they are reserved to resolve to the
|
|
31
|
+
* loopback interface and are a common local-development convention.
|
|
32
|
+
*/
|
|
33
|
+
function isLoopbackHostname(hostname: string): boolean {
|
|
34
|
+
const host = hostname.toLowerCase();
|
|
35
|
+
if (host === 'localhost' || host.endsWith('.localhost')) return true;
|
|
36
|
+
if (host === '[::1]' || host === '::1') return true;
|
|
37
|
+
// The whole 127.0.0.0/8 block is loopback, not just 127.0.0.1.
|
|
38
|
+
return /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function reject(message: string): never {
|
|
42
|
+
throw new AbloValidationError(message, {
|
|
43
|
+
code: 'invalid_options',
|
|
44
|
+
param: 'baseURL',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Resolves a caller-supplied base URL to the absolute origin the SDK will send
|
|
50
|
+
* credentials to, refusing the values that would leak one.
|
|
51
|
+
*
|
|
52
|
+
* Accepted: an absolute `http`, `https`, `ws`, or `wss` URL, or a bare host
|
|
53
|
+
* name that is treated as `https`. A path prefix is preserved, so a
|
|
54
|
+
* self-hosted deployment mounted at `https://internal.example/ablo` works.
|
|
55
|
+
*
|
|
56
|
+
* Refused, each because the request that followed would be wrong rather than
|
|
57
|
+
* merely unusual:
|
|
58
|
+
*
|
|
59
|
+
* - an unparseable value, which today fails later as an opaque fetch error;
|
|
60
|
+
* - a scheme outside the HTTP family;
|
|
61
|
+
* - plaintext `http` to anywhere but the local machine, which puts the key
|
|
62
|
+
* on the wire in clear;
|
|
63
|
+
* - an embedded `user:password`, which is both a credential in the wrong
|
|
64
|
+
* place and the shape a lookalike host uses to read as a familiar one;
|
|
65
|
+
* - a query string or fragment, which cannot survive having a path appended;
|
|
66
|
+
* - a trailing-dot host, which reaches the same server as the name without it
|
|
67
|
+
* while comparing unequal to every check that names the host.
|
|
68
|
+
*/
|
|
69
|
+
export function normalizeAbloBaseUrl(rawUrl: string): string {
|
|
70
|
+
const trimmed = rawUrl.trim();
|
|
71
|
+
// An empty override is an unset override. Returning it verbatim would hand
|
|
72
|
+
// the transports a base no request can be built against.
|
|
73
|
+
if (!trimmed) return ABLO_DEFAULT_BASE_URL;
|
|
74
|
+
|
|
75
|
+
// A scheme-less value (e.g. `api-staging.abloatai.com`) is treated as a
|
|
76
|
+
// relative URL: `new URL()` throws on it, and a later `fetch` would resolve it
|
|
77
|
+
// against the current page, producing a 404 from the app's own origin.
|
|
78
|
+
// Prepending a scheme makes the base absolute, and `https` is the only safe
|
|
79
|
+
// guess; the socket layer derives `wss` from it. An existing scheme (ws, wss,
|
|
80
|
+
// http, or https) is preserved untouched.
|
|
81
|
+
const schemed = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
82
|
+
|
|
83
|
+
let url: URL;
|
|
84
|
+
try {
|
|
85
|
+
url = new URL(schemed);
|
|
86
|
+
} catch {
|
|
87
|
+
reject(
|
|
88
|
+
`\`baseURL\` is not a valid URL: ${JSON.stringify(rawUrl)}. ` +
|
|
89
|
+
`Pass an absolute origin such as ${ABLO_DEFAULT_BASE_URL}.`,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Canonicalize the scheme to the HTTP family: accept all four schemes
|
|
94
|
+
// (http, https, ws, wss), normalize at this single entry point, and let
|
|
95
|
+
// each layer derive its own protocol (the socket layer maps http to ws and
|
|
96
|
+
// https to wss; fetch uses the URL as-is). Without this, a `ws://` base URL
|
|
97
|
+
// reaches HTTP consumers un-normalized and the client fails at startup
|
|
98
|
+
// instead of connecting.
|
|
99
|
+
if (url.protocol === 'ws:') url.protocol = 'http:';
|
|
100
|
+
if (url.protocol === 'wss:') url.protocol = 'https:';
|
|
101
|
+
|
|
102
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
103
|
+
reject(
|
|
104
|
+
`\`baseURL\` must be an https URL. ${JSON.stringify(rawUrl)} uses ` +
|
|
105
|
+
`${url.protocol.replace(':', '')}, which Ablo cannot send a request over.`,
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (url.username || url.password) {
|
|
110
|
+
reject(
|
|
111
|
+
'`baseURL` must not embed a username or password. Ablo authenticates ' +
|
|
112
|
+
'with the credential you pass as `apiKey`; a URL that carries its own ' +
|
|
113
|
+
'is either a mistake or a host impersonating a familiar one.',
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (url.search || url.hash) {
|
|
118
|
+
reject(
|
|
119
|
+
'`baseURL` must not carry a query string or fragment. Ablo appends its ' +
|
|
120
|
+
'own path to this value, so anything after it would be discarded or ' +
|
|
121
|
+
'would swallow the path. Pass the origin, and the path prefix if you ' +
|
|
122
|
+
'self-host behind one.',
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (url.hostname.endsWith('.')) {
|
|
127
|
+
reject(
|
|
128
|
+
'`baseURL` must not end its host in a dot. That name reaches the same ' +
|
|
129
|
+
'server as the one without it, but compares unequal everywhere the ' +
|
|
130
|
+
'host is checked.',
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (url.protocol === 'http:' && !isLoopbackHostname(url.hostname)) {
|
|
135
|
+
reject(
|
|
136
|
+
`\`baseURL\` must use https. Ablo sends your API key with every ` +
|
|
137
|
+
`request, and ${url.hostname} over plain http would expose it to ` +
|
|
138
|
+
`anything on the path. Plain http is accepted only for the local ` +
|
|
139
|
+
`machine during development.`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return url.toString().replace(/\/+$/, '');
|
|
144
|
+
}
|
package/src/auth/capability.ts
CHANGED
|
@@ -310,7 +310,7 @@ export const capabilityRequestSchema = z.object({
|
|
|
310
310
|
participantId: z.string().min(1).optional(),
|
|
311
311
|
/**
|
|
312
312
|
* Mint into another organization. Reserved for a platform secret carrying
|
|
313
|
-
* `
|
|
313
|
+
* `organization:act-as`; ordinary tenant keys may omit only.
|
|
314
314
|
*/
|
|
315
315
|
organizationId: z.string().min(1).optional(),
|
|
316
316
|
/**
|
package/src/auth/index.ts
CHANGED
|
@@ -29,11 +29,11 @@ export {
|
|
|
29
29
|
ABLO_HOSTED_API_DOMAIN,
|
|
30
30
|
ABLO_HOSTED_HTTP_BASE_URL,
|
|
31
31
|
} from './hostedEndpoints.js';
|
|
32
|
-
export {
|
|
32
|
+
export { normalizeAbloBaseUrl } from './baseUrl.js';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @deprecated Use {@link CapabilityMintResponse}. This is a
|
|
36
|
-
*
|
|
35
|
+
* @deprecated Use {@link CapabilityMintResponse}. Removed in 0.55.0. This is a
|
|
36
|
+
* type-only rename bridge; both names resolve to the same canonical Zod
|
|
37
37
|
* contract and no runtime parser or schema is duplicated.
|
|
38
38
|
*/
|
|
39
39
|
export type CapabilityExchangeResponse = CapabilityMintResponse;
|
|
@@ -240,7 +240,7 @@ interface MintUserSessionBase {
|
|
|
240
240
|
* session's `participantId`. */
|
|
241
241
|
readonly userId: string;
|
|
242
242
|
/** The organization to mint the session into, for a platform that manages many
|
|
243
|
-
* organizations. Requires the secret key to carry the `
|
|
243
|
+
* organizations. Requires the secret key to carry the `organization:act-as`
|
|
244
244
|
* capability. Omit to mint into the key's own organization. */
|
|
245
245
|
readonly organizationId?: string;
|
|
246
246
|
/** Points this session's schema at a shared project while its data stays scoped
|
|
@@ -248,7 +248,7 @@ interface MintUserSessionBase {
|
|
|
248
248
|
* they all share one schema: keep a single schema project, and every customer's
|
|
249
249
|
* session resolves its schema from it instead of pushing the schema into each
|
|
250
250
|
* organization separately. Requires the secret key to carry the
|
|
251
|
-
* `
|
|
251
|
+
* `organization:act-as` capability. Cross-organization mints default to
|
|
252
252
|
* the secret key's own project; pass this only to override that binding.
|
|
253
253
|
* Same-organization mints continue to resolve the session's own project. */
|
|
254
254
|
readonly schemaProject?: {
|
package/src/branches.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { listEnvelopeSchema } from './wire/listEnvelope.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* A branch handle is for people and URLs. Durable routing always uses the
|
|
@@ -47,10 +48,7 @@ export const branchResponseSchema = z.object({
|
|
|
47
48
|
});
|
|
48
49
|
export type BranchResponse = z.infer<typeof branchResponseSchema>;
|
|
49
50
|
|
|
50
|
-
export const branchListResponseSchema =
|
|
51
|
-
object: z.literal('list'),
|
|
52
|
-
data: z.array(branchResponseSchema).readonly(),
|
|
53
|
-
});
|
|
51
|
+
export const branchListResponseSchema = listEnvelopeSchema(branchResponseSchema);
|
|
54
52
|
export type BranchListResponse = z.infer<typeof branchListResponseSchema>;
|
|
55
53
|
|
|
56
54
|
export const createBranchRequestSchema = z.object({
|
package/src/errorCodes.ts
CHANGED
|
@@ -39,7 +39,7 @@ import { z } from 'zod';
|
|
|
39
39
|
* error documentation and returned on the `Ablo-Version` response header, so a
|
|
40
40
|
* consumer can detect when its expected contract has drifted from the server's.
|
|
41
41
|
*/
|
|
42
|
-
export const ERROR_CONTRACT_VERSION = '2026-08-
|
|
42
|
+
export const ERROR_CONTRACT_VERSION = '2026-08-15';
|
|
43
43
|
|
|
44
44
|
/** A coarse grouping of error codes, used to organize metrics and documentation. */
|
|
45
45
|
export type ErrorCategory =
|
|
@@ -870,6 +870,12 @@ export const ERROR_CODES = {
|
|
|
870
870
|
false,
|
|
871
871
|
'A structured (JSON) value was written to a column whose database type cannot hold it. Ablo adapts a json field to either a jsonb column (native) or a text column (serialized) — but a scalar column (integer, boolean, uuid, timestamp, …) cannot store a JSON object or array. Use a jsonb or text column for this field. Ablo adapts to your column; it does not alter your schema.'
|
|
872
872
|
),
|
|
873
|
+
column_value_out_of_range: wire(
|
|
874
|
+
'validation',
|
|
875
|
+
400,
|
|
876
|
+
false,
|
|
877
|
+
'A stored value is outside the range the field was declared to hold. A number field reads back as a JavaScript number, which represents integers exactly only up to 9,007,199,254,740,991; a bigint column holding more than that would come back rounded. Declare the field as text to read those values digit for digit.'
|
|
878
|
+
),
|
|
873
879
|
|
|
874
880
|
// ── tenant / unknown model (400) ───────────────────────────────────
|
|
875
881
|
server_execute_unknown_model: wire(
|
|
@@ -1617,6 +1623,18 @@ export const ERROR_CODES = {
|
|
|
1617
1623
|
false,
|
|
1618
1624
|
'The query contained an invalid identifier.'
|
|
1619
1625
|
),
|
|
1626
|
+
query_relation_expansion_too_large: wire(
|
|
1627
|
+
'validation',
|
|
1628
|
+
400,
|
|
1629
|
+
false,
|
|
1630
|
+
'A requested relation expansion exceeds the bounded nested-row budget. Query the related model as its own paginated collection instead.'
|
|
1631
|
+
),
|
|
1632
|
+
organization_disabled: wire(
|
|
1633
|
+
'permission',
|
|
1634
|
+
403,
|
|
1635
|
+
false,
|
|
1636
|
+
'This organization has been disabled by an operator. Contact support before retrying.'
|
|
1637
|
+
),
|
|
1620
1638
|
org_id_required: wire(
|
|
1621
1639
|
'validation',
|
|
1622
1640
|
400,
|
package/src/errorObservation.ts
CHANGED
|
@@ -79,7 +79,15 @@ const SENSITIVE_KEYS = [
|
|
|
79
79
|
const MASK = '[redacted]';
|
|
80
80
|
const SECRET_PATTERNS = [
|
|
81
81
|
/postgres(?:ql)?:\/\/[^\s"']+/gi,
|
|
82
|
-
|
|
82
|
+
// A prefixed credential, with or without an environment segment: `sk_…` and
|
|
83
|
+
// `sk_live_…` are both keys. The long alphanumeric run stays mandatory, so an
|
|
84
|
+
// ordinary snake_case identifier is not mistaken for one.
|
|
85
|
+
/\b[a-z]{2,4}_(?:[a-z]{2,8}_)?[A-Za-z0-9]{12,}\b/g,
|
|
86
|
+
// An address identifies a person, so it is a secret everywhere an
|
|
87
|
+
// observation can land. Sinks are configured `sendDefaultPii: false`; this
|
|
88
|
+
// keeps that true for addresses a message body carries in prose, which the
|
|
89
|
+
// sink's own PII switch never sees.
|
|
90
|
+
/\b[\w.+-]+@[\w-]+(?:\.[\w-]+)+\b/g,
|
|
83
91
|
];
|
|
84
92
|
|
|
85
93
|
export function redactObservationString(value: string): string {
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type {
|
|
|
35
35
|
HttpModelClient,
|
|
36
36
|
HttpModelMutationParams,
|
|
37
37
|
} from './transport/httpClient.js';
|
|
38
|
+
/** What `ablo.<model>.list()` resolves to: the rows, and where the page ends. */
|
|
39
|
+
export type { ModelList } from './resources/httpResources.js';
|
|
38
40
|
export type {
|
|
39
41
|
FunctionalUpdateOptions,
|
|
40
42
|
/** @deprecated Use `FunctionalUpdateOptions`. */
|
|
@@ -101,9 +101,51 @@ export interface HttpTransportRead<T = Record<string, unknown>> {
|
|
|
101
101
|
/** @internal Exact collection envelope retained until the typed facade captures evidence. */
|
|
102
102
|
export interface HttpTransportList<T = Record<string, unknown>> {
|
|
103
103
|
readonly data: readonly T[];
|
|
104
|
+
/**
|
|
105
|
+
* Whether the collection continues past this page. A list read is always a
|
|
106
|
+
* page — the server applies a default size and caps the largest one — so a
|
|
107
|
+
* caller that treats `data` as the whole set is right only while this is
|
|
108
|
+
* `false`. It used to be dropped on the floor here, which made a truncated
|
|
109
|
+
* read indistinguishable from a complete one.
|
|
110
|
+
*/
|
|
111
|
+
readonly hasMore: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The cursor to pass back as `cursor` for the next page, or `null` at the end
|
|
114
|
+
* of the collection.
|
|
115
|
+
*/
|
|
116
|
+
readonly nextCursor: string | null;
|
|
104
117
|
readonly evidence?: readonly ModelListEvidence[];
|
|
105
118
|
}
|
|
106
119
|
|
|
120
|
+
/**
|
|
121
|
+
* What a collection read hands back: the rows, and where the collection stands.
|
|
122
|
+
*
|
|
123
|
+
* It is an array, so it maps, filters, spreads, and iterates like the rows it
|
|
124
|
+
* always was. `hasMore` and `nextCursor` ride along as non-enumerable
|
|
125
|
+
* properties, which keeps `JSON.stringify` and a spread producing exactly the
|
|
126
|
+
* array they produced before.
|
|
127
|
+
*
|
|
128
|
+
* They ride along because a list read is a page: the server applies a default
|
|
129
|
+
* size and caps the largest one. Returning only the rows made a truncated read
|
|
130
|
+
* and a complete one the same value, so the caller with 500 matching rows got
|
|
131
|
+
* 20 and no way to find out.
|
|
132
|
+
*/
|
|
133
|
+
export type ModelList<T> = T[] & Pick<HttpTransportList<T>, 'hasMore' | 'nextCursor'>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Attach the page state to the rows. Non-enumerable so the result stays
|
|
137
|
+
* indistinguishable from a plain array everywhere the properties aren't read.
|
|
138
|
+
*/
|
|
139
|
+
export function modelList<T>(
|
|
140
|
+
rows: readonly T[],
|
|
141
|
+
page: Pick<HttpTransportList<unknown>, 'hasMore' | 'nextCursor'>,
|
|
142
|
+
): ModelList<T> {
|
|
143
|
+
return Object.defineProperties([...rows], {
|
|
144
|
+
hasMore: { value: page.hasMore, enumerable: false },
|
|
145
|
+
nextCursor: { value: page.nextCursor, enumerable: false },
|
|
146
|
+
}) as ModelList<T>;
|
|
147
|
+
}
|
|
148
|
+
|
|
107
149
|
export type IfClaimedPolicy = 'return' | 'fail';
|
|
108
150
|
|
|
109
151
|
export interface ClaimedOptions {
|
|
@@ -406,13 +448,13 @@ export interface CreateUserSessionParams<S extends SchemaRecord> {
|
|
|
406
448
|
user: { id: string };
|
|
407
449
|
/** Mint the session into this organization instead of the key's own — for a
|
|
408
450
|
* platform that serves many tenants from one backend. Requires the `sk_` key to
|
|
409
|
-
* carry the `
|
|
451
|
+
* carry the `organization:act-as` scope; omit it for the normal
|
|
410
452
|
* single-tenant case. */
|
|
411
453
|
organizationId?: string;
|
|
412
454
|
/** Resolve this session's schema from a shared project while its data stays
|
|
413
455
|
* scoped to `organizationId`. Cross-organization mints default to the
|
|
414
456
|
* platform key's own project, so most platforms can omit this. Specify it
|
|
415
|
-
* only to override that default. Requires `
|
|
457
|
+
* only to override that default. Requires `organization:act-as`. */
|
|
416
458
|
schemaProject?: {
|
|
417
459
|
organizationId: string;
|
|
418
460
|
projectId: string;
|
|
@@ -205,7 +205,19 @@ export interface ServerReadOptions<T> {
|
|
|
205
205
|
*/
|
|
206
206
|
where?: LoadWhere<T>;
|
|
207
207
|
orderBy?: { [K in keyof T]?: 'asc' | 'desc' };
|
|
208
|
+
/**
|
|
209
|
+
* Rows per page. The server has its own ceiling and applies a default when
|
|
210
|
+
* this is omitted, so a collection larger than one page always comes back as
|
|
211
|
+
* a page: read `hasMore` on the result before treating it as the whole set.
|
|
212
|
+
*/
|
|
208
213
|
limit?: number;
|
|
214
|
+
/**
|
|
215
|
+
* Where to resume: the `nextCursor` from the previous page. Pass it back with
|
|
216
|
+
* the same `where` and `orderBy` to walk a collection; the cursor encodes the
|
|
217
|
+
* sort position it was issued for, so it is an opaque token rather than a row
|
|
218
|
+
* id, and a read that changes either starts a new walk.
|
|
219
|
+
*/
|
|
220
|
+
cursor?: string;
|
|
209
221
|
/**
|
|
210
222
|
* `complete` waits for the server. `unknown` returns whatever is local
|
|
211
223
|
* immediately and refreshes in the background.
|