@dxos/echo-query 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{browser → neutral}/index.mjs +1 -1
- package/dist/lib/{browser → neutral}/index.mjs.map +1 -1
- package/dist/lib/{browser → neutral}/meta.json +1 -1
- package/dist/query-lite/index.d.ts +1552 -385
- package/dist/query-lite/index.d.ts.map +1 -1
- package/dist/query-lite/index.js +168 -17
- package/dist/query-lite/index.js.map +1 -1
- package/dist/types/src/query-lite/query-lite.d.ts.map +1 -1
- package/dist/types/src/sandbox/query-sandbox.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -14
- package/src/parser/query.test.ts +29 -29
- package/src/query-lite/query-lite.ts +231 -21
- package/src/sandbox/query-sandbox.test.ts +10 -10
- package/src/sandbox/query-sandbox.ts +1 -1
- package/dist/lib/node-esm/index.mjs +0 -719
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
|
@@ -4711,7 +4711,7 @@ declare namespace FastCheck_d_exports {
|
|
|
4711
4711
|
export { Arbitrary, ArrayConstraints$1 as ArrayConstraints, AsyncCommand, AsyncPropertyHookFunction, BigIntArrayConstraints, BigIntConstraints$1 as BigIntConstraints, BigUintConstraints, CloneValue, Command, CommandsContraints, ContextValue, DateConstraints$1 as DateConstraints, DepthContext, DepthIdentifier, DepthSize, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, ExecutionStatus, ExecutionTree, FalsyContraints, FalsyValue, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, GeneratorValue, GlobalAsyncPropertyHookFunction, GlobalParameters, GlobalPropertyHookFunction, IAsyncProperty, IAsyncPropertyWithHooks, ICommand, IProperty, IPropertyWithHooks, IRawProperty, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, JsonValue, LetrecLooselyTypedBuilder, LetrecLooselyTypedTie, LetrecTypedBuilder, LetrecTypedTie, LetrecValue, LoremConstraints, MaybeWeightedArbitrary, Memo, MixedCaseConstraints, ModelRunAsyncSetup, ModelRunSetup, NatConstraints, ObjectConstraints, OneOfConstraints, OneOfValue, OptionConstraints, Parameters$1 as Parameters, PreconditionFailure, PropertyFailure, PropertyHookFunction, Random, RandomType, RecordConstraints, RecordValue, RunDetails, RunDetailsCommon, RunDetailsFailureInterrupted, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsSuccess, Scheduler, SchedulerAct, SchedulerConstraints, SchedulerReportItem, SchedulerSequenceItem, ShuffledSubarrayConstraints, Size, SizeForArbitrary, SparseArrayConstraints, Stream$1 as Stream, StringConstraints$1 as StringConstraints, StringMatchingConstraints, StringSharedConstraints, SubarrayConstraints, UnicodeJsonSharedConstraints, UniqueArrayConstraints, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UniqueArrayConstraintsRecommended, UniqueArraySharedConstraints, UuidConstraints, Value$1 as Value, VerbosityLevel, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, WeightedArbitrary, WithAsyncToStringMethod, WithCloneMethod, WithToStringMethod, __commitHash, __type, __version, anything, array, ascii, asciiString, assert, asyncDefaultReportMessage, asyncModelRun, asyncProperty, asyncStringify, asyncToStringMethod, base64, base64String, bigInt, bigInt64Array, bigIntN, bigUint, bigUint64Array, bigUintN, boolean, char, char16bits, check, clone, cloneIfNeeded, cloneMethod, commands, compareBooleanFunc, compareFunc, configureGlobal, constant, constantFrom, context, createDepthIdentifier, date, defaultReportMessage, dictionary, domain, double, emailAddress, falsy, float, float32Array, float64Array, fullUnicode, fullUnicodeString, func, gen, getDepthContextFor, hasAsyncToStringMethod, hasCloneMethod, hasToStringMethod, hash, hexa, hexaString, infiniteStream, int16Array, int32Array, int8Array, integer, ipV4, ipV4Extended, ipV6, json, jsonValue, letrec, limitShrink, lorem, mapToConstant, maxSafeInteger, maxSafeNat, memo, mixedCase, modelRun, nat, noBias, noShrink, object, oneof, option, pre, property$1 as property, readConfigureGlobal, record, resetConfigureGlobal, sample, scheduledModelRun, scheduler, schedulerFor, shuffledSubarray, sparseArray, statistics, stream, string, string16bits, stringMatching, stringOf, stringify, subarray, toStringMethod, tuple, uint16Array, uint32Array, uint8Array, uint8ClampedArray, ulid, unicode, unicodeJson, unicodeJsonValue, unicodeString, uniqueArray, uuid, uuidV, webAuthority, webFragments, webPath, webQueryParameters, webSegment, webUrl };
|
|
4712
4712
|
}
|
|
4713
4713
|
//#endregion
|
|
4714
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4714
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Arbitrary.d.ts
|
|
4715
4715
|
/**
|
|
4716
4716
|
* @category model
|
|
4717
4717
|
* @since 3.10.0
|
|
@@ -4756,7 +4756,7 @@ interface DateConstraints {
|
|
|
4756
4756
|
readonly constraints: DateConstraints$1;
|
|
4757
4757
|
}
|
|
4758
4758
|
//#endregion
|
|
4759
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4759
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Types.d.ts
|
|
4760
4760
|
/**
|
|
4761
4761
|
* A utility type that transforms a union type `T` into an intersection type.
|
|
4762
4762
|
*
|
|
@@ -4764,6 +4764,20 @@ interface DateConstraints {
|
|
|
4764
4764
|
* @category types
|
|
4765
4765
|
*/
|
|
4766
4766
|
type UnionToIntersection<T$1> = (T$1 extends any ? (x: T$1) => any : never) extends ((x: infer R) => any) ? R : never;
|
|
4767
|
+
/**
|
|
4768
|
+
* Simplifies the type signature of a type.
|
|
4769
|
+
*
|
|
4770
|
+
* @example
|
|
4771
|
+
* ```ts
|
|
4772
|
+
* import type { Types } from "effect"
|
|
4773
|
+
*
|
|
4774
|
+
* type Res = Types.Simplify<{ a: number } & { b: number }> // { a: number; b: number; }
|
|
4775
|
+
* ```
|
|
4776
|
+
*
|
|
4777
|
+
* @since 2.0.0
|
|
4778
|
+
* @category types
|
|
4779
|
+
*/
|
|
4780
|
+
type Simplify$1<A$1> = { [K in keyof A$1]: A$1[K] } extends infer B ? B : never;
|
|
4767
4781
|
/**
|
|
4768
4782
|
* Describes the concurrency to use when executing multiple Effect's.
|
|
4769
4783
|
*
|
|
@@ -4832,8 +4846,12 @@ declare namespace Contravariant {
|
|
|
4832
4846
|
*/
|
|
4833
4847
|
type Type<A$1> = A$1 extends Contravariant<infer U> ? U : never;
|
|
4834
4848
|
}
|
|
4849
|
+
/**
|
|
4850
|
+
* @since 3.9.0
|
|
4851
|
+
*/
|
|
4852
|
+
type NoExcessProperties<T$1, U$1> = T$1 & { readonly [K in Exclude<keyof U$1, keyof T$1>]: never };
|
|
4835
4853
|
//#endregion
|
|
4836
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4854
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Equivalence.d.ts
|
|
4837
4855
|
/**
|
|
4838
4856
|
* @category type class
|
|
4839
4857
|
* @since 2.0.0
|
|
@@ -4842,7 +4860,7 @@ interface Equivalence<in A$1> {
|
|
|
4842
4860
|
(self: A$1, that: A$1): boolean;
|
|
4843
4861
|
}
|
|
4844
4862
|
//#endregion
|
|
4845
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4863
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Hash.d.ts
|
|
4846
4864
|
/**
|
|
4847
4865
|
* @since 2.0.0
|
|
4848
4866
|
* @category models
|
|
@@ -4851,7 +4869,7 @@ interface Hash {
|
|
|
4851
4869
|
[symbol](): number;
|
|
4852
4870
|
}
|
|
4853
4871
|
//#endregion
|
|
4854
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4872
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Equal.d.ts
|
|
4855
4873
|
/**
|
|
4856
4874
|
* @since 2.0.0
|
|
4857
4875
|
* @category models
|
|
@@ -4860,7 +4878,7 @@ interface Equal extends Hash {
|
|
|
4860
4878
|
[symbol](that: Equal): boolean;
|
|
4861
4879
|
}
|
|
4862
4880
|
//#endregion
|
|
4863
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4881
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Pipeable.d.ts
|
|
4864
4882
|
/**
|
|
4865
4883
|
* @since 2.0.0
|
|
4866
4884
|
* @category Models
|
|
@@ -4890,7 +4908,7 @@ interface Pipeable {
|
|
|
4890
4908
|
pipe<A$1, B$1 = never, C = never, D = never, E$1 = never, F = never, G = never, H$1 = never, I$1 = never, J = never, K$1 = never, L$1 = never, M = never, N = never, O = never, P$1 = never, Q = never, R$1 = never, S$1 = never, T$1 = never, U$1 = never>(this: A$1, ab: (_: A$1) => B$1, bc: (_: B$1) => C, cd: (_: C) => D, de: (_: D) => E$1, ef: (_: E$1) => F, fg: (_: F) => G, gh: (_: G) => H$1, hi: (_: H$1) => I$1, ij: (_: I$1) => J, jk: (_: J) => K$1, kl: (_: K$1) => L$1, lm: (_: L$1) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P$1, pq: (_: P$1) => Q, qr: (_: Q) => R$1, rs: (_: R$1) => S$1, st: (_: S$1) => T$1, tu: (_: T$1) => U$1): U$1;
|
|
4891
4909
|
}
|
|
4892
4910
|
//#endregion
|
|
4893
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4911
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Unify.d.ts
|
|
4894
4912
|
/**
|
|
4895
4913
|
* @since 2.0.0
|
|
4896
4914
|
*/
|
|
@@ -4919,7 +4937,7 @@ declare const ignoreSymbol: unique symbol;
|
|
|
4919
4937
|
*/
|
|
4920
4938
|
type ignoreSymbol = typeof ignoreSymbol;
|
|
4921
4939
|
//#endregion
|
|
4922
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4940
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Utils.d.ts
|
|
4923
4941
|
/**
|
|
4924
4942
|
* @since 3.0.6
|
|
4925
4943
|
*/
|
|
@@ -4936,7 +4954,7 @@ declare class YieldWrap<T$1> {
|
|
|
4936
4954
|
[YieldWrapTypeId](): T$1;
|
|
4937
4955
|
}
|
|
4938
4956
|
//#endregion
|
|
4939
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4957
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Option.d.ts
|
|
4940
4958
|
/**
|
|
4941
4959
|
* The `Option` data type represents optional values. An `Option<A>` can either
|
|
4942
4960
|
* be `Some<A>`, containing a value of type `A`, or `None`, representing the
|
|
@@ -4960,12 +4978,12 @@ type Option<A$1> = None$1<A$1> | Some$1<A$1>;
|
|
|
4960
4978
|
* @category Symbols
|
|
4961
4979
|
* @since 2.0.0
|
|
4962
4980
|
*/
|
|
4963
|
-
declare const TypeId$
|
|
4981
|
+
declare const TypeId$4: unique symbol;
|
|
4964
4982
|
/**
|
|
4965
4983
|
* @category Symbols
|
|
4966
4984
|
* @since 2.0.0
|
|
4967
4985
|
*/
|
|
4968
|
-
type TypeId$
|
|
4986
|
+
type TypeId$4 = typeof TypeId$4;
|
|
4969
4987
|
/**
|
|
4970
4988
|
* @category Models
|
|
4971
4989
|
* @since 2.0.0
|
|
@@ -4973,7 +4991,7 @@ type TypeId$3 = typeof TypeId$3;
|
|
|
4973
4991
|
interface None$1<out A$1> extends Pipeable, Inspectable {
|
|
4974
4992
|
readonly _tag: "None";
|
|
4975
4993
|
readonly _op: "None";
|
|
4976
|
-
readonly [TypeId$
|
|
4994
|
+
readonly [TypeId$4]: {
|
|
4977
4995
|
readonly _A: Covariant<A$1>;
|
|
4978
4996
|
};
|
|
4979
4997
|
[typeSymbol]?: unknown;
|
|
@@ -4988,7 +5006,7 @@ interface Some$1<out A$1> extends Pipeable, Inspectable {
|
|
|
4988
5006
|
readonly _tag: "Some";
|
|
4989
5007
|
readonly _op: "Some";
|
|
4990
5008
|
readonly value: A$1;
|
|
4991
|
-
readonly [TypeId$
|
|
5009
|
+
readonly [TypeId$4]: {
|
|
4992
5010
|
readonly _A: Covariant<A$1>;
|
|
4993
5011
|
};
|
|
4994
5012
|
[typeSymbol]?: unknown;
|
|
@@ -5037,7 +5055,7 @@ declare namespace Option {
|
|
|
5037
5055
|
*/
|
|
5038
5056
|
interface OptionUnifyIgnore {}
|
|
5039
5057
|
//#endregion
|
|
5040
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5058
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Context.d.ts
|
|
5041
5059
|
/**
|
|
5042
5060
|
* @since 2.0.0
|
|
5043
5061
|
* @category symbol
|
|
@@ -5127,18 +5145,18 @@ declare namespace Tag$2 {
|
|
|
5127
5145
|
*/
|
|
5128
5146
|
type Identifier<T$1 extends Tag$2<any, any> | TagClassShape<any, any>> = T$1 extends Tag$2<any, any> ? T$1["Identifier"] : T$1 extends TagClassShape<any, any> ? T$1 : never;
|
|
5129
5147
|
}
|
|
5130
|
-
declare const TypeId$
|
|
5148
|
+
declare const TypeId$3: unique symbol;
|
|
5131
5149
|
/**
|
|
5132
5150
|
* @since 2.0.0
|
|
5133
5151
|
* @category symbol
|
|
5134
5152
|
*/
|
|
5135
|
-
type TypeId$
|
|
5153
|
+
type TypeId$3 = typeof TypeId$3;
|
|
5136
5154
|
/**
|
|
5137
5155
|
* @since 2.0.0
|
|
5138
5156
|
* @category models
|
|
5139
5157
|
*/
|
|
5140
5158
|
interface Context$1<in Services> extends Equal, Pipeable, Inspectable {
|
|
5141
|
-
readonly [TypeId$
|
|
5159
|
+
readonly [TypeId$3]: {
|
|
5142
5160
|
readonly _Services: Contravariant<Services>;
|
|
5143
5161
|
};
|
|
5144
5162
|
readonly unsafeMap: Map<string, any>;
|
|
@@ -5162,7 +5180,7 @@ interface Context$1<in Services> extends Equal, Pipeable, Inspectable {
|
|
|
5162
5180
|
*/
|
|
5163
5181
|
declare const Tag$2: <const Id$1 extends string>(id: Id$1) => <Self, Shape>() => TagClass<Self, Id$1, Shape>;
|
|
5164
5182
|
//#endregion
|
|
5165
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5183
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Sink.d.ts
|
|
5166
5184
|
/**
|
|
5167
5185
|
* @since 2.0.0
|
|
5168
5186
|
* @category symbols
|
|
@@ -5218,7 +5236,7 @@ declare namespace Sink {
|
|
|
5218
5236
|
}
|
|
5219
5237
|
}
|
|
5220
5238
|
//#endregion
|
|
5221
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5239
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/STM.d.ts
|
|
5222
5240
|
/**
|
|
5223
5241
|
* @since 2.0.0
|
|
5224
5242
|
* @category symbols
|
|
@@ -5337,7 +5355,7 @@ declare namespace STM {
|
|
|
5337
5355
|
}
|
|
5338
5356
|
}
|
|
5339
5357
|
//#endregion
|
|
5340
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5358
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Stream.d.ts
|
|
5341
5359
|
/**
|
|
5342
5360
|
* @since 2.0.0
|
|
5343
5361
|
* @category symbols
|
|
@@ -5450,7 +5468,7 @@ declare namespace Stream {
|
|
|
5450
5468
|
type DynamicTupleOf<T$1, N extends number, R$1 extends Array<unknown>> = R$1["length"] extends N ? R$1 : DynamicTupleOf<T$1, N, [T$1, ...R$1]>;
|
|
5451
5469
|
}
|
|
5452
5470
|
//#endregion
|
|
5453
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5471
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Channel.d.ts
|
|
5454
5472
|
/**
|
|
5455
5473
|
* @since 2.0.0
|
|
5456
5474
|
* @category symbols
|
|
@@ -5544,7 +5562,7 @@ declare namespace Channel {
|
|
|
5544
5562
|
}
|
|
5545
5563
|
}
|
|
5546
5564
|
//#endregion
|
|
5547
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5565
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Cause.d.ts
|
|
5548
5566
|
/**
|
|
5549
5567
|
* A unique symbol identifying the `NoSuchElementException` type.
|
|
5550
5568
|
*
|
|
@@ -5684,7 +5702,7 @@ declare const NoSuchElementException: new (message?: string | undefined) => NoSu
|
|
|
5684
5702
|
*/
|
|
5685
5703
|
declare const UnknownException: new (error: unknown, message?: string | undefined) => UnknownException;
|
|
5686
5704
|
//#endregion
|
|
5687
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5705
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Effect.d.ts
|
|
5688
5706
|
/**
|
|
5689
5707
|
* @since 2.0.0
|
|
5690
5708
|
* @category Symbols
|
|
@@ -5914,7 +5932,7 @@ declare const Tag$1: <const Id$1 extends string>(id: Id$1) => <Self, Type$5 exte
|
|
|
5914
5932
|
use: <X>(body: (_: Type$5) => X) => [X] extends [Effect<infer A, infer E, infer R>] ? Effect<A, E, R | Self> : [X] extends [PromiseLike<infer A>] ? Effect<A, UnknownException, Self> : Effect<X, never, Self>;
|
|
5915
5933
|
};
|
|
5916
5934
|
//#endregion
|
|
5917
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5935
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Inspectable.d.ts
|
|
5918
5936
|
/**
|
|
5919
5937
|
* @since 2.0.0
|
|
5920
5938
|
* @category models
|
|
@@ -5925,7 +5943,7 @@ interface Inspectable {
|
|
|
5925
5943
|
[NodeInspectSymbol](): unknown;
|
|
5926
5944
|
}
|
|
5927
5945
|
//#endregion
|
|
5928
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5946
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Either.d.ts
|
|
5929
5947
|
/**
|
|
5930
5948
|
* @category models
|
|
5931
5949
|
* @since 2.0.0
|
|
@@ -5935,12 +5953,12 @@ type Either<A$1, E$1 = never> = Left$1<E$1, A$1> | Right$1<E$1, A$1>;
|
|
|
5935
5953
|
* @category symbols
|
|
5936
5954
|
* @since 2.0.0
|
|
5937
5955
|
*/
|
|
5938
|
-
declare const TypeId$
|
|
5956
|
+
declare const TypeId$2: unique symbol;
|
|
5939
5957
|
/**
|
|
5940
5958
|
* @category symbols
|
|
5941
5959
|
* @since 2.0.0
|
|
5942
5960
|
*/
|
|
5943
|
-
type TypeId$
|
|
5961
|
+
type TypeId$2 = typeof TypeId$2;
|
|
5944
5962
|
/**
|
|
5945
5963
|
* @category models
|
|
5946
5964
|
* @since 2.0.0
|
|
@@ -5949,7 +5967,7 @@ interface Left$1<out E$1, out A$1> extends Pipeable, Inspectable {
|
|
|
5949
5967
|
readonly _tag: "Left";
|
|
5950
5968
|
readonly _op: "Left";
|
|
5951
5969
|
readonly left: E$1;
|
|
5952
|
-
readonly [TypeId$
|
|
5970
|
+
readonly [TypeId$2]: {
|
|
5953
5971
|
readonly _R: Covariant<A$1>;
|
|
5954
5972
|
readonly _L: Covariant<E$1>;
|
|
5955
5973
|
};
|
|
@@ -5965,7 +5983,7 @@ interface Right$1<out E$1, out A$1> extends Pipeable, Inspectable {
|
|
|
5965
5983
|
readonly _tag: "Right";
|
|
5966
5984
|
readonly _op: "Right";
|
|
5967
5985
|
readonly right: A$1;
|
|
5968
|
-
readonly [TypeId$
|
|
5986
|
+
readonly [TypeId$2]: {
|
|
5969
5987
|
readonly _R: Covariant<A$1>;
|
|
5970
5988
|
readonly _L: Covariant<E$1>;
|
|
5971
5989
|
};
|
|
@@ -6003,7 +6021,7 @@ declare namespace Either {
|
|
|
6003
6021
|
type Right<T$1 extends Either<any, any>> = [T$1] extends [Either<infer _A, infer _E>] ? _A : never;
|
|
6004
6022
|
}
|
|
6005
6023
|
//#endregion
|
|
6006
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6024
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Array.d.ts
|
|
6007
6025
|
/**
|
|
6008
6026
|
* @category models
|
|
6009
6027
|
* @since 2.0.0
|
|
@@ -6015,12 +6033,21 @@ type NonEmptyReadonlyArray<A$1> = readonly [A$1, ...Array<A$1>];
|
|
|
6015
6033
|
*/
|
|
6016
6034
|
type NonEmptyArray<A$1> = [A$1, ...Array<A$1>];
|
|
6017
6035
|
//#endregion
|
|
6018
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6036
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/SchemaAST.d.ts
|
|
6019
6037
|
/**
|
|
6020
6038
|
* @category model
|
|
6021
6039
|
* @since 3.10.0
|
|
6022
6040
|
*/
|
|
6023
|
-
type AST = Declaration | Literal$1 | UniqueSymbol | UndefinedKeyword | VoidKeyword | NeverKeyword | UnknownKeyword | AnyKeyword | StringKeyword | NumberKeyword | BooleanKeyword | BigIntKeyword | SymbolKeyword | ObjectKeyword | Enums | TemplateLiteral | Refinement$1 | TupleType$1 | TypeLiteral$1 | Union$1 | Suspend | Transformation$1;
|
|
6041
|
+
type AST = Declaration | Literal$1 | UniqueSymbol | UndefinedKeyword | VoidKeyword | NeverKeyword | UnknownKeyword | AnyKeyword | StringKeyword | NumberKeyword | BooleanKeyword | BigIntKeyword | SymbolKeyword | ObjectKeyword | Enums$1 | TemplateLiteral | Refinement$1 | TupleType$1 | TypeLiteral$1 | Union$1 | Suspend | Transformation$1;
|
|
6042
|
+
/**
|
|
6043
|
+
* @category annotations
|
|
6044
|
+
* @since 3.19.0
|
|
6045
|
+
* @experimental
|
|
6046
|
+
*/
|
|
6047
|
+
type TypeConstructorAnnotation = {
|
|
6048
|
+
readonly _tag: string;
|
|
6049
|
+
[key: PropertyKey]: unknown;
|
|
6050
|
+
};
|
|
6024
6051
|
/**
|
|
6025
6052
|
* @category annotations
|
|
6026
6053
|
* @since 3.10.0
|
|
@@ -6408,7 +6435,7 @@ declare class ObjectKeyword implements Annotated {
|
|
|
6408
6435
|
* @category model
|
|
6409
6436
|
* @since 3.10.0
|
|
6410
6437
|
*/
|
|
6411
|
-
declare class Enums implements Annotated {
|
|
6438
|
+
declare class Enums$1 implements Annotated {
|
|
6412
6439
|
readonly enums: ReadonlyArray<readonly [string, string | number]>;
|
|
6413
6440
|
readonly annotations: Annotations$1;
|
|
6414
6441
|
/**
|
|
@@ -6818,7 +6845,7 @@ declare class TypeLiteralTransformation {
|
|
|
6818
6845
|
constructor(propertySignatureTransformations: ReadonlyArray<PropertySignatureTransformation$1>);
|
|
6819
6846
|
}
|
|
6820
6847
|
//#endregion
|
|
6821
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6848
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/ParseResult.d.ts
|
|
6822
6849
|
/**
|
|
6823
6850
|
* `ParseIssue` is a type that represents the different types of errors that can occur when decoding/encoding a value.
|
|
6824
6851
|
*
|
|
@@ -6990,7 +7017,7 @@ declare class Forbidden {
|
|
|
6990
7017
|
constructor(ast: AST, actual: unknown, message?: string | undefined);
|
|
6991
7018
|
}
|
|
6992
7019
|
//#endregion
|
|
6993
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
7020
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Pretty.d.ts
|
|
6994
7021
|
/**
|
|
6995
7022
|
* @category model
|
|
6996
7023
|
* @since 3.10.0
|
|
@@ -7004,7 +7031,7 @@ interface Pretty<To> {
|
|
|
7004
7031
|
*/
|
|
7005
7032
|
type PrettyAnnotation<A$1, TypeParameters extends ReadonlyArray<any> = readonly []> = (...pretties: { readonly [K in keyof TypeParameters]: Pretty<TypeParameters[K]> }) => Pretty<A$1>;
|
|
7006
7033
|
//#endregion
|
|
7007
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
7034
|
+
//#region ../../../../node_modules/.pnpm/effect@3.20.0/node_modules/effect/dist/dts/Schema.d.ts
|
|
7008
7035
|
/**
|
|
7009
7036
|
* @since 3.10.0
|
|
7010
7037
|
*/
|
|
@@ -7013,12 +7040,12 @@ type Simplify<A$1> = { [K in keyof A$1]: A$1[K] } & {};
|
|
|
7013
7040
|
* @since 3.10.0
|
|
7014
7041
|
* @category symbol
|
|
7015
7042
|
*/
|
|
7016
|
-
declare const TypeId: unique symbol;
|
|
7043
|
+
declare const TypeId$1: unique symbol;
|
|
7017
7044
|
/**
|
|
7018
7045
|
* @since 3.10.0
|
|
7019
7046
|
* @category symbol
|
|
7020
7047
|
*/
|
|
7021
|
-
type TypeId = typeof TypeId;
|
|
7048
|
+
type TypeId$1 = typeof TypeId$1;
|
|
7022
7049
|
/**
|
|
7023
7050
|
* @category model
|
|
7024
7051
|
* @since 3.10.0
|
|
@@ -7079,7 +7106,7 @@ declare namespace Schema {
|
|
|
7079
7106
|
* @since 3.10.0
|
|
7080
7107
|
*/
|
|
7081
7108
|
interface Variance<A$1, I$1, R$1> {
|
|
7082
|
-
readonly [TypeId]: {
|
|
7109
|
+
readonly [TypeId$1]: {
|
|
7083
7110
|
readonly _A: Invariant<A$1>;
|
|
7084
7111
|
readonly _I: Invariant<I$1>;
|
|
7085
7112
|
readonly _R: Covariant<R$1>;
|
|
@@ -7140,6 +7167,24 @@ interface Literal<Literals extends NonEmptyReadonlyArray<LiteralValue>> extends
|
|
|
7140
7167
|
declare function Literal<Literals extends NonEmptyReadonlyArray<LiteralValue>>(...literals: Literals): Literal<Literals>;
|
|
7141
7168
|
declare function Literal(): Never;
|
|
7142
7169
|
declare function Literal<Literals extends ReadonlyArray<LiteralValue>>(...literals: Literals): SchemaClass<Literals[number]>;
|
|
7170
|
+
/**
|
|
7171
|
+
* @category api interface
|
|
7172
|
+
* @since 3.10.0
|
|
7173
|
+
*/
|
|
7174
|
+
interface Enums<A$1 extends EnumsDefinition> extends AnnotableClass<Enums<A$1>, A$1[keyof A$1]> {
|
|
7175
|
+
readonly enums: A$1;
|
|
7176
|
+
}
|
|
7177
|
+
/**
|
|
7178
|
+
* @since 3.10.0
|
|
7179
|
+
*/
|
|
7180
|
+
type EnumsDefinition = {
|
|
7181
|
+
[x: string]: string | number;
|
|
7182
|
+
};
|
|
7183
|
+
/**
|
|
7184
|
+
* @category constructors
|
|
7185
|
+
* @since 3.10.0
|
|
7186
|
+
*/
|
|
7187
|
+
declare const Enums: <A$1 extends EnumsDefinition>(enums: A$1) => Enums<A$1>;
|
|
7143
7188
|
declare const Null_base: SchemaClass<null, null, never>;
|
|
7144
7189
|
/**
|
|
7145
7190
|
* @category primitives
|
|
@@ -7157,7 +7202,7 @@ declare const Unknown_base: SchemaClass<unknown, unknown, never>;
|
|
|
7157
7202
|
* @category primitives
|
|
7158
7203
|
* @since 3.10.0
|
|
7159
7204
|
*/
|
|
7160
|
-
declare class Unknown$
|
|
7205
|
+
declare class Unknown$3 extends Unknown_base {}
|
|
7161
7206
|
declare const Any_base: SchemaClass<any, any, never>;
|
|
7162
7207
|
/**
|
|
7163
7208
|
* @category primitives
|
|
@@ -7256,6 +7301,14 @@ interface TupleType<Elements extends TupleType.Elements, Rest$1 extends TupleTyp
|
|
|
7256
7301
|
readonly elements: Readonly<Elements>;
|
|
7257
7302
|
readonly rest: Readonly<Rest$1>;
|
|
7258
7303
|
}
|
|
7304
|
+
/**
|
|
7305
|
+
* @category api interface
|
|
7306
|
+
* @since 3.13.3
|
|
7307
|
+
*/
|
|
7308
|
+
interface Tuple2<Fst extends Schema.Any, Snd extends Schema.Any> extends AnnotableClass<Tuple2<Fst, Snd>, readonly [Schema.Type<Fst>, Schema.Type<Snd>], readonly [Schema.Encoded<Fst>, Schema.Encoded<Snd>], Schema.Context<Fst> | Schema.Context<Snd>> {
|
|
7309
|
+
readonly elements: readonly [Fst, Snd];
|
|
7310
|
+
readonly rest: readonly [];
|
|
7311
|
+
}
|
|
7259
7312
|
/**
|
|
7260
7313
|
* @category api interface
|
|
7261
7314
|
* @since 3.10.0
|
|
@@ -7511,6 +7564,64 @@ interface Struct<Fields extends Struct.Fields> extends AnnotableClass<Struct<Fie
|
|
|
7511
7564
|
*/
|
|
7512
7565
|
declare function Struct<Fields extends Struct.Fields, const Records extends IndexSignature.NonEmptyRecords>(fields: Fields, ...records: Records): TypeLiteral<Fields, Records>;
|
|
7513
7566
|
declare function Struct<Fields extends Struct.Fields>(fields: Fields): Struct<Fields>;
|
|
7567
|
+
/**
|
|
7568
|
+
* @category api interface
|
|
7569
|
+
* @since 3.10.0
|
|
7570
|
+
*/
|
|
7571
|
+
interface tag$1<Tag$3 extends LiteralValue> extends PropertySignature<":", Tag$3, never, ":", Tag$3, true, never> {}
|
|
7572
|
+
/**
|
|
7573
|
+
* Returns a property signature that represents a tag.
|
|
7574
|
+
* A tag is a literal value that is used to distinguish between different types of objects.
|
|
7575
|
+
* The tag is optional when using the `make` method.
|
|
7576
|
+
*
|
|
7577
|
+
* @example
|
|
7578
|
+
* ```ts
|
|
7579
|
+
* import * as assert from "node:assert"
|
|
7580
|
+
* import { Schema } from "effect"
|
|
7581
|
+
*
|
|
7582
|
+
* const User = Schema.Struct({
|
|
7583
|
+
* _tag: Schema.tag("User"),
|
|
7584
|
+
* name: Schema.String,
|
|
7585
|
+
* age: Schema.Number
|
|
7586
|
+
* })
|
|
7587
|
+
*
|
|
7588
|
+
* assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
|
|
7589
|
+
* ```
|
|
7590
|
+
*
|
|
7591
|
+
* @see {@link TaggedStruct}
|
|
7592
|
+
*
|
|
7593
|
+
* @since 3.10.0
|
|
7594
|
+
*/
|
|
7595
|
+
declare const tag$1: <Tag$3 extends LiteralValue>(tag: Tag$3) => tag$1<Tag$3>;
|
|
7596
|
+
/**
|
|
7597
|
+
* @category api interface
|
|
7598
|
+
* @since 3.10.0
|
|
7599
|
+
*/
|
|
7600
|
+
type TaggedStruct<Tag$3 extends LiteralValue, Fields extends Struct.Fields> = Struct<{
|
|
7601
|
+
_tag: tag$1<Tag$3>;
|
|
7602
|
+
} & Fields>;
|
|
7603
|
+
/**
|
|
7604
|
+
* A tagged struct is a struct that has a tag property that is used to distinguish between different types of objects.
|
|
7605
|
+
*
|
|
7606
|
+
* The tag is optional when using the `make` method.
|
|
7607
|
+
*
|
|
7608
|
+
* @example
|
|
7609
|
+
* ```ts
|
|
7610
|
+
* import * as assert from "node:assert"
|
|
7611
|
+
* import { Schema } from "effect"
|
|
7612
|
+
*
|
|
7613
|
+
* const User = Schema.TaggedStruct("User", {
|
|
7614
|
+
* name: Schema.String,
|
|
7615
|
+
* age: Schema.Number
|
|
7616
|
+
* })
|
|
7617
|
+
*
|
|
7618
|
+
* assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
|
|
7619
|
+
* ```
|
|
7620
|
+
*
|
|
7621
|
+
* @category constructors
|
|
7622
|
+
* @since 3.10.0
|
|
7623
|
+
*/
|
|
7624
|
+
declare const TaggedStruct: <Tag$3 extends LiteralValue, Fields extends Struct.Fields>(value: Tag$3, fields: Fields) => TaggedStruct<Tag$3, Fields>;
|
|
7514
7625
|
/**
|
|
7515
7626
|
* @category api interface
|
|
7516
7627
|
* @since 3.10.0
|
|
@@ -7611,6 +7722,7 @@ declare namespace Annotations {
|
|
|
7611
7722
|
* @since 3.10.0
|
|
7612
7723
|
*/
|
|
7613
7724
|
interface Schema<A$1, TypeParameters extends ReadonlyArray<any> = readonly []> extends Doc<A$1> {
|
|
7725
|
+
readonly typeConstructor?: TypeConstructorAnnotation;
|
|
7614
7726
|
readonly identifier?: IdentifierAnnotation;
|
|
7615
7727
|
readonly message?: MessageAnnotation;
|
|
7616
7728
|
readonly schemaId?: SchemaIdAnnotation;
|
|
@@ -7762,8 +7874,8 @@ type QueueSubspaceTag = (typeof QueueSubspaceTags)[keyof typeof QueueSubspaceTag
|
|
|
7762
7874
|
* dxn:echo:<space key>:<echo id>
|
|
7763
7875
|
* dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7764
7876
|
* dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7765
|
-
* dxn:type:dxos.
|
|
7766
|
-
* dxn:plugin:dxos.
|
|
7877
|
+
* dxn:type:org.dxos.type.calendar
|
|
7878
|
+
* dxn:plugin:org.dxos.agent.plugin.functions
|
|
7767
7879
|
* ```
|
|
7768
7880
|
*/
|
|
7769
7881
|
declare class DXN {
|
|
@@ -7800,11 +7912,11 @@ declare class DXN {
|
|
|
7800
7912
|
static parse(dxn: string): DXN;
|
|
7801
7913
|
static tryParse(dxn: string): DXN | undefined;
|
|
7802
7914
|
/**
|
|
7803
|
-
* @example `dxn:type:example.
|
|
7915
|
+
* @example `dxn:type:com.example.type.person`
|
|
7804
7916
|
*/
|
|
7805
7917
|
static fromTypename(typename: string): DXN;
|
|
7806
7918
|
/**
|
|
7807
|
-
* @example `dxn:type:example.
|
|
7919
|
+
* @example `dxn:type:com.example.type.person:0.1.0`
|
|
7808
7920
|
*/
|
|
7809
7921
|
static fromTypenameAndVersion(typename: string, version: string): DXN;
|
|
7810
7922
|
/**
|
|
@@ -7890,6 +8002,9 @@ declare const ForeignKey: Schema<ForeignKey>;
|
|
|
7890
8002
|
*/
|
|
7891
8003
|
type ToMutable<T$1> = T$1 extends object ? { -readonly [K in keyof T$1]: T$1[K] extends readonly (infer U)[] ? U[] : T$1[K] } : T$1;
|
|
7892
8004
|
//#endregion
|
|
8005
|
+
//#region ../../../common/async/dist/types/src/cleanup.d.ts
|
|
8006
|
+
type CleanupFn = () => void;
|
|
8007
|
+
//#endregion
|
|
7893
8008
|
//#region ../echo-protocol/dist/types/src/reference.d.ts
|
|
7894
8009
|
/**
|
|
7895
8010
|
* Reference as it is stored in Automerge document.
|
|
@@ -7919,7 +8034,7 @@ declare const FilterObject_: Struct<{
|
|
|
7919
8034
|
* Filter by property.
|
|
7920
8035
|
* Must not include object ID.
|
|
7921
8036
|
*/
|
|
7922
|
-
props: Record$<SchemaClass<string, string, never>, suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8037
|
+
props: Record$<SchemaClass<string, string, never>, suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
7923
8038
|
/**
|
|
7924
8039
|
* Objects that have any of the given foreign keys.
|
|
7925
8040
|
*/
|
|
@@ -7939,7 +8054,7 @@ declare const FilterObject: Schema<FilterObject>;
|
|
|
7939
8054
|
declare const FilterCompare_: Struct<{
|
|
7940
8055
|
type: Literal<["compare"]>;
|
|
7941
8056
|
operator: Literal<["eq", "neq", "gt", "gte", "lt", "lte"]>;
|
|
7942
|
-
value: typeof Unknown$
|
|
8057
|
+
value: typeof Unknown$3;
|
|
7943
8058
|
}>;
|
|
7944
8059
|
interface FilterCompare extends Schema.Type<typeof FilterCompare_> {}
|
|
7945
8060
|
declare const FilterCompare: Schema<FilterCompare>;
|
|
@@ -7984,6 +8099,18 @@ declare const FilterRange_: Struct<{
|
|
|
7984
8099
|
}>;
|
|
7985
8100
|
interface FilterRange extends Schema.Type<typeof FilterRange_> {}
|
|
7986
8101
|
declare const FilterRange: Schema<FilterRange>;
|
|
8102
|
+
/**
|
|
8103
|
+
* Filter by system timestamp (createdAt / updatedAt).
|
|
8104
|
+
* Timestamps are unix milliseconds stored in the object meta index.
|
|
8105
|
+
*/
|
|
8106
|
+
declare const FilterTimestamp_: Struct<{
|
|
8107
|
+
type: Literal<["timestamp"]>;
|
|
8108
|
+
field: Literal<["createdAt", "updatedAt"]>;
|
|
8109
|
+
operator: Literal<["gt", "gte", "lt", "lte"]>;
|
|
8110
|
+
value: typeof Number$;
|
|
8111
|
+
}>;
|
|
8112
|
+
interface FilterTimestamp extends Schema.Type<typeof FilterTimestamp_> {}
|
|
8113
|
+
declare const FilterTimestamp: Schema<FilterTimestamp>;
|
|
7987
8114
|
/**
|
|
7988
8115
|
* Text search.
|
|
7989
8116
|
*/
|
|
@@ -7999,7 +8126,7 @@ declare const FilterTextSearch: Schema<FilterTextSearch>;
|
|
|
7999
8126
|
*/
|
|
8000
8127
|
declare const FilterNot_: Struct<{
|
|
8001
8128
|
type: Literal<["not"]>;
|
|
8002
|
-
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8129
|
+
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8003
8130
|
}>;
|
|
8004
8131
|
interface FilterNot extends Schema.Type<typeof FilterNot_> {}
|
|
8005
8132
|
declare const FilterNot: Schema<FilterNot>;
|
|
@@ -8008,7 +8135,7 @@ declare const FilterNot: Schema<FilterNot>;
|
|
|
8008
8135
|
*/
|
|
8009
8136
|
declare const FilterAnd_: Struct<{
|
|
8010
8137
|
type: Literal<["and"]>;
|
|
8011
|
-
filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8138
|
+
filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8012
8139
|
}>;
|
|
8013
8140
|
interface FilterAnd extends Schema.Type<typeof FilterAnd_> {}
|
|
8014
8141
|
declare const FilterAnd: Schema<FilterAnd>;
|
|
@@ -8017,21 +8144,21 @@ declare const FilterAnd: Schema<FilterAnd>;
|
|
|
8017
8144
|
*/
|
|
8018
8145
|
declare const FilterOr_: Struct<{
|
|
8019
8146
|
type: Literal<["or"]>;
|
|
8020
|
-
filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8147
|
+
filters: Array$<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8021
8148
|
}>;
|
|
8022
8149
|
interface FilterOr extends Schema.Type<typeof FilterOr_> {}
|
|
8023
8150
|
declare const FilterOr: Schema<FilterOr>;
|
|
8024
8151
|
/**
|
|
8025
8152
|
* Union of filters.
|
|
8026
8153
|
*/
|
|
8027
|
-
declare const Filter$1: Union<[Schema<FilterObject, FilterObject, never>, Schema<FilterCompare, FilterCompare, never>, Schema<FilterIn, FilterIn, never>, Schema<FilterContains, FilterContains, never>, Schema<FilterTag, FilterTag, never>, Schema<FilterRange, FilterRange, never>, Schema<FilterTextSearch, FilterTextSearch, never>, Schema<FilterNot, FilterNot, never>, Schema<FilterAnd, FilterAnd, never>, Schema<FilterOr, FilterOr, never>]>;
|
|
8154
|
+
declare const Filter$1: Union<[Schema<FilterObject, FilterObject, never>, Schema<FilterCompare, FilterCompare, never>, Schema<FilterIn, FilterIn, never>, Schema<FilterContains, FilterContains, never>, Schema<FilterTag, FilterTag, never>, Schema<FilterRange, FilterRange, never>, Schema<FilterTimestamp, FilterTimestamp, never>, Schema<FilterTextSearch, FilterTextSearch, never>, Schema<FilterNot, FilterNot, never>, Schema<FilterAnd, FilterAnd, never>, Schema<FilterOr, FilterOr, never>]>;
|
|
8028
8155
|
type Filter$1 = Schema.Type<typeof Filter$1>;
|
|
8029
8156
|
/**
|
|
8030
8157
|
* Query objects by type, id, and/or predicates.
|
|
8031
8158
|
*/
|
|
8032
8159
|
declare const QuerySelectClause_: Struct<{
|
|
8033
8160
|
type: Literal<["select"]>;
|
|
8034
|
-
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8161
|
+
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8035
8162
|
}>;
|
|
8036
8163
|
interface QuerySelectClause extends Schema.Type<typeof QuerySelectClause_> {}
|
|
8037
8164
|
declare const QuerySelectClause: Schema<QuerySelectClause>;
|
|
@@ -8040,8 +8167,8 @@ declare const QuerySelectClause: Schema<QuerySelectClause>;
|
|
|
8040
8167
|
*/
|
|
8041
8168
|
declare const QueryFilterClause_: Struct<{
|
|
8042
8169
|
type: Literal<["filter"]>;
|
|
8043
|
-
selection: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8044
|
-
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8170
|
+
selection: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8171
|
+
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>;
|
|
8045
8172
|
}>;
|
|
8046
8173
|
interface QueryFilterClause extends Schema.Type<typeof QueryFilterClause_> {}
|
|
8047
8174
|
declare const QueryFilterClause: Schema<QueryFilterClause>;
|
|
@@ -8050,7 +8177,7 @@ declare const QueryFilterClause: Schema<QueryFilterClause>;
|
|
|
8050
8177
|
*/
|
|
8051
8178
|
declare const QueryReferenceTraversalClause_: Struct<{
|
|
8052
8179
|
type: Literal<["reference-traversal"]>;
|
|
8053
|
-
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8180
|
+
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8054
8181
|
property: typeof String$;
|
|
8055
8182
|
}>;
|
|
8056
8183
|
interface QueryReferenceTraversalClause extends Schema.Type<typeof QueryReferenceTraversalClause_> {}
|
|
@@ -8060,7 +8187,7 @@ declare const QueryReferenceTraversalClause: Schema<QueryReferenceTraversalClaus
|
|
|
8060
8187
|
*/
|
|
8061
8188
|
declare const QueryIncomingReferencesClause_: Struct<{
|
|
8062
8189
|
type: Literal<["incoming-references"]>;
|
|
8063
|
-
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8190
|
+
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8064
8191
|
/**
|
|
8065
8192
|
* Property path where the reference is located.
|
|
8066
8193
|
* If null, matches references from any property.
|
|
@@ -8075,14 +8202,14 @@ declare const QueryIncomingReferencesClause: Schema<QueryIncomingReferencesClaus
|
|
|
8075
8202
|
*/
|
|
8076
8203
|
declare const QueryRelationClause_: Struct<{
|
|
8077
8204
|
type: Literal<["relation"]>;
|
|
8078
|
-
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8205
|
+
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8079
8206
|
/**
|
|
8080
8207
|
* outgoing: anchor is the source of the relation.
|
|
8081
8208
|
* incoming: anchor is the target of the relation.
|
|
8082
8209
|
* both: anchor is either the source or target of the relation.
|
|
8083
8210
|
*/
|
|
8084
8211
|
direction: Literal<["outgoing", "incoming", "both"]>;
|
|
8085
|
-
filter: optional<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8212
|
+
filter: optional<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8086
8213
|
}>;
|
|
8087
8214
|
interface QueryRelationClause extends Schema.Type<typeof QueryRelationClause_> {}
|
|
8088
8215
|
declare const QueryRelationClause: Schema<QueryRelationClause>;
|
|
@@ -8091,17 +8218,31 @@ declare const QueryRelationClause: Schema<QueryRelationClause>;
|
|
|
8091
8218
|
*/
|
|
8092
8219
|
declare const QueryRelationTraversalClause_: Struct<{
|
|
8093
8220
|
type: Literal<["relation-traversal"]>;
|
|
8094
|
-
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8221
|
+
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8095
8222
|
direction: Literal<["source", "target", "both"]>;
|
|
8096
8223
|
}>;
|
|
8097
8224
|
interface QueryRelationTraversalClause extends Schema.Type<typeof QueryRelationTraversalClause_> {}
|
|
8098
8225
|
declare const QueryRelationTraversalClause: Schema<QueryRelationTraversalClause>;
|
|
8226
|
+
/**
|
|
8227
|
+
* Traverse parent-child hierarchy.
|
|
8228
|
+
*/
|
|
8229
|
+
declare const QueryHierarchyTraversalClause_: Struct<{
|
|
8230
|
+
type: Literal<["hierarchy-traversal"]>;
|
|
8231
|
+
anchor: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8232
|
+
/**
|
|
8233
|
+
* to-parent: traverse from child to parent.
|
|
8234
|
+
* to-children: traverse from parent to children.
|
|
8235
|
+
*/
|
|
8236
|
+
direction: Literal<["to-parent", "to-children"]>;
|
|
8237
|
+
}>;
|
|
8238
|
+
interface QueryHierarchyTraversalClause extends Schema.Type<typeof QueryHierarchyTraversalClause_> {}
|
|
8239
|
+
declare const QueryHierarchyTraversalClause: Schema<QueryHierarchyTraversalClause>;
|
|
8099
8240
|
/**
|
|
8100
8241
|
* Union of multiple queries.
|
|
8101
8242
|
*/
|
|
8102
8243
|
declare const QueryUnionClause_: Struct<{
|
|
8103
8244
|
type: Literal<["union"]>;
|
|
8104
|
-
queries: Array$<suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>>;
|
|
8245
|
+
queries: Array$<suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>>;
|
|
8105
8246
|
}>;
|
|
8106
8247
|
interface QueryUnionClause extends Schema.Type<typeof QueryUnionClause_> {}
|
|
8107
8248
|
declare const QueryUnionClause: Schema<QueryUnionClause>;
|
|
@@ -8110,8 +8251,8 @@ declare const QueryUnionClause: Schema<QueryUnionClause>;
|
|
|
8110
8251
|
*/
|
|
8111
8252
|
declare const QuerySetDifferenceClause_: Struct<{
|
|
8112
8253
|
type: Literal<["set-difference"]>;
|
|
8113
|
-
source: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8114
|
-
exclude: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8254
|
+
source: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8255
|
+
exclude: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8115
8256
|
}>;
|
|
8116
8257
|
interface QuerySetDifferenceClause extends Schema.Type<typeof QuerySetDifferenceClause_> {}
|
|
8117
8258
|
declare const QuerySetDifferenceClause: Schema<QuerySetDifferenceClause>;
|
|
@@ -8135,7 +8276,7 @@ declare const Order$1: Schema<Order$1>;
|
|
|
8135
8276
|
*/
|
|
8136
8277
|
declare const QueryOrderClause_: Struct<{
|
|
8137
8278
|
type: Literal<["order"]>;
|
|
8138
|
-
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8279
|
+
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8139
8280
|
order: Array$<Schema<{
|
|
8140
8281
|
readonly kind: "natural";
|
|
8141
8282
|
} | {
|
|
@@ -8163,17 +8304,11 @@ declare const QueryOrderClause: Schema<QueryOrderClause>;
|
|
|
8163
8304
|
*/
|
|
8164
8305
|
declare const QueryOptionsClause_: Struct<{
|
|
8165
8306
|
type: Literal<["options"]>;
|
|
8166
|
-
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8307
|
+
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8167
8308
|
options: suspend<{
|
|
8168
8309
|
readonly deleted?: "include" | "exclude" | "only" | undefined;
|
|
8169
|
-
readonly spaceIds?: readonly string[] | undefined;
|
|
8170
|
-
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8171
|
-
readonly queues?: readonly string[] | undefined;
|
|
8172
8310
|
}, {
|
|
8173
8311
|
readonly deleted?: "include" | "exclude" | "only" | undefined;
|
|
8174
|
-
readonly spaceIds?: readonly string[] | undefined;
|
|
8175
|
-
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8176
|
-
readonly queues?: readonly string[] | undefined;
|
|
8177
8312
|
}, never>;
|
|
8178
8313
|
}>;
|
|
8179
8314
|
interface QueryOptionsClause extends Schema.Type<typeof QueryOptionsClause_> {}
|
|
@@ -8183,15 +8318,44 @@ declare const QueryOptionsClause: Schema<QueryOptionsClause>;
|
|
|
8183
8318
|
*/
|
|
8184
8319
|
declare const QueryLimitClause_: Struct<{
|
|
8185
8320
|
type: Literal<["limit"]>;
|
|
8186
|
-
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause, never>;
|
|
8321
|
+
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8187
8322
|
limit: typeof Number$;
|
|
8188
8323
|
}>;
|
|
8189
8324
|
interface QueryLimitClause extends Schema.Type<typeof QueryLimitClause_> {}
|
|
8190
8325
|
declare const QueryLimitClause: Schema<QueryLimitClause>;
|
|
8191
|
-
declare const
|
|
8192
|
-
type
|
|
8193
|
-
|
|
8326
|
+
declare const QueryFromClause_: Struct<{
|
|
8327
|
+
type: Literal<["from"]>;
|
|
8328
|
+
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8329
|
+
from: Union<[TaggedStruct<"scope", {
|
|
8330
|
+
scope: suspend<{
|
|
8331
|
+
readonly spaceIds?: readonly string[] | undefined;
|
|
8332
|
+
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8333
|
+
readonly queues?: readonly string[] | undefined;
|
|
8334
|
+
}, {
|
|
8335
|
+
readonly spaceIds?: readonly string[] | undefined;
|
|
8336
|
+
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8337
|
+
readonly queues?: readonly string[] | undefined;
|
|
8338
|
+
}, never>;
|
|
8339
|
+
}>, TaggedStruct<"query", {
|
|
8340
|
+
query: suspend<QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause, never>;
|
|
8341
|
+
}>]>;
|
|
8342
|
+
}>;
|
|
8343
|
+
interface QueryFromClause extends Schema.Type<typeof QueryFromClause_> {}
|
|
8344
|
+
declare const QueryFromClause: Schema<QueryFromClause>;
|
|
8345
|
+
declare const Query_: Union<[Schema<QuerySelectClause, QuerySelectClause, never>, Schema<QueryFilterClause, QueryFilterClause, never>, Schema<QueryReferenceTraversalClause, QueryReferenceTraversalClause, never>, Schema<QueryIncomingReferencesClause, QueryIncomingReferencesClause, never>, Schema<QueryRelationClause, QueryRelationClause, never>, Schema<QueryRelationTraversalClause, QueryRelationTraversalClause, never>, Schema<QueryHierarchyTraversalClause, QueryHierarchyTraversalClause, never>, Schema<QueryUnionClause, QueryUnionClause, never>, Schema<QuerySetDifferenceClause, QuerySetDifferenceClause, never>, Schema<QueryOrderClause, QueryOrderClause, never>, Schema<QueryOptionsClause, QueryOptionsClause, never>, Schema<QueryLimitClause, QueryLimitClause, never>, Schema<QueryFromClause, QueryFromClause, never>]>;
|
|
8346
|
+
type Query$2 = Schema.Type<typeof Query_>;
|
|
8347
|
+
declare const Query$2: Schema<Query$2>;
|
|
8194
8348
|
declare const QueryOptions: Struct<{
|
|
8349
|
+
/**
|
|
8350
|
+
* Nested select statements will use this option to filter deleted objects.
|
|
8351
|
+
*/
|
|
8352
|
+
deleted: optional<Literal<["include", "exclude", "only"]>>;
|
|
8353
|
+
}>;
|
|
8354
|
+
interface QueryOptions extends Schema.Type<typeof QueryOptions> {}
|
|
8355
|
+
/**
|
|
8356
|
+
* Specifies the scope of the data to query from.
|
|
8357
|
+
*/
|
|
8358
|
+
declare const Scope: Struct<{
|
|
8195
8359
|
/**
|
|
8196
8360
|
* The nested select statemets will select from the given spaces.
|
|
8197
8361
|
*
|
|
@@ -8208,49 +8372,19 @@ declare const QueryOptions: Struct<{
|
|
|
8208
8372
|
* NOTE: Spaces and queues are unioned together if both are specified.
|
|
8209
8373
|
*/
|
|
8210
8374
|
queues: optional<Array$<refine<string, typeof NonEmptyString>>>;
|
|
8211
|
-
/**
|
|
8212
|
-
* Nested select statements will use this option to filter deleted objects.
|
|
8213
|
-
*/
|
|
8214
|
-
deleted: optional<Literal<["include", "exclude", "only"]>>;
|
|
8215
8375
|
}>;
|
|
8216
|
-
interface
|
|
8217
|
-
//#endregion
|
|
8218
|
-
//#region ../echo/dist/types/src/internal/types/base.d.ts
|
|
8219
|
-
/**
|
|
8220
|
-
* Canonical type for all ECHO entities (objects and relations).
|
|
8221
|
-
*/
|
|
8222
|
-
interface AnyEntity {
|
|
8223
|
-
readonly id: ObjectId;
|
|
8224
|
-
}
|
|
8376
|
+
interface Scope extends Schema.Type<typeof Scope> {}
|
|
8225
8377
|
//#endregion
|
|
8226
|
-
//#region
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
declare const KindId: "~@dxos/echo/Kind";
|
|
8231
|
-
type KindId = typeof KindId;
|
|
8232
|
-
/**
|
|
8233
|
-
* String key used to identify the kind of a schema (object schema or relation schema).
|
|
8234
|
-
* Parallels KindId which identifies instance kinds.
|
|
8235
|
-
*/
|
|
8236
|
-
declare const SchemaKindId: "~@dxos/echo/SchemaKind";
|
|
8237
|
-
type SchemaKindId = typeof SchemaKindId;
|
|
8378
|
+
//#region ../../../common/effect/dist/types/src/json-path.d.ts
|
|
8379
|
+
type JsonPath = string & {
|
|
8380
|
+
__JsonPath: true;
|
|
8381
|
+
};
|
|
8238
8382
|
/**
|
|
8239
|
-
*
|
|
8383
|
+
* https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html
|
|
8240
8384
|
*/
|
|
8241
|
-
declare
|
|
8242
|
-
Object = "object",
|
|
8243
|
-
Relation = "relation",
|
|
8244
|
-
}
|
|
8245
|
-
//#endregion
|
|
8246
|
-
//#region ../echo/dist/types/src/internal/annotations/annotations.d.ts
|
|
8247
|
-
declare const TypeMeta: Struct<{
|
|
8248
|
-
typename: refine<string, typeof String$>;
|
|
8249
|
-
version: refine<string, typeof String$>;
|
|
8250
|
-
}>;
|
|
8251
|
-
interface TypeMeta extends Schema.Type<typeof TypeMeta> {}
|
|
8385
|
+
declare const JsonPath: Schema<JsonPath>;
|
|
8252
8386
|
//#endregion
|
|
8253
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.
|
|
8387
|
+
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.20_0d92fe5e7b61f71046b89ef5357c0767/node_modules/@effect-atom/atom/dist/dts/AtomHttpApi.d.ts
|
|
8254
8388
|
declare global {
|
|
8255
8389
|
interface ErrorConstructor {
|
|
8256
8390
|
stackTraceLimit: number;
|
|
@@ -8261,7 +8395,7 @@ declare global {
|
|
|
8261
8395
|
* @category Constructors
|
|
8262
8396
|
*/
|
|
8263
8397
|
//#endregion
|
|
8264
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.
|
|
8398
|
+
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.1_@effect+experimental@0.58.0_@effect+platform@0.94.4_effect@3.20_0d92fe5e7b61f71046b89ef5357c0767/node_modules/@effect-atom/atom/dist/dts/AtomRpc.d.ts
|
|
8265
8399
|
declare global {
|
|
8266
8400
|
interface ErrorConstructor {
|
|
8267
8401
|
stackTraceLimit: number;
|
|
@@ -8272,188 +8406,715 @@ declare global {
|
|
|
8272
8406
|
* @category Constructors
|
|
8273
8407
|
*/
|
|
8274
8408
|
//#endregion
|
|
8275
|
-
//#region ../echo/dist/types/src/internal/
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
* Reference Schema.
|
|
8279
|
-
*/
|
|
8280
|
-
interface RefSchema<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
|
|
8281
|
-
/**
|
|
8282
|
-
* Type of the `Ref` function and extra methods attached to it.
|
|
8283
|
-
*/
|
|
8284
|
-
interface RefFn {
|
|
8285
|
-
<S$1 extends Schema.Any>(schema: S$1): RefSchema<Schema.Type<S$1>>;
|
|
8286
|
-
/**
|
|
8287
|
-
* @returns True if the object is a reference.
|
|
8288
|
-
*/
|
|
8289
|
-
isRef: (obj: unknown) => obj is Ref<any>;
|
|
8290
|
-
/**
|
|
8291
|
-
* @returns True if the reference points to the given object id.
|
|
8292
|
-
*/
|
|
8293
|
-
hasObjectId: (id: ObjectId) => (ref: Ref<any>) => boolean;
|
|
8294
|
-
/**
|
|
8295
|
-
* @returns True if the schema is a reference schema.
|
|
8296
|
-
*/
|
|
8297
|
-
isRefSchema: (schema: Schema<any, any>) => schema is RefSchema<any>;
|
|
8298
|
-
/**
|
|
8299
|
-
* @returns True if the schema AST is a reference schema.
|
|
8300
|
-
*/
|
|
8301
|
-
isRefSchemaAST: (ast: AST) => boolean;
|
|
8409
|
+
//#region ../echo/dist/types/src/internal/Entity/entity.d.ts
|
|
8410
|
+
type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
|
|
8411
|
+
interface EchoTypeSchema<Self extends Schema.Any, ExtraFields = {}, K$1 extends EntityKind = EntityKind, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, AnnotableClass<EchoTypeSchema<Self, ExtraFields, K$1, Fields>, EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields>, EchoTypeSchemaProps<Schema.Encoded<Self>, ExtraFields>, Schema.Context<Self>> {
|
|
8302
8412
|
/**
|
|
8303
|
-
*
|
|
8413
|
+
* Schema kind key that marks this as an ECHO schema and indicates its kind.
|
|
8414
|
+
* Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
|
|
8304
8415
|
*/
|
|
8305
|
-
|
|
8416
|
+
readonly [SchemaKindId]: K$1;
|
|
8306
8417
|
/**
|
|
8307
|
-
*
|
|
8418
|
+
* The fields defined in the original struct schema.
|
|
8419
|
+
* Allows accessing field definitions for introspection.
|
|
8308
8420
|
*/
|
|
8309
|
-
|
|
8421
|
+
readonly fields: Fields;
|
|
8422
|
+
instanceOf(value: unknown): boolean;
|
|
8310
8423
|
}
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
* This is the data type for the fields marked as ref.
|
|
8318
|
-
*/
|
|
8319
|
-
interface Ref<T$1> {
|
|
8320
|
-
/**
|
|
8321
|
-
* Target object DXN.
|
|
8322
|
-
*/
|
|
8323
|
-
get dxn(): DXN;
|
|
8324
|
-
/**
|
|
8325
|
-
* Returns true if the reference has a target available (inlined or resolver set).
|
|
8326
|
-
*/
|
|
8327
|
-
get isAvailable(): boolean;
|
|
8328
|
-
/**
|
|
8329
|
-
* @returns The reference target.
|
|
8330
|
-
* May return `undefined` if the object is not loaded in the working set.
|
|
8331
|
-
* Accessing this property, even if it returns `undefined` will trigger the object to be loaded to the working set.
|
|
8332
|
-
*/
|
|
8333
|
-
get target(): T$1 | undefined;
|
|
8334
|
-
/**
|
|
8335
|
-
* @returns Promise that will resolves with the target object.
|
|
8336
|
-
* Will load the object from disk if it is not present in the working set.
|
|
8337
|
-
* @throws If the object is not available locally.
|
|
8338
|
-
*/
|
|
8339
|
-
load(): Promise<T$1>;
|
|
8340
|
-
/**
|
|
8341
|
-
* @returns Promise that will resolves with the target object or undefined if the object is not loaded locally.
|
|
8342
|
-
*/
|
|
8343
|
-
tryLoad(): Promise<T$1 | undefined>;
|
|
8344
|
-
/**
|
|
8345
|
-
* Do not inline the target object in the reference.
|
|
8346
|
-
* Makes .target unavailable unless the reference is connected to a database context.
|
|
8347
|
-
*
|
|
8348
|
-
* When serialized with toJSON, the difference is between:
|
|
8349
|
-
* `{ "/": "dxn:..." }`
|
|
8350
|
-
* and
|
|
8351
|
-
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8352
|
-
*
|
|
8353
|
-
* Clones the reference object.
|
|
8354
|
-
*/
|
|
8355
|
-
noInline(): Ref<T$1>;
|
|
8356
|
-
/**
|
|
8357
|
-
* Serializes the reference to a JSON object.
|
|
8358
|
-
* The serialization format is compatible with the IPLD-style encoded references.
|
|
8359
|
-
* When a reference has a saved target (i.e. the target or object holding the reference is not in the database),
|
|
8360
|
-
* the target is included in the serialized object.
|
|
8361
|
-
*
|
|
8362
|
-
* Examples:
|
|
8363
|
-
* `{ "/": "dxn:..." }`
|
|
8364
|
-
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8365
|
-
*/
|
|
8366
|
-
encode(): EncodedReference;
|
|
8367
|
-
[RefTypeId]: {
|
|
8368
|
-
_T: T$1;
|
|
8424
|
+
declare namespace Filter_d_exports {
|
|
8425
|
+
export { Any$3 as Any, Filter, Props, TextSearchOptions, Type$2 as Type, and, between, contains, created, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, lt, lte, neq, not, nothing, or, pretty$1 as pretty, props, tag, text, type$2 as type, typeDXN, typename$1 as typename, updated };
|
|
8426
|
+
}
|
|
8427
|
+
interface Filter<T$1> {
|
|
8428
|
+
'~Filter': {
|
|
8429
|
+
value: Covariant<T$1>;
|
|
8369
8430
|
};
|
|
8431
|
+
ast: Filter$1;
|
|
8370
8432
|
}
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8433
|
+
type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
|
|
8434
|
+
type Any$3 = Filter<any>;
|
|
8435
|
+
type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
|
|
8436
|
+
declare class FilterClass implements Any$3 {
|
|
8437
|
+
readonly ast: Filter$1;
|
|
8438
|
+
private static 'variance';
|
|
8439
|
+
constructor(ast: Filter$1);
|
|
8440
|
+
'~Filter': {
|
|
8441
|
+
value: Covariant<any>;
|
|
8442
|
+
};
|
|
8376
8443
|
}
|
|
8377
|
-
|
|
8378
|
-
|
|
8444
|
+
declare const is$1: (value: unknown) => value is Any$3;
|
|
8445
|
+
/** Construct a filter from an ast. */
|
|
8446
|
+
declare const fromAst$1: (ast: Filter$1) => Any$3;
|
|
8379
8447
|
/**
|
|
8380
|
-
*
|
|
8448
|
+
* Filter that matches all objects.
|
|
8381
8449
|
*/
|
|
8382
|
-
declare const
|
|
8450
|
+
declare const everything: () => FilterClass;
|
|
8383
8451
|
/**
|
|
8384
|
-
*
|
|
8452
|
+
* Filter that matches no objects.
|
|
8385
8453
|
*/
|
|
8386
|
-
declare const
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8454
|
+
declare const nothing: () => FilterClass;
|
|
8455
|
+
declare const id: (...ids: ObjectId[]) => Any$3;
|
|
8456
|
+
/**
|
|
8457
|
+
* Filter by type.
|
|
8458
|
+
*/
|
|
8459
|
+
declare const type$2: <S$1 extends Schema.All>(schema: S$1 | string, props?: Props<Schema.Type<S$1>>) => Filter<Schema.Type<S$1>>;
|
|
8460
|
+
/**
|
|
8461
|
+
* Filter by non-qualified typename.
|
|
8462
|
+
*/
|
|
8463
|
+
declare const typename$1: (typename: string) => Any$3;
|
|
8464
|
+
/**
|
|
8465
|
+
* Filter by fully qualified type DXN.
|
|
8466
|
+
*/
|
|
8467
|
+
declare const typeDXN: (dxn: DXN) => Any$3;
|
|
8468
|
+
/**
|
|
8469
|
+
* Filter by tag.
|
|
8470
|
+
*/
|
|
8471
|
+
declare const tag: (tag: string) => Any$3;
|
|
8472
|
+
/**
|
|
8473
|
+
* Filter by properties.
|
|
8474
|
+
*/
|
|
8475
|
+
declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
|
|
8476
|
+
type TextSearchOptions = {
|
|
8477
|
+
type?: 'full-text' | 'vector';
|
|
8478
|
+
};
|
|
8479
|
+
/**
|
|
8480
|
+
* Full-text or vector search.
|
|
8481
|
+
*/
|
|
8482
|
+
declare const text: (text: string, options?: TextSearchOptions) => Any$3;
|
|
8483
|
+
/**
|
|
8484
|
+
* Filter by foreign keys.
|
|
8485
|
+
*/
|
|
8486
|
+
declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
|
|
8487
|
+
/**
|
|
8488
|
+
* Predicate for property to be equal to the provided value.
|
|
8489
|
+
*/
|
|
8490
|
+
declare const eq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8491
|
+
/**
|
|
8492
|
+
* Predicate for property to be not equal to the provided value.
|
|
8493
|
+
*/
|
|
8494
|
+
declare const neq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8495
|
+
/**
|
|
8496
|
+
* Predicate for property to be greater than the provided value.
|
|
8497
|
+
*/
|
|
8498
|
+
declare const gt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8499
|
+
/**
|
|
8500
|
+
* Predicate for property to be greater than or equal to the provided value.
|
|
8501
|
+
*/
|
|
8502
|
+
declare const gte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8503
|
+
/**
|
|
8504
|
+
* Predicate for property to be less than the provided value.
|
|
8505
|
+
*/
|
|
8506
|
+
declare const lt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8507
|
+
/**
|
|
8508
|
+
* Predicate for property to be less than or equal to the provided value.
|
|
8509
|
+
*/
|
|
8510
|
+
declare const lte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8511
|
+
/**
|
|
8512
|
+
* Predicate for property to be in the provided array.
|
|
8513
|
+
* @param values - Values to check against.
|
|
8514
|
+
*/
|
|
8515
|
+
declare const in$: <T$1>(...values: T$1[]) => Filter<T$1>;
|
|
8516
|
+
/**
|
|
8517
|
+
* Predicate for an array property to contain the provided value.
|
|
8518
|
+
* @param value - Value to check against.
|
|
8519
|
+
*/
|
|
8520
|
+
declare const contains: <T$1>(value: T$1) => Filter<readonly T$1[] | undefined>;
|
|
8521
|
+
/**
|
|
8522
|
+
* Predicate for property to be in the provided range.
|
|
8523
|
+
* @param from - Start of the range (inclusive).
|
|
8524
|
+
* @param to - End of the range (exclusive).
|
|
8525
|
+
*/
|
|
8526
|
+
declare const between: <T$1>(from: T$1, to: T$1) => Filter<T$1>;
|
|
8527
|
+
type TimeRange = {
|
|
8528
|
+
after?: Date | number;
|
|
8529
|
+
before?: Date | number;
|
|
8530
|
+
};
|
|
8531
|
+
/**
|
|
8532
|
+
* Filter objects by updatedAt timestamp.
|
|
8533
|
+
*/
|
|
8534
|
+
declare const updated: (range: TimeRange) => Any$3;
|
|
8535
|
+
/**
|
|
8536
|
+
* Filter objects by createdAt timestamp.
|
|
8537
|
+
*/
|
|
8538
|
+
declare const created: (range: TimeRange) => Any$3;
|
|
8539
|
+
/**
|
|
8540
|
+
* Negate the filter.
|
|
8541
|
+
*/
|
|
8542
|
+
declare const not: <F extends Any$3>(filter: F) => Filter<Type$2<F>>;
|
|
8543
|
+
/**
|
|
8544
|
+
* Combine filters with a logical AND.
|
|
8545
|
+
*/
|
|
8546
|
+
declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
|
|
8547
|
+
/**
|
|
8548
|
+
* Combine filters with a logical OR.
|
|
8549
|
+
*/
|
|
8550
|
+
declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
|
|
8551
|
+
/**
|
|
8552
|
+
* Returns a human-readable string representation of a Filter AST.
|
|
8392
8553
|
*/
|
|
8393
|
-
|
|
8554
|
+
declare const pretty$1: (filter: Any$3) => string;
|
|
8394
8555
|
//#endregion
|
|
8395
|
-
//#region ../echo/dist/types/src/
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8556
|
+
//#region ../echo/dist/types/src/internal/JsonSchema/json-schema-type.d.ts
|
|
8557
|
+
/**
|
|
8558
|
+
* Describes a schema for the JSON-schema objects stored in ECHO.
|
|
8559
|
+
* Contains extensions for ECHO (e.g., references).
|
|
8560
|
+
* Ref: https://json-schema.org/draft-07/schema
|
|
8561
|
+
*/
|
|
8562
|
+
declare const _JsonSchemaType: Struct<{
|
|
8563
|
+
/**
|
|
8564
|
+
* Identifier for this schema.
|
|
8565
|
+
* This schema might be referenced by $ref clause in other schemas.
|
|
8566
|
+
*/
|
|
8567
|
+
$id: optional<typeof String$>;
|
|
8568
|
+
/**
|
|
8569
|
+
* Schema of this schema.
|
|
8570
|
+
* Set to "https://json-schema.org/draft-07/schema".
|
|
8571
|
+
*/
|
|
8572
|
+
$schema: optional<typeof String$>;
|
|
8573
|
+
/**
|
|
8574
|
+
* Reference to another schema.
|
|
8575
|
+
*/
|
|
8576
|
+
$ref: optional<typeof String$>;
|
|
8577
|
+
/**
|
|
8578
|
+
* Comments are ignored when interpreting the schema.
|
|
8579
|
+
*/
|
|
8580
|
+
$comment: optional<typeof String$>;
|
|
8581
|
+
/**
|
|
8582
|
+
* Defines whether this schema is an object schema or a relation schema.
|
|
8583
|
+
*/
|
|
8584
|
+
entityKind: optional<Enums<typeof EntityKind>>;
|
|
8585
|
+
/**
|
|
8586
|
+
* Typename of this schema.
|
|
8587
|
+
* Only on schema representing an ECHO object.
|
|
8588
|
+
*
|
|
8589
|
+
* @example 'com.example.type.my-type'
|
|
8590
|
+
*/
|
|
8591
|
+
typename: optional<typeof String$>;
|
|
8592
|
+
/**
|
|
8593
|
+
* Version of this schema.
|
|
8594
|
+
* Custom dialect for ECHO.
|
|
8595
|
+
*/
|
|
8596
|
+
version: optional<typeof String$>;
|
|
8597
|
+
/**
|
|
8598
|
+
* Target of this relation.
|
|
8599
|
+
* Only for relation schemas.
|
|
8600
|
+
* The referenced schema must be an object schema.
|
|
8601
|
+
*/
|
|
8602
|
+
relationTarget: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8603
|
+
/**
|
|
8604
|
+
* Source of this relation.
|
|
8605
|
+
* Only for relation schemas.
|
|
8606
|
+
* The referenced schema must be an object schema.
|
|
8607
|
+
*/
|
|
8608
|
+
relationSource: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8609
|
+
/**
|
|
8610
|
+
* Title of this schema.
|
|
8611
|
+
*/
|
|
8612
|
+
title: optional<typeof String$>;
|
|
8613
|
+
/**
|
|
8614
|
+
* Description of this schema.
|
|
8615
|
+
*/
|
|
8616
|
+
description: optional<typeof String$>;
|
|
8617
|
+
/**
|
|
8618
|
+
* Whether this schema is read-only.
|
|
8619
|
+
*/
|
|
8620
|
+
readOnly: optional<typeof Boolean$>;
|
|
8621
|
+
/**
|
|
8622
|
+
* Whether this schema is write-only.
|
|
8623
|
+
*/
|
|
8624
|
+
writeOnly: optional<typeof Boolean$>;
|
|
8625
|
+
/**
|
|
8626
|
+
* Examples of instances of this schema.
|
|
8627
|
+
*/
|
|
8628
|
+
examples: optional<Array$<typeof Any$4>>;
|
|
8629
|
+
/**
|
|
8630
|
+
* Default value for this schema.
|
|
8631
|
+
*/
|
|
8632
|
+
default: optional<typeof Any$4>;
|
|
8633
|
+
/**
|
|
8634
|
+
* This schema only matches values that are equal to this value.
|
|
8635
|
+
*/
|
|
8636
|
+
const: optional<typeof Any$4>;
|
|
8637
|
+
/**
|
|
8638
|
+
* This schema only matches one of the values in this array.
|
|
8639
|
+
*/
|
|
8640
|
+
enum: optional<Array$<typeof Any$4>>;
|
|
8641
|
+
/**
|
|
8642
|
+
* Base type of the schema.
|
|
8643
|
+
*/
|
|
8644
|
+
type: optional<Union<[Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>, Array$<Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>>]>>;
|
|
8645
|
+
multipleOf: optional<filter<typeof Number$>>;
|
|
8646
|
+
maximum: optional<typeof Number$>;
|
|
8647
|
+
exclusiveMaximum: optional<typeof Number$>;
|
|
8648
|
+
minimum: optional<typeof Number$>;
|
|
8649
|
+
exclusiveMinimum: optional<typeof Number$>;
|
|
8650
|
+
maxLength: optional<filter<typeof Number$>>;
|
|
8651
|
+
/**
|
|
8652
|
+
* Regex pattern for strings.
|
|
8653
|
+
*/
|
|
8654
|
+
pattern: optional<typeof String$>;
|
|
8655
|
+
/**
|
|
8656
|
+
* Serialized from {@link FormatAnnotationId}.
|
|
8657
|
+
*/
|
|
8658
|
+
format: optional<typeof String$>;
|
|
8659
|
+
minLength: optional<filter<typeof Number$>>;
|
|
8660
|
+
items: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, Array$<suspend<JsonSchemaType, JsonSchemaType, never>>]>>;
|
|
8661
|
+
additionalItems: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
|
|
8662
|
+
maxItems: optional<filter<typeof Number$>>;
|
|
8663
|
+
minItems: optional<filter<typeof Number$>>;
|
|
8664
|
+
uniqueItems: optional<typeof Boolean$>;
|
|
8665
|
+
contains: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8666
|
+
maxProperties: optional<filter<typeof Number$>>;
|
|
8667
|
+
minProperties: optional<filter<typeof Number$>>;
|
|
8668
|
+
required: optional<Array$<typeof String$>>;
|
|
8669
|
+
/**
|
|
8670
|
+
* Non-standard JSON Schema extension.
|
|
8671
|
+
* Defines the order of properties in the object.
|
|
8672
|
+
* The unmentioned properties are placed at the end.
|
|
8673
|
+
*
|
|
8674
|
+
* Related: https://github.com/json-schema/json-schema/issues/119
|
|
8675
|
+
*/
|
|
8676
|
+
propertyOrder: optional<Array$<typeof String$>>;
|
|
8677
|
+
additionalProperties: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
|
|
8678
|
+
properties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8679
|
+
patternProperties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8680
|
+
propertyNames: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8681
|
+
definitions: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8682
|
+
dependencies: optional<Record$<typeof String$, suspend<string | readonly string[] | JsonSchemaType, string | readonly string[] | JsonSchemaType, never>>>;
|
|
8683
|
+
contentMediaType: optional<typeof String$>;
|
|
8684
|
+
contentEncoding: optional<typeof String$>;
|
|
8685
|
+
if: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8686
|
+
then: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8687
|
+
else: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8688
|
+
allOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8689
|
+
anyOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8690
|
+
oneOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8691
|
+
not: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8692
|
+
$defs: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8693
|
+
currency: optional<typeof String$>;
|
|
8694
|
+
reference: optional<Struct<{
|
|
8695
|
+
schema: suspend<JsonSchemaType, JsonSchemaType, never>;
|
|
8696
|
+
schemaVersion: optional<typeof String$>;
|
|
8697
|
+
schemaObject: optional<typeof String$>;
|
|
8698
|
+
}>>;
|
|
8699
|
+
/**
|
|
8700
|
+
* ECHO-specific annotations.
|
|
8701
|
+
*/
|
|
8702
|
+
annotations: optional<Struct<{
|
|
8703
|
+
/**
|
|
8704
|
+
* Label for this schema.
|
|
8705
|
+
* Mapped from {@link LabelAnnotationId}.
|
|
8706
|
+
*/
|
|
8707
|
+
labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
|
|
8708
|
+
/**
|
|
8709
|
+
* Generator function for this schema.
|
|
8710
|
+
* Mapped from {@link GeneratorAnnotationId}.
|
|
8711
|
+
*/
|
|
8712
|
+
generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
|
|
8713
|
+
/**
|
|
8714
|
+
* {@link PropertyMeta} annotations get serialized here.
|
|
8715
|
+
*/
|
|
8716
|
+
meta: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8717
|
+
/**
|
|
8718
|
+
* @deprecated
|
|
8719
|
+
*/
|
|
8720
|
+
type: optional<Struct<{
|
|
8721
|
+
typename: typeof String$;
|
|
8722
|
+
version: typeof String$;
|
|
8723
|
+
schemaId: optional<typeof String$>;
|
|
8724
|
+
}>>;
|
|
8725
|
+
/**
|
|
8726
|
+
* @deprecated Superseded by `meta`.
|
|
8727
|
+
*/
|
|
8728
|
+
annotations: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8729
|
+
}>>;
|
|
8730
|
+
/**
|
|
8731
|
+
* @deprecated Use `annotations` instead.
|
|
8732
|
+
*/
|
|
8733
|
+
echo: optional<Struct<{
|
|
8734
|
+
/**
|
|
8735
|
+
* Label for this schema.
|
|
8736
|
+
* Mapped from {@link LabelAnnotationId}.
|
|
8737
|
+
*/
|
|
8738
|
+
labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
|
|
8739
|
+
/**
|
|
8740
|
+
* Generator function for this schema.
|
|
8741
|
+
* Mapped from {@link GeneratorAnnotationId}.
|
|
8742
|
+
*/
|
|
8743
|
+
generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
|
|
8744
|
+
/**
|
|
8745
|
+
* {@link PropertyMeta} annotations get serialized here.
|
|
8746
|
+
*/
|
|
8747
|
+
meta: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8748
|
+
/**
|
|
8749
|
+
* @deprecated
|
|
8750
|
+
*/
|
|
8751
|
+
type: optional<Struct<{
|
|
8752
|
+
typename: typeof String$;
|
|
8753
|
+
version: typeof String$;
|
|
8754
|
+
schemaId: optional<typeof String$>;
|
|
8755
|
+
}>>;
|
|
8756
|
+
/**
|
|
8757
|
+
* @deprecated Superseded by `meta`.
|
|
8758
|
+
*/
|
|
8759
|
+
annotations: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8760
|
+
}>>;
|
|
8761
|
+
}>;
|
|
8762
|
+
/**
|
|
8763
|
+
* https://json-schema.org/draft-07/schema
|
|
8764
|
+
*/
|
|
8765
|
+
interface JsonSchemaType extends Schema.Type<typeof _JsonSchemaType> {}
|
|
8766
|
+
declare const JsonSchemaType: Schema<JsonSchemaType>;
|
|
8400
8767
|
//#endregion
|
|
8401
|
-
//#region ../echo/dist/types/src/
|
|
8768
|
+
//#region ../echo/dist/types/src/internal/Ref/ref.d.ts
|
|
8769
|
+
declare const RefTypeId: unique symbol;
|
|
8402
8770
|
/**
|
|
8403
|
-
*
|
|
8404
|
-
* The value indicates the entity kind (Object or Relation).
|
|
8771
|
+
* Reference Schema.
|
|
8405
8772
|
*/
|
|
8406
|
-
|
|
8407
|
-
readonly [SchemaKindId]: K$1;
|
|
8408
|
-
};
|
|
8773
|
+
interface RefSchema$1<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
|
|
8409
8774
|
/**
|
|
8410
|
-
*
|
|
8775
|
+
* Type of the `Ref` function and extra methods attached to it.
|
|
8411
8776
|
*/
|
|
8412
|
-
|
|
8777
|
+
interface RefFn {
|
|
8778
|
+
<S$1 extends Schema.Any>(schema: S$1): RefSchema$1<Schema.Type<S$1>>;
|
|
8779
|
+
/**
|
|
8780
|
+
* @returns True if the object is a reference.
|
|
8781
|
+
*/
|
|
8782
|
+
isRef: (obj: unknown) => obj is Ref<any>;
|
|
8783
|
+
/**
|
|
8784
|
+
* @returns True if the reference points to the given object id.
|
|
8785
|
+
*/
|
|
8786
|
+
hasObjectId: (id: ObjectId) => (ref: Ref<any>) => boolean;
|
|
8787
|
+
/**
|
|
8788
|
+
* @returns True if the schema is a reference schema.
|
|
8789
|
+
*/
|
|
8790
|
+
isRefSchema: (schema: Schema<any, any>) => schema is RefSchema$1<any>;
|
|
8791
|
+
/**
|
|
8792
|
+
* @returns True if the schema AST is a reference schema.
|
|
8793
|
+
*/
|
|
8794
|
+
isRefSchemaAST: (ast: AST) => boolean;
|
|
8795
|
+
/**
|
|
8796
|
+
* Constructs a reference that points to the given object.
|
|
8797
|
+
*/
|
|
8798
|
+
make: <T$1 extends AnyEntity>(object: T$1) => Ref<T$1>;
|
|
8799
|
+
/**
|
|
8800
|
+
* Constructs a reference that points to the object specified by the provided DXN.
|
|
8801
|
+
*/
|
|
8802
|
+
fromDXN: (dxn: DXN) => Ref<any>;
|
|
8803
|
+
}
|
|
8413
8804
|
/**
|
|
8414
|
-
*
|
|
8805
|
+
* Schema builder for references.
|
|
8415
8806
|
*/
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8807
|
+
declare const Ref: RefFn;
|
|
8808
|
+
/**
|
|
8809
|
+
* Represents materialized reference to a target.
|
|
8810
|
+
* This is the data type for the fields marked as ref.
|
|
8811
|
+
*/
|
|
8812
|
+
interface Ref<T$1> extends Pipeable {
|
|
8813
|
+
/**
|
|
8814
|
+
* Target object DXN.
|
|
8815
|
+
*/
|
|
8816
|
+
get dxn(): DXN;
|
|
8817
|
+
/**
|
|
8818
|
+
* Returns true if the reference has a target available (inlined or resolver set).
|
|
8819
|
+
*/
|
|
8820
|
+
get isAvailable(): boolean;
|
|
8821
|
+
/**
|
|
8822
|
+
* @returns The reference target.
|
|
8823
|
+
* May return `undefined` if the object is not loaded in the working set.
|
|
8824
|
+
* Accessing this property, even if it returns `undefined` will trigger the object to be loaded to the working set.
|
|
8825
|
+
*/
|
|
8826
|
+
get target(): T$1 | undefined;
|
|
8827
|
+
/**
|
|
8828
|
+
* @returns Promise that will resolves with the target object.
|
|
8829
|
+
* Will load the object from disk if it is not present in the working set.
|
|
8830
|
+
* @throws If the object is not available locally.
|
|
8831
|
+
*/
|
|
8832
|
+
load(): Promise<T$1>;
|
|
8833
|
+
/**
|
|
8834
|
+
* @returns Promise that will resolves with the target object or undefined if the object is not loaded locally.
|
|
8835
|
+
*/
|
|
8836
|
+
tryLoad(): Promise<T$1 | undefined>;
|
|
8837
|
+
/**
|
|
8838
|
+
* Do not inline the target object in the reference.
|
|
8839
|
+
* Makes .target unavailable unless the reference is connected to a database context.
|
|
8840
|
+
*
|
|
8841
|
+
* When serialized with toJSON, the difference is between:
|
|
8842
|
+
* `{ "/": "dxn:..." }`
|
|
8843
|
+
* and
|
|
8844
|
+
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8845
|
+
*
|
|
8846
|
+
* Clones the reference object.
|
|
8847
|
+
*/
|
|
8848
|
+
noInline(): Ref<T$1>;
|
|
8849
|
+
/**
|
|
8850
|
+
* Serializes the reference to a JSON object.
|
|
8851
|
+
* The serialization format is compatible with the IPLD-style encoded references.
|
|
8852
|
+
* When a reference has a saved target (i.e. the target or object holding the reference is not in the database),
|
|
8853
|
+
* the target is included in the serialized object.
|
|
8854
|
+
*
|
|
8855
|
+
* Examples:
|
|
8856
|
+
* `{ "/": "dxn:..." }`
|
|
8857
|
+
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8858
|
+
*/
|
|
8859
|
+
encode(): EncodedReference;
|
|
8860
|
+
[RefTypeId]: {
|
|
8861
|
+
_T: T$1;
|
|
8862
|
+
};
|
|
8420
8863
|
}
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8864
|
+
declare namespace Ref {
|
|
8865
|
+
/**
|
|
8866
|
+
* Target of the reference.
|
|
8867
|
+
*/
|
|
8868
|
+
type Target<R$1> = R$1 extends Ref<infer U> ? U : never;
|
|
8869
|
+
}
|
|
8870
|
+
interface RefResolver {
|
|
8871
|
+
/**
|
|
8872
|
+
* Resolve ref synchronously from the objects in the working set.
|
|
8873
|
+
*
|
|
8874
|
+
* @param dxn
|
|
8875
|
+
* @param load If true the resolver should attempt to load the object from disk.
|
|
8876
|
+
* @param onLoad Callback to call when the object is loaded.
|
|
8877
|
+
*/
|
|
8878
|
+
resolveSync(dxn: DXN, load: boolean, onLoad?: () => void): AnyProperties | undefined;
|
|
8879
|
+
/**
|
|
8880
|
+
* Resolver ref asynchronously.
|
|
8881
|
+
*/
|
|
8882
|
+
resolve(dxn: DXN): Promise<AnyProperties | undefined>;
|
|
8883
|
+
resolveSchema(dxn: DXN): Promise<Schema.AnyNoContext | undefined>;
|
|
8884
|
+
}
|
|
8885
|
+
//#endregion
|
|
8886
|
+
//#region ../echo/dist/types/src/internal/Obj/typed-object.d.ts
|
|
8426
8887
|
/**
|
|
8427
|
-
*
|
|
8428
|
-
*
|
|
8429
|
-
*
|
|
8888
|
+
* Definition for an object type that can be stored in an ECHO database.
|
|
8889
|
+
* Implements effect schema to define object properties.
|
|
8890
|
+
* Has a typename and version.
|
|
8891
|
+
*
|
|
8892
|
+
* In contrast to {@link EchoSchema} this definition is not recorded in the database.
|
|
8893
|
+
*
|
|
8894
|
+
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8895
|
+
*/
|
|
8896
|
+
interface TypedObject<A$1 = any, I$1 = any> extends TypeMeta, Schema<A$1, I$1> {}
|
|
8897
|
+
/**
|
|
8898
|
+
* Typed object that could be used as a prototype in class definitions.
|
|
8899
|
+
* This is an internal API type.
|
|
8900
|
+
*
|
|
8901
|
+
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8902
|
+
*/
|
|
8903
|
+
interface TypedObjectPrototype<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8904
|
+
/** Type constructor. */
|
|
8905
|
+
new (): AnyEntity & A$1;
|
|
8906
|
+
}
|
|
8907
|
+
//#endregion
|
|
8908
|
+
//#region ../echo/dist/types/src/internal/Type/persistent-schema.d.ts
|
|
8909
|
+
/**
|
|
8910
|
+
* Persistent representation of a schema.
|
|
8911
|
+
*/
|
|
8912
|
+
declare const PersistentSchema: EchoObjectSchema<Struct<{
|
|
8913
|
+
name: optional<typeof String$>;
|
|
8914
|
+
typename: refine<string, typeof String$>;
|
|
8915
|
+
version: refine<string, typeof String$>;
|
|
8916
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8917
|
+
}>, Readonly<{
|
|
8918
|
+
name: optional<typeof String$>;
|
|
8919
|
+
typename: refine<string, typeof String$>;
|
|
8920
|
+
version: refine<string, typeof String$>;
|
|
8921
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8922
|
+
}>>;
|
|
8923
|
+
interface PersistentSchema extends Schema.Type<typeof PersistentSchema> {}
|
|
8924
|
+
//#endregion
|
|
8925
|
+
//#region ../echo/dist/types/src/internal/Type/echo-schema.d.ts
|
|
8926
|
+
/**
|
|
8927
|
+
* Base schema type.
|
|
8928
|
+
*/
|
|
8929
|
+
interface BaseSchema<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8930
|
+
get readonly(): boolean;
|
|
8931
|
+
get mutable(): EchoSchema<A$1, I$1>;
|
|
8932
|
+
get snapshot(): Schema<A$1, I$1>;
|
|
8933
|
+
get jsonSchema(): JsonSchemaType;
|
|
8934
|
+
}
|
|
8935
|
+
declare const EchoSchema_base: TypedObjectPrototype<any, any>;
|
|
8936
|
+
/**
|
|
8937
|
+
* Represents a schema that is persisted in the ECHO database.
|
|
8938
|
+
* Schema can me mutable or readonly (specified by the {@link EchoSchema.readonly} field).
|
|
8939
|
+
*
|
|
8940
|
+
* Schema that can be modified at runtime via the API.
|
|
8941
|
+
* Is an instance of effect-schema (`Schema.Schema.AnyNoContext`) so it can be used in the same way as a regular schema.
|
|
8942
|
+
* IMPORTANT: The schema AST will change reactively when the schema is updated, including synced updates from remote peers.
|
|
8430
8943
|
*
|
|
8431
|
-
*
|
|
8432
|
-
* Use `Relation.isRelation()` for proper ECHO instance type guards that check the KindId brand.
|
|
8944
|
+
* The class constructor is a schema instance itself, and can be used in the echo object definitions:
|
|
8433
8945
|
*
|
|
8434
8946
|
* @example
|
|
8435
8947
|
* ```ts
|
|
8436
|
-
*
|
|
8437
|
-
*
|
|
8438
|
-
*
|
|
8439
|
-
*
|
|
8440
|
-
*
|
|
8948
|
+
* export class TableType extends Schema.Struct({...}).pipe(Type.object({ typename: 'com.example.type.table', version: '0.1.0' })){
|
|
8949
|
+
* title: Schema.String,
|
|
8950
|
+
* schema: Schema.optional(ref(EchoSchema)),
|
|
8951
|
+
* props: Schema.mutable(S.Array(TablePropSchema)),
|
|
8952
|
+
* }) {}
|
|
8441
8953
|
* ```
|
|
8954
|
+
*
|
|
8955
|
+
* The ECHO API will translate any references to PersistentSchema objects to be resolved as EchoSchema objects.
|
|
8956
|
+
*/
|
|
8957
|
+
declare class EchoSchema<A$1 = any, I$1 = any> extends EchoSchema_base implements BaseSchema<A$1, I$1> {
|
|
8958
|
+
private readonly _persistentSchema;
|
|
8959
|
+
private _schema;
|
|
8960
|
+
private _isDirty;
|
|
8961
|
+
/**
|
|
8962
|
+
* Schema kind key that marks this as an ECHO schema.
|
|
8963
|
+
* Makes EchoSchema satisfy the Type.AnyObj type.
|
|
8964
|
+
*/
|
|
8965
|
+
readonly [SchemaKindId]: EntityKind.Object;
|
|
8966
|
+
constructor(_persistentSchema: PersistentSchema);
|
|
8967
|
+
get [TypeId$1](): {
|
|
8968
|
+
_A: (_: any) => any;
|
|
8969
|
+
_I: (_: any) => any;
|
|
8970
|
+
_R: (_: never) => never;
|
|
8971
|
+
};
|
|
8972
|
+
get Type(): A$1;
|
|
8973
|
+
get Encoded(): I$1;
|
|
8974
|
+
get Context(): never;
|
|
8975
|
+
get ast(): AST;
|
|
8976
|
+
get annotations(): (annotations: Annotations.GenericSchema<any>) => Schema<any, any, never>;
|
|
8977
|
+
get pipe(): Schema.AnyNoContext['pipe'];
|
|
8978
|
+
get kind(): EntityKind.Object;
|
|
8979
|
+
get typename(): string;
|
|
8980
|
+
get version(): string;
|
|
8981
|
+
get readonly(): boolean;
|
|
8982
|
+
/**
|
|
8983
|
+
* Returns an immutable schema snapshot of the current state of the schema.
|
|
8984
|
+
*/
|
|
8985
|
+
get snapshot(): Schema.AnyNoContext;
|
|
8986
|
+
/**
|
|
8987
|
+
* Returns the JSON schema for the schema.
|
|
8988
|
+
*/
|
|
8989
|
+
get jsonSchema(): JsonSchemaType;
|
|
8990
|
+
/**
|
|
8991
|
+
* Returns a mutable schema.
|
|
8992
|
+
*/
|
|
8993
|
+
get mutable(): EchoSchema;
|
|
8994
|
+
/**
|
|
8995
|
+
* Id of the ECHO object containing the schema.
|
|
8996
|
+
*/
|
|
8997
|
+
get id(): ObjectId;
|
|
8998
|
+
/**
|
|
8999
|
+
* Short name of the schema.
|
|
9000
|
+
*/
|
|
9001
|
+
get name(): string | undefined;
|
|
9002
|
+
get [SchemaMetaSymbol](): SchemaMeta;
|
|
9003
|
+
/**
|
|
9004
|
+
* Reference to the underlying persistent schema object.
|
|
9005
|
+
*/
|
|
9006
|
+
get persistentSchema(): PersistentType;
|
|
9007
|
+
getProperties(): PropertySignature$1[];
|
|
9008
|
+
/**
|
|
9009
|
+
* @throws Error if the schema is readonly.
|
|
9010
|
+
*/
|
|
9011
|
+
updateTypename(typename: string): void;
|
|
9012
|
+
/**
|
|
9013
|
+
* @throws Error if the schema is readonly.
|
|
9014
|
+
*/
|
|
9015
|
+
addFields(fields: Struct.Fields): void;
|
|
9016
|
+
/**
|
|
9017
|
+
* @throws Error if the schema is readonly.
|
|
9018
|
+
*/
|
|
9019
|
+
updateFields(fields: Struct.Fields): void;
|
|
9020
|
+
/**
|
|
9021
|
+
* @throws Error if the schema is readonly.
|
|
9022
|
+
*/
|
|
9023
|
+
updateFieldPropertyName({
|
|
9024
|
+
before,
|
|
9025
|
+
after
|
|
9026
|
+
}: {
|
|
9027
|
+
before: PropertyKey;
|
|
9028
|
+
after: PropertyKey;
|
|
9029
|
+
}): void;
|
|
9030
|
+
/**
|
|
9031
|
+
* @throws Error if the schema is readonly.
|
|
9032
|
+
*/
|
|
9033
|
+
removeFields(fieldNames: string[]): void;
|
|
9034
|
+
/**
|
|
9035
|
+
* Wrapper for Obj.change that handles the change context for the persistent schema.
|
|
9036
|
+
*/
|
|
9037
|
+
private _change;
|
|
9038
|
+
/**
|
|
9039
|
+
* Called by DatabaseSchemaRegistry on update.
|
|
9040
|
+
*/
|
|
9041
|
+
_invalidate(): void;
|
|
9042
|
+
/**
|
|
9043
|
+
* Rebuilds this schema if it is dirty.
|
|
9044
|
+
*/
|
|
9045
|
+
_rebuild(): void;
|
|
9046
|
+
_getSchema(): Schema.AnyNoContext;
|
|
9047
|
+
}
|
|
9048
|
+
//#endregion
|
|
9049
|
+
//#region ../echo/dist/types/src/Relation.d.ts
|
|
9050
|
+
type Endpoints$1<Source, Target$1> = {
|
|
9051
|
+
[Source]: Source;
|
|
9052
|
+
[Target$1]: Target$1;
|
|
9053
|
+
};
|
|
9054
|
+
/**
|
|
9055
|
+
* Get relation source type.
|
|
9056
|
+
*/
|
|
9057
|
+
type SourceOf<A$1> = A$1 extends Endpoints$1<infer S, infer _T> ? S : never;
|
|
9058
|
+
/**
|
|
9059
|
+
* Get relation target type.
|
|
9060
|
+
*/
|
|
9061
|
+
type TargetOf<A$1> = A$1 extends Endpoints$1<infer _S, infer T> ? T : never;
|
|
9062
|
+
//#endregion
|
|
9063
|
+
//#region ../echo/dist/types/src/Type.d.ts
|
|
9064
|
+
/**
|
|
9065
|
+
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9066
|
+
*/
|
|
9067
|
+
declare const RuntimeType: typeof EchoSchema;
|
|
9068
|
+
/**
|
|
9069
|
+
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9070
|
+
*/
|
|
9071
|
+
type RuntimeType = EchoSchema;
|
|
9072
|
+
/**
|
|
9073
|
+
* Type that marks a schema as an ECHO schema.
|
|
9074
|
+
* The value indicates the entity kind (Object or Relation).
|
|
8442
9075
|
*/
|
|
8443
|
-
|
|
9076
|
+
type EchoSchemaKind<K$1 extends EntityKind = EntityKind> = {
|
|
9077
|
+
readonly [SchemaKindId]: K$1;
|
|
9078
|
+
};
|
|
8444
9079
|
/**
|
|
8445
|
-
* TypeScript type for an ECHO
|
|
8446
|
-
* `T` is the instance type produced by the schema
|
|
8447
|
-
* `Source` and `Target` are the endpoint types.
|
|
9080
|
+
* TypeScript type for an ECHO object schema.
|
|
9081
|
+
* `T` is the instance type produced by the schema.
|
|
8448
9082
|
* `Fields` is the optional struct fields type for introspection.
|
|
9083
|
+
*
|
|
9084
|
+
* @example
|
|
9085
|
+
* ```ts
|
|
9086
|
+
* const PersonSchema: Type.Obj<Person> = Schema.Struct({
|
|
9087
|
+
* name: Schema.String,
|
|
9088
|
+
* }).pipe(Type.object({ typename: 'Person', version: '0.1.0' }));
|
|
9089
|
+
*
|
|
9090
|
+
* // Access fields for introspection:
|
|
9091
|
+
* Object.keys(PersonSchema.fields); // ['name']
|
|
9092
|
+
* ```
|
|
8449
9093
|
*/
|
|
8450
|
-
interface
|
|
9094
|
+
interface Obj$1<T$1, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, EchoSchemaKind<EntityKind.Object>, AnnotableClass<Obj$1<T$1, Fields>, OfKind<typeof Kind.Object> & T$1, Simplify<BaseObjJson & ToMutable<T$1>>, never> {
|
|
8451
9095
|
/**
|
|
8452
9096
|
* The fields defined in the original struct schema.
|
|
8453
9097
|
* Allows accessing field definitions for introspection.
|
|
8454
9098
|
*/
|
|
8455
9099
|
readonly fields: Fields;
|
|
8456
9100
|
}
|
|
9101
|
+
/**
|
|
9102
|
+
* Structural base type for any ECHO object schema.
|
|
9103
|
+
* Accepts both static schemas (created with Type.object()) and EchoSchema.
|
|
9104
|
+
* NOTE: Does not include the brand symbol to avoid TS4053 declaration portability issues.
|
|
9105
|
+
* Use Type.isObjectSchema() for runtime type guards.
|
|
9106
|
+
*/
|
|
9107
|
+
type ObjectSchemaBase = Schema.AnyNoContext & {
|
|
9108
|
+
readonly typename: string;
|
|
9109
|
+
readonly version: string;
|
|
9110
|
+
};
|
|
9111
|
+
/**
|
|
9112
|
+
* Type that represents any ECHO object schema.
|
|
9113
|
+
* Accepts both static schemas (Type.object()) and mutable schemas (EchoSchema).
|
|
9114
|
+
*/
|
|
9115
|
+
type AnyObj = ObjectSchemaBase;
|
|
9116
|
+
declare const PersistentType: Obj$1<PersistentSchema>;
|
|
9117
|
+
interface PersistentType extends Schema.Type<typeof PersistentType> {}
|
|
8457
9118
|
/**
|
|
8458
9119
|
* Structural base type for any ECHO relation schema.
|
|
8459
9120
|
* Accepts static schemas (created with Type.relation()).
|
|
@@ -8464,25 +9125,16 @@ type RelationSchemaBase = Schema.AnyNoContext & {
|
|
|
8464
9125
|
readonly typename: string;
|
|
8465
9126
|
readonly version: string;
|
|
8466
9127
|
};
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
/**
|
|
8478
|
-
* Get relation target type.
|
|
8479
|
-
*/
|
|
8480
|
-
type Target<A$1> = A$1 extends Relation.Endpoints<infer _S, infer T> ? T : never;
|
|
8481
|
-
type Endpoints<Source$1, Target$2> = {
|
|
8482
|
-
[Source]: Source$1;
|
|
8483
|
-
[Target]: Target$2;
|
|
8484
|
-
};
|
|
8485
|
-
}
|
|
9128
|
+
/**
|
|
9129
|
+
* Type that represents any ECHO relation schema.
|
|
9130
|
+
* Accepts static schemas (Type.relation()).
|
|
9131
|
+
*/
|
|
9132
|
+
type AnyRelation = RelationSchemaBase;
|
|
9133
|
+
/**
|
|
9134
|
+
* Type alias for any ECHO entity schema (object or relation).
|
|
9135
|
+
* Use this in type annotations for schema parameters.
|
|
9136
|
+
*/
|
|
9137
|
+
type AnyEntity$1 = AnyObj | AnyRelation;
|
|
8486
9138
|
//#endregion
|
|
8487
9139
|
//#region ../echo/dist/types/src/Obj.d.ts
|
|
8488
9140
|
/**
|
|
@@ -8492,7 +9144,7 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
|
|
|
8492
9144
|
/**
|
|
8493
9145
|
* Object type with specific properties.
|
|
8494
9146
|
*/
|
|
8495
|
-
|
|
9147
|
+
type OfShape<Props$1> = BaseObj & Props$1;
|
|
8496
9148
|
/**
|
|
8497
9149
|
* Object with no known properties beyond id and kind.
|
|
8498
9150
|
* Use this when the object's schema/properties are not known.
|
|
@@ -8501,134 +9153,383 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
|
|
|
8501
9153
|
* NOTE: This is a TypeScript type only, not a schema.
|
|
8502
9154
|
* To validate that a value is an ECHO object, use `Schema.is(Type.Obj)`.
|
|
8503
9155
|
*/
|
|
8504
|
-
interface Unknown extends BaseObj {}
|
|
8505
|
-
//#endregion
|
|
8506
|
-
//#region ../echo/dist/types/src/Entity.d.ts
|
|
8507
|
-
declare const Kind: typeof EntityKind;
|
|
8508
|
-
type Kind = EntityKind;
|
|
9156
|
+
interface Unknown$2 extends BaseObj {}
|
|
8509
9157
|
/**
|
|
8510
|
-
*
|
|
8511
|
-
*
|
|
9158
|
+
* Runtime Effect schema for any ECHO object.
|
|
9159
|
+
* Use for validation, parsing, or as a reference target for collections.
|
|
9160
|
+
*
|
|
9161
|
+
* NOTE: `Schema.is(Type.Obj)` does STRUCTURAL validation only (checks for `id` field).
|
|
9162
|
+
* Use `Obj.isObject()` for proper ECHO instance type guards that check the KindId brand.
|
|
9163
|
+
*
|
|
9164
|
+
* @example
|
|
9165
|
+
* ```ts
|
|
9166
|
+
* // Structural type guard (accepts any object with id field)
|
|
9167
|
+
* if (Schema.is(Type.Obj)(unknownValue)) { ... }
|
|
9168
|
+
*
|
|
9169
|
+
* // ECHO instance type guard (checks KindId brand)
|
|
9170
|
+
* if (Obj.isObject(unknownValue)) { ... }
|
|
9171
|
+
*
|
|
9172
|
+
* // Reference to any object type
|
|
9173
|
+
* const Collection = Schema.Struct({
|
|
9174
|
+
* objects: Schema.Array(Ref.Ref(Obj.Unknown)),
|
|
9175
|
+
* }).pipe(Type.object({ typename: 'Collection', version: '0.1.0' }));
|
|
9176
|
+
* ```
|
|
8512
9177
|
*/
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
}
|
|
8520
|
-
interface Filter<T$1> {
|
|
8521
|
-
'~Filter': {
|
|
8522
|
-
value: Contravariant<T$1>;
|
|
8523
|
-
};
|
|
8524
|
-
ast: Filter$1;
|
|
8525
|
-
}
|
|
8526
|
-
type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
|
|
8527
|
-
type Any$3 = Filter<any>;
|
|
8528
|
-
type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
|
|
8529
|
-
declare class FilterClass implements Any$3 {
|
|
8530
|
-
readonly ast: Filter$1;
|
|
8531
|
-
private static variance;
|
|
8532
|
-
constructor(ast: Filter$1);
|
|
8533
|
-
'~Filter': {
|
|
8534
|
-
value: Contravariant<any>;
|
|
8535
|
-
};
|
|
9178
|
+
declare const Unknown$2: Obj$1<Unknown$2>;
|
|
9179
|
+
/**
|
|
9180
|
+
* JSON-encoded properties for objects.
|
|
9181
|
+
*/
|
|
9182
|
+
interface BaseObjJson {
|
|
9183
|
+
id: string;
|
|
8536
9184
|
}
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
declare const fromAst$1: (ast: Filter$1) => Any$3;
|
|
9185
|
+
//#endregion
|
|
9186
|
+
//#region ../echo/dist/types/src/Ref.d.ts
|
|
8540
9187
|
/**
|
|
8541
|
-
*
|
|
9188
|
+
* Instance type for a reference.
|
|
9189
|
+
*
|
|
9190
|
+
* Reference can point to any object or relation.
|
|
9191
|
+
* References are lazy loaded.
|
|
9192
|
+
*
|
|
9193
|
+
* `ref.dxn` is the DXN of the referenced object.
|
|
9194
|
+
*
|
|
9195
|
+
* @example
|
|
9196
|
+
* ```ts
|
|
9197
|
+
* const taskRef: Ref<Task> = Ref.make(task);
|
|
9198
|
+
*
|
|
9199
|
+
* await taskRef.load(); // Returns Promise<Task>
|
|
9200
|
+
* yield* Database.load(taskRef); // Effectful version.
|
|
9201
|
+
*
|
|
9202
|
+
* database.makeRef(dxn); // Create a ref from a DXN.
|
|
9203
|
+
* ```
|
|
8542
9204
|
*/
|
|
8543
|
-
|
|
9205
|
+
type Ref$1<T$1> = Ref<T$1>;
|
|
9206
|
+
type Unknown$1 = Ref<Unknown$2>;
|
|
8544
9207
|
/**
|
|
8545
|
-
*
|
|
9208
|
+
* Factory function to create a Ref schema for the given target schema.
|
|
9209
|
+
* Use this in schema definitions to declare reference fields.
|
|
9210
|
+
*
|
|
9211
|
+
* @example
|
|
9212
|
+
* ```ts
|
|
9213
|
+
* const Task = Schema.Struct({
|
|
9214
|
+
* assignee: Ref.Ref(Person), // Creates a Ref schema
|
|
9215
|
+
* }).pipe(Type.object({ typename: 'Task', version: '0.1.0' }));
|
|
9216
|
+
* ```
|
|
8546
9217
|
*/
|
|
8547
|
-
declare const
|
|
8548
|
-
declare const id: (...ids: ObjectId[]) => Any$3;
|
|
9218
|
+
declare const Ref$1: <S$1 extends Schema.Any>(schema: S$1) => RefSchema<Schema.Type<S$1>>;
|
|
8549
9219
|
/**
|
|
8550
|
-
*
|
|
9220
|
+
* TypeScript type for a Ref schema.
|
|
9221
|
+
* This is the type of the SCHEMA itself, not the runtime ref instance.
|
|
9222
|
+
* For the instance type, use `Ref.Ref<T>` from the Ref module.
|
|
9223
|
+
*
|
|
9224
|
+
* @example
|
|
9225
|
+
* ```ts
|
|
9226
|
+
* // Schema type annotation (rarely needed, usually inferred):
|
|
9227
|
+
* const refSchema: Ref.RefSchema<typeof Task> = Ref.Ref(Task);
|
|
9228
|
+
*
|
|
9229
|
+
* // Instance type annotation (use Ref.Ref instead):
|
|
9230
|
+
* const refInstance: Ref.Ref<Task> = Ref.make(task);
|
|
9231
|
+
* ```
|
|
8551
9232
|
*/
|
|
8552
|
-
|
|
9233
|
+
interface RefSchema<T$1 extends Unknown> extends RefSchema$1<T$1> {}
|
|
8553
9234
|
/**
|
|
8554
|
-
*
|
|
9235
|
+
* Extract reference target.
|
|
8555
9236
|
*/
|
|
8556
|
-
|
|
9237
|
+
type Target<R$1 extends Unknown$1> = R$1 extends Ref<infer T> ? T : never;
|
|
8557
9238
|
/**
|
|
8558
|
-
*
|
|
9239
|
+
* Reference resolver.
|
|
8559
9240
|
*/
|
|
8560
|
-
|
|
9241
|
+
type Resolver = RefResolver;
|
|
9242
|
+
//#endregion
|
|
9243
|
+
//#region ../echo/dist/types/src/JsonSchema.d.ts
|
|
8561
9244
|
/**
|
|
8562
|
-
*
|
|
9245
|
+
* Serializable JsonSchema type definition.
|
|
8563
9246
|
*/
|
|
8564
|
-
|
|
9247
|
+
type JsonSchema = JsonSchemaType;
|
|
9248
|
+
declare const JsonSchema: Schema<JsonSchemaType>;
|
|
9249
|
+
//#endregion
|
|
9250
|
+
//#region ../echo/dist/types/src/QueryResult.d.ts
|
|
8565
9251
|
/**
|
|
8566
|
-
*
|
|
9252
|
+
* Individual query result entry.
|
|
8567
9253
|
*/
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
9254
|
+
type Entry$1<T$1> = {
|
|
9255
|
+
id: string;
|
|
9256
|
+
/**
|
|
9257
|
+
* May not be present for remote results.
|
|
9258
|
+
*/
|
|
9259
|
+
result?: T$1;
|
|
9260
|
+
match?: {
|
|
9261
|
+
/**
|
|
9262
|
+
* Higher means better match.
|
|
9263
|
+
*/
|
|
9264
|
+
rank: number;
|
|
9265
|
+
};
|
|
9266
|
+
/**
|
|
9267
|
+
* Query resolution metadata.
|
|
9268
|
+
*/
|
|
9269
|
+
resolution?: {
|
|
9270
|
+
source: 'remote' | 'local' | 'index';
|
|
9271
|
+
/**
|
|
9272
|
+
* Query resolution time in milliseconds.
|
|
9273
|
+
*/
|
|
9274
|
+
time: number;
|
|
9275
|
+
};
|
|
9276
|
+
};
|
|
9277
|
+
type RunOptions = {
|
|
9278
|
+
timeout?: number;
|
|
9279
|
+
};
|
|
9280
|
+
type SubscriptionOptions = {
|
|
9281
|
+
/**
|
|
9282
|
+
* Fire the callback immediately.
|
|
9283
|
+
*/
|
|
9284
|
+
fire?: boolean;
|
|
9285
|
+
};
|
|
9286
|
+
interface QueryResult<T$1> {
|
|
9287
|
+
/**
|
|
9288
|
+
* Currently available results along with their match metadata.
|
|
9289
|
+
*/
|
|
9290
|
+
readonly entries: Entry$1<T$1>[];
|
|
9291
|
+
/**
|
|
9292
|
+
* Currently available results.
|
|
9293
|
+
*/
|
|
9294
|
+
readonly results: T$1[];
|
|
9295
|
+
/**
|
|
9296
|
+
* Returns all known results.
|
|
9297
|
+
*/
|
|
9298
|
+
run(opts?: RunOptions): Promise<T$1[]>;
|
|
9299
|
+
/**
|
|
9300
|
+
* Returns all known results along with their match metadata.
|
|
9301
|
+
*/
|
|
9302
|
+
runEntries(opts?: RunOptions): Promise<Entry$1<T$1>[]>;
|
|
9303
|
+
/**
|
|
9304
|
+
* Returns currently available results synchronously.
|
|
9305
|
+
*/
|
|
9306
|
+
runSync(): T$1[];
|
|
9307
|
+
/**
|
|
9308
|
+
* Returns currently available results synchronously along with their match metadata.
|
|
9309
|
+
*/
|
|
9310
|
+
runSyncEntries(): Entry$1<T$1>[];
|
|
9311
|
+
/**
|
|
9312
|
+
* Returns first result.
|
|
9313
|
+
*/
|
|
9314
|
+
first(opts?: RunOptions): Promise<T$1>;
|
|
9315
|
+
/**
|
|
9316
|
+
* Returns first result if there is one.
|
|
9317
|
+
*/
|
|
9318
|
+
firstOrUndefined(opts?: RunOptions): Promise<T$1 | undefined>;
|
|
9319
|
+
/**
|
|
9320
|
+
* Subscribes to changes in query results.
|
|
9321
|
+
*/
|
|
9322
|
+
subscribe(callback?: (query: QueryResult<T$1>) => void, opts?: SubscriptionOptions): CleanupFn;
|
|
9323
|
+
}
|
|
9324
|
+
//#endregion
|
|
9325
|
+
//#region ../echo/dist/types/src/SchemaRegistry.d.ts
|
|
9326
|
+
type Query$1 = {
|
|
9327
|
+
/**
|
|
9328
|
+
* Filter by schema ID.
|
|
9329
|
+
* Schema id is a DXN with `echo` or `type` kind.
|
|
9330
|
+
*/
|
|
9331
|
+
id?: string | string[];
|
|
9332
|
+
/**
|
|
9333
|
+
* Id of the backing ECHO object.
|
|
9334
|
+
*/
|
|
9335
|
+
backingObjectId?: ObjectId | ObjectId[];
|
|
9336
|
+
/**
|
|
9337
|
+
* One or more typenames to filter by.
|
|
9338
|
+
*/
|
|
9339
|
+
typename?: string | string[];
|
|
9340
|
+
/**
|
|
9341
|
+
* [Semver Range](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges) for the schema version.
|
|
9342
|
+
*/
|
|
9343
|
+
version?: string;
|
|
9344
|
+
/**
|
|
9345
|
+
* Where to look for the schema.
|
|
9346
|
+
*
|
|
9347
|
+
* Database schema are stored in the database of the current space.
|
|
9348
|
+
* Runtime schema are registered in the runtime.
|
|
9349
|
+
*
|
|
9350
|
+
* @default ['database']
|
|
9351
|
+
*/
|
|
9352
|
+
location?: ('database' | 'runtime')[];
|
|
9353
|
+
/**
|
|
9354
|
+
* Include system schemas.
|
|
9355
|
+
* @default false
|
|
9356
|
+
*
|
|
9357
|
+
* The system schema include but are not limited to:
|
|
9358
|
+
* - org.dxos.type.schema
|
|
9359
|
+
*/
|
|
9360
|
+
includeSystem?: boolean;
|
|
8571
9361
|
};
|
|
8572
9362
|
/**
|
|
8573
|
-
*
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
*
|
|
8578
|
-
|
|
8579
|
-
declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
|
|
8580
|
-
/**
|
|
8581
|
-
* Predicate for property to be equal to the provided value.
|
|
8582
|
-
*/
|
|
8583
|
-
declare const eq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8584
|
-
/**
|
|
8585
|
-
* Predicate for property to be not equal to the provided value.
|
|
8586
|
-
*/
|
|
8587
|
-
declare const neq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8588
|
-
/**
|
|
8589
|
-
* Predicate for property to be greater than the provided value.
|
|
8590
|
-
*/
|
|
8591
|
-
declare const gt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8592
|
-
/**
|
|
8593
|
-
* Predicate for property to be greater than or equal to the provided value.
|
|
9363
|
+
* Input for schema registration.
|
|
9364
|
+
* The typename, version and schema mutability metadata is read from the schema annotations.
|
|
9365
|
+
*
|
|
9366
|
+
* Accepts:
|
|
9367
|
+
* - Branded ECHO schemas created with Type.Obj() or Type.Relation()
|
|
9368
|
+
* - JSON schema with typename and version
|
|
8594
9369
|
*/
|
|
8595
|
-
|
|
9370
|
+
type RegisterSchemaInput = AnyEntity$1 | {
|
|
9371
|
+
typename: string;
|
|
9372
|
+
version: string;
|
|
9373
|
+
jsonSchema: JsonSchema;
|
|
9374
|
+
/**
|
|
9375
|
+
* Display name of the schema.
|
|
9376
|
+
*/
|
|
9377
|
+
name?: string;
|
|
9378
|
+
};
|
|
9379
|
+
type ExtractQueryResult<Query$3> = Query$3 extends {
|
|
9380
|
+
location: ('database' | 'runtime')[];
|
|
9381
|
+
} ? AnyEntity$1 : RuntimeType;
|
|
9382
|
+
interface SchemaRegistry {
|
|
9383
|
+
/**
|
|
9384
|
+
* Checks if the provided schema is registered.
|
|
9385
|
+
*/
|
|
9386
|
+
hasSchema(schema: AnyEntity$1): boolean;
|
|
9387
|
+
/**
|
|
9388
|
+
* Registers the provided schema.
|
|
9389
|
+
*
|
|
9390
|
+
* @returns Mutable runtime instances of schemas that were registered.
|
|
9391
|
+
*
|
|
9392
|
+
* The behavior of this method depends on the state of the database.
|
|
9393
|
+
* The general principle is that the schema will be upserted into the space.
|
|
9394
|
+
* If an equivalent schema with the same name and version already exists, the method does nothing.
|
|
9395
|
+
* If a different schema with the same name and version exists, the method throws an error.
|
|
9396
|
+
* If no schema with the same name and version exists, a new schema will be inserted based on semantic versioning rules.
|
|
9397
|
+
*/
|
|
9398
|
+
register(input: RegisterSchemaInput[]): Promise<RuntimeType[]>;
|
|
9399
|
+
/**
|
|
9400
|
+
*
|
|
9401
|
+
*/
|
|
9402
|
+
query<Q extends NoExcessProperties<Query$1, Q>>(query?: Q & Query$1): QueryResult<ExtractQueryResult<Q>>;
|
|
9403
|
+
}
|
|
9404
|
+
//#endregion
|
|
9405
|
+
//#region ../echo/dist/types/src/Hypergraph.d.ts
|
|
8596
9406
|
/**
|
|
8597
|
-
*
|
|
9407
|
+
* Resolution context.
|
|
9408
|
+
* Affects how non-absolute DXNs are resolved.
|
|
8598
9409
|
*/
|
|
8599
|
-
|
|
9410
|
+
interface RefResolutionContext {
|
|
9411
|
+
/**
|
|
9412
|
+
* Space that the resolution is happening from.
|
|
9413
|
+
*/
|
|
9414
|
+
space?: SpaceId;
|
|
9415
|
+
/**
|
|
9416
|
+
* Queue that the resolution is happening from.
|
|
9417
|
+
* This queue will be searched first, and then the space it belongs to.
|
|
9418
|
+
*/
|
|
9419
|
+
queue?: DXN;
|
|
9420
|
+
}
|
|
9421
|
+
interface RefResolverOptions {
|
|
9422
|
+
/**
|
|
9423
|
+
* Resolution context.
|
|
9424
|
+
* Affects how non-absolute DXNs are resolved.
|
|
9425
|
+
*/
|
|
9426
|
+
context?: RefResolutionContext;
|
|
9427
|
+
/**
|
|
9428
|
+
* Middleware to change the resolved object before returning it.
|
|
9429
|
+
* @deprecated On track to be removed.
|
|
9430
|
+
*/
|
|
9431
|
+
middleware?: (obj: AnyProperties) => AnyProperties;
|
|
9432
|
+
}
|
|
8600
9433
|
/**
|
|
8601
|
-
*
|
|
9434
|
+
* Manages cross-space database interactions.
|
|
8602
9435
|
*/
|
|
8603
|
-
|
|
9436
|
+
interface Hypergraph extends Queryable {
|
|
9437
|
+
get schemaRegistry(): SchemaRegistry;
|
|
9438
|
+
/**
|
|
9439
|
+
* Query objects.
|
|
9440
|
+
*/
|
|
9441
|
+
query: QueryFn;
|
|
9442
|
+
/**
|
|
9443
|
+
* Creates a reference to an existing object in the database.
|
|
9444
|
+
*
|
|
9445
|
+
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9446
|
+
* NOTE: Difference from `Ref.fromDXN`
|
|
9447
|
+
* `Ref.fromDXN(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9448
|
+
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9449
|
+
*/
|
|
9450
|
+
makeRef<T$1 extends Unknown = Unknown>(dxn: DXN): Ref$1<T$1>;
|
|
9451
|
+
/**
|
|
9452
|
+
* @param hostDb Host database for reference resolution.
|
|
9453
|
+
* @param middleware Called with the loaded object. The caller may change the object.
|
|
9454
|
+
* @returns Result of `onLoad`.
|
|
9455
|
+
*/
|
|
9456
|
+
createRefResolver(options: RefResolverOptions): Resolver;
|
|
9457
|
+
/**
|
|
9458
|
+
* Get a database by space ID.
|
|
9459
|
+
* @returns The database for the given space ID, or undefined if not found.
|
|
9460
|
+
*/
|
|
9461
|
+
getDatabase(spaceId: SpaceId): Database | undefined;
|
|
9462
|
+
}
|
|
9463
|
+
//#endregion
|
|
9464
|
+
//#region ../echo/dist/types/src/Collection.d.ts
|
|
8604
9465
|
/**
|
|
8605
|
-
*
|
|
8606
|
-
* @param values - Values to check against.
|
|
9466
|
+
* A an ordered set of objects.
|
|
8607
9467
|
*/
|
|
8608
|
-
declare const
|
|
9468
|
+
declare const Collection: Obj$1<{
|
|
9469
|
+
readonly name?: string | undefined;
|
|
9470
|
+
readonly objects: readonly Ref<OfKind<EntityKind.Object> & Unknown$2>[];
|
|
9471
|
+
}, Struct.Fields>;
|
|
9472
|
+
interface Collection extends Schema.Type<typeof Collection> {}
|
|
9473
|
+
//#endregion
|
|
9474
|
+
//#region ../echo/dist/types/src/Feed.d.ts
|
|
8609
9475
|
/**
|
|
8610
|
-
*
|
|
8611
|
-
*
|
|
9476
|
+
* Runtime schema for a Feed object.
|
|
9477
|
+
*
|
|
9478
|
+
* @example
|
|
9479
|
+
* ```ts
|
|
9480
|
+
* const feed = Obj.make(Feed.Feed, { name: 'notifications', kind: 'org.dxos.plugin.notifications.v1' });
|
|
9481
|
+
* ```
|
|
8612
9482
|
*/
|
|
8613
|
-
declare const
|
|
9483
|
+
declare const Feed: Obj$1<{
|
|
9484
|
+
readonly kind?: string | undefined;
|
|
9485
|
+
readonly name?: string | undefined;
|
|
9486
|
+
readonly namespace?: "data" | "trace" | undefined;
|
|
9487
|
+
}, Struct.Fields>;
|
|
8614
9488
|
/**
|
|
8615
|
-
*
|
|
8616
|
-
* @param from - Start of the range (inclusive).
|
|
8617
|
-
* @param to - End of the range (exclusive).
|
|
9489
|
+
* TypeScript instance type for a Feed object.
|
|
8618
9490
|
*/
|
|
8619
|
-
|
|
9491
|
+
interface Feed extends Schema.Type<typeof Feed> {}
|
|
9492
|
+
//#endregion
|
|
9493
|
+
//#region ../echo/dist/types/src/View.d.ts
|
|
8620
9494
|
/**
|
|
8621
|
-
*
|
|
9495
|
+
* Views are generated or user-defined projections of a schema's properties.
|
|
9496
|
+
* They are used to configure the visual representation of the data.
|
|
8622
9497
|
*/
|
|
8623
|
-
declare const
|
|
9498
|
+
declare const ViewSchema: Obj$1<{
|
|
9499
|
+
readonly query: {
|
|
9500
|
+
readonly ast: QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause;
|
|
9501
|
+
readonly raw?: string | undefined;
|
|
9502
|
+
};
|
|
9503
|
+
readonly projection: {
|
|
9504
|
+
readonly schema?: JsonSchemaType | undefined;
|
|
9505
|
+
readonly fields: readonly {
|
|
9506
|
+
readonly id: string;
|
|
9507
|
+
readonly path: JsonPath;
|
|
9508
|
+
readonly visible?: boolean | undefined;
|
|
9509
|
+
readonly referencePath?: JsonPath | undefined;
|
|
9510
|
+
}[];
|
|
9511
|
+
readonly pivotFieldId?: string | undefined;
|
|
9512
|
+
};
|
|
9513
|
+
}, Struct.Fields>;
|
|
9514
|
+
interface View extends Schema.Type<typeof ViewSchema> {}
|
|
8624
9515
|
/**
|
|
8625
|
-
*
|
|
9516
|
+
* View instance type.
|
|
8626
9517
|
*/
|
|
8627
|
-
declare const
|
|
9518
|
+
declare const View: Obj$1<View>;
|
|
9519
|
+
//#endregion
|
|
9520
|
+
//#region ../echo/dist/types/src/Dataset.d.ts
|
|
8628
9521
|
/**
|
|
8629
|
-
*
|
|
9522
|
+
* Abstart set of objects, represented by a view, feed, or collection.
|
|
8630
9523
|
*/
|
|
8631
|
-
declare const
|
|
9524
|
+
declare const Dataset: Union<[Obj$1<{
|
|
9525
|
+
readonly kind?: string | undefined;
|
|
9526
|
+
readonly name?: string | undefined;
|
|
9527
|
+
readonly namespace?: "data" | "trace" | undefined;
|
|
9528
|
+
}, Struct.Fields>, Obj$1<{
|
|
9529
|
+
readonly name?: string | undefined;
|
|
9530
|
+
readonly objects: readonly Ref<OfKind<EntityKind.Object> & Unknown$2>[];
|
|
9531
|
+
}, Struct.Fields>, Obj$1<View, Struct.Fields>]>;
|
|
9532
|
+
type Dataset = Feed | Collection | View;
|
|
8632
9533
|
declare namespace Order_d_exports {
|
|
8633
9534
|
export { Any$2 as Any, Order, natural, property, rank };
|
|
8634
9535
|
}
|
|
@@ -8647,7 +9548,7 @@ declare const property: <T$1>(property: keyof T$1 & string, direction: OrderDire
|
|
|
8647
9548
|
*/
|
|
8648
9549
|
declare const rank: <T$1>(direction?: OrderDirection) => Order<T$1>;
|
|
8649
9550
|
declare namespace Query_d_exports {
|
|
8650
|
-
export { Any$1 as Any, Query, Type$1 as Type, all, fromAst, is, select, type$1 as type, without };
|
|
9551
|
+
export { Any$1 as Any, Query, Type$1 as Type, all, from, fromAst, is, pretty, select, type$1 as type, without };
|
|
8651
9552
|
}
|
|
8652
9553
|
/**
|
|
8653
9554
|
* All property paths inside T that are references.
|
|
@@ -8657,76 +9558,150 @@ interface Query<T$1> {
|
|
|
8657
9558
|
'~Query': {
|
|
8658
9559
|
value: T$1;
|
|
8659
9560
|
};
|
|
8660
|
-
ast: Query$
|
|
9561
|
+
ast: Query$2;
|
|
8661
9562
|
/**
|
|
8662
9563
|
* Filter the current selection based on a filter.
|
|
8663
9564
|
* @param filter - Filter to select the objects.
|
|
8664
9565
|
* @returns Query for the selected objects.
|
|
8665
9566
|
*/
|
|
8666
|
-
select(filter: Filter<T$1>): Query<T$1>;
|
|
8667
|
-
select(props: Props<T$1>): Query<T$1>;
|
|
9567
|
+
'select'(filter: Filter<T$1>): Query<T$1>;
|
|
9568
|
+
'select'(props: Props<T$1>): Query<T$1>;
|
|
8668
9569
|
/**
|
|
8669
9570
|
* Traverse an outgoing reference.
|
|
8670
9571
|
* @param key - Property path inside T that is a reference or optional reference.
|
|
8671
9572
|
* @returns Query for the target of the reference.
|
|
8672
9573
|
*/
|
|
8673
|
-
reference<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$1 ? Target
|
|
9574
|
+
'reference'<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$1 ? Target<T$1[K$1]> : T$1[K$1] extends Unknown$1 | undefined ? Target<Exclude<T$1[K$1], undefined>> : never>;
|
|
8674
9575
|
/**
|
|
8675
9576
|
* Find objects referencing this object.
|
|
8676
9577
|
* @param target - Schema of the referencing object. If not provided, matches any type.
|
|
8677
9578
|
* @param key - Property path inside the referencing object that is a reference. If not provided, matches any property.
|
|
8678
9579
|
* @returns Query for the referencing objects.
|
|
8679
9580
|
*/
|
|
8680
|
-
referencedBy<S$1 extends Schema.All>(target: S$1 | string, key: RefPropKey<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
8681
|
-
referencedBy<S$1 extends Schema.All>(target: S$1 | string): Query<Schema.Type<S$1>>;
|
|
8682
|
-
referencedBy(): Query<any>;
|
|
9581
|
+
'referencedBy'<S$1 extends Schema.All>(target: S$1 | string, key: RefPropKey<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9582
|
+
'referencedBy'<S$1 extends Schema.All>(target: S$1 | string): Query<Schema.Type<S$1>>;
|
|
9583
|
+
'referencedBy'(): Query<any>;
|
|
8683
9584
|
/**
|
|
8684
9585
|
* Find relations where this object is the source.
|
|
8685
9586
|
* @returns Query for the relation objects.
|
|
8686
9587
|
* @param relation - Schema of the relation.
|
|
8687
9588
|
* @param predicates - Predicates to filter the relation objects.
|
|
8688
9589
|
*/
|
|
8689
|
-
sourceOf<S$1 extends Schema.All>(relation
|
|
9590
|
+
'sourceOf'<S$1 extends Schema.All>(relation?: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
8690
9591
|
/**
|
|
8691
9592
|
* Find relations where this object is the target.
|
|
8692
9593
|
* @returns Query for the relation objects.
|
|
8693
9594
|
* @param relation - Schema of the relation.
|
|
8694
9595
|
* @param predicates - Predicates to filter the relation objects.
|
|
8695
9596
|
*/
|
|
8696
|
-
targetOf<S$1 extends Schema.All>(relation
|
|
9597
|
+
'targetOf'<S$1 extends Schema.All>(relation?: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
8697
9598
|
/**
|
|
8698
9599
|
* For a query for relations, get the source objects.
|
|
8699
9600
|
* @returns Query for the source objects.
|
|
8700
9601
|
*/
|
|
8701
|
-
source(): Query<
|
|
9602
|
+
'source'(): Query<SourceOf<T$1>>;
|
|
8702
9603
|
/**
|
|
8703
9604
|
* For a query for relations, get the target objects.
|
|
8704
9605
|
* @returns Query for the target objects.
|
|
8705
9606
|
*/
|
|
8706
|
-
target(): Query<
|
|
9607
|
+
'target'(): Query<TargetOf<T$1>>;
|
|
9608
|
+
/**
|
|
9609
|
+
* Get the parent object of the current selection.
|
|
9610
|
+
* @returns Query for the parent objects.
|
|
9611
|
+
*/
|
|
9612
|
+
'parent'(): Query<any>;
|
|
9613
|
+
/**
|
|
9614
|
+
* Get all child objects of the current selection.
|
|
9615
|
+
* @returns Query for the child objects.
|
|
9616
|
+
*/
|
|
9617
|
+
'children'(): Query<any>;
|
|
8707
9618
|
/**
|
|
8708
9619
|
* Order the query results.
|
|
8709
9620
|
* Orders are specified in priority order. The first order will be applied first, etc.
|
|
8710
9621
|
* @param order - Order to sort the results.
|
|
8711
9622
|
* @returns Query for the ordered results.
|
|
8712
9623
|
*/
|
|
8713
|
-
orderBy(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
|
|
9624
|
+
'orderBy'(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
|
|
8714
9625
|
/**
|
|
8715
9626
|
* Limit the number of results.
|
|
8716
9627
|
* @param limit - Maximum number of results to return.
|
|
8717
9628
|
* @returns Query for the limited results.
|
|
8718
9629
|
*/
|
|
8719
|
-
limit(limit: number): Query<T$1>;
|
|
9630
|
+
'limit'(limit: number): Query<T$1>;
|
|
9631
|
+
/**
|
|
9632
|
+
* Query from selected databases only.
|
|
9633
|
+
*
|
|
9634
|
+
* Example:
|
|
9635
|
+
*
|
|
9636
|
+
* ```ts
|
|
9637
|
+
* Query.select(Filter.type(Person)).from(db);
|
|
9638
|
+
* ```
|
|
9639
|
+
*
|
|
9640
|
+
* @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
|
|
9641
|
+
*/
|
|
9642
|
+
'from'(database: Database | Database[], options?: {
|
|
9643
|
+
includeFeeds?: boolean;
|
|
9644
|
+
}): Query<T$1>;
|
|
9645
|
+
/**
|
|
9646
|
+
* Query from selected feeds only.
|
|
9647
|
+
*
|
|
9648
|
+
* Example:
|
|
9649
|
+
*
|
|
9650
|
+
* ```ts
|
|
9651
|
+
* Query.select(Filter.type(Person)).from(feed);
|
|
9652
|
+
* ```
|
|
9653
|
+
*
|
|
9654
|
+
*/
|
|
9655
|
+
'from'(feeds: Feed | Feed[]): Query<T$1>;
|
|
9656
|
+
/**
|
|
9657
|
+
* Query from all accessible spaces.
|
|
9658
|
+
*
|
|
9659
|
+
* Example:
|
|
9660
|
+
*
|
|
9661
|
+
* ```ts
|
|
9662
|
+
* Query.select(Filter.type(Person)).from('all-accessible-spaces');
|
|
9663
|
+
* ```
|
|
9664
|
+
*
|
|
9665
|
+
* @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
|
|
9666
|
+
*/
|
|
9667
|
+
'from'(allSpaces: 'all-accessible-spaces', options?: {
|
|
9668
|
+
includeFeeds?: boolean;
|
|
9669
|
+
}): Query<T$1>;
|
|
9670
|
+
/**
|
|
9671
|
+
* Query from a dataset.
|
|
9672
|
+
* Currently only feeds are supported.
|
|
9673
|
+
*
|
|
9674
|
+
* Example:
|
|
9675
|
+
*
|
|
9676
|
+
* ```ts
|
|
9677
|
+
* Query.type(Person).from(feed);
|
|
9678
|
+
* ```
|
|
9679
|
+
*/
|
|
9680
|
+
'from'(dataset: Dataset): Query<T$1>;
|
|
9681
|
+
/**
|
|
9682
|
+
* Query from the results of another query.
|
|
9683
|
+
*
|
|
9684
|
+
* Example:
|
|
9685
|
+
*
|
|
9686
|
+
* ```ts
|
|
9687
|
+
* Query.select(Filter.props({ foo: 'foo' })).from(Query.select(Filter.type(Contact)).reference('org'));
|
|
9688
|
+
* ```
|
|
9689
|
+
*/
|
|
9690
|
+
'from'(query: Any$1): Query<T$1>;
|
|
9691
|
+
/**
|
|
9692
|
+
* Query from a raw scope specification.
|
|
9693
|
+
*/
|
|
9694
|
+
'from'(scope: Scope): Query<T$1>;
|
|
8720
9695
|
/**
|
|
8721
9696
|
* Add options to a query.
|
|
8722
9697
|
*/
|
|
8723
|
-
options(options: QueryOptions): Query<T$1>;
|
|
9698
|
+
'options'(options: QueryOptions): Query<T$1>;
|
|
8724
9699
|
}
|
|
8725
9700
|
type Any$1 = Query<any>;
|
|
8726
9701
|
type Type$1<Q extends Any$1> = Q extends Query<infer T> ? T : never;
|
|
8727
9702
|
declare const is: (value: unknown) => value is Any$1;
|
|
8728
9703
|
/** Construct a query from an ast. */
|
|
8729
|
-
declare const fromAst: (ast: Query$
|
|
9704
|
+
declare const fromAst: (ast: Query$2) => Any$1;
|
|
8730
9705
|
/**
|
|
8731
9706
|
* Select objects based on a filter.
|
|
8732
9707
|
* @param filter - Filter to select the objects.
|
|
@@ -8741,7 +9716,10 @@ declare const select: <F extends Any$3>(filter: F) => Query<Type$2<F>>;
|
|
|
8741
9716
|
*
|
|
8742
9717
|
* Shorthand for: `Query.select(Filter.type(schema, predicates))`.
|
|
8743
9718
|
*/
|
|
8744
|
-
declare const type$1:
|
|
9719
|
+
declare const type$1: {
|
|
9720
|
+
<S$1 extends Schema.All>(schema: S$1, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9721
|
+
(schema: string, predicates?: Props<unknown>): Query<any>;
|
|
9722
|
+
};
|
|
8745
9723
|
/**
|
|
8746
9724
|
* Combine results of multiple queries.
|
|
8747
9725
|
* @param queries - Queries to combine.
|
|
@@ -8755,6 +9733,195 @@ declare const all: (...queries: Any$1[]) => Any$1;
|
|
|
8755
9733
|
* @returns Query for the results of the source query minus the results of the exclude query.
|
|
8756
9734
|
*/
|
|
8757
9735
|
declare const without: <T$1>(source: Query<T$1>, exclude: Query<T$1>) => Query<T$1>;
|
|
9736
|
+
/**
|
|
9737
|
+
* Create a query scoped to a data source.
|
|
9738
|
+
* The returned query selects everything from the source; chain `.select()` to narrow results.
|
|
9739
|
+
*
|
|
9740
|
+
* @param source - Data source: database, feed, 'all-accessible-spaces', or another query.
|
|
9741
|
+
* @returns Query scoped to the given source.
|
|
9742
|
+
*/
|
|
9743
|
+
declare const from: (source: Database | Database[] | Feed | Feed[] | Any$1 | Scope | "all-accessible-spaces", options?: {
|
|
9744
|
+
includeFeeds?: boolean;
|
|
9745
|
+
}) => Any$1;
|
|
9746
|
+
/**
|
|
9747
|
+
* Returns a human-readable string representation of a Query AST.
|
|
9748
|
+
*/
|
|
9749
|
+
declare const pretty: (query: Any$1) => string;
|
|
9750
|
+
//#endregion
|
|
9751
|
+
//#region ../echo/dist/types/src/Database.d.ts
|
|
9752
|
+
/**
|
|
9753
|
+
* `query` API function declaration.
|
|
9754
|
+
*/
|
|
9755
|
+
interface QueryFn {
|
|
9756
|
+
<Q extends Any$1>(query: Q): QueryResult<Type$1<Q>>;
|
|
9757
|
+
<F extends Any$3>(filter: F): QueryResult<Type$2<F>>;
|
|
9758
|
+
}
|
|
9759
|
+
/**
|
|
9760
|
+
* Common interface for Database and Queue.
|
|
9761
|
+
*/
|
|
9762
|
+
interface Queryable {
|
|
9763
|
+
query: QueryFn;
|
|
9764
|
+
}
|
|
9765
|
+
type GetObjectByIdOptions = {
|
|
9766
|
+
deleted?: boolean;
|
|
9767
|
+
};
|
|
9768
|
+
type ObjectPlacement = 'root-doc' | 'linked-doc';
|
|
9769
|
+
type AddOptions = {
|
|
9770
|
+
/**
|
|
9771
|
+
* Where to place the object in the Automerge document tree.
|
|
9772
|
+
* Root document is always loaded with the space.
|
|
9773
|
+
* Linked documents are loaded lazily.
|
|
9774
|
+
* Placing large number of objects in the root document may slow down the initial load.
|
|
9775
|
+
*
|
|
9776
|
+
* @default 'linked-doc'
|
|
9777
|
+
*/
|
|
9778
|
+
placeIn?: ObjectPlacement;
|
|
9779
|
+
};
|
|
9780
|
+
type FlushOptions = {
|
|
9781
|
+
/**
|
|
9782
|
+
* Write any pending changes to disk.
|
|
9783
|
+
* @default true
|
|
9784
|
+
*/
|
|
9785
|
+
disk?: boolean;
|
|
9786
|
+
/**
|
|
9787
|
+
* Wait for pending index updates.
|
|
9788
|
+
* @default true
|
|
9789
|
+
*/
|
|
9790
|
+
indexes?: boolean;
|
|
9791
|
+
/**
|
|
9792
|
+
* Flush pending updates to objects and queries.
|
|
9793
|
+
* @default false
|
|
9794
|
+
*/
|
|
9795
|
+
updates?: boolean;
|
|
9796
|
+
};
|
|
9797
|
+
/**
|
|
9798
|
+
* Identifier denoting an ECHO Database.
|
|
9799
|
+
*/
|
|
9800
|
+
declare const TypeId: unique symbol;
|
|
9801
|
+
type TypeId = typeof TypeId;
|
|
9802
|
+
/**
|
|
9803
|
+
* ECHO Database interface.
|
|
9804
|
+
*/
|
|
9805
|
+
interface Database extends Queryable {
|
|
9806
|
+
readonly [TypeId]: TypeId;
|
|
9807
|
+
get spaceId(): SpaceId;
|
|
9808
|
+
get schemaRegistry(): SchemaRegistry;
|
|
9809
|
+
get graph(): Hypergraph;
|
|
9810
|
+
toJSON(): object;
|
|
9811
|
+
/**
|
|
9812
|
+
* Return object by local ID.
|
|
9813
|
+
*/
|
|
9814
|
+
getObjectById<T$1 extends Unknown$2 = OfShape<AnyProperties>>(id: string, opts?: GetObjectByIdOptions): T$1 | undefined;
|
|
9815
|
+
/**
|
|
9816
|
+
* Query objects.
|
|
9817
|
+
*/
|
|
9818
|
+
query: QueryFn;
|
|
9819
|
+
/**
|
|
9820
|
+
* Creates a reference to an existing object in the database.
|
|
9821
|
+
*
|
|
9822
|
+
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9823
|
+
* NOTE: Difference from `Ref.fromDXN`
|
|
9824
|
+
* `Ref.fromDXN(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9825
|
+
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9826
|
+
*/
|
|
9827
|
+
makeRef<T$1 extends Unknown = Unknown>(dxn: DXN): Ref<T$1>;
|
|
9828
|
+
/**
|
|
9829
|
+
* Adds object to the database.
|
|
9830
|
+
*/
|
|
9831
|
+
add<T$1 extends Unknown = Unknown>(obj: T$1, opts?: AddOptions): T$1;
|
|
9832
|
+
/**
|
|
9833
|
+
* Removes object from the database.
|
|
9834
|
+
*/
|
|
9835
|
+
remove(obj: Unknown): void;
|
|
9836
|
+
/**
|
|
9837
|
+
* Wait for all pending changes to be saved to disk.
|
|
9838
|
+
* Optionaly waits for changes to be propagated to indexes and event handlers.
|
|
9839
|
+
*/
|
|
9840
|
+
flush(opts?: FlushOptions): Promise<void>;
|
|
9841
|
+
}
|
|
9842
|
+
declare const Database: Schema<Database>;
|
|
9843
|
+
//#endregion
|
|
9844
|
+
//#region ../echo/dist/types/src/internal/Entity/object.d.ts
|
|
9845
|
+
/**
|
|
9846
|
+
* Object schema type with kind marker.
|
|
9847
|
+
*/
|
|
9848
|
+
type EchoObjectSchema<Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields> = EchoTypeSchema<Self, {}, EntityKind.Object, Fields>;
|
|
9849
|
+
/**
|
|
9850
|
+
* Schema for Obj entity types.
|
|
9851
|
+
* Pipeable function to add ECHO object annotations to a schema.
|
|
9852
|
+
*/
|
|
9853
|
+
declare const EchoObjectSchema: {
|
|
9854
|
+
(meta: TypeMeta): <Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields>(self: Self & {
|
|
9855
|
+
fields?: Fields;
|
|
9856
|
+
}) => EchoObjectSchema<Self, Fields>;
|
|
9857
|
+
};
|
|
9858
|
+
//#endregion
|
|
9859
|
+
//#region ../echo/dist/types/src/Entity.d.ts
|
|
9860
|
+
declare const KindId$1: "~@dxos/echo/Kind";
|
|
9861
|
+
type KindId$1 = typeof KindId;
|
|
9862
|
+
declare const Kind: typeof EntityKind;
|
|
9863
|
+
type Kind = EntityKind;
|
|
9864
|
+
/**
|
|
9865
|
+
* Assigns a kind to an Object or Relation instance.
|
|
9866
|
+
* NOTE: Needed to make `isRelation` and `isObject` checks work.
|
|
9867
|
+
*/
|
|
9868
|
+
interface OfKind<K$1 extends Kind> {
|
|
9869
|
+
readonly [KindId$1]: K$1;
|
|
9870
|
+
readonly id: ObjectId;
|
|
9871
|
+
}
|
|
9872
|
+
/**
|
|
9873
|
+
* Unknown Obj or Relation (reactive).
|
|
9874
|
+
*/
|
|
9875
|
+
interface Unknown extends OfKind<Kind> {}
|
|
9876
|
+
//#endregion
|
|
9877
|
+
//#region ../echo/dist/types/src/internal/common/types/base.d.ts
|
|
9878
|
+
/**
|
|
9879
|
+
* Base type for all data objects (reactive, ECHO, and other raw objects).
|
|
9880
|
+
* NOTE: This describes the base type for all database objects.
|
|
9881
|
+
* It is stricter than `T extends {}` or `T extends object`.
|
|
9882
|
+
*/
|
|
9883
|
+
type AnyProperties = Record<string, any>;
|
|
9884
|
+
/**
|
|
9885
|
+
* Canonical type for all ECHO entities (objects and relations).
|
|
9886
|
+
* @depreacted Remove, use Entity.Unknown instead.
|
|
9887
|
+
*/
|
|
9888
|
+
interface AnyEntity {
|
|
9889
|
+
readonly id: ObjectId;
|
|
9890
|
+
}
|
|
9891
|
+
//#endregion
|
|
9892
|
+
//#region ../echo/dist/types/src/internal/common/types/entity.d.ts
|
|
9893
|
+
/**
|
|
9894
|
+
* String key used to identify the kind of an entity instance (object or relation).
|
|
9895
|
+
*/
|
|
9896
|
+
declare const KindId: "~@dxos/echo/Kind";
|
|
9897
|
+
type KindId = typeof KindId;
|
|
9898
|
+
/**
|
|
9899
|
+
* String key used to identify the kind of a schema (object schema or relation schema).
|
|
9900
|
+
* Parallels KindId which identifies instance kinds.
|
|
9901
|
+
*/
|
|
9902
|
+
declare const SchemaKindId: "~@dxos/echo/SchemaKind";
|
|
9903
|
+
type SchemaKindId = typeof SchemaKindId;
|
|
9904
|
+
/**
|
|
9905
|
+
* Kinds of entities stored in ECHO: objects and relations.
|
|
9906
|
+
*/
|
|
9907
|
+
declare enum EntityKind {
|
|
9908
|
+
Object = "object",
|
|
9909
|
+
Relation = "relation",
|
|
9910
|
+
}
|
|
9911
|
+
//#endregion
|
|
9912
|
+
//#region ../echo/dist/types/src/internal/Annotation/annotations.d.ts
|
|
9913
|
+
declare const TypeMeta: Struct<{
|
|
9914
|
+
typename: refine<string, typeof String$>;
|
|
9915
|
+
version: refine<string, typeof String$>;
|
|
9916
|
+
}>;
|
|
9917
|
+
interface TypeMeta extends Schema.Type<typeof TypeMeta> {}
|
|
9918
|
+
/**
|
|
9919
|
+
* SchemaMeta.
|
|
9920
|
+
*/
|
|
9921
|
+
declare const SchemaMetaSymbol: unique symbol;
|
|
9922
|
+
type SchemaMeta = TypeMeta & {
|
|
9923
|
+
id: string;
|
|
9924
|
+
};
|
|
8758
9925
|
//#endregion
|
|
8759
9926
|
//#region src/query-lite/query-lite.d.ts
|
|
8760
9927
|
declare const Order2: typeof Order_d_exports;
|