@party-stack/ontology-server 0.12.1 → 0.14.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 +12 -3
- package/lib/authorization.js +1 -1
- package/lib/bindingFence.d.ts +5 -0
- package/lib/bindingFence.d.ts.map +1 -1
- package/lib/bindingFence.js +24 -3
- package/lib/bindingFence.js.map +1 -1
- package/lib/composition.d.ts +5 -17
- package/lib/composition.d.ts.map +1 -1
- package/lib/definitionProjection.d.ts.map +1 -1
- package/lib/definitionProjection.js +4 -4
- package/lib/definitionProjection.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/internalAccess.js +1 -4
- package/lib/internalAccess.js.map +1 -1
- package/lib/operations.d.ts +35 -166
- package/lib/operations.d.ts.map +1 -1
- package/lib/operations.js +3 -55
- package/lib/operations.js.map +1 -1
- package/lib/replicaBootstrap.d.ts +20 -26
- package/lib/replicaBootstrap.d.ts.map +1 -1
- package/lib/replicaBootstrap.js +78 -42
- package/lib/replicaBootstrap.js.map +1 -1
- package/lib/routing.d.ts +49 -19
- package/lib/routing.d.ts.map +1 -1
- package/lib/routing.js +80 -52
- package/lib/routing.js.map +1 -1
- package/lib/rpc.d.ts +655 -767
- package/lib/rpc.d.ts.map +1 -1
- package/lib/rpc.js +128 -35
- package/lib/rpc.js.map +1 -1
- package/lib/rpcLocal.d.ts.map +1 -1
- package/lib/rpcLocal.js +6 -1
- package/lib/rpcLocal.js.map +1 -1
- package/lib/rpcWorker.d.ts.map +1 -1
- package/lib/rpcWorker.js +4 -1
- package/lib/rpcWorker.js.map +1 -1
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OntologyInternalAccess } from "./internalAccess.js";
|
|
2
2
|
import { OntologyAuthenticate, OntologyBindingOptions, OntologyServerBindingOptions, ontologyServerHandlers } from "./composition.js";
|
|
3
|
-
import {
|
|
4
|
-
import { ManagedReplicaRoute, OntologyResolver, OntologyRoute,
|
|
5
|
-
export { type ManagedReplicaRoute, type OntologyAuthenticate, type OntologyBindingOptions, type OntologyInternalAccess, type OntologyResolver, type OntologyRoute, type
|
|
3
|
+
import { ReplicaUpstream } from "./replicaBootstrap.js";
|
|
4
|
+
import { ManagedReplicaRoute, OntologyResolver, OntologyRoute, OntologyRouteDeclaration, OntologyRouteFactory, OntologyRouteParams, OntologyServer, OntologyServerOptions, OntologyServerRoutes, OpenedOntologyRoute, makeOntologyServer, ontologyServerDispatch } from "./routing.js";
|
|
5
|
+
export { type ManagedReplicaRoute, type OntologyAuthenticate, type OntologyBindingOptions, type OntologyInternalAccess, type OntologyResolver, type OntologyRoute, type OntologyRouteDeclaration, type OntologyRouteFactory, type OntologyRouteParams, type OntologyServer, type OntologyServerBindingOptions, type OntologyServerOptions, type OntologyServerRoutes, type OpenedOntologyRoute, type ReplicaUpstream, makeOntologyServer, ontologyServerDispatch, ontologyServerHandlers };
|
package/lib/internalAccess.js
CHANGED
|
@@ -5,10 +5,7 @@ const withInternalCommands = (authorize, enabled) => (request, headers) => enabl
|
|
|
5
5
|
"ReplicaStatus",
|
|
6
6
|
"Traces",
|
|
7
7
|
"ControlOutbox",
|
|
8
|
-
"
|
|
9
|
-
"WatchPin",
|
|
10
|
-
"SetPin",
|
|
11
|
-
"ClearPin",
|
|
8
|
+
"System",
|
|
12
9
|
"DeleteLocalData",
|
|
13
10
|
"ReleaseOwner"
|
|
14
11
|
].includes(request.operation) ? Effect.void : authorize(request, headers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalAccess.js","names":[],"sources":["../src/internalAccess.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport type { OntologyRpcServerOptions } from \"./rpc.js\";\n\n/** Internal commands can inspect or change state outside the caller's IR policy.\n * Policy/context binding remain enforced. Without a policy, exposes raw capabilities.\n */\nexport type OntologyInternalAccess = true | ((context: Record<string, unknown>) => boolean);\n\n/** Adds internal commands without changing domain permissions or exposing raw replication. */\nexport const withInternalCommands =\n <R>(\n authorize: OntologyRpcServerOptions<R>[\"authorize\"],\n enabled: boolean\n ): OntologyRpcServerOptions<R>[\"authorize\"] =>\n (request, headers) =>\n enabled &&\n [\
|
|
1
|
+
{"version":3,"file":"internalAccess.js","names":[],"sources":["../src/internalAccess.ts"],"sourcesContent":["import { Effect } from \"effect\";\nimport type { OntologyRpcServerOptions } from \"./rpc.js\";\n\n/** Internal commands can inspect or change state outside the caller's IR policy.\n * Policy/context binding remain enforced. Without a policy, exposes raw capabilities.\n */\nexport type OntologyInternalAccess = true | ((context: Record<string, unknown>) => boolean);\n\n/** Adds internal commands without changing domain permissions or exposing raw replication. */\nexport const withInternalCommands =\n <R>(\n authorize: OntologyRpcServerOptions<R>[\"authorize\"],\n enabled: boolean\n ): OntologyRpcServerOptions<R>[\"authorize\"] =>\n (request, headers) =>\n enabled &&\n [\"ReplicaStatus\", \"Traces\", \"ControlOutbox\", \"System\", \"DeleteLocalData\", \"ReleaseOwner\"].includes(\n request.operation\n )\n ? Effect.void\n : authorize(request, headers);\n"],"mappings":";;;AASA,MAAa,wBAEL,WACA,aAEH,SAAS,YACN,WACA;CAAC;CAAiB;CAAU;CAAiB;CAAU;CAAmB;AAAc,CAAC,CAAC,SACtF,QAAQ,SACZ,IACM,OAAO,OACP,UAAU,SAAS,OAAO"}
|
package/lib/operations.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ import { ActionRequestSchema } from "@party-stack/ontology-backend/protocol";
|
|
|
5
5
|
import { ByteInput, ByteSource, ReadableByteInput } from "@party-stack/ontology-storage/blobs";
|
|
6
6
|
import { Effect, Layer, Queue, Schema, Scope, Stream } from "effect";
|
|
7
7
|
import { Rpc, RpcGroup } from "effect/rpc";
|
|
8
|
-
import { AttachmentCreateOptions,
|
|
9
|
-
import { QueryDocumentSchema } from "@party-stack/ontology-spec/effect";
|
|
8
|
+
import { AttachmentCreateOptions, ReplicaService } from "@party-stack/ontology-replica";
|
|
10
9
|
import { ObjectSubset } from "@party-stack/ontology-spec/query";
|
|
11
10
|
import { Headers } from "effect/http/Headers";
|
|
12
11
|
import { attachment } from "@party-stack/ontology-spec/values";
|
|
@@ -65,7 +64,7 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
65
64
|
readonly width: Schema.Number;
|
|
66
65
|
readonly height: Schema.Number;
|
|
67
66
|
}>>;
|
|
68
|
-
}>, typeof BackendError, never, never> | Rpc.Rpc<"
|
|
67
|
+
}>, typeof BackendError, never, never> | Rpc.Rpc<"ControlOutbox", Schema.Codec<{
|
|
69
68
|
readonly operation: "edit" | "remove" | "retry";
|
|
70
69
|
readonly id: string;
|
|
71
70
|
readonly invocation?: {
|
|
@@ -197,26 +196,7 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
197
196
|
}>, Schema.Struct<{
|
|
198
197
|
readonly kind: Schema.Literal<"bytes">;
|
|
199
198
|
readonly bytes: Schema.Uint8ArrayFromBase64;
|
|
200
|
-
}>]>, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"
|
|
201
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
202
|
-
readonly inputs?: {
|
|
203
|
-
readonly [x: string]: unknown;
|
|
204
|
-
} | undefined;
|
|
205
|
-
readonly attachments: "all" | "none";
|
|
206
|
-
readonly ready: boolean;
|
|
207
|
-
readonly previousGraphRetained: boolean;
|
|
208
|
-
readonly retainedGraph?: {
|
|
209
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
210
|
-
readonly inputs?: {
|
|
211
|
-
readonly [x: string]: unknown;
|
|
212
|
-
} | undefined;
|
|
213
|
-
readonly attachments: "all" | "none";
|
|
214
|
-
} | undefined;
|
|
215
|
-
readonly error?: {
|
|
216
|
-
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
217
|
-
readonly message: string;
|
|
218
|
-
} | undefined;
|
|
219
|
-
} | undefined, string, never, never>, typeof BackendError, never, never> | Rpc.Rpc<"ReleaseOwner", Schema.Void, Schema.Void, typeof BackendError, never, never> | Rpc.Rpc<"ReplicaStatus", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.Codec<{
|
|
199
|
+
}>]>, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"ReleaseOwner", Schema.Void, Schema.Void, typeof BackendError, never, never> | Rpc.Rpc<"ReplicaStatus", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.Codec<{
|
|
220
200
|
readonly capacity?: {
|
|
221
201
|
readonly memory?: {
|
|
222
202
|
readonly scope: "database" | "filesystem" | "isolate" | "origin" | "process";
|
|
@@ -249,14 +229,6 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
249
229
|
readonly targetBytes?: number | undefined;
|
|
250
230
|
};
|
|
251
231
|
} | undefined;
|
|
252
|
-
readonly pin?: {
|
|
253
|
-
readonly ready: boolean;
|
|
254
|
-
readonly previousGraphRetained: boolean;
|
|
255
|
-
readonly error?: {
|
|
256
|
-
readonly kind: string;
|
|
257
|
-
readonly message: string;
|
|
258
|
-
} | undefined;
|
|
259
|
-
} | undefined;
|
|
260
232
|
readonly sourceId: string;
|
|
261
233
|
readonly upstreamId: string;
|
|
262
234
|
readonly mode: "adapter" | "protocol";
|
|
@@ -283,6 +255,14 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
283
255
|
readonly message: string;
|
|
284
256
|
readonly retryable: boolean;
|
|
285
257
|
} | undefined;
|
|
258
|
+
readonly definition?: {
|
|
259
|
+
readonly hash: string;
|
|
260
|
+
readonly error?: {
|
|
261
|
+
readonly hash?: string | undefined;
|
|
262
|
+
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
263
|
+
readonly message: string;
|
|
264
|
+
} | undefined;
|
|
265
|
+
} | undefined;
|
|
286
266
|
readonly replicationError?: {
|
|
287
267
|
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
288
268
|
readonly message: string;
|
|
@@ -375,15 +355,7 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
375
355
|
};
|
|
376
356
|
}, string, never, never>, Schema.Codec<{
|
|
377
357
|
readonly [x: string]: unknown;
|
|
378
|
-
}, string, never, never>, typeof BackendError, never, never> | Rpc.Rpc<"
|
|
379
|
-
query: Schema.Codec<import("@party-stack/ontology-spec").QueryDocument, string, never, never>;
|
|
380
|
-
options: Schema.optional<Schema.Codec<{
|
|
381
|
-
readonly inputs?: {
|
|
382
|
-
readonly [x: string]: unknown;
|
|
383
|
-
} | undefined;
|
|
384
|
-
readonly attachments?: "all" | "none" | undefined;
|
|
385
|
-
}, string, never, never>>;
|
|
386
|
-
}>, Schema.Void, typeof BackendError, never, never> | Rpc.Rpc<"Traces", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.$Array<Schema.Struct<{
|
|
358
|
+
}, string, never, never>, typeof BackendError, never, never> | Rpc.Rpc<"Traces", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.$Array<Schema.Struct<{
|
|
387
359
|
readonly id: Schema.String;
|
|
388
360
|
readonly traceId: Schema.String;
|
|
389
361
|
readonly parentId: Schema.optional<Schema.String>;
|
|
@@ -426,26 +398,7 @@ export declare const OntologyOperationRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"ApplyActi
|
|
|
426
398
|
readonly messageSource?: "configured" | "standard" | undefined;
|
|
427
399
|
}[];
|
|
428
400
|
};
|
|
429
|
-
}, string, never, never>, typeof BackendError, never, never> | Rpc.Rpc<"WatchChanges", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.Literal<"invalidate">, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"
|
|
430
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
431
|
-
readonly inputs?: {
|
|
432
|
-
readonly [x: string]: unknown;
|
|
433
|
-
} | undefined;
|
|
434
|
-
readonly attachments: "all" | "none";
|
|
435
|
-
readonly ready: boolean;
|
|
436
|
-
readonly previousGraphRetained: boolean;
|
|
437
|
-
readonly retainedGraph?: {
|
|
438
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
439
|
-
readonly inputs?: {
|
|
440
|
-
readonly [x: string]: unknown;
|
|
441
|
-
} | undefined;
|
|
442
|
-
readonly attachments: "all" | "none";
|
|
443
|
-
} | undefined;
|
|
444
|
-
readonly error?: {
|
|
445
|
-
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
446
|
-
readonly message: string;
|
|
447
|
-
} | undefined;
|
|
448
|
-
} | undefined, string, never, never>, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"WatchSubset", Schema.Codec<ObjectSubset, string, never, never>, import("effect/rpc/RpcSchema").Stream<Schema.Literals<readonly ["reset", "invalidate"]>, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"WriteAttachmentChunk", Schema.Struct<{
|
|
401
|
+
}, string, never, never>, typeof BackendError, never, never> | Rpc.Rpc<"WatchChanges", Schema.Void, import("effect/rpc/RpcSchema").Stream<Schema.Literal<"invalidate">, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"WatchSubset", Schema.Codec<ObjectSubset, string, never, never>, import("effect/rpc/RpcSchema").Stream<Schema.Literals<readonly ["reset", "invalidate"]>, typeof BackendError>, Schema.Never, never, never> | Rpc.Rpc<"WriteAttachmentChunk", Schema.Struct<{
|
|
449
402
|
readonly uploadId: Schema.NonEmptyString;
|
|
450
403
|
readonly sequence: Schema.Int;
|
|
451
404
|
readonly bytes: Schema.Uint8ArrayFromBase64;
|
|
@@ -491,19 +444,17 @@ export type OntologyOperationRequest = {
|
|
|
491
444
|
readonly id: string;
|
|
492
445
|
readonly command: "remove" | "retry" | "edit";
|
|
493
446
|
readonly invocation?: Schema.Schema.Type<typeof ActionRequestSchema>;
|
|
494
|
-
} |
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
readonly
|
|
499
|
-
readonly options?: Schema.Schema.Type<typeof PinOptionsSchema>;
|
|
447
|
+
} |
|
|
448
|
+
/** Reads and writes of the endpoint's system ontology (the `system` resource): its replica's
|
|
449
|
+
* downloads and status. */
|
|
450
|
+
{
|
|
451
|
+
readonly operation: "System";
|
|
500
452
|
} | {
|
|
501
453
|
readonly operation: "ReplicaStatus" | "Traces" | "DeleteLocalData" | "ReleaseOwner";
|
|
502
454
|
};
|
|
503
455
|
export type OntologyOperationOptions<R = never> = ErrorProjectionOptions & {
|
|
504
456
|
readonly attachmentTransfers?: AttachmentTransferPolicy<R>;
|
|
505
457
|
readonly replica?: ReplicaService;
|
|
506
|
-
readonly pins?: ReplicaPinControls;
|
|
507
458
|
readonly traces?: TraceStore;
|
|
508
459
|
readonly backend?: import("@party-stack/ontology-backend").OntologyBackendService;
|
|
509
460
|
readonly ready?: Effect.Effect<void, BackendError, R>;
|
|
@@ -516,7 +467,7 @@ export declare const ontologyAttachmentHandlers: <R>(options: OntologyOperationO
|
|
|
516
467
|
create: (request: AttachmentUpload, blob: import("@party-stack/ontology-storage/blobs").ByteInput) => Effect.Effect<attachment, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">, R>;
|
|
517
468
|
read: (attachment: AttachmentValue, headers: Headers) => Effect.Effect<ByteInput, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">, R | Scope.Scope>;
|
|
518
469
|
};
|
|
519
|
-
export declare const ontologyOperationHandlers: <R>(options: OntologyOperationOptions<R>, authorize?: OntologyOperationOptions<R>["authorize"]) => Layer.Layer<Rpc.Handler<"ApplyAction"> | Rpc.Handler<"AttachmentMetadata"> | Rpc.Handler<"
|
|
470
|
+
export declare const ontologyOperationHandlers: <R>(options: OntologyOperationOptions<R>, authorize?: OntologyOperationOptions<R>["authorize"]) => Layer.Layer<Rpc.Handler<"ApplyAction"> | Rpc.Handler<"AttachmentMetadata"> | Rpc.Handler<"ControlOutbox"> | Rpc.Handler<"CreateAttachment"> | Rpc.Handler<"Decrypt"> | Rpc.Handler<"DeleteLocalData"> | Rpc.Handler<"LoadSubset"> | Rpc.Handler<"PullChanges"> | Rpc.Handler<"Query"> | Rpc.Handler<"QueryFunction"> | Rpc.Handler<"ReadAttachment"> | Rpc.Handler<"ReleaseOwner"> | Rpc.Handler<"ReplicaStatus"> | Rpc.Handler<"ResolveActionParameters"> | Rpc.Handler<"Traces"> | Rpc.Handler<"ValidateAction"> | Rpc.Handler<"WatchChanges"> | Rpc.Handler<"WatchSubset"> | Rpc.Handler<"WriteAttachmentChunk">, never, Exclude<Exclude<R, never>, Scope.Scope> | Exclude<Exclude<Exclude<R, Scope.Scope>, never>, Scope.Scope>>;
|
|
520
471
|
export interface ProtocolAttachments {
|
|
521
472
|
readonly create: (input: ByteInput | ReadableByteInput, options?: AttachmentCreateOptions) => Effect.Effect<{
|
|
522
473
|
readonly attachment: attachment;
|
|
@@ -540,7 +491,6 @@ export interface OntologyOperationsClient {
|
|
|
540
491
|
readonly outbox: Pick<import("@party-stack/ontology-replica").ReplicaService["outbox"], "remove" | "retry" | "edit">;
|
|
541
492
|
readonly traces: TraceStore;
|
|
542
493
|
readonly replicaMonitor: import("@party-stack/ontology-replica").ReplicaMonitor;
|
|
543
|
-
readonly pins: ReplicaPinControls;
|
|
544
494
|
readonly deleteLocalData: Effect.Effect<void, BackendError>;
|
|
545
495
|
readonly releaseOwner: Effect.Effect<void, BackendError>;
|
|
546
496
|
}
|
|
@@ -589,11 +539,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
589
539
|
readonly height: number;
|
|
590
540
|
} | undefined;
|
|
591
541
|
}, import("effect/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">), never>;
|
|
592
|
-
readonly ClearPin: <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
|
|
593
|
-
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
594
|
-
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
595
|
-
readonly discard?: Discard | undefined;
|
|
596
|
-
} | undefined) => Effect.Effect<Discard extends true ? void : void, import("effect/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">), never>;
|
|
597
542
|
readonly ControlOutbox: <const AsQueue extends boolean = false, const Discard = false>(input: unknown, options?: {
|
|
598
543
|
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
599
544
|
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
@@ -770,30 +715,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
770
715
|
readonly kind: "bytes";
|
|
771
716
|
readonly bytes: Uint8Array<ArrayBufferLike>;
|
|
772
717
|
}, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced"> | import("effect/rpc/RpcClientError").RpcClientError, never>;
|
|
773
|
-
readonly ReadPin: <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
|
|
774
|
-
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
775
|
-
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
776
|
-
readonly discard?: Discard | undefined;
|
|
777
|
-
} | undefined) => Effect.Effect<Discard extends true ? void : {
|
|
778
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
779
|
-
readonly inputs?: {
|
|
780
|
-
readonly [x: string]: unknown;
|
|
781
|
-
} | undefined;
|
|
782
|
-
readonly attachments: "all" | "none";
|
|
783
|
-
readonly ready: boolean;
|
|
784
|
-
readonly previousGraphRetained: boolean;
|
|
785
|
-
readonly retainedGraph?: {
|
|
786
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
787
|
-
readonly inputs?: {
|
|
788
|
-
readonly [x: string]: unknown;
|
|
789
|
-
} | undefined;
|
|
790
|
-
readonly attachments: "all" | "none";
|
|
791
|
-
} | undefined;
|
|
792
|
-
readonly error?: {
|
|
793
|
-
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
794
|
-
readonly message: string;
|
|
795
|
-
} | undefined;
|
|
796
|
-
} | undefined, import("effect/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">), never>;
|
|
797
718
|
readonly ReleaseOwner: <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
|
|
798
719
|
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
799
720
|
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
@@ -837,14 +758,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
837
758
|
readonly targetBytes?: number | undefined;
|
|
838
759
|
};
|
|
839
760
|
} | undefined;
|
|
840
|
-
readonly pin?: {
|
|
841
|
-
readonly ready: boolean;
|
|
842
|
-
readonly previousGraphRetained: boolean;
|
|
843
|
-
readonly error?: {
|
|
844
|
-
readonly kind: string;
|
|
845
|
-
readonly message: string;
|
|
846
|
-
} | undefined;
|
|
847
|
-
} | undefined;
|
|
848
761
|
readonly sourceId: string;
|
|
849
762
|
readonly upstreamId: string;
|
|
850
763
|
readonly mode: "adapter" | "protocol";
|
|
@@ -871,6 +784,14 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
871
784
|
readonly message: string;
|
|
872
785
|
readonly retryable: boolean;
|
|
873
786
|
} | undefined;
|
|
787
|
+
readonly definition?: {
|
|
788
|
+
readonly hash: string;
|
|
789
|
+
readonly error?: {
|
|
790
|
+
readonly hash?: string | undefined;
|
|
791
|
+
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
792
|
+
readonly message: string;
|
|
793
|
+
} | undefined;
|
|
794
|
+
} | undefined;
|
|
874
795
|
readonly replicationError?: {
|
|
875
796
|
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
876
797
|
readonly message: string;
|
|
@@ -989,14 +910,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
989
910
|
readonly targetBytes?: number | undefined;
|
|
990
911
|
};
|
|
991
912
|
} | undefined;
|
|
992
|
-
readonly pin?: {
|
|
993
|
-
readonly ready: boolean;
|
|
994
|
-
readonly previousGraphRetained: boolean;
|
|
995
|
-
readonly error?: {
|
|
996
|
-
readonly kind: string;
|
|
997
|
-
readonly message: string;
|
|
998
|
-
} | undefined;
|
|
999
|
-
} | undefined;
|
|
1000
913
|
readonly sourceId: string;
|
|
1001
914
|
readonly upstreamId: string;
|
|
1002
915
|
readonly mode: "adapter" | "protocol";
|
|
@@ -1023,6 +936,14 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
1023
936
|
readonly message: string;
|
|
1024
937
|
readonly retryable: boolean;
|
|
1025
938
|
} | undefined;
|
|
939
|
+
readonly definition?: {
|
|
940
|
+
readonly hash: string;
|
|
941
|
+
readonly error?: {
|
|
942
|
+
readonly hash?: string | undefined;
|
|
943
|
+
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
944
|
+
readonly message: string;
|
|
945
|
+
} | undefined;
|
|
946
|
+
} | undefined;
|
|
1026
947
|
readonly replicationError?: {
|
|
1027
948
|
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
1028
949
|
readonly message: string;
|
|
@@ -1116,14 +1037,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
1116
1037
|
} | undefined) => Effect.Effect<Discard extends true ? void : {
|
|
1117
1038
|
readonly [x: string]: unknown;
|
|
1118
1039
|
}, import("effect/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">), never>;
|
|
1119
|
-
readonly SetPin: <const AsQueue extends boolean = false, const Discard = false>(input: {
|
|
1120
|
-
readonly query: unknown;
|
|
1121
|
-
readonly options?: unknown;
|
|
1122
|
-
}, options?: {
|
|
1123
|
-
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
1124
|
-
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
1125
|
-
readonly discard?: Discard | undefined;
|
|
1126
|
-
} | undefined) => Effect.Effect<Discard extends true ? void : void, import("effect/rpc/RpcClientError").RpcClientError | (Discard extends true ? never : BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced">), never>;
|
|
1127
1040
|
readonly Traces: <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
|
|
1128
1041
|
readonly asQueue?: AsQueue | undefined;
|
|
1129
1042
|
readonly streamBufferSize?: number | undefined;
|
|
@@ -1205,50 +1118,6 @@ export declare const makeOntologyOperationsClient: (client: {
|
|
|
1205
1118
|
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
1206
1119
|
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
1207
1120
|
} | undefined) => AsQueue extends true ? Effect.Effect<Queue.Dequeue<"invalidate", BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced"> | import("effect/Cause").Done<void> | import("effect/rpc/RpcClientError").RpcClientError>, never, Scope.Scope> : Stream.Stream<"invalidate", BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced"> | import("effect/rpc/RpcClientError").RpcClientError, never>;
|
|
1208
|
-
readonly WatchPin: <const AsQueue extends boolean = false, const Discard = false>(input: void, options?: {
|
|
1209
|
-
readonly asQueue?: AsQueue | undefined;
|
|
1210
|
-
readonly streamBufferSize?: number | undefined;
|
|
1211
|
-
readonly headers?: import("effect/http/Headers").Input | undefined;
|
|
1212
|
-
readonly context?: import("effect/Context").Context<never> | undefined;
|
|
1213
|
-
} | undefined) => AsQueue extends true ? Effect.Effect<Queue.Dequeue<{
|
|
1214
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
1215
|
-
readonly inputs?: {
|
|
1216
|
-
readonly [x: string]: unknown;
|
|
1217
|
-
} | undefined;
|
|
1218
|
-
readonly attachments: "all" | "none";
|
|
1219
|
-
readonly ready: boolean;
|
|
1220
|
-
readonly previousGraphRetained: boolean;
|
|
1221
|
-
readonly retainedGraph?: {
|
|
1222
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
1223
|
-
readonly inputs?: {
|
|
1224
|
-
readonly [x: string]: unknown;
|
|
1225
|
-
} | undefined;
|
|
1226
|
-
readonly attachments: "all" | "none";
|
|
1227
|
-
} | undefined;
|
|
1228
|
-
readonly error?: {
|
|
1229
|
-
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
1230
|
-
readonly message: string;
|
|
1231
|
-
} | undefined;
|
|
1232
|
-
} | undefined, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced"> | import("effect/Cause").Done<void> | import("effect/rpc/RpcClientError").RpcClientError>, never, Scope.Scope> : Stream.Stream<{
|
|
1233
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
1234
|
-
readonly inputs?: {
|
|
1235
|
-
readonly [x: string]: unknown;
|
|
1236
|
-
} | undefined;
|
|
1237
|
-
readonly attachments: "all" | "none";
|
|
1238
|
-
readonly ready: boolean;
|
|
1239
|
-
readonly previousGraphRetained: boolean;
|
|
1240
|
-
readonly retainedGraph?: {
|
|
1241
|
-
readonly query: import("@party-stack/ontology-spec").QueryDocument;
|
|
1242
|
-
readonly inputs?: {
|
|
1243
|
-
readonly [x: string]: unknown;
|
|
1244
|
-
} | undefined;
|
|
1245
|
-
readonly attachments: "all" | "none";
|
|
1246
|
-
} | undefined;
|
|
1247
|
-
readonly error?: {
|
|
1248
|
-
readonly kind: "Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced";
|
|
1249
|
-
readonly message: string;
|
|
1250
|
-
} | undefined;
|
|
1251
|
-
} | undefined, BackendError<"Conflict" | "Forbidden" | "HistoryExpired" | "Internal" | "InvalidConfiguration" | "InvalidRequest" | "InvalidResponse" | "NotFound" | "NotImplemented" | "RateLimited" | "ResultExpired" | "SchemaMismatch" | "SessionExpired" | "SessionReplaced" | "SourceMismatch" | "Unauthenticated" | "Unavailable" | "ValidationFailed" | "ViewReplaced"> | import("effect/rpc/RpcClientError").RpcClientError, never>;
|
|
1252
1121
|
readonly WatchSubset: <const AsQueue extends boolean = false, const Discard = false>(input: unknown, options?: {
|
|
1253
1122
|
readonly asQueue?: AsQueue | undefined;
|
|
1254
1123
|
readonly streamBufferSize?: number | undefined;
|
package/lib/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","names":["_$__attachmentTransfers_js0.AttachmentUpload","_$__attachmentTransfers_js0.AttachmentValue"],"sources":["../src/operations.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations.d.ts","names":["_$__attachmentTransfers_js0.AttachmentUpload","_$__attachmentTransfers_js0.AttachmentValue"],"sources":["../src/operations.ts"],"mappings":"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"}
|
package/lib/operations.js
CHANGED
|
@@ -5,10 +5,10 @@ import { ActionRequestSchema, ObjectSubsetCodec, protocolValueCodec } from "@par
|
|
|
5
5
|
import { attachmentByteSource, byteChunks, collectByteBlob, scopedByteSource } from "@party-stack/ontology-storage/blobs";
|
|
6
6
|
import { Effect, Exit, Fiber, Layer, Option, Queue, Schema, Scope, Sink, Stream } from "effect";
|
|
7
7
|
import { Rpc, RpcGroup } from "effect/rpc";
|
|
8
|
-
import {
|
|
8
|
+
import { withObjectSources } from "@party-stack/ontology-storage";
|
|
9
|
+
import { ReplicaStatusSchema, makeReplicaMonitor } from "@party-stack/ontology-replica";
|
|
9
10
|
import { QueryDocumentSchema } from "@party-stack/ontology-spec/effect";
|
|
10
11
|
import { getTargetValueType } from "@party-stack/ontology-spec/utils";
|
|
11
|
-
import { withObjectSources } from "@party-stack/ontology-storage";
|
|
12
12
|
//#region src/operations.ts
|
|
13
13
|
const Validation = ValidationReportSchema;
|
|
14
14
|
const Trace = Schema.Struct({
|
|
@@ -142,20 +142,7 @@ const HelperRpcs = RpcGroup.make(Rpc.make("Query", {
|
|
|
142
142
|
allowUnknownOutcome: Schema.optional(Schema.Boolean)
|
|
143
143
|
})),
|
|
144
144
|
error: BackendError
|
|
145
|
-
}), Rpc.make("
|
|
146
|
-
success: protocolValueCodec(Schema.UndefinedOr(PinStatusSchema)),
|
|
147
|
-
error: BackendError
|
|
148
|
-
}), Rpc.make("WatchPin", {
|
|
149
|
-
success: protocolValueCodec(Schema.UndefinedOr(PinStatusSchema)),
|
|
150
|
-
error: BackendError,
|
|
151
|
-
stream: true
|
|
152
|
-
}), Rpc.make("SetPin", {
|
|
153
|
-
payload: {
|
|
154
|
-
query: protocolValueCodec(QueryDocumentSchema),
|
|
155
|
-
options: Schema.optional(protocolValueCodec(PinOptionsSchema))
|
|
156
|
-
},
|
|
157
|
-
error: BackendError
|
|
158
|
-
}), Rpc.make("ClearPin", { error: BackendError }), Rpc.make("ReplicaStatus", {
|
|
145
|
+
}), Rpc.make("ReplicaStatus", {
|
|
159
146
|
success: protocolValueCodec(ReplicaStatusSchema),
|
|
160
147
|
error: BackendError,
|
|
161
148
|
stream: true
|
|
@@ -411,36 +398,6 @@ const ontologyOperationHandlers = (options, authorize = options.authorize) => {
|
|
|
411
398
|
strategy: "sliding"
|
|
412
399
|
});
|
|
413
400
|
})),
|
|
414
|
-
ReadPin: (_, context) => Effect.gen(function* () {
|
|
415
|
-
yield* authorize({ operation: "ReadPin" }, context.headers);
|
|
416
|
-
yield* options.ready ?? Effect.void;
|
|
417
|
-
const pins = options.pins ?? options.replica?.demand;
|
|
418
|
-
if (!pins) return yield* missing("ReadPin");
|
|
419
|
-
return yield* pins.pinStatus;
|
|
420
|
-
}),
|
|
421
|
-
WatchPin: (_, context) => Stream.unwrap(Effect.gen(function* () {
|
|
422
|
-
yield* authorize({ operation: "WatchPin" }, context.headers);
|
|
423
|
-
yield* options.ready ?? Effect.void;
|
|
424
|
-
return (options.pins ?? options.replica?.demand)?.pinStatusChanges ?? Stream.fail(missing("WatchPin"));
|
|
425
|
-
})),
|
|
426
|
-
SetPin: ({ query, options: settings }, context) => Effect.gen(function* () {
|
|
427
|
-
yield* authorize({
|
|
428
|
-
operation: "SetPin",
|
|
429
|
-
query,
|
|
430
|
-
options: settings
|
|
431
|
-
}, context.headers);
|
|
432
|
-
yield* options.ready ?? Effect.void;
|
|
433
|
-
const pins = options.pins ?? options.replica?.demand;
|
|
434
|
-
if (!pins) return yield* missing("SetPin");
|
|
435
|
-
return yield* pins.setPin(query, settings);
|
|
436
|
-
}),
|
|
437
|
-
ClearPin: (_, context) => Effect.gen(function* () {
|
|
438
|
-
yield* authorize({ operation: "ClearPin" }, context.headers);
|
|
439
|
-
yield* options.ready ?? Effect.void;
|
|
440
|
-
const pins = options.pins ?? options.replica?.demand;
|
|
441
|
-
if (!pins) return yield* missing("ClearPin");
|
|
442
|
-
return yield* pins.clearPin;
|
|
443
|
-
}),
|
|
444
401
|
DeleteLocalData: (_, context) => authorize({ operation: "DeleteLocalData" }, context.headers).pipe(Effect.andThen(options.deleteLocalData ?? Effect.fail(missing("DeleteLocalData")))),
|
|
445
402
|
ReleaseOwner: (_, context) => authorize({ operation: "ReleaseOwner" }, context.headers).pipe(Effect.andThen(options.releaseOwner ?? Effect.fail(missing("ReleaseOwner"))))
|
|
446
403
|
}).pipe(Layer.merge(attachmentTransferHandlers({
|
|
@@ -568,15 +525,6 @@ const makeOntologyOperationsClient = Effect.fnUntraced(function* (client) {
|
|
|
568
525
|
}).pipe(Effect.map((result) => result.value), Effect.mapError(decryptFailure)),
|
|
569
526
|
deleteLocalData: client.DeleteLocalData().pipe(Effect.mapError(failure)),
|
|
570
527
|
releaseOwner: client.ReleaseOwner(void 0, { discard: true }).pipe(Effect.mapError(failure)),
|
|
571
|
-
pins: {
|
|
572
|
-
pinStatus: client.ReadPin().pipe(Effect.mapError(failure)),
|
|
573
|
-
pinStatusChanges: client.WatchPin().pipe(Stream.mapError(failure)),
|
|
574
|
-
setPin: (query, settings) => client.SetPin({
|
|
575
|
-
query,
|
|
576
|
-
options: settings
|
|
577
|
-
}).pipe(Effect.mapError(failure)),
|
|
578
|
-
clearPin: client.ClearPin().pipe(Effect.mapError(failure))
|
|
579
|
-
},
|
|
580
528
|
queryFunction: (name, parameters) => client.QueryFunction({
|
|
581
529
|
name,
|
|
582
530
|
parameters
|