@collective-intelligence/external-apps-client-sdk 0.4.0 → 0.5.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/README.md +13 -3
- package/dist/chat.d.ts +2 -2
- package/dist/{client-DR9lGYcy.d.ts → client-C-o7Az4B.d.ts} +1 -1
- package/dist/effect.d.ts +4 -4
- package/dist/effect.js +2 -2
- package/dist/{index-_tusNazf.d.ts → index-BwHhPzAs.d.ts} +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/{proxy-BceN4mU3.d.ts → proxy-B4MA1pat.d.ts} +62 -3
- package/dist/{resources-BiYIVzGa.js → resources-DCOTahAB.js} +1 -1
- package/dist/{resources-DFkLnuj9.d.ts → resources-Du03G6Wo.d.ts} +28 -6
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +2 -2
- package/dist/{service-CREcfOem.js → service-CM4fS7mV.js} +1 -1
- package/dist/{service-CimYXTmK.js → service-w6n_gspU.js} +76 -69
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -219,19 +219,26 @@ methods. Existing hard-delete behavior is never relabeled as common `delete`.
|
|
|
219
219
|
|
|
220
220
|
`resource.listMembers(parentId, field, query, { signal })` reads a forward or
|
|
221
221
|
inverse relation as an ordinary entity page. `query` uses `EntityListQuery`
|
|
222
|
-
filters, sorting,
|
|
222
|
+
filters, sorting, pagination and includes on the resolved **member** schema.
|
|
223
223
|
For example:
|
|
224
224
|
|
|
225
225
|
```ts
|
|
226
226
|
const members = await leads.listMembers("lead-1", "companies", {
|
|
227
227
|
filter: { field: "industry", operator: "eq", value: "Research" },
|
|
228
228
|
sort: [{ field: "industry", direction: "asc" }],
|
|
229
|
-
pagination: {
|
|
229
|
+
pagination: { limit: 25, mode: "cursor" }
|
|
230
230
|
})
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
CI transport sends `POST /application/v1/resources/:schemaFqn/records/:parentId/relation-members/search`
|
|
234
|
-
with `{ field, ...query }`.
|
|
234
|
+
with `{ field, ...query }`. An entity search pages by cursor
|
|
235
|
+
(`{ mode: "cursor", cursor?, limit }`; send the page's `nextCursor` for the next
|
|
236
|
+
page, null on the last page) or by number for a page-numbered view
|
|
237
|
+
(`{ mode: "page", page, pageSize }`); CI refuses a page that starts past the
|
|
238
|
+
first 10,000 records. The page carries the Capped Total: `total` is exact up
|
|
239
|
+
to 10,000 records, `totalIsLowerBound` tells that more match, and
|
|
240
|
+
`exactTotal: true` in the query asks for an exact count. `facetsPartial`
|
|
241
|
+
tells that facets count only the first 100,000 candidates. The page describes
|
|
235
242
|
the authorized filtered membership, including zero/one-member scalar relations.
|
|
236
243
|
Without explicit sorting, forward members use stored position and inverse members
|
|
237
244
|
use source ID order. CI authorizes the parent and members and validates the field.
|
|
@@ -252,6 +259,9 @@ markers; nested include pagination is unavailable. Overall exhaustion fails with
|
|
|
252
259
|
`budget` is `work`, `nodes`, `relation_ids` or `bytes`. The `/resources` export
|
|
253
260
|
`isEntityReadLimitError(error)` narrows to `EntityReadLimitDetails`. Narrow the
|
|
254
261
|
query or includes before retrying; these failures expose no member IDs or counts.
|
|
262
|
+
The `knowledge_query` and `knowledge_autocomplete` operations answer a
|
|
263
|
+
page-number read past the first 10,000 rows with `invalid_request` and details
|
|
264
|
+
`{ reason: "page_depth_exceeded" }`; page by cursor or narrow the search.
|
|
255
265
|
Current request-wide ceilings are 100,000 work units, 2,000 nested object
|
|
256
266
|
occurrences, 50,000 relation-ID occurrences and 8,388,608 accounted bytes.
|
|
257
267
|
Repeated serialized occurrences count even when target reads are deduplicated.
|
package/dist/chat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as ClientOperationMap } from "./proxy-
|
|
2
|
-
import { i as OrganizationClient } from "./client-
|
|
1
|
+
import { x as ClientOperationMap } from "./proxy-B4MA1pat.js";
|
|
2
|
+
import { i as OrganizationClient } from "./client-C-o7Az4B.js";
|
|
3
3
|
import { ChatTransport } from "@collective-intelligence/ai-core/chat";
|
|
4
4
|
/** The organization client whose chat domain the transport calls. */
|
|
5
5
|
type ChatTransportClient = Pick<OrganizationClient<ClientOperationMap>, "chat">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as OperationExecutionOptions, D as CiError, P as CiResult, S as ClientOperationOutput, V as ExternalApplicationChatOperationId, b as ClientOperationInput, i as ClientFetch, k as CiTransportError, n as ProxyTransportOptions, w as TypedOperationExecutor, x as ClientOperationMap, y as ClientOperationId } from "./proxy-
|
|
1
|
+
import { C as OperationExecutionOptions, D as CiError, P as CiResult, S as ClientOperationOutput, V as ExternalApplicationChatOperationId, b as ClientOperationInput, i as ClientFetch, k as CiTransportError, n as ProxyTransportOptions, w as TypedOperationExecutor, x as ClientOperationMap, y as ClientOperationId } from "./proxy-B4MA1pat.js";
|
|
2
2
|
import "effect/Clock";
|
|
3
3
|
import * as Config from "effect/Config";
|
|
4
4
|
import * as Context from "effect/Context";
|
package/dist/effect.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as FederatedAuthError, D as CiError, O as CiErrorCode, d as FederatedAuthValue, f as layerFederated, h as layerServerSessionConfig, i as ClientFetch, j as FederatedAuthErrorCode, k as CiTransportError, m as layerServerSession, p as layerFederatedConfig, u as FederatedAuth } from "./proxy-
|
|
2
|
-
import { A as layerProxyConfig, C as CiClient, D as layerDirectConfig, E as layerDirect, O as layerFromExecutor, S as layer, T as ExecuteResult, _ as CiStreamPage$1, b as Chat, d as RunFollowOptions, f as Runs, k as layerProxy, m as layer$5, p as RunsValue, u as DEFAULT_FOLLOW_RUN_DEADLINE_MS, w as CiClientValue, x as ChatValue } from "./client-
|
|
3
|
-
import { C as RealtimeChange, T as RealtimeTopicFilter, f as DelegatedApplicationRuntimeOptions, p as DelegatedRuntimeState, w as RealtimeTopic } from "./index-
|
|
4
|
-
import { _ as layerLegacy, a as LegacyResourceClient, c as LegacyResourcesValue, d as ResourcesFromEntityTransportOptions, f as ResourcesLayerOptions, g as layerFromEntityTransport, h as layerConfig$3, i as makeEntityHttpExecute, l as ResourceEntityClient, m as layer$4, o as LegacyResources, p as ResourcesValue, s as LegacyResourcesLayerOptions, u as Resources, v as layerLegacyConfig } from "./resources-
|
|
1
|
+
import { A as FederatedAuthError, D as CiError, O as CiErrorCode, d as FederatedAuthValue, f as layerFederated, h as layerServerSessionConfig, i as ClientFetch, j as FederatedAuthErrorCode, k as CiTransportError, m as layerServerSession, p as layerFederatedConfig, u as FederatedAuth } from "./proxy-B4MA1pat.js";
|
|
2
|
+
import { A as layerProxyConfig, C as CiClient, D as layerDirectConfig, E as layerDirect, O as layerFromExecutor, S as layer, T as ExecuteResult, _ as CiStreamPage$1, b as Chat, d as RunFollowOptions, f as Runs, k as layerProxy, m as layer$5, p as RunsValue, u as DEFAULT_FOLLOW_RUN_DEADLINE_MS, w as CiClientValue, x as ChatValue } from "./client-C-o7Az4B.js";
|
|
3
|
+
import { C as RealtimeChange, T as RealtimeTopicFilter, f as DelegatedApplicationRuntimeOptions, p as DelegatedRuntimeState, w as RealtimeTopic } from "./index-BwHhPzAs.js";
|
|
4
|
+
import { _ as layerLegacy, a as LegacyResourceClient, c as LegacyResourcesValue, d as ResourcesFromEntityTransportOptions, f as ResourcesLayerOptions, g as layerFromEntityTransport, h as layerConfig$3, i as makeEntityHttpExecute, l as ResourceEntityClient, m as layer$4, o as LegacyResources, p as ResourcesValue, s as LegacyResourcesLayerOptions, u as Resources, v as layerLegacyConfig } from "./resources-Du03G6Wo.js";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as Config from "effect/Config";
|
|
7
7
|
import * as Context from "effect/Context";
|
package/dist/effect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as FederatedAuthErrorCode, i as FederatedAuthError, n as CiErrorCode, r as CiTransportError, t as CiError } from "./errors-B4-Jo4j3.js";
|
|
2
|
-
import { a as layerConfig$3, c as layerLegacyConfig, f as makeEntityHttpExecute, i as layer$4, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources } from "./service-
|
|
3
|
-
import { A as subscribe, C as layerProxy, D as layer$3, E as RealtimeClient, O as layerConfig$2, S as layerFromExecutor, a as layer$2, b as layerDirect, c as layerFederated, d as layerServerSessionConfig, f as Chat, g as Runs, h as DEFAULT_FOLLOW_RUN_DEADLINE_MS, i as FixedWorkflows, l as layerFederatedConfig, n as layer$1, o as layerConfig$1, p as layer, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layer$5, w as layerProxyConfig, x as layerDirectConfig, y as CiClient } from "./service-
|
|
2
|
+
import { a as layerConfig$3, c as layerLegacyConfig, f as makeEntityHttpExecute, i as layer$4, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources } from "./service-w6n_gspU.js";
|
|
3
|
+
import { A as subscribe, C as layerProxy, D as layer$3, E as RealtimeClient, O as layerConfig$2, S as layerFromExecutor, a as layer$2, b as layerDirect, c as layerFederated, d as layerServerSessionConfig, f as Chat, g as Runs, h as DEFAULT_FOLLOW_RUN_DEADLINE_MS, i as FixedWorkflows, l as layerFederatedConfig, n as layer$1, o as layerConfig$1, p as layer, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layer$5, w as layerProxyConfig, x as layerDirectConfig, y as CiClient } from "./service-CM4fS7mV.js";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
/**
|
|
6
6
|
* The wire Schemas of the CI envelopes that `./effect` exports. The Type of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as ConversationHistory, D as CiError$1, F as JsonValue, G as SearchQuery, H as JsonObject, K as WorkflowInvokeTarget, M as CiError$2, R as AgentInvokeTarget, U as KnowledgeQuery, W as QueryFilter, c as FederatedSessionIdentity, i as ClientFetch, s as FederatedAuthState, v as ClientOperationDefinition, z as ConversationContinueTarget } from "./proxy-
|
|
2
|
-
import { n as ClientSdkClient } from "./client-
|
|
3
|
-
import "./resources-
|
|
1
|
+
import { B as ConversationHistory, D as CiError$1, F as JsonValue, G as SearchQuery, H as JsonObject, K as WorkflowInvokeTarget, M as CiError$2, R as AgentInvokeTarget, U as KnowledgeQuery, W as QueryFilter, c as FederatedSessionIdentity, i as ClientFetch, s as FederatedAuthState, v as ClientOperationDefinition, z as ConversationContinueTarget } from "./proxy-B4MA1pat.js";
|
|
2
|
+
import { n as ClientSdkClient } from "./client-C-o7Az4B.js";
|
|
3
|
+
import "./resources-Du03G6Wo.js";
|
|
4
4
|
import "effect/Context";
|
|
5
5
|
import "effect/Effect";
|
|
6
6
|
import "effect/Layer";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FederatedAuthError, C as OperationExecutionOptions, E as isClientOperationId, F as JsonValue, G as SearchQuery, H as JsonObject, I as OperationRequest, K as WorkflowInvokeTarget, L as OperationSuccess, N as CiErrorCode, P as CiResult, S as ClientOperationOutput, T as clientOperationIds, U as KnowledgeQuery, W as QueryFilter, _ as createServerSessionAuth, a as FederatedAuth, b as ClientOperationInput, c as FederatedSessionIdentity, g as ServerSessionAuthOptions, i as ClientFetch, j as FederatedAuthErrorCode, k as CiTransportError, l as createFederatedAuth, n as ProxyTransportOptions, o as FederatedAuthOptions, r as createProxyTransport, s as FederatedAuthState, t as ProxyAuthentication, v as ClientOperationDefinition, w as TypedOperationExecutor, x as ClientOperationMap, y as ClientOperationId } from "./proxy-
|
|
2
|
-
import { M as createDirectTransport, _ as CiStreamPage, a as clientSdkProtocolVersion, c as FollowRunSource, g as CiStreamEvent, h as CiRunCancellation, i as OrganizationClient, j as DirectTransportOptions, l as followRun, n as ClientSdkClient, o as createClient, r as ClientSdkEntrypoint, s as FollowRunOptions, t as ClientDomains, u as DEFAULT_FOLLOW_RUN_DEADLINE_MS, v as nextStreamCursor, y as ChatClient } from "./client-
|
|
3
|
-
import { C as RealtimeChange, E as realtimeTopicKey, S as RealtimeWindow, T as RealtimeTopicFilter, _ as RealtimeStreamEnd, a as RealtimeClientStatus, b as createFetchEventSourceFactory, c as FixedWorkflowClient, d as DelegatedApplicationRuntime, f as DelegatedApplicationRuntimeOptions, g as RealtimeEventSourceFactory, h as RealtimeEventSource, i as RealtimeClientState, l as FixedWorkflowClientOptions, m as createDelegatedApplicationRuntime, n as RealtimeClient, o as RealtimeTimers, p as DelegatedRuntimeState, r as RealtimeClientOptions, s as createRealtimeClient, t as CiError, u as createFixedWorkflowClient, v as RealtimeStreamEvent, w as RealtimeTopic, x as RealtimeDocument, y as RealtimeStreamHandlers } from "./index-
|
|
4
|
-
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-
|
|
1
|
+
import { A as FederatedAuthError, C as OperationExecutionOptions, E as isClientOperationId, F as JsonValue, G as SearchQuery, H as JsonObject, I as OperationRequest, K as WorkflowInvokeTarget, L as OperationSuccess, N as CiErrorCode, P as CiResult, S as ClientOperationOutput, T as clientOperationIds, U as KnowledgeQuery, W as QueryFilter, _ as createServerSessionAuth, a as FederatedAuth, b as ClientOperationInput, c as FederatedSessionIdentity, g as ServerSessionAuthOptions, i as ClientFetch, j as FederatedAuthErrorCode, k as CiTransportError, l as createFederatedAuth, n as ProxyTransportOptions, o as FederatedAuthOptions, r as createProxyTransport, s as FederatedAuthState, t as ProxyAuthentication, v as ClientOperationDefinition, w as TypedOperationExecutor, x as ClientOperationMap, y as ClientOperationId } from "./proxy-B4MA1pat.js";
|
|
2
|
+
import { M as createDirectTransport, _ as CiStreamPage, a as clientSdkProtocolVersion, c as FollowRunSource, g as CiStreamEvent, h as CiRunCancellation, i as OrganizationClient, j as DirectTransportOptions, l as followRun, n as ClientSdkClient, o as createClient, r as ClientSdkEntrypoint, s as FollowRunOptions, t as ClientDomains, u as DEFAULT_FOLLOW_RUN_DEADLINE_MS, v as nextStreamCursor, y as ChatClient } from "./client-C-o7Az4B.js";
|
|
3
|
+
import { C as RealtimeChange, E as realtimeTopicKey, S as RealtimeWindow, T as RealtimeTopicFilter, _ as RealtimeStreamEnd, a as RealtimeClientStatus, b as createFetchEventSourceFactory, c as FixedWorkflowClient, d as DelegatedApplicationRuntime, f as DelegatedApplicationRuntimeOptions, g as RealtimeEventSourceFactory, h as RealtimeEventSource, i as RealtimeClientState, l as FixedWorkflowClientOptions, m as createDelegatedApplicationRuntime, n as RealtimeClient, o as RealtimeTimers, p as DelegatedRuntimeState, r as RealtimeClientOptions, s as createRealtimeClient, t as CiError, u as createFixedWorkflowClient, v as RealtimeStreamEvent, w as RealtimeTopic, x as RealtimeDocument, y as RealtimeStreamHandlers } from "./index-BwHhPzAs.js";
|
|
4
|
+
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-Du03G6Wo.js";
|
|
5
5
|
export { type ChatClient, CiError, type CiErrorCode, type CiResult, type CiRunCancellation, type CiStreamEvent, type CiStreamPage, CiTransportError, type ClientDomains, type ClientFetch, type ClientOperationDefinition, type ClientOperationId, type ClientOperationInput, type ClientOperationMap, type ClientOperationOutput, type ClientSdkClient, type ClientSdkEntrypoint, DEFAULT_FOLLOW_RUN_DEADLINE_MS, type DelegatedApplicationRuntime, type DelegatedApplicationRuntimeOptions, type DelegatedRuntimeState, type DirectTransportOptions, type EntityBatchInput, type EntityBatchOp, type EntityBatchRefusal, type EntityBatchRefusedDetails, type EntityClient, type EntityCreateInput, type EntityDeleteInput, type EntityFileFieldWrite, type EntityFileValue, type EntityFileWrite, type EntityHttpDestination, type EntityHttpTransportOptions, type EntityListQuery, type EntityMemberValue, type EntityOperation, type EntityOperationResult, type EntityPage, type EntityProtocol, type EntityReadLimitDetails, type EntityRequest, type EntityRestoreInput, type EntityTransport, type EntityUpdateInput, type EntityUploadInput, type EntityUploadSlot, type FederatedAuth, FederatedAuthError, type FederatedAuthErrorCode, type FederatedAuthOptions, type FederatedAuthState, type FederatedSessionIdentity, type FixedWorkflowClient, type FixedWorkflowClientOptions, type FollowRunOptions, type FollowRunSource, type IdempotencyKey, type JsonObject, type JsonValue, type KnowledgeQuery, type OperationExecutionOptions, type OperationRequest, type OperationSuccess, type OrganizationClient, type PortableResourceSchema, type ProxyAuthentication, type ProxyTransportOptions, type QueryFilter, type RealtimeChange, type RealtimeClient, type RealtimeClientOptions, type RealtimeClientState, type RealtimeClientStatus, type RealtimeDocument, type RealtimeEventSource, type RealtimeEventSourceFactory, type RealtimeStreamEnd, type RealtimeStreamEvent, type RealtimeStreamHandlers, type RealtimeTimers, type RealtimeTopic, type RealtimeTopicFilter, type RealtimeWindow, type ResourceCapabilities, type ResourceClient, type ResourceCreateInput, type ResourceCreateRequest, type ResourceCursor, type ResourceDefinition, type ResourceError, type ResourceErrorCode, type ResourceFilter, type ResourceGetRequest, type ResourceId, type ResourceIdentityField, type ResourceJsonValue, type ResourceLifecycleInput, type ResourceLifecycleRequest, type ResourceListQuery, type ResourceListRequest, type ResourceListResult, type ResourceMutationInput, type ResourcePagination, type ResourcePaginationMode, type ResourceRecord, type ResourceRecordId, type ResourceRequestOptions, type ResourceResult, type ResourceRevision, type ResourceSort, type ResourceTransport, type ResourceTransportRequest, type ResourceUpdateRequest, type SearchQuery, type ServerSessionAuthOptions, type TypedOperationExecutor, type WorkflowInvokeTarget, clientOperationIds, clientSdkProtocolVersion, createClient, createDelegatedApplicationRuntime, createDirectTransport, createEntityHttpTransport, createEntityProtocol, createFederatedAuth, createFetchEventSourceFactory, createFixedWorkflowClient, createProxyTransport, createRealtimeClient, createResourceClient, createServerSessionAuth, followRun, isClientOperationId, isEntityBatchRefusedError, isEntityReadLimitError, nextStreamCursor, realtimeTopicKey };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as FederatedAuthError, o as errors_exports, r as CiTransportError } from "./errors-B4-Jo4j3.js";
|
|
2
|
-
import { C as isClientOperationId, T as createFetchEventSourceFactory, b as proxyHttpOptions, d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol, v as directHttpOptions, w as toCiResult, x as clientOperationIds, y as makeHttpExecute } from "./service-
|
|
3
|
-
import { F as currentLink, M as layer$3, N as layerFromFactory, P as layerBrowser, S as layerFromExecutor, T as make, _ as followSource, a as layer$2, c as layerFederated, g as Runs, h as DEFAULT_FOLLOW_RUN_DEADLINE_MS, i as FixedWorkflows, j as realtimeTopicKey, k as makeConnection, m as mapChatOperations, n as layer$1, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layer, y as CiClient } from "./service-
|
|
4
|
-
import { t as createResourceClient } from "./resources-
|
|
2
|
+
import { C as isClientOperationId, T as createFetchEventSourceFactory, b as proxyHttpOptions, d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol, v as directHttpOptions, w as toCiResult, x as clientOperationIds, y as makeHttpExecute } from "./service-w6n_gspU.js";
|
|
3
|
+
import { F as currentLink, M as layer$3, N as layerFromFactory, P as layerBrowser, S as layerFromExecutor, T as make, _ as followSource, a as layer$2, c as layerFederated, g as Runs, h as DEFAULT_FOLLOW_RUN_DEADLINE_MS, i as FixedWorkflows, j as realtimeTopicKey, k as makeConnection, m as mapChatOperations, n as layer$1, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layer, y as CiClient } from "./service-CM4fS7mV.js";
|
|
4
|
+
import { t as createResourceClient } from "./resources-DCOTahAB.js";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
import * as Clock from "effect/Clock";
|
|
7
7
|
import * as Context from "effect/Context";
|
|
@@ -5,6 +5,50 @@ import * as Effect from "effect/Effect";
|
|
|
5
5
|
import * as Layer from "effect/Layer";
|
|
6
6
|
import * as Stream from "effect/Stream";
|
|
7
7
|
import "effect/ManagedRuntime";
|
|
8
|
+
type ExternalApplicationRunSource = {
|
|
9
|
+
documentId: string;
|
|
10
|
+
downloadUrl: string;
|
|
11
|
+
pages: Array<{
|
|
12
|
+
end: number;
|
|
13
|
+
start: number;
|
|
14
|
+
}>;
|
|
15
|
+
title: string;
|
|
16
|
+
versionId: string;
|
|
17
|
+
};
|
|
18
|
+
type ExternalApplicationsPutRunFeedbackData = {
|
|
19
|
+
body: {
|
|
20
|
+
sentiment: 'positive' | 'negative';
|
|
21
|
+
submitterNote?: string;
|
|
22
|
+
};
|
|
23
|
+
headers: {
|
|
24
|
+
authorization?: string;
|
|
25
|
+
'x-organization-id': string;
|
|
26
|
+
'x-correlation-id'?: string;
|
|
27
|
+
'x-external-audit-issuer'?: string;
|
|
28
|
+
'x-external-audit-subject'?: string;
|
|
29
|
+
'x-external-caller-kind'?: 'anonymous_visitor';
|
|
30
|
+
'x-external-ci-user-id'?: string;
|
|
31
|
+
};
|
|
32
|
+
path: {
|
|
33
|
+
runId: string;
|
|
34
|
+
};
|
|
35
|
+
query?: never;
|
|
36
|
+
url: '/application/v1/runs/{runId}/feedback';
|
|
37
|
+
};
|
|
38
|
+
type ExternalApplicationsPutRunFeedbackResponses = {
|
|
39
|
+
/**
|
|
40
|
+
* Success
|
|
41
|
+
*/
|
|
42
|
+
200: {
|
|
43
|
+
correlationId: string;
|
|
44
|
+
result: {
|
|
45
|
+
runId: string;
|
|
46
|
+
sentiment: 'positive' | 'negative';
|
|
47
|
+
submitterNote: string | null;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
type ExternalApplicationsPutRunFeedbackResponse = ExternalApplicationsPutRunFeedbackResponses[keyof ExternalApplicationsPutRunFeedbackResponses];
|
|
8
52
|
type ExternalAppChatConversationsListData = {
|
|
9
53
|
body?: never;
|
|
10
54
|
headers: {
|
|
@@ -2605,13 +2649,28 @@ interface DurableFileUpload {
|
|
|
2605
2649
|
fileName: string;
|
|
2606
2650
|
sizeBytes: number;
|
|
2607
2651
|
}
|
|
2608
|
-
|
|
2652
|
+
/** The rating of the answer of a run: a not useful one needs a note with text. */
|
|
2653
|
+
type ExternalApplicationRunFeedback = ExternalApplicationsPutRunFeedbackData["body"] & {
|
|
2654
|
+
runId: string;
|
|
2655
|
+
};
|
|
2656
|
+
/** Operations that only a server client invokes. */
|
|
2657
|
+
type ExternalApplicationServiceOperationRequest = {
|
|
2609
2658
|
input: DurableFileUpload;
|
|
2610
2659
|
operationId: "files_upload";
|
|
2611
|
-
}
|
|
2660
|
+
} | {
|
|
2661
|
+
input: {
|
|
2662
|
+
runId: string;
|
|
2663
|
+
};
|
|
2664
|
+
operationId: "runs_sources";
|
|
2665
|
+
} | {
|
|
2666
|
+
input: ExternalApplicationRunFeedback;
|
|
2667
|
+
operationId: "runs_feedback";
|
|
2668
|
+
};
|
|
2612
2669
|
type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"files_upload", {
|
|
2613
2670
|
storageFileId: StorageFileId;
|
|
2614
|
-
}
|
|
2671
|
+
}> | EnvelopeSuccess<"runs_sources", {
|
|
2672
|
+
sources: ExternalApplicationRunSource[];
|
|
2673
|
+
}> | EnvelopeSuccess<"runs_feedback", ExternalApplicationsPutRunFeedbackResponse["result"]>;
|
|
2615
2674
|
/** Every operation a confidential server client may invoke. */
|
|
2616
2675
|
type ExternalApplicationServerOperationRequest = ExternalApplicationOperationRequest | ExternalApplicationServiceOperationRequest;
|
|
2617
2676
|
type ExternalApplicationOperationId = ExternalApplicationOperationRequest["operationId"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as CiTransportError } from "./errors-B4-Jo4j3.js";
|
|
2
|
-
import { l as makeEntityCore, p as runEntityRequest, r as fromEntityTransport, u as makeLegacyResourceCore } from "./service-
|
|
2
|
+
import { l as makeEntityCore, p as runEntityRequest, r as fromEntityTransport, u as makeLegacyResourceCore } from "./service-w6n_gspU.js";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as CiError, i as ClientFetch, k as CiTransportError, t as ProxyAuthentication } from "./proxy-
|
|
1
|
+
import { D as CiError, i as ClientFetch, k as CiTransportError, t as ProxyAuthentication } from "./proxy-B4MA1pat.js";
|
|
2
2
|
import * as Config from "effect/Config";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
@@ -243,14 +243,36 @@ interface ResourceClient<Entity, Create = Entity, Update = Partial<Entity>> {
|
|
|
243
243
|
}
|
|
244
244
|
/** Common entity operations. Generic resource lifecycle/cursor APIs remain separate. */
|
|
245
245
|
type EntityOperation = "list_members" | "list" | "get" | "create" | "update" | "delete" | "restore" | "upload" | "batch";
|
|
246
|
+
/**
|
|
247
|
+
* An entity search. It pages by the `nextCursor` of the previous page, or by
|
|
248
|
+
* number for a page-numbered view; CI refuses a page past its first 10,000
|
|
249
|
+
* records. `textSearch` searches all text of the record.
|
|
250
|
+
*/
|
|
246
251
|
type EntityListQuery = Omit<ResourceListQuery, "pagination" | "includeDeleted"> & Readonly<{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
252
|
+
/** Count every match; else CI stops the total at 10,000. */
|
|
253
|
+
exactTotal?: boolean;
|
|
254
|
+
pagination: ResourcePagination;
|
|
250
255
|
}>;
|
|
251
|
-
|
|
256
|
+
/**
|
|
257
|
+
* A page of an entity search. `total` is the Capped Total: exact up to
|
|
258
|
+
* 10,000 records unless the search asks for `exactTotal`;
|
|
259
|
+
* `totalIsLowerBound` tells that more records match. `facetsPartial` tells
|
|
260
|
+
* that facets count only the first 100,000 candidates. `nextCursor` pages
|
|
261
|
+
* the same search; it is null on the last page.
|
|
262
|
+
*/
|
|
263
|
+
type EntityPage<Value> = Readonly<{
|
|
264
|
+
facetsPartial: boolean;
|
|
265
|
+
items: readonly ResourceRecord<Value>[];
|
|
266
|
+
nextCursor: ResourceCursor | null;
|
|
267
|
+
total: number;
|
|
268
|
+
totalIsLowerBound: boolean;
|
|
269
|
+
}> & (Readonly<{
|
|
270
|
+
pagination: "cursor";
|
|
271
|
+
}> | Readonly<{
|
|
252
272
|
pagination: "page";
|
|
253
|
-
|
|
273
|
+
page: number;
|
|
274
|
+
pageSize: number;
|
|
275
|
+
}>);
|
|
254
276
|
/** Member schemas are resolved by CI, independently of the parent resource. */
|
|
255
277
|
type EntityMemberValue = Readonly<Record<string, ResourceJsonValue>>;
|
|
256
278
|
type EntityCreateInput<Value> = ResourceCreateInput<Value>;
|
package/dist/resources.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-
|
|
1
|
+
import { $ as ResourceDefinition, A as EntityFileFieldWrite, B as EntityRequest, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, F as EntityOperation, G as EntityUploadSlot, H as EntityTransport, I as EntityOperationResult, J as ResourceCapabilities, K as IdempotencyKey, L as EntityPage, M as EntityFileWrite, N as EntityListQuery, O as EntityCreateInput, P as EntityMemberValue, Q as ResourceCursor, R as EntityProtocol, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, U as EntityUpdateInput, V as EntityRestoreInput, W as EntityUploadInput, X as ResourceCreateInput, Y as ResourceClient, Z as ResourceCreateRequest, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, ct as ResourceLifecycleRequest, dt as ResourceListResult, et as ResourceError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, k as EntityDeleteInput, lt as ResourceListQuery, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pt as ResourcePagination, q as PortableResourceSchema, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails } from "./resources-Du03G6Wo.js";
|
|
2
2
|
export { type EntityBatchInput, type EntityBatchOp, type EntityBatchRefusal, type EntityBatchRefusedDetails, type EntityClient, type EntityCreateInput, type EntityDeleteInput, type EntityFileFieldWrite, type EntityFileValue, type EntityFileWrite, type EntityHttpDestination, type EntityHttpTransportOptions, type EntityListQuery, type EntityMemberValue, type EntityOperation, type EntityOperationResult, type EntityPage, type EntityProtocol, type EntityReadLimitDetails, type EntityRequest, type EntityRestoreInput, type EntityTransport, type EntityUpdateInput, type EntityUploadInput, type EntityUploadSlot, type IdempotencyKey, type PortableResourceSchema, type ResourceCapabilities, type ResourceClient, type ResourceCreateInput, type ResourceCreateRequest, type ResourceCursor, type ResourceDefinition, type ResourceError, type ResourceErrorCode, type ResourceFilter, type ResourceGetRequest, type ResourceId, type ResourceIdentityField, type ResourceJsonValue, type ResourceLifecycleInput, type ResourceLifecycleRequest, type ResourceListQuery, type ResourceListRequest, type ResourceListResult, type ResourceMutationInput, type ResourcePagination, type ResourcePaginationMode, type ResourceRecord, type ResourceRecordId, type ResourceRequestOptions, type ResourceResult, type ResourceRevision, type ResourceSort, type ResourceTransport, type ResourceTransportRequest, type ResourceUpdateRequest, createEntityHttpTransport, createEntityProtocol, createResourceClient, isEntityBatchRefusedError, isEntityReadLimitError };
|
package/dist/resources.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol } from "./service-
|
|
2
|
-
import { t as createResourceClient } from "./resources-
|
|
1
|
+
import { d as createEntityHttpTransport, g as isEntityReadLimitError, h as isEntityBatchRefusedError, m as createEntityProtocol } from "./service-w6n_gspU.js";
|
|
2
|
+
import { t as createResourceClient } from "./resources-DCOTahAB.js";
|
|
3
3
|
export { createEntityHttpTransport, createEntityProtocol, createResourceClient, isEntityBatchRefusedError, isEntityReadLimitError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as FederatedAuthError, r as CiTransportError, s as ciErrorCodes, t as CiError } from "./errors-B4-Jo4j3.js";
|
|
2
|
-
import { E as retryAfterMilliseconds, S as fromCiResult, T as createFetchEventSourceFactory, _ as backendErrorCode, b as proxyHttpOptions, v as directHttpOptions, w as toCiResult, y as makeHttpExecute } from "./service-
|
|
2
|
+
import { E as retryAfterMilliseconds, S as fromCiResult, T as createFetchEventSourceFactory, _ as backendErrorCode, b as proxyHttpOptions, v as directHttpOptions, w as toCiResult, y as makeHttpExecute } from "./service-w6n_gspU.js";
|
|
3
3
|
import * as Predicate from "effect/Predicate";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as Arr from "effect/Array";
|
|
@@ -786,18 +786,20 @@ const backendErrorCode = (value) => {
|
|
|
786
786
|
};
|
|
787
787
|
const transportFailure = (response, value) => {
|
|
788
788
|
if (isRecord(value) && isRecord(value.error)) {
|
|
789
|
-
const { code: rawCode, details } = value.error;
|
|
789
|
+
const { code: rawCode, details, reason } = value.error;
|
|
790
790
|
const fields = {
|
|
791
791
|
code: isString(rawCode) ? backendErrorCode(rawCode) : "internal",
|
|
792
792
|
message: isString(value.error.message) ? value.error.message : "The CI operation failed",
|
|
793
793
|
retryable: isBoolean(value.error.retryable) ? value.error.retryable : response.status >= 500
|
|
794
794
|
};
|
|
795
|
+
const reasonDetails = isString(reason) ? { reason } : void 0;
|
|
796
|
+
const errorDetails = details !== void 0 && isRecord(details) ? details : reasonDetails;
|
|
795
797
|
return {
|
|
796
798
|
correlationId: isString(value.correlationId) ? value.correlationId : response.headers.get("x-correlation-id") ?? "unavailable",
|
|
797
|
-
error:
|
|
799
|
+
error: errorDetails === void 0 ? new CiError(fields) : new CiError({
|
|
798
800
|
...fields,
|
|
799
|
-
details
|
|
800
|
-
})
|
|
801
|
+
details: errorDetails
|
|
802
|
+
}),
|
|
801
803
|
ok: false
|
|
802
804
|
};
|
|
803
805
|
}
|
|
@@ -8078,6 +8080,30 @@ const objectSchema = (properties, required = Object.keys(properties)) => ({
|
|
|
8078
8080
|
required,
|
|
8079
8081
|
type: "object"
|
|
8080
8082
|
});
|
|
8083
|
+
const pageSize = {
|
|
8084
|
+
maximum: 100,
|
|
8085
|
+
minimum: 1,
|
|
8086
|
+
type: "integer"
|
|
8087
|
+
};
|
|
8088
|
+
/**
|
|
8089
|
+
* How a search pages: by the `nextCursor` of the previous page, or by
|
|
8090
|
+
* number for a page-numbered view.
|
|
8091
|
+
*/
|
|
8092
|
+
const paginationSchema = { oneOf: [objectSchema({
|
|
8093
|
+
cursor: {
|
|
8094
|
+
minLength: 1,
|
|
8095
|
+
type: "string"
|
|
8096
|
+
},
|
|
8097
|
+
limit: pageSize,
|
|
8098
|
+
mode: { const: "cursor" }
|
|
8099
|
+
}, ["limit", "mode"]), objectSchema({
|
|
8100
|
+
mode: { const: "page" },
|
|
8101
|
+
page: {
|
|
8102
|
+
minimum: 1,
|
|
8103
|
+
type: "integer"
|
|
8104
|
+
},
|
|
8105
|
+
pageSize
|
|
8106
|
+
})] };
|
|
8081
8107
|
/**
|
|
8082
8108
|
* Include Paths: relation fields whose records a read returns in
|
|
8083
8109
|
* `included`, such as `["company", "contacts.company"]`, at most three
|
|
@@ -8293,22 +8319,11 @@ const entityQuerySchema = (definition) => {
|
|
|
8293
8319
|
operator: { const: "not" }
|
|
8294
8320
|
})
|
|
8295
8321
|
] };
|
|
8296
|
-
const page = objectSchema({
|
|
8297
|
-
mode: { const: "page" },
|
|
8298
|
-
page: {
|
|
8299
|
-
minimum: 1,
|
|
8300
|
-
type: "integer"
|
|
8301
|
-
},
|
|
8302
|
-
pageSize: {
|
|
8303
|
-
maximum: 100,
|
|
8304
|
-
minimum: 1,
|
|
8305
|
-
type: "integer"
|
|
8306
|
-
}
|
|
8307
|
-
});
|
|
8308
8322
|
const query = objectSchema({
|
|
8323
|
+
exactTotal: { type: "boolean" },
|
|
8309
8324
|
filter: { $ref: "#/$defs/filter" },
|
|
8310
8325
|
include: includeSchema,
|
|
8311
|
-
pagination:
|
|
8326
|
+
pagination: paginationSchema,
|
|
8312
8327
|
sort: {
|
|
8313
8328
|
items: objectSchema({
|
|
8314
8329
|
direction: { enum: ["asc", "desc"] },
|
|
@@ -8388,20 +8403,10 @@ const memberQuerySchema = {
|
|
|
8388
8403
|
})
|
|
8389
8404
|
] },
|
|
8390
8405
|
query: objectSchema({
|
|
8406
|
+
exactTotal: { type: "boolean" },
|
|
8391
8407
|
filter: { $ref: "#/$defs/memberFilter" },
|
|
8392
8408
|
include: includeSchema,
|
|
8393
|
-
pagination:
|
|
8394
|
-
mode: { const: "page" },
|
|
8395
|
-
page: {
|
|
8396
|
-
minimum: 1,
|
|
8397
|
-
type: "integer"
|
|
8398
|
-
},
|
|
8399
|
-
pageSize: {
|
|
8400
|
-
maximum: 100,
|
|
8401
|
-
minimum: 1,
|
|
8402
|
-
type: "integer"
|
|
8403
|
-
}
|
|
8404
|
-
}),
|
|
8409
|
+
pagination: paginationSchema,
|
|
8405
8410
|
sort: {
|
|
8406
8411
|
items: objectSchema({
|
|
8407
8412
|
direction: { enum: ["asc", "desc"] },
|
|
@@ -8465,7 +8470,42 @@ const coherentPage = (validatePageEnvelope) => (input) => {
|
|
|
8465
8470
|
if (!validatePageEnvelope(input)) return false;
|
|
8466
8471
|
if (!input.ok) return true;
|
|
8467
8472
|
const { value } = input;
|
|
8468
|
-
return value.
|
|
8473
|
+
return value.items.length <= value.total && (value.pagination !== "page" || value.items.length <= value.pageSize);
|
|
8474
|
+
};
|
|
8475
|
+
/** A cursor page or a numbered page of `item` records, with the search limit flags. */
|
|
8476
|
+
const pageOf = (item) => {
|
|
8477
|
+
const fields = {
|
|
8478
|
+
facetsPartial: { type: "boolean" },
|
|
8479
|
+
items: {
|
|
8480
|
+
items: item,
|
|
8481
|
+
type: "array"
|
|
8482
|
+
},
|
|
8483
|
+
nextCursor: {
|
|
8484
|
+
minLength: 1,
|
|
8485
|
+
type: ["string", "null"]
|
|
8486
|
+
},
|
|
8487
|
+
total: {
|
|
8488
|
+
minimum: 0,
|
|
8489
|
+
type: "integer"
|
|
8490
|
+
},
|
|
8491
|
+
totalIsLowerBound: { type: "boolean" }
|
|
8492
|
+
};
|
|
8493
|
+
return { oneOf: [objectSchema({
|
|
8494
|
+
...fields,
|
|
8495
|
+
pagination: { const: "cursor" }
|
|
8496
|
+
}), objectSchema({
|
|
8497
|
+
...fields,
|
|
8498
|
+
page: {
|
|
8499
|
+
minimum: 1,
|
|
8500
|
+
type: "integer"
|
|
8501
|
+
},
|
|
8502
|
+
pageSize: {
|
|
8503
|
+
maximum: 100,
|
|
8504
|
+
minimum: 1,
|
|
8505
|
+
type: "integer"
|
|
8506
|
+
},
|
|
8507
|
+
pagination: { const: "page" }
|
|
8508
|
+
})] };
|
|
8469
8509
|
};
|
|
8470
8510
|
/** Common entity wire codec; transport and persistence remain with their owners. */
|
|
8471
8511
|
const createEntityProtocol = (definition) => {
|
|
@@ -8654,30 +8694,6 @@ const createEntityProtocol = (definition) => {
|
|
|
8654
8694
|
deletedAt: false
|
|
8655
8695
|
}
|
|
8656
8696
|
};
|
|
8657
|
-
const page = objectSchema({
|
|
8658
|
-
items: {
|
|
8659
|
-
items: liveRecord,
|
|
8660
|
-
type: "array"
|
|
8661
|
-
},
|
|
8662
|
-
page: {
|
|
8663
|
-
minimum: 1,
|
|
8664
|
-
type: "integer"
|
|
8665
|
-
},
|
|
8666
|
-
pageSize: {
|
|
8667
|
-
maximum: 100,
|
|
8668
|
-
minimum: 1,
|
|
8669
|
-
type: "integer"
|
|
8670
|
-
},
|
|
8671
|
-
pagination: { const: "page" },
|
|
8672
|
-
totalItems: {
|
|
8673
|
-
minimum: 0,
|
|
8674
|
-
type: "integer"
|
|
8675
|
-
},
|
|
8676
|
-
totalPages: {
|
|
8677
|
-
minimum: 0,
|
|
8678
|
-
type: "integer"
|
|
8679
|
-
}
|
|
8680
|
-
});
|
|
8681
8697
|
const resultSchema = (value) => ({
|
|
8682
8698
|
$defs: { entity: scopeSchema(responseSchema(definition.schemas.entity), "#/$defs/entity") },
|
|
8683
8699
|
oneOf: [objectSchema({
|
|
@@ -8695,7 +8711,7 @@ const createEntityProtocol = (definition) => {
|
|
|
8695
8711
|
...record,
|
|
8696
8712
|
required: [...record.required, "deletedAt"]
|
|
8697
8713
|
}));
|
|
8698
|
-
const validatePage = ajv.compile(resultSchema(
|
|
8714
|
+
const validatePage = ajv.compile(resultSchema(pageOf(liveRecord)));
|
|
8699
8715
|
const validateUploadSlot = ajv.compile(resultSchema(objectSchema({
|
|
8700
8716
|
headers: {
|
|
8701
8717
|
additionalProperties: { type: "string" },
|
|
@@ -8705,22 +8721,13 @@ const createEntityProtocol = (definition) => {
|
|
|
8705
8721
|
uploadId: identifier,
|
|
8706
8722
|
url: identifier
|
|
8707
8723
|
})));
|
|
8708
|
-
const validateMemberPage = ajv.compile(resultSchema({
|
|
8709
|
-
...
|
|
8724
|
+
const validateMemberPage = ajv.compile(resultSchema(pageOf({
|
|
8725
|
+
...liveRecord,
|
|
8710
8726
|
properties: {
|
|
8711
|
-
...
|
|
8712
|
-
|
|
8713
|
-
items: {
|
|
8714
|
-
...liveRecord,
|
|
8715
|
-
properties: {
|
|
8716
|
-
...liveRecord.properties,
|
|
8717
|
-
value: { type: "object" }
|
|
8718
|
-
}
|
|
8719
|
-
},
|
|
8720
|
-
type: "array"
|
|
8721
|
-
}
|
|
8727
|
+
...liveRecord.properties,
|
|
8728
|
+
value: { type: "object" }
|
|
8722
8729
|
}
|
|
8723
|
-
}));
|
|
8730
|
+
})));
|
|
8724
8731
|
const validateOperationResult = {
|
|
8725
8732
|
batch: ajv.compile(resultSchema({
|
|
8726
8733
|
items: record,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/external-apps-client-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Framework-neutral client for Collective Intelligence external applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"lint": "node \"../../../.agents/scripts/managed-lint-runner.mjs\" --scope \"packages/public/external-apps-client-sdk\"",
|
|
53
53
|
"lint:staged": "oxlint --no-error-on-unmatched-pattern",
|
|
54
54
|
"prepack": "bun run build",
|
|
55
|
-
"type-check": "bun check && bun check -p tsconfig.type-tests.json"
|
|
55
|
+
"type-check": "bun check --no-script -p tsconfig.json && bun check --no-script -p tsconfig.type-tests.json"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"ajv-formats": "3.0.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@collective-intelligence/ai-core": "0.
|
|
65
|
+
"@collective-intelligence/ai-core": "0.5.0",
|
|
66
66
|
"effect": "^4.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@collective-intelligence/ai-core": "0.
|
|
74
|
+
"@collective-intelligence/ai-core": "0.5.0",
|
|
75
75
|
"@effect/eslint-plugin": "0.3.2",
|
|
76
76
|
"@effect/vitest": "4.1.4",
|
|
77
77
|
"@oxlint/plugins": "1.94.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"ultracite": "7.10.7",
|
|
89
89
|
"vitest": "5.0.2"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "a8245252c396252c381dafd86a4fcb31af310906"
|
|
92
92
|
}
|