@collective-intelligence/external-apps-client-sdk 0.2.1 → 0.2.3
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 +5 -7
- package/dist/effect.d.ts +2 -2
- package/dist/effect.js +2 -2
- package/dist/{index-CAYSljTO.d.ts → index-BTkfYlty.d.ts} +1 -49
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/{resources-DJ1cTUBp.js → resources-BedkrCzl.js} +1 -1
- package/dist/{resources-CL3ZWaWz.d.ts → resources-DVq8jSnc.d.ts} +11 -182
- package/dist/resources.d.ts +1 -1
- package/dist/resources.js +2 -2
- package/dist/{service-8gveUQPI.js → service-DaANR0QD.js} +0 -48
- package/dist/{service-BJjQFasg.js → service-ZWwY3AJB.js} +5 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,13 +5,11 @@ The root entrypoint provides federated login, typed CI operations, and direct or
|
|
|
5
5
|
same-origin proxy transports. It contains no confidential credentials or
|
|
6
6
|
framework state.
|
|
7
7
|
|
|
8
|
-
The typed transport `execute` method
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
current permissions. Server credentials and Server Role selection belong to the
|
|
14
|
-
Server SDK.
|
|
8
|
+
The typed transport `execute` method calls the dedicated Application HTTP
|
|
9
|
+
routes. Supply `organizationId` in the execution options. The backend checks the
|
|
10
|
+
signed-in user's current access. Members, guests and Access Grants are managed
|
|
11
|
+
by app servers through the Server SDK's `ci.access`; server credentials belong
|
|
12
|
+
to the Server SDK.
|
|
15
13
|
|
|
16
14
|
`createFederatedAuth` implements the public OAuth authorization-code flow with
|
|
17
15
|
PKCE. It validates same-origin return targets, keeps the login transaction in
|
package/dist/effect.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as RealtimeTopicFilter, B as layerProxyConfig, D as RunsValue, E as Runs, F as ExecuteResult, I as layerDirect, L as layerDirectConfig, N as CiClient, O as layer$4, P as CiClientValue, Q as RealtimeTopic, R as layerFromExecutor, T as RunFollowOptions, Z as RealtimeChange, f as DelegatedApplicationRuntimeOptions, j as CiStreamPage$1, p as DelegatedRuntimeState, w as DEFAULT_FOLLOW_RUN_DEADLINE_MS, z as layerProxy } from "./index-
|
|
1
|
+
import { Xt as ClientFetch, _ as layerLegacy, a as LegacyResourceClient, an as layerFederatedConfig, c as LegacyResourcesValue, d as ResourcesFromEntityTransportOptions, dn as CiErrorCode, f as ResourcesLayerOptions, fn as CiTransportError, g as layerFromEntityTransport, h as layerConfig$3, i as makeEntityHttpExecute, in as layerFederated, l as ResourceEntityClient, m as layer$3, mn as FederatedAuthErrorCode, nn as FederatedAuth, o as LegacyResources, on as layerServerSession, p as ResourcesValue, pn as FederatedAuthError, rn as FederatedAuthValue, s as LegacyResourcesLayerOptions, sn as layerServerSessionConfig, u as Resources, un as CiError, v as layerLegacyConfig } from "./resources-DVq8jSnc.js";
|
|
2
|
+
import { $ as RealtimeTopicFilter, B as layerProxyConfig, D as RunsValue, E as Runs, F as ExecuteResult, I as layerDirect, L as layerDirectConfig, N as CiClient, O as layer$4, P as CiClientValue, Q as RealtimeTopic, R as layerFromExecutor, T as RunFollowOptions, Z as RealtimeChange, f as DelegatedApplicationRuntimeOptions, j as CiStreamPage$1, p as DelegatedRuntimeState, w as DEFAULT_FOLLOW_RUN_DEADLINE_MS, z as layerProxy } from "./index-BTkfYlty.js";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
import * as Config from "effect/Config";
|
|
5
5
|
import * as Context from "effect/Context";
|
package/dist/effect.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as CiTransportError, E as CiErrorCode, O as FederatedAuthError, T as CiError, a as layerConfig$3, c as layerLegacyConfig, f as makeEntityHttpExecute, i as layer$3, k as FederatedAuthErrorCode, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources } from "./service-
|
|
2
|
-
import { C as RealtimeClient, D as subscribe, T as layerConfig$2, _ as layerDirect, a as layer$1, b as layerProxy, c as layerFederated, d as layerServerSessionConfig, f as DEFAULT_FOLLOW_RUN_DEADLINE_MS, g as CiClient, h as layer$4, i as FixedWorkflows, l as layerFederatedConfig, n as layer, o as layerConfig$1, p as Runs, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layerDirectConfig, w as layer$2, x as layerProxyConfig, y as layerFromExecutor } from "./service-
|
|
1
|
+
import { D as CiTransportError, E as CiErrorCode, O as FederatedAuthError, T as CiError, a as layerConfig$3, c as layerLegacyConfig, f as makeEntityHttpExecute, i as layer$3, k as FederatedAuthErrorCode, n as Resources, o as layerFromEntityTransport, s as layerLegacy, t as LegacyResources } from "./service-DaANR0QD.js";
|
|
2
|
+
import { C as RealtimeClient, D as subscribe, T as layerConfig$2, _ as layerDirect, a as layer$1, b as layerProxy, c as layerFederated, d as layerServerSessionConfig, f as DEFAULT_FOLLOW_RUN_DEADLINE_MS, g as CiClient, h as layer$4, i as FixedWorkflows, l as layerFederatedConfig, n as layer, o as layerConfig$1, p as Runs, r as layerConfig, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, v as layerDirectConfig, w as layer$2, x as layerProxyConfig, y as layerFromExecutor } from "./service-ZWwY3AJB.js";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
/**
|
|
5
5
|
* The wire Schemas of the CI envelopes that `./effect` exports. The Type of
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as JsonValue, Dt as CiError$2, Ft as ClientOperationInput, Gt as
|
|
1
|
+
import { $t as FederatedAuthState, At as JsonValue, Dt as CiError$2, Ft as ClientOperationInput, Gt as JsonObject, Ht as AgentInvokeTarget, It as ClientOperationMap, Jt as SearchQuery, Kt as KnowledgeQuery, Lt as ClientOperationOutput, Nt as ClientOperationDefinition, Pt as ClientOperationId, Rt as OperationExecutionOptions, Tt as ProxyTransportOptions, Ut as ConversationContinueTarget, Wt as ConversationHistory, Xt as ClientFetch, Yt as WorkflowInvokeTarget, en as FederatedSessionIdentity, fn as CiTransportError, kt as CiResult, qt as QueryFilter, un as CiError$1, zt as TypedOperationExecutor } from "./resources-DVq8jSnc.js";
|
|
2
2
|
import "effect/Clock";
|
|
3
3
|
import * as Config from "effect/Config";
|
|
4
4
|
import * as Context from "effect/Context";
|
|
@@ -308,54 +308,6 @@ declare const createDelegatedApplicationRuntime: (options: DelegatedApplicationR
|
|
|
308
308
|
subscribe: (listener: (state: FederatedAuthState) => void) => () => void;
|
|
309
309
|
}>;
|
|
310
310
|
client: ClientSdkClient<Readonly<{
|
|
311
|
-
users_get: ClientOperationDefinition<{
|
|
312
|
-
userId: string;
|
|
313
|
-
}, {
|
|
314
|
-
email: string | null;
|
|
315
|
-
name: string | null;
|
|
316
|
-
userId: string;
|
|
317
|
-
}>;
|
|
318
|
-
users_list: ClientOperationDefinition<{
|
|
319
|
-
page?: number;
|
|
320
|
-
pageSize?: number;
|
|
321
|
-
}, {
|
|
322
|
-
items: Array<{
|
|
323
|
-
email: string | null;
|
|
324
|
-
name: string | null;
|
|
325
|
-
userId: string;
|
|
326
|
-
}>;
|
|
327
|
-
}>;
|
|
328
|
-
users_deactivate: ClientOperationDefinition<{
|
|
329
|
-
userId: string;
|
|
330
|
-
}, {
|
|
331
|
-
userId: string;
|
|
332
|
-
}>;
|
|
333
|
-
roles_list: ClientOperationDefinition<Record<string, never>, {
|
|
334
|
-
items: ApplicationRole[];
|
|
335
|
-
}>;
|
|
336
|
-
roles_assign: ClientOperationDefinition<{
|
|
337
|
-
userId: string;
|
|
338
|
-
roles: string[];
|
|
339
|
-
}, {
|
|
340
|
-
userId: string;
|
|
341
|
-
}>;
|
|
342
|
-
roles_revoke: ClientOperationDefinition<{
|
|
343
|
-
userId: string;
|
|
344
|
-
roles: string[];
|
|
345
|
-
}, {
|
|
346
|
-
userId: string;
|
|
347
|
-
}>;
|
|
348
|
-
users_create_or_get: ClientOperationDefinition<{
|
|
349
|
-
email: string;
|
|
350
|
-
name: string;
|
|
351
|
-
roles: Array<string>;
|
|
352
|
-
}, {
|
|
353
|
-
email: string | null;
|
|
354
|
-
name: string | null;
|
|
355
|
-
userId: string;
|
|
356
|
-
created: boolean;
|
|
357
|
-
kind: "member" | "external_app_user";
|
|
358
|
-
}>;
|
|
359
311
|
context_get: ClientOperationDefinition<unknown[] | Readonly<Record<string, string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | /*elided*/ any | Readonly<{
|
|
360
312
|
readonly [key: string]: string | number | boolean | /*elided*/ any | Readonly< /*elided*/ any> | null;
|
|
361
313
|
}> | null)[] | Readonly<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as ResourceDefinition, $t as
|
|
2
|
-
import { $ as RealtimeTopicFilter, A as CiStreamEvent, C as followRun, G as RealtimeStreamEnd, H as createDirectTransport, J as createFetchEventSourceFactory, K as RealtimeStreamEvent, M as nextStreamCursor, Q as RealtimeTopic, S as FollowRunSource, U as RealtimeEventSource, V as DirectTransportOptions, W as RealtimeEventSourceFactory, X as RealtimeWindow, Y as RealtimeDocument, Z as RealtimeChange, _ as ClientSdkEntrypoint, a as RealtimeClientStatus, b as createClient, c as FixedWorkflowClient, d as DelegatedApplicationRuntime, et as realtimeTopicKey, f as DelegatedApplicationRuntimeOptions, g as ClientSdkClient, h as ClientDomains, i as RealtimeClientState, j as CiStreamPage, k as CiRunCancellation, l as FixedWorkflowClientOptions, m as createDelegatedApplicationRuntime, n as RealtimeClient, o as RealtimeTimers, p as DelegatedRuntimeState, q as RealtimeStreamHandlers, r as RealtimeClientOptions, s as createRealtimeClient, t as CiError, u as createFixedWorkflowClient, v as OrganizationClient, w as DEFAULT_FOLLOW_RUN_DEADLINE_MS, x as FollowRunOptions, y as clientSdkProtocolVersion } from "./index-
|
|
1
|
+
import { $ as ResourceDefinition, $t as FederatedAuthState, A as EntityFileFieldWrite, At as JsonValue, B as EntityRequest, Bt as clientOperationIds, C as EntityBatchInput, Ct as ResourceUpdateRequest, D as EntityClient, E as EntityBatchRefusedDetails, Et as createProxyTransport, F as EntityOperation, Ft as ClientOperationInput, G as EntityUploadSlot, Gt as JsonObject, H as EntityTransport, I as EntityOperationResult, It as ClientOperationMap, J as ResourceCapabilities, Jt as SearchQuery, K as IdempotencyKey, Kt as KnowledgeQuery, L as EntityPage, Lt as ClientOperationOutput, M as EntityFileWrite, Mt as OperationSuccess, N as EntityListQuery, Nt as ClientOperationDefinition, O as EntityCreateInput, Ot as CiErrorCode, P as EntityMemberValue, Pt as ClientOperationId, Q as ResourceCursor, Qt as FederatedAuthOptions, R as EntityProtocol, Rt as OperationExecutionOptions, S as createResourceClient, St as ResourceTransportRequest, T as EntityBatchRefusal, Tt as ProxyTransportOptions, U as EntityUpdateInput, V as EntityRestoreInput, Vt as isClientOperationId, W as EntityUploadInput, X as ResourceCreateInput, Xt as ClientFetch, Y as ResourceClient, Yt as WorkflowInvokeTarget, Z as ResourceCreateRequest, Zt as FederatedAuth, _t as ResourceRequestOptions, at as ResourceIdentityField, b as isEntityBatchRefusedError, bt as ResourceSort, cn as ServerSessionAuthOptions, ct as ResourceLifecycleRequest, dt as ResourceListResult, en as FederatedSessionIdentity, et as ResourceError, fn as CiTransportError, ft as ResourceMutationInput, gt as ResourceRecordId, ht as ResourceRecord, it as ResourceId, j as EntityFileValue, jt as OperationRequest, k as EntityDeleteInput, kt as CiResult, ln as createServerSessionAuth, lt as ResourceListQuery, mn as FederatedAuthErrorCode, mt as ResourcePaginationMode, n as EntityHttpTransportOptions, nt as ResourceFilter, ot as ResourceJsonValue, pn as FederatedAuthError, pt as ResourcePagination, q as PortableResourceSchema, qt as QueryFilter, r as createEntityHttpTransport, rt as ResourceGetRequest, st as ResourceLifecycleInput, t as EntityHttpDestination, tn as createFederatedAuth, tt as ResourceErrorCode, ut as ResourceListRequest, vt as ResourceResult, w as EntityBatchOp, wt as ProxyAuthentication, x as isEntityReadLimitError, xt as ResourceTransport, y as createEntityProtocol, yt as ResourceRevision, z as EntityReadLimitDetails, zt as TypedOperationExecutor } from "./resources-DVq8jSnc.js";
|
|
2
|
+
import { $ as RealtimeTopicFilter, A as CiStreamEvent, C as followRun, G as RealtimeStreamEnd, H as createDirectTransport, J as createFetchEventSourceFactory, K as RealtimeStreamEvent, M as nextStreamCursor, Q as RealtimeTopic, S as FollowRunSource, U as RealtimeEventSource, V as DirectTransportOptions, W as RealtimeEventSourceFactory, X as RealtimeWindow, Y as RealtimeDocument, Z as RealtimeChange, _ as ClientSdkEntrypoint, a as RealtimeClientStatus, b as createClient, c as FixedWorkflowClient, d as DelegatedApplicationRuntime, et as realtimeTopicKey, f as DelegatedApplicationRuntimeOptions, g as ClientSdkClient, h as ClientDomains, i as RealtimeClientState, j as CiStreamPage, k as CiRunCancellation, l as FixedWorkflowClientOptions, m as createDelegatedApplicationRuntime, n as RealtimeClient, o as RealtimeTimers, p as DelegatedRuntimeState, q as RealtimeStreamHandlers, r as RealtimeClientOptions, s as createRealtimeClient, t as CiError, u as createFixedWorkflowClient, v as OrganizationClient, w as DEFAULT_FOLLOW_RUN_DEADLINE_MS, x as FollowRunOptions, y as clientSdkProtocolVersion } from "./index-BTkfYlty.js";
|
|
3
3
|
export { 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,6 +1,6 @@
|
|
|
1
|
-
import { A as errors_exports, C as isClientOperationId, D as CiTransportError, O as FederatedAuthError, 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-
|
|
2
|
-
import { A as layerFromFactory, E as makeConnection, M as currentLink, N as createFetchEventSourceFactory, O as realtimeTopicKey, S as make, a as layer$2, c as layerFederated, f as DEFAULT_FOLLOW_RUN_DEADLINE_MS, g as CiClient, h as layer, i as FixedWorkflows, j as layerBrowser, k as layer$3, m as followSource, n as layer$1, p as Runs, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, y as layerFromExecutor } from "./service-
|
|
3
|
-
import { t as createResourceClient } from "./resources-
|
|
1
|
+
import { A as errors_exports, C as isClientOperationId, D as CiTransportError, O as FederatedAuthError, 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-DaANR0QD.js";
|
|
2
|
+
import { A as layerFromFactory, E as makeConnection, M as currentLink, N as createFetchEventSourceFactory, O as realtimeTopicKey, S as make, a as layer$2, c as layerFederated, f as DEFAULT_FOLLOW_RUN_DEADLINE_MS, g as CiClient, h as layer, i as FixedWorkflows, j as layerBrowser, k as layer$3, m as followSource, n as layer$1, p as Runs, s as FederatedAuth, t as DelegatedRuntime, u as layerServerSession, y as layerFromExecutor } from "./service-ZWwY3AJB.js";
|
|
3
|
+
import { t as createResourceClient } from "./resources-BedkrCzl.js";
|
|
4
4
|
import * as Clock from "effect/Clock";
|
|
5
5
|
import * as Context from "effect/Context";
|
|
6
6
|
import * as Duration from "effect/Duration";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as CiTransportError, l as makeEntityCore, p as runEntityRequest, r as fromEntityTransport, u as makeLegacyResourceCore } from "./service-
|
|
1
|
+
import { D as CiTransportError, l as makeEntityCore, p as runEntityRequest, r as fromEntityTransport, u as makeLegacyResourceCore } from "./service-DaANR0QD.js";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
4
4
|
/**
|
|
@@ -101,15 +101,14 @@ declare const layerServerSessionConfig: (config: Config.Wrap<ServerSessionAuthOp
|
|
|
101
101
|
*/
|
|
102
102
|
type FederatedSessionIdentity = Readonly<{
|
|
103
103
|
appId: string;
|
|
104
|
-
/** The App Permissions of the user's effective roles. */
|
|
105
|
-
appPermissions: readonly string[];
|
|
106
104
|
email: string | null;
|
|
107
|
-
/**
|
|
108
|
-
|
|
105
|
+
/**
|
|
106
|
+
* A person is a member or a guest of one Organization, never both; null
|
|
107
|
+
* for a tenant user without a membership.
|
|
108
|
+
*/
|
|
109
|
+
kind: "member" | "guest" | null;
|
|
109
110
|
name: string | null;
|
|
110
111
|
organizationId: string;
|
|
111
|
-
/** The user's effective roles on the app. */
|
|
112
|
-
roles: readonly string[];
|
|
113
112
|
userId: string;
|
|
114
113
|
}>;
|
|
115
114
|
type FederatedAuthState = Readonly<{
|
|
@@ -149,7 +148,6 @@ type FederatedAuthOptions = Readonly<{
|
|
|
149
148
|
navigate?: (url: string) => void;
|
|
150
149
|
now?: () => number;
|
|
151
150
|
redirectUri: string;
|
|
152
|
-
scopes: readonly string[];
|
|
153
151
|
sessionStorage?: Pick<Storage, "getItem" | "removeItem" | "setItem">;
|
|
154
152
|
tenantUrl: string;
|
|
155
153
|
}>;
|
|
@@ -162,120 +160,6 @@ type FederatedAuthOptions = Readonly<{
|
|
|
162
160
|
declare const createFederatedAuth: (options: FederatedAuthOptions) => FederatedAuth & Readonly<{
|
|
163
161
|
close: () => Promise<void>;
|
|
164
162
|
}>;
|
|
165
|
-
type ExternalApplicationsListAppUsersResponses = {
|
|
166
|
-
/**
|
|
167
|
-
* Success
|
|
168
|
-
*/
|
|
169
|
-
200: {
|
|
170
|
-
correlationId: string;
|
|
171
|
-
result: {
|
|
172
|
-
items: Array<{
|
|
173
|
-
email: string | null;
|
|
174
|
-
name: string | null;
|
|
175
|
-
userId: string;
|
|
176
|
-
}>;
|
|
177
|
-
};
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
type ExternalApplicationsListAppUsersResponse = ExternalApplicationsListAppUsersResponses[keyof ExternalApplicationsListAppUsersResponses];
|
|
181
|
-
type ExternalApplicationsCreateOrGetAppUserData = {
|
|
182
|
-
body: {
|
|
183
|
-
email: string;
|
|
184
|
-
name: string;
|
|
185
|
-
roles: Array<string>;
|
|
186
|
-
};
|
|
187
|
-
headers: {
|
|
188
|
-
authorization?: string;
|
|
189
|
-
'x-organization-id': string;
|
|
190
|
-
'x-correlation-id'?: string;
|
|
191
|
-
'x-external-audit-issuer'?: string;
|
|
192
|
-
'x-external-audit-subject'?: string;
|
|
193
|
-
'x-external-caller-kind'?: 'anonymous_visitor';
|
|
194
|
-
'x-external-ci-user-id'?: string;
|
|
195
|
-
'x-external-server-role'?: string;
|
|
196
|
-
};
|
|
197
|
-
path?: never;
|
|
198
|
-
query?: never;
|
|
199
|
-
url: '/application/v1/users';
|
|
200
|
-
};
|
|
201
|
-
type ExternalApplicationsCreateOrGetAppUserResponses = {
|
|
202
|
-
/**
|
|
203
|
-
* Success
|
|
204
|
-
*/
|
|
205
|
-
200: {
|
|
206
|
-
correlationId: string;
|
|
207
|
-
result: {
|
|
208
|
-
email: string | null;
|
|
209
|
-
name: string | null;
|
|
210
|
-
userId: string;
|
|
211
|
-
created: boolean;
|
|
212
|
-
kind: 'member' | 'external_app_user';
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
type ExternalApplicationsCreateOrGetAppUserResponse = ExternalApplicationsCreateOrGetAppUserResponses[keyof ExternalApplicationsCreateOrGetAppUserResponses];
|
|
217
|
-
type ExternalApplicationsCheckAppUserEmailData = {
|
|
218
|
-
body: {
|
|
219
|
-
email: string;
|
|
220
|
-
};
|
|
221
|
-
headers: {
|
|
222
|
-
authorization?: string;
|
|
223
|
-
'x-organization-id': string;
|
|
224
|
-
'x-correlation-id'?: string;
|
|
225
|
-
'x-external-audit-issuer'?: string;
|
|
226
|
-
'x-external-audit-subject'?: string;
|
|
227
|
-
'x-external-caller-kind'?: 'anonymous_visitor';
|
|
228
|
-
'x-external-ci-user-id'?: string;
|
|
229
|
-
'x-external-server-role'?: string;
|
|
230
|
-
};
|
|
231
|
-
path?: never;
|
|
232
|
-
query?: never;
|
|
233
|
-
url: '/application/v1/users/check-email';
|
|
234
|
-
};
|
|
235
|
-
type ExternalApplicationsCheckAppUserEmailResponses = {
|
|
236
|
-
/**
|
|
237
|
-
* Success
|
|
238
|
-
*/
|
|
239
|
-
200: {
|
|
240
|
-
correlationId: string;
|
|
241
|
-
result: {
|
|
242
|
-
usable: true;
|
|
243
|
-
} | {
|
|
244
|
-
reason: 'user_unavailable' | 'target_inactive';
|
|
245
|
-
usable: false;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
type ExternalApplicationsCheckAppUserEmailResponse = ExternalApplicationsCheckAppUserEmailResponses[keyof ExternalApplicationsCheckAppUserEmailResponses];
|
|
250
|
-
type ExternalApplicationsGetAppUserResponses = {
|
|
251
|
-
/**
|
|
252
|
-
* Success
|
|
253
|
-
*/
|
|
254
|
-
200: {
|
|
255
|
-
correlationId: string;
|
|
256
|
-
result: {
|
|
257
|
-
email: string | null;
|
|
258
|
-
name: string | null;
|
|
259
|
-
userId: string;
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
type ExternalApplicationsGetAppUserResponse = ExternalApplicationsGetAppUserResponses[keyof ExternalApplicationsGetAppUserResponses];
|
|
264
|
-
type ExternalApplicationsListAppRolesResponses = {
|
|
265
|
-
/**
|
|
266
|
-
* Success
|
|
267
|
-
*/
|
|
268
|
-
200: {
|
|
269
|
-
correlationId: string;
|
|
270
|
-
result: {
|
|
271
|
-
items: Array<{
|
|
272
|
-
id: string;
|
|
273
|
-
key: string;
|
|
274
|
-
}>;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
type ExternalApplicationsListAppRolesResponse = ExternalApplicationsListAppRolesResponses[keyof ExternalApplicationsListAppRolesResponses];
|
|
279
163
|
type JsonValue$1 = boolean | null | number | readonly JsonValue$1[] | Readonly<{
|
|
280
164
|
readonly [key: string]: JsonValue$1;
|
|
281
165
|
}> | string;
|
|
@@ -353,40 +237,6 @@ type KnowledgeQuery = {
|
|
|
353
237
|
op: "autocomplete";
|
|
354
238
|
});
|
|
355
239
|
type ExternalApplicationOperationRequest = {
|
|
356
|
-
input: {
|
|
357
|
-
userId: string;
|
|
358
|
-
};
|
|
359
|
-
operationId: "users_get";
|
|
360
|
-
} | {
|
|
361
|
-
input: {
|
|
362
|
-
page?: number;
|
|
363
|
-
pageSize?: number;
|
|
364
|
-
};
|
|
365
|
-
operationId: "users_list";
|
|
366
|
-
} | {
|
|
367
|
-
input: {
|
|
368
|
-
userId: string;
|
|
369
|
-
};
|
|
370
|
-
operationId: "users_deactivate";
|
|
371
|
-
} | {
|
|
372
|
-
input: Record<string, never>;
|
|
373
|
-
operationId: "roles_list";
|
|
374
|
-
} | {
|
|
375
|
-
input: {
|
|
376
|
-
userId: string;
|
|
377
|
-
roles: string[];
|
|
378
|
-
};
|
|
379
|
-
operationId: "roles_assign";
|
|
380
|
-
} | {
|
|
381
|
-
input: {
|
|
382
|
-
userId: string;
|
|
383
|
-
roles: string[];
|
|
384
|
-
};
|
|
385
|
-
operationId: "roles_revoke";
|
|
386
|
-
} | {
|
|
387
|
-
input: ExternalApplicationsCreateOrGetAppUserData["body"];
|
|
388
|
-
operationId: "users_create_or_get";
|
|
389
|
-
} | {
|
|
390
240
|
input: JsonObject | unknown[];
|
|
391
241
|
operationId: "context_get";
|
|
392
242
|
} | {
|
|
@@ -551,15 +401,7 @@ interface EnvelopeSuccess<Id extends string, Result> {
|
|
|
551
401
|
operationId: Id;
|
|
552
402
|
result: Result;
|
|
553
403
|
}
|
|
554
|
-
type ExternalApplicationOperationSuccess = EnvelopeSuccess<"
|
|
555
|
-
userId: string;
|
|
556
|
-
}> | EnvelopeSuccess<"roles_list", {
|
|
557
|
-
items: ApplicationRole[];
|
|
558
|
-
}> | EnvelopeSuccess<"roles_assign", {
|
|
559
|
-
userId: string;
|
|
560
|
-
}> | EnvelopeSuccess<"roles_revoke", {
|
|
561
|
-
userId: string;
|
|
562
|
-
}> | EnvelopeSuccess<"users_create_or_get", ApplicationUserResolution> | EnvelopeSuccess<"context_get", JsonObject> | EnvelopeSuccess<"knowledge_query", JsonObject> | EnvelopeSuccess<"knowledge_get_entity_schema_snapshot", JsonObject> | EnvelopeSuccess<"knowledge_search_entities", JsonObject> | EnvelopeSuccess<"knowledge_facets", JsonObject> | EnvelopeSuccess<"knowledge_get_schema_query_context", JsonObject> | EnvelopeSuccess<"knowledge_autocomplete", JsonObject> | EnvelopeSuccess<"knowledge_get_entity", JsonObject> | EnvelopeSuccess<"knowledge_create_entity", JsonObject> | EnvelopeSuccess<"knowledge_update_entity", JsonObject> | EnvelopeSuccess<"knowledge_upsert_entity", JsonObject> | EnvelopeSuccess<"knowledge_delete_entity", JsonObject> | EnvelopeSuccess<"agents_list", JsonObject> | EnvelopeSuccess<"agents_invoke", {
|
|
404
|
+
type ExternalApplicationOperationSuccess = EnvelopeSuccess<"context_get", JsonObject> | EnvelopeSuccess<"knowledge_query", JsonObject> | EnvelopeSuccess<"knowledge_get_entity_schema_snapshot", JsonObject> | EnvelopeSuccess<"knowledge_search_entities", JsonObject> | EnvelopeSuccess<"knowledge_facets", JsonObject> | EnvelopeSuccess<"knowledge_get_schema_query_context", JsonObject> | EnvelopeSuccess<"knowledge_autocomplete", JsonObject> | EnvelopeSuccess<"knowledge_get_entity", JsonObject> | EnvelopeSuccess<"knowledge_create_entity", JsonObject> | EnvelopeSuccess<"knowledge_update_entity", JsonObject> | EnvelopeSuccess<"knowledge_upsert_entity", JsonObject> | EnvelopeSuccess<"knowledge_delete_entity", JsonObject> | EnvelopeSuccess<"agents_list", JsonObject> | EnvelopeSuccess<"agents_invoke", {
|
|
563
405
|
runId: string;
|
|
564
406
|
}> | EnvelopeSuccess<"skills_list", JsonObject> | EnvelopeSuccess<"skills_invoke", {
|
|
565
407
|
runId: string;
|
|
@@ -577,11 +419,6 @@ type ExternalApplicationOperationSuccess = EnvelopeSuccess<"users_get", Applicat
|
|
|
577
419
|
conversationId: string;
|
|
578
420
|
runId: string;
|
|
579
421
|
}> | EnvelopeSuccess<"conversations_history", ConversationHistory>;
|
|
580
|
-
/** User details returned by the application's user-management gateway. */
|
|
581
|
-
type ApplicationUser = ExternalApplicationsGetAppUserResponse["result"];
|
|
582
|
-
type ApplicationUserResolution = ExternalApplicationsCreateOrGetAppUserResponse["result"];
|
|
583
|
-
type ApplicationUserPage = ExternalApplicationsListAppUsersResponse["result"];
|
|
584
|
-
type ApplicationRole = ExternalApplicationsListAppRolesResponse["result"]["items"][number];
|
|
585
422
|
declare const storageFileIdBrand: unique symbol;
|
|
586
423
|
/** A durable private file of the application's Organization. */
|
|
587
424
|
type StorageFileId = string & Readonly<{
|
|
@@ -597,19 +434,11 @@ interface DurableFileUpload {
|
|
|
597
434
|
fileName: string;
|
|
598
435
|
sizeBytes: number;
|
|
599
436
|
}
|
|
600
|
-
|
|
601
|
-
input: ExternalApplicationsCheckAppUserEmailData["body"];
|
|
602
|
-
operationId: "users_check_email";
|
|
603
|
-
} | {
|
|
437
|
+
interface ExternalApplicationServiceOperationRequest {
|
|
604
438
|
input: DurableFileUpload;
|
|
605
439
|
operationId: "files_upload";
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
* Whether `users_create_or_get` would accept an email, checked without
|
|
609
|
-
* creating anything; an unknown email is usable.
|
|
610
|
-
*/
|
|
611
|
-
type ApplicationUserEmailCheck = ExternalApplicationsCheckAppUserEmailResponse["result"];
|
|
612
|
-
type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"users_check_email", ApplicationUserEmailCheck> | EnvelopeSuccess<"files_upload", {
|
|
440
|
+
}
|
|
441
|
+
type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"files_upload", {
|
|
613
442
|
storageFileId: StorageFileId;
|
|
614
443
|
}>;
|
|
615
444
|
/** Every operation a confidential server client may invoke. */
|
|
@@ -623,7 +452,7 @@ type ExternalApplicationOperationSuccessFor<Id extends ExternalApplicationServer
|
|
|
623
452
|
operationId: Id;
|
|
624
453
|
}>;
|
|
625
454
|
/** Generated, curated external-application operation authority. */
|
|
626
|
-
declare const clientOperationIds: readonly ["
|
|
455
|
+
declare const clientOperationIds: readonly ["context_get", "knowledge_query", "knowledge_get_entity_schema_snapshot", "knowledge_search_entities", "knowledge_facets", "knowledge_get_schema_query_context", "knowledge_autocomplete", "knowledge_get_entity", "knowledge_create_entity", "knowledge_update_entity", "knowledge_upsert_entity", "knowledge_delete_entity", "agents_list", "agents_invoke", "skills_list", "skills_invoke", "workflows_list", "workflows_invoke", "runs_get", "runs_stream", "runs_cancel", "attachments_upload", "attachments_download_url", "conversations_continue", "conversations_history"];
|
|
627
456
|
type ClientOperationId = ExternalApplicationOperationId;
|
|
628
457
|
declare const isClientOperationId: (value: string) => value is ClientOperationId;
|
|
629
458
|
interface ClientOperationDefinition<Input, Output> {
|
|
@@ -1238,4 +1067,4 @@ declare const makeEntityHttpExecute: (options: EntityHttpTransportOptions) => En
|
|
|
1238
1067
|
declare const createEntityHttpTransport: (options: EntityHttpTransportOptions) => EntityTransport & Readonly<{
|
|
1239
1068
|
close: () => Promise<void>;
|
|
1240
1069
|
}>;
|
|
1241
|
-
export { ResourceDefinition as $,
|
|
1070
|
+
export { ResourceDefinition as $, FederatedAuthState as $t, EntityFileFieldWrite as A, JsonValue as At, EntityRequest as B, clientOperationIds as Bt, EntityBatchInput as C, ResourceUpdateRequest as Ct, EntityClient as D, CiError as Dt, EntityBatchRefusedDetails as E, createProxyTransport as Et, EntityOperation as F, ClientOperationInput as Ft, EntityUploadSlot as G, JsonObject as Gt, EntityTransport as H, AgentInvokeTarget as Ht, EntityOperationResult as I, ClientOperationMap as It, ResourceCapabilities as J, SearchQuery as Jt, IdempotencyKey as K, KnowledgeQuery as Kt, EntityPage as L, ClientOperationOutput as Lt, EntityFileWrite as M, OperationSuccess as Mt, EntityListQuery as N, ClientOperationDefinition as Nt, EntityCreateInput as O, CiErrorCode as Ot, EntityMemberValue as P, ClientOperationId as Pt, ResourceCursor as Q, FederatedAuthOptions as Qt, EntityProtocol as R, OperationExecutionOptions as Rt, createResourceClient as S, ResourceTransportRequest as St, EntityBatchRefusal as T, ProxyTransportOptions as Tt, EntityUpdateInput as U, ConversationContinueTarget as Ut, EntityRestoreInput as V, isClientOperationId as Vt, EntityUploadInput as W, ConversationHistory as Wt, ResourceCreateInput as X, ClientFetch as Xt, ResourceClient as Y, WorkflowInvokeTarget as Yt, ResourceCreateRequest as Z, FederatedAuth as Zt, layerLegacy as _, ResourceRequestOptions as _t, LegacyResourceClient as a, layerFederatedConfig as an, ResourceIdentityField as at, isEntityBatchRefusedError as b, ResourceSort as bt, LegacyResourcesValue as c, ServerSessionAuthOptions as cn, ResourceLifecycleRequest as ct, ResourcesFromEntityTransportOptions as d, CiErrorCode$1 as dn, ResourceListResult as dt, FederatedSessionIdentity as en, ResourceError as et, ResourcesLayerOptions as f, CiTransportError as fn, ResourceMutationInput as ft, layerFromEntityTransport as g, ResourceRecordId as gt, layerConfig as h, ResourceRecord as ht, makeEntityHttpExecute as i, layerFederated as in, ResourceId as it, EntityFileValue as j, OperationRequest as jt, EntityDeleteInput as k, CiResult as kt, ResourceEntityClient as l, createServerSessionAuth as ln, ResourceListQuery as lt, layer as m, FederatedAuthErrorCode as mn, ResourcePaginationMode as mt, EntityHttpTransportOptions as n, FederatedAuth$1 as nn, ResourceFilter as nt, LegacyResources as o, layerServerSession as on, ResourceJsonValue as ot, ResourcesValue as p, FederatedAuthError as pn, ResourcePagination as pt, PortableResourceSchema as q, QueryFilter as qt, createEntityHttpTransport as r, FederatedAuthValue as rn, ResourceGetRequest as rt, LegacyResourcesLayerOptions as s, layerServerSessionConfig as sn, ResourceLifecycleInput as st, EntityHttpDestination as t, createFederatedAuth as tn, ResourceErrorCode as tt, Resources as u, CiError$1 as un, ResourceListRequest as ut, layerLegacyConfig as v, ResourceResult as vt, EntityBatchOp as w, ProxyAuthentication as wt, isEntityReadLimitError as x, ResourceTransport as xt, createEntityProtocol as y, ResourceRevision as yt, EntityReadLimitDetails as z, TypedOperationExecutor as zt };
|
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-DVq8jSnc.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-DaANR0QD.js";
|
|
2
|
+
import { t as createResourceClient } from "./resources-BedkrCzl.js";
|
|
3
3
|
export { createEntityHttpTransport, createEntityProtocol, createResourceClient, isEntityBatchRefusedError, isEntityReadLimitError };
|
|
@@ -92,13 +92,6 @@ var CiTransportError = class extends Schema.TaggedError()("CiTransportError", {
|
|
|
92
92
|
const completeOperationRegistry = (ids) => ids;
|
|
93
93
|
/** Generated, curated external-application operation authority. */
|
|
94
94
|
const clientOperationIds = completeOperationRegistry([
|
|
95
|
-
"users_get",
|
|
96
|
-
"users_list",
|
|
97
|
-
"users_deactivate",
|
|
98
|
-
"roles_list",
|
|
99
|
-
"roles_assign",
|
|
100
|
-
"roles_revoke",
|
|
101
|
-
"users_create_or_get",
|
|
102
95
|
"context_get",
|
|
103
96
|
"knowledge_query",
|
|
104
97
|
"knowledge_get_entity_schema_snapshot",
|
|
@@ -297,47 +290,6 @@ const dedicatedHttpCall = (operationId, input) => {
|
|
|
297
290
|
if (removedEntityOperation.has(operationId)) return null;
|
|
298
291
|
const record = isRecord$1(input) ? input : {};
|
|
299
292
|
switch (operationId) {
|
|
300
|
-
case "users_create_or_get": return {
|
|
301
|
-
body: input,
|
|
302
|
-
method: "POST",
|
|
303
|
-
parse: "json",
|
|
304
|
-
pathname: "/users"
|
|
305
|
-
};
|
|
306
|
-
case "users_list": {
|
|
307
|
-
const query = {};
|
|
308
|
-
if (typeof record.page === "number") query.page = String(record.page);
|
|
309
|
-
if (typeof record.pageSize === "number") query.pageSize = String(record.pageSize);
|
|
310
|
-
return {
|
|
311
|
-
method: "GET",
|
|
312
|
-
parse: "json",
|
|
313
|
-
pathname: "/users",
|
|
314
|
-
query
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
case "roles_list": return {
|
|
318
|
-
method: "GET",
|
|
319
|
-
parse: "json",
|
|
320
|
-
pathname: "/roles"
|
|
321
|
-
};
|
|
322
|
-
case "users_get":
|
|
323
|
-
case "users_deactivate":
|
|
324
|
-
case "roles_assign":
|
|
325
|
-
case "roles_revoke": {
|
|
326
|
-
const userId = textField(record, "userId");
|
|
327
|
-
if (userId === void 0) return null;
|
|
328
|
-
const pathname = `/users/${encodeURIComponent(userId)}`;
|
|
329
|
-
if (operationId === "users_get" || operationId === "users_deactivate") return {
|
|
330
|
-
method: operationId === "users_get" ? "GET" : "DELETE",
|
|
331
|
-
parse: "json",
|
|
332
|
-
pathname
|
|
333
|
-
};
|
|
334
|
-
return {
|
|
335
|
-
body: { roles: record.roles },
|
|
336
|
-
method: operationId === "roles_assign" ? "POST" : "DELETE",
|
|
337
|
-
parse: "json",
|
|
338
|
-
pathname: `${pathname}/roles`
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
293
|
case "context_get": return {
|
|
342
294
|
method: "GET",
|
|
343
295
|
parse: "json",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as CiTransportError, O as FederatedAuthError, S as fromCiResult, T as CiError, _ as backendErrorCode, b as proxyHttpOptions, j as ciErrorCodes, v as directHttpOptions, w as toCiResult, y as makeHttpExecute } from "./service-
|
|
1
|
+
import { D as CiTransportError, O as FederatedAuthError, S as fromCiResult, T as CiError, _ as backendErrorCode, b as proxyHttpOptions, j as ciErrorCodes, v as directHttpOptions, w as toCiResult, y as makeHttpExecute } from "./service-DaANR0QD.js";
|
|
2
2
|
import * as Predicate from "effect/Predicate";
|
|
3
3
|
import * as Schema from "effect/Schema";
|
|
4
4
|
import * as Arr from "effect/Array";
|
|
@@ -1110,7 +1110,7 @@ const makeFederated = Effect.fnUntraced(function* makeFederated(options) {
|
|
|
1110
1110
|
const now = options.now ?? Date.now;
|
|
1111
1111
|
const storage = options.sessionStorage ?? globalThis.sessionStorage;
|
|
1112
1112
|
const navigate = navigation(options.navigate);
|
|
1113
|
-
if (options.clientId.length === 0
|
|
1113
|
+
if (options.clientId.length === 0) return yield* configurationError("clientId is required");
|
|
1114
1114
|
if (crypto === void 0 || storage === void 0 || fetch === void 0) return yield* configurationError("Browser crypto, fetch, and sessionStorage are required");
|
|
1115
1115
|
const storageKey = `ci:federated-auth:${redirectUri.origin}:${options.clientId}`;
|
|
1116
1116
|
const { changes, getState, subscribe, transition } = makeState();
|
|
@@ -1145,7 +1145,6 @@ const makeFederated = Effect.fnUntraced(function* makeFederated(options) {
|
|
|
1145
1145
|
authorizationUrl.searchParams.set("client_id", options.clientId);
|
|
1146
1146
|
authorizationUrl.searchParams.set("redirect_uri", redirectUri.href);
|
|
1147
1147
|
authorizationUrl.searchParams.set("response_type", "code");
|
|
1148
|
-
authorizationUrl.searchParams.set("scope", options.scopes.join(" "));
|
|
1149
1148
|
authorizationUrl.searchParams.set("state", transaction.state);
|
|
1150
1149
|
authorizationUrl.searchParams.set("code_challenge", pkce.challenge);
|
|
1151
1150
|
authorizationUrl.searchParams.set("code_challenge_method", pkce.method);
|
|
@@ -1248,34 +1247,25 @@ const readString = (record, key) => {
|
|
|
1248
1247
|
const candidate = record[key];
|
|
1249
1248
|
return typeof candidate === "string" ? candidate : null;
|
|
1250
1249
|
};
|
|
1251
|
-
|
|
1252
|
-
const candidate = record[key];
|
|
1253
|
-
if (!Array.isArray(candidate)) return null;
|
|
1254
|
-
const items = candidate;
|
|
1255
|
-
return items.every((item) => typeof item === "string") ? items : null;
|
|
1256
|
-
};
|
|
1250
|
+
/** The membership kind, or undefined when the value is not one. */
|
|
1257
1251
|
const readKind = (record) => {
|
|
1258
1252
|
const { kind } = record;
|
|
1259
|
-
return kind === "member" || kind === "
|
|
1253
|
+
return kind === "member" || kind === "guest" || kind === null ? kind : void 0;
|
|
1260
1254
|
};
|
|
1261
1255
|
const parseIdentity = (value) => {
|
|
1262
1256
|
const identity = asRecord$1(asRecord$1(value)?.identity);
|
|
1263
1257
|
if (identity === null) return null;
|
|
1264
1258
|
const appId = readString(identity, "appId");
|
|
1265
|
-
const appPermissions = readStrings(identity, "appPermissions");
|
|
1266
1259
|
const kind = readKind(identity);
|
|
1267
1260
|
const organizationId = readString(identity, "organizationId");
|
|
1268
|
-
const roles = readStrings(identity, "roles");
|
|
1269
1261
|
const userId = readString(identity, "userId");
|
|
1270
|
-
if (appId === null ||
|
|
1262
|
+
if (appId === null || kind === void 0 || organizationId === null || userId === null) return null;
|
|
1271
1263
|
return {
|
|
1272
1264
|
appId,
|
|
1273
|
-
appPermissions,
|
|
1274
1265
|
email: readString(identity, "email"),
|
|
1275
1266
|
kind,
|
|
1276
1267
|
name: readString(identity, "name"),
|
|
1277
1268
|
organizationId,
|
|
1278
|
-
roles,
|
|
1279
1269
|
userId
|
|
1280
1270
|
};
|
|
1281
1271
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/external-apps-client-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Framework-neutral client for Collective Intelligence external applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"ultracite": "7.10.7",
|
|
72
72
|
"vitest": "5.0.2"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "1718b80bc8d0ba696d78ac8f5f905c8dc46fe0c5"
|
|
75
75
|
}
|