@dxos/echo-query 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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 +1573 -383
- package/dist/query-lite/index.d.ts.map +1 -1
- package/dist/query-lite/index.js +182 -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 +14 -15
- package/src/parser/query.test.ts +29 -29
- package/src/query-lite/query-lite.ts +258 -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 | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | 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 | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | 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 | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | 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,34 @@ 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 | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8021
8148
|
}>;
|
|
8022
8149
|
interface FilterOr extends Schema.Type<typeof FilterOr_> {}
|
|
8023
8150
|
declare const FilterOr: Schema<FilterOr>;
|
|
8151
|
+
/**
|
|
8152
|
+
* Filter objects that are children of the specified parents.
|
|
8153
|
+
* With transitive=true (default), matches grandchildren and beyond.
|
|
8154
|
+
*/
|
|
8155
|
+
declare const FilterChildOf_: Struct<{
|
|
8156
|
+
type: Literal<["child-of"]>;
|
|
8157
|
+
/** Parent DXNs to match children of. */
|
|
8158
|
+
parents: Array$<refine<string, typeof NonEmptyString>>;
|
|
8159
|
+
/** Whether to match transitively (grandchildren, etc.). Defaults to true. */
|
|
8160
|
+
transitive: typeof Boolean$;
|
|
8161
|
+
}>;
|
|
8162
|
+
interface FilterChildOf extends Schema.Type<typeof FilterChildOf_> {}
|
|
8163
|
+
declare const FilterChildOf: Schema<FilterChildOf>;
|
|
8024
8164
|
/**
|
|
8025
8165
|
* Union of filters.
|
|
8026
8166
|
*/
|
|
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>]>;
|
|
8167
|
+
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<FilterChildOf, FilterChildOf, never>, Schema<FilterNot, FilterNot, never>, Schema<FilterAnd, FilterAnd, never>, Schema<FilterOr, FilterOr, never>]>;
|
|
8028
8168
|
type Filter$1 = Schema.Type<typeof Filter$1>;
|
|
8029
8169
|
/**
|
|
8030
8170
|
* Query objects by type, id, and/or predicates.
|
|
8031
8171
|
*/
|
|
8032
8172
|
declare const QuerySelectClause_: Struct<{
|
|
8033
8173
|
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>;
|
|
8174
|
+
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, never>;
|
|
8035
8175
|
}>;
|
|
8036
8176
|
interface QuerySelectClause extends Schema.Type<typeof QuerySelectClause_> {}
|
|
8037
8177
|
declare const QuerySelectClause: Schema<QuerySelectClause>;
|
|
@@ -8040,8 +8180,8 @@ declare const QuerySelectClause: Schema<QuerySelectClause>;
|
|
|
8040
8180
|
*/
|
|
8041
8181
|
declare const QueryFilterClause_: Struct<{
|
|
8042
8182
|
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>;
|
|
8183
|
+
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>;
|
|
8184
|
+
filter: suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, never>;
|
|
8045
8185
|
}>;
|
|
8046
8186
|
interface QueryFilterClause extends Schema.Type<typeof QueryFilterClause_> {}
|
|
8047
8187
|
declare const QueryFilterClause: Schema<QueryFilterClause>;
|
|
@@ -8050,7 +8190,7 @@ declare const QueryFilterClause: Schema<QueryFilterClause>;
|
|
|
8050
8190
|
*/
|
|
8051
8191
|
declare const QueryReferenceTraversalClause_: Struct<{
|
|
8052
8192
|
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>;
|
|
8193
|
+
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
8194
|
property: typeof String$;
|
|
8055
8195
|
}>;
|
|
8056
8196
|
interface QueryReferenceTraversalClause extends Schema.Type<typeof QueryReferenceTraversalClause_> {}
|
|
@@ -8060,7 +8200,7 @@ declare const QueryReferenceTraversalClause: Schema<QueryReferenceTraversalClaus
|
|
|
8060
8200
|
*/
|
|
8061
8201
|
declare const QueryIncomingReferencesClause_: Struct<{
|
|
8062
8202
|
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>;
|
|
8203
|
+
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
8204
|
/**
|
|
8065
8205
|
* Property path where the reference is located.
|
|
8066
8206
|
* If null, matches references from any property.
|
|
@@ -8075,14 +8215,14 @@ declare const QueryIncomingReferencesClause: Schema<QueryIncomingReferencesClaus
|
|
|
8075
8215
|
*/
|
|
8076
8216
|
declare const QueryRelationClause_: Struct<{
|
|
8077
8217
|
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>;
|
|
8218
|
+
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
8219
|
/**
|
|
8080
8220
|
* outgoing: anchor is the source of the relation.
|
|
8081
8221
|
* incoming: anchor is the target of the relation.
|
|
8082
8222
|
* both: anchor is either the source or target of the relation.
|
|
8083
8223
|
*/
|
|
8084
8224
|
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>>;
|
|
8225
|
+
filter: optional<suspend<FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, FilterObject | FilterCompare | FilterIn | FilterContains | FilterTag | FilterRange | FilterTimestamp | FilterTextSearch | FilterChildOf | FilterNot | FilterAnd | FilterOr, never>>;
|
|
8086
8226
|
}>;
|
|
8087
8227
|
interface QueryRelationClause extends Schema.Type<typeof QueryRelationClause_> {}
|
|
8088
8228
|
declare const QueryRelationClause: Schema<QueryRelationClause>;
|
|
@@ -8091,17 +8231,31 @@ declare const QueryRelationClause: Schema<QueryRelationClause>;
|
|
|
8091
8231
|
*/
|
|
8092
8232
|
declare const QueryRelationTraversalClause_: Struct<{
|
|
8093
8233
|
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>;
|
|
8234
|
+
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
8235
|
direction: Literal<["source", "target", "both"]>;
|
|
8096
8236
|
}>;
|
|
8097
8237
|
interface QueryRelationTraversalClause extends Schema.Type<typeof QueryRelationTraversalClause_> {}
|
|
8098
8238
|
declare const QueryRelationTraversalClause: Schema<QueryRelationTraversalClause>;
|
|
8239
|
+
/**
|
|
8240
|
+
* Traverse parent-child hierarchy.
|
|
8241
|
+
*/
|
|
8242
|
+
declare const QueryHierarchyTraversalClause_: Struct<{
|
|
8243
|
+
type: Literal<["hierarchy-traversal"]>;
|
|
8244
|
+
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>;
|
|
8245
|
+
/**
|
|
8246
|
+
* to-parent: traverse from child to parent.
|
|
8247
|
+
* to-children: traverse from parent to children.
|
|
8248
|
+
*/
|
|
8249
|
+
direction: Literal<["to-parent", "to-children"]>;
|
|
8250
|
+
}>;
|
|
8251
|
+
interface QueryHierarchyTraversalClause extends Schema.Type<typeof QueryHierarchyTraversalClause_> {}
|
|
8252
|
+
declare const QueryHierarchyTraversalClause: Schema<QueryHierarchyTraversalClause>;
|
|
8099
8253
|
/**
|
|
8100
8254
|
* Union of multiple queries.
|
|
8101
8255
|
*/
|
|
8102
8256
|
declare const QueryUnionClause_: Struct<{
|
|
8103
8257
|
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>>;
|
|
8258
|
+
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
8259
|
}>;
|
|
8106
8260
|
interface QueryUnionClause extends Schema.Type<typeof QueryUnionClause_> {}
|
|
8107
8261
|
declare const QueryUnionClause: Schema<QueryUnionClause>;
|
|
@@ -8110,8 +8264,8 @@ declare const QueryUnionClause: Schema<QueryUnionClause>;
|
|
|
8110
8264
|
*/
|
|
8111
8265
|
declare const QuerySetDifferenceClause_: Struct<{
|
|
8112
8266
|
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>;
|
|
8267
|
+
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>;
|
|
8268
|
+
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
8269
|
}>;
|
|
8116
8270
|
interface QuerySetDifferenceClause extends Schema.Type<typeof QuerySetDifferenceClause_> {}
|
|
8117
8271
|
declare const QuerySetDifferenceClause: Schema<QuerySetDifferenceClause>;
|
|
@@ -8135,7 +8289,7 @@ declare const Order$1: Schema<Order$1>;
|
|
|
8135
8289
|
*/
|
|
8136
8290
|
declare const QueryOrderClause_: Struct<{
|
|
8137
8291
|
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>;
|
|
8292
|
+
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
8293
|
order: Array$<Schema<{
|
|
8140
8294
|
readonly kind: "natural";
|
|
8141
8295
|
} | {
|
|
@@ -8163,17 +8317,11 @@ declare const QueryOrderClause: Schema<QueryOrderClause>;
|
|
|
8163
8317
|
*/
|
|
8164
8318
|
declare const QueryOptionsClause_: Struct<{
|
|
8165
8319
|
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>;
|
|
8320
|
+
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
8321
|
options: suspend<{
|
|
8168
8322
|
readonly deleted?: "include" | "exclude" | "only" | undefined;
|
|
8169
|
-
readonly spaceIds?: readonly string[] | undefined;
|
|
8170
|
-
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8171
|
-
readonly queues?: readonly string[] | undefined;
|
|
8172
8323
|
}, {
|
|
8173
8324
|
readonly deleted?: "include" | "exclude" | "only" | undefined;
|
|
8174
|
-
readonly spaceIds?: readonly string[] | undefined;
|
|
8175
|
-
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8176
|
-
readonly queues?: readonly string[] | undefined;
|
|
8177
8325
|
}, never>;
|
|
8178
8326
|
}>;
|
|
8179
8327
|
interface QueryOptionsClause extends Schema.Type<typeof QueryOptionsClause_> {}
|
|
@@ -8183,15 +8331,44 @@ declare const QueryOptionsClause: Schema<QueryOptionsClause>;
|
|
|
8183
8331
|
*/
|
|
8184
8332
|
declare const QueryLimitClause_: Struct<{
|
|
8185
8333
|
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>;
|
|
8334
|
+
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
8335
|
limit: typeof Number$;
|
|
8188
8336
|
}>;
|
|
8189
8337
|
interface QueryLimitClause extends Schema.Type<typeof QueryLimitClause_> {}
|
|
8190
8338
|
declare const QueryLimitClause: Schema<QueryLimitClause>;
|
|
8191
|
-
declare const
|
|
8192
|
-
type
|
|
8193
|
-
|
|
8339
|
+
declare const QueryFromClause_: Struct<{
|
|
8340
|
+
type: Literal<["from"]>;
|
|
8341
|
+
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>;
|
|
8342
|
+
from: Union<[TaggedStruct<"scope", {
|
|
8343
|
+
scope: suspend<{
|
|
8344
|
+
readonly spaceIds?: readonly string[] | undefined;
|
|
8345
|
+
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8346
|
+
readonly queues?: readonly string[] | undefined;
|
|
8347
|
+
}, {
|
|
8348
|
+
readonly spaceIds?: readonly string[] | undefined;
|
|
8349
|
+
readonly allQueuesFromSpaces?: boolean | undefined;
|
|
8350
|
+
readonly queues?: readonly string[] | undefined;
|
|
8351
|
+
}, never>;
|
|
8352
|
+
}>, TaggedStruct<"query", {
|
|
8353
|
+
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>;
|
|
8354
|
+
}>]>;
|
|
8355
|
+
}>;
|
|
8356
|
+
interface QueryFromClause extends Schema.Type<typeof QueryFromClause_> {}
|
|
8357
|
+
declare const QueryFromClause: Schema<QueryFromClause>;
|
|
8358
|
+
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>]>;
|
|
8359
|
+
type Query$2 = Schema.Type<typeof Query_>;
|
|
8360
|
+
declare const Query$2: Schema<Query$2>;
|
|
8194
8361
|
declare const QueryOptions: Struct<{
|
|
8362
|
+
/**
|
|
8363
|
+
* Nested select statements will use this option to filter deleted objects.
|
|
8364
|
+
*/
|
|
8365
|
+
deleted: optional<Literal<["include", "exclude", "only"]>>;
|
|
8366
|
+
}>;
|
|
8367
|
+
interface QueryOptions extends Schema.Type<typeof QueryOptions> {}
|
|
8368
|
+
/**
|
|
8369
|
+
* Specifies the scope of the data to query from.
|
|
8370
|
+
*/
|
|
8371
|
+
declare const Scope: Struct<{
|
|
8195
8372
|
/**
|
|
8196
8373
|
* The nested select statemets will select from the given spaces.
|
|
8197
8374
|
*
|
|
@@ -8208,49 +8385,19 @@ declare const QueryOptions: Struct<{
|
|
|
8208
8385
|
* NOTE: Spaces and queues are unioned together if both are specified.
|
|
8209
8386
|
*/
|
|
8210
8387
|
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
8388
|
}>;
|
|
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
|
-
}
|
|
8389
|
+
interface Scope extends Schema.Type<typeof Scope> {}
|
|
8225
8390
|
//#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;
|
|
8391
|
+
//#region ../../../common/effect/dist/types/src/json-path.d.ts
|
|
8392
|
+
type JsonPath = string & {
|
|
8393
|
+
__JsonPath: true;
|
|
8394
|
+
};
|
|
8238
8395
|
/**
|
|
8239
|
-
*
|
|
8396
|
+
* https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html
|
|
8240
8397
|
*/
|
|
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> {}
|
|
8398
|
+
declare const JsonPath: Schema<JsonPath>;
|
|
8252
8399
|
//#endregion
|
|
8253
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.
|
|
8400
|
+
//#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
8401
|
declare global {
|
|
8255
8402
|
interface ErrorConstructor {
|
|
8256
8403
|
stackTraceLimit: number;
|
|
@@ -8261,7 +8408,7 @@ declare global {
|
|
|
8261
8408
|
* @category Constructors
|
|
8262
8409
|
*/
|
|
8263
8410
|
//#endregion
|
|
8264
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.
|
|
8411
|
+
//#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
8412
|
declare global {
|
|
8266
8413
|
interface ErrorConstructor {
|
|
8267
8414
|
stackTraceLimit: number;
|
|
@@ -8272,188 +8419,725 @@ declare global {
|
|
|
8272
8419
|
* @category Constructors
|
|
8273
8420
|
*/
|
|
8274
8421
|
//#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;
|
|
8422
|
+
//#region ../echo/dist/types/src/internal/Entity/entity.d.ts
|
|
8423
|
+
type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
|
|
8424
|
+
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
8425
|
/**
|
|
8303
|
-
*
|
|
8426
|
+
* Schema kind key that marks this as an ECHO schema and indicates its kind.
|
|
8427
|
+
* Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
|
|
8304
8428
|
*/
|
|
8305
|
-
|
|
8429
|
+
readonly [SchemaKindId]: K$1;
|
|
8306
8430
|
/**
|
|
8307
|
-
*
|
|
8431
|
+
* The fields defined in the original struct schema.
|
|
8432
|
+
* Allows accessing field definitions for introspection.
|
|
8308
8433
|
*/
|
|
8309
|
-
|
|
8434
|
+
readonly fields: Fields;
|
|
8435
|
+
instanceOf(value: unknown): boolean;
|
|
8310
8436
|
}
|
|
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;
|
|
8437
|
+
declare namespace Filter_d_exports {
|
|
8438
|
+
export { Any$3 as Any, ChildOfOptions, Filter, Props, TextSearchOptions, Type$2 as Type, and, between, childOf, 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 };
|
|
8439
|
+
}
|
|
8440
|
+
interface Filter<T$1> {
|
|
8441
|
+
'~Filter': {
|
|
8442
|
+
value: Covariant<T$1>;
|
|
8369
8443
|
};
|
|
8444
|
+
ast: Filter$1;
|
|
8370
8445
|
}
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8446
|
+
type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
|
|
8447
|
+
type Any$3 = Filter<any>;
|
|
8448
|
+
type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
|
|
8449
|
+
declare class FilterClass implements Any$3 {
|
|
8450
|
+
readonly ast: Filter$1;
|
|
8451
|
+
private static 'variance';
|
|
8452
|
+
constructor(ast: Filter$1);
|
|
8453
|
+
'~Filter': {
|
|
8454
|
+
value: Covariant<any>;
|
|
8455
|
+
};
|
|
8376
8456
|
}
|
|
8377
|
-
|
|
8378
|
-
|
|
8457
|
+
declare const is$1: (value: unknown) => value is Any$3;
|
|
8458
|
+
/** Construct a filter from an ast. */
|
|
8459
|
+
declare const fromAst$1: (ast: Filter$1) => Any$3;
|
|
8379
8460
|
/**
|
|
8380
|
-
*
|
|
8461
|
+
* Filter that matches all objects.
|
|
8381
8462
|
*/
|
|
8382
|
-
declare const
|
|
8463
|
+
declare const everything: () => FilterClass;
|
|
8383
8464
|
/**
|
|
8384
|
-
*
|
|
8465
|
+
* Filter that matches no objects.
|
|
8385
8466
|
*/
|
|
8386
|
-
declare const
|
|
8467
|
+
declare const nothing: () => FilterClass;
|
|
8468
|
+
declare const id: (...ids: ObjectId[]) => Any$3;
|
|
8469
|
+
/**
|
|
8470
|
+
* Filter by type.
|
|
8471
|
+
*/
|
|
8472
|
+
declare const type$2: <S$1 extends Schema.All>(schema: S$1 | string, props?: Props<Schema.Type<S$1>>) => Filter<Schema.Type<S$1>>;
|
|
8473
|
+
/**
|
|
8474
|
+
* Filter by non-qualified typename.
|
|
8475
|
+
*/
|
|
8476
|
+
declare const typename$1: (typename: string) => Any$3;
|
|
8477
|
+
/**
|
|
8478
|
+
* Filter by fully qualified type DXN.
|
|
8479
|
+
*/
|
|
8480
|
+
declare const typeDXN: (dxn: DXN) => Any$3;
|
|
8481
|
+
/**
|
|
8482
|
+
* Filter by tag.
|
|
8483
|
+
*/
|
|
8484
|
+
declare const tag: (tag: string) => Any$3;
|
|
8485
|
+
/**
|
|
8486
|
+
* Filter by properties.
|
|
8487
|
+
*/
|
|
8488
|
+
declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
|
|
8489
|
+
type TextSearchOptions = {
|
|
8490
|
+
type?: 'full-text' | 'vector';
|
|
8491
|
+
};
|
|
8492
|
+
/**
|
|
8493
|
+
* Full-text or vector search.
|
|
8494
|
+
*/
|
|
8495
|
+
declare const text: (text: string, options?: TextSearchOptions) => Any$3;
|
|
8496
|
+
/**
|
|
8497
|
+
* Filter by foreign keys.
|
|
8498
|
+
*/
|
|
8499
|
+
declare const foreignKeys: <S$1 extends Schema.All>(schema: S$1 | string, keys: ForeignKey[]) => Filter<Schema.Type<S$1>>;
|
|
8500
|
+
/**
|
|
8501
|
+
* Predicate for property to be equal to the provided value.
|
|
8502
|
+
*/
|
|
8503
|
+
declare const eq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8504
|
+
/**
|
|
8505
|
+
* Predicate for property to be not equal to the provided value.
|
|
8506
|
+
*/
|
|
8507
|
+
declare const neq: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8508
|
+
/**
|
|
8509
|
+
* Predicate for property to be greater than the provided value.
|
|
8510
|
+
*/
|
|
8511
|
+
declare const gt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8512
|
+
/**
|
|
8513
|
+
* Predicate for property to be greater than or equal to the provided value.
|
|
8514
|
+
*/
|
|
8515
|
+
declare const gte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8516
|
+
/**
|
|
8517
|
+
* Predicate for property to be less than the provided value.
|
|
8518
|
+
*/
|
|
8519
|
+
declare const lt: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8520
|
+
/**
|
|
8521
|
+
* Predicate for property to be less than or equal to the provided value.
|
|
8522
|
+
*/
|
|
8523
|
+
declare const lte: <T$1>(value: T$1) => Filter<T$1 | undefined>;
|
|
8524
|
+
/**
|
|
8525
|
+
* Predicate for property to be in the provided array.
|
|
8526
|
+
* @param values - Values to check against.
|
|
8527
|
+
*/
|
|
8528
|
+
declare const in$: <T$1>(...values: T$1[]) => Filter<T$1>;
|
|
8529
|
+
/**
|
|
8530
|
+
* Predicate for an array property to contain the provided value.
|
|
8531
|
+
* @param value - Value to check against.
|
|
8532
|
+
*/
|
|
8533
|
+
declare const contains: <T$1>(value: T$1) => Filter<readonly T$1[] | undefined>;
|
|
8534
|
+
/**
|
|
8535
|
+
* Predicate for property to be in the provided range.
|
|
8536
|
+
* @param from - Start of the range (inclusive).
|
|
8537
|
+
* @param to - End of the range (exclusive).
|
|
8538
|
+
*/
|
|
8539
|
+
declare const between: <T$1>(from: T$1, to: T$1) => Filter<T$1>;
|
|
8540
|
+
type TimeRange = {
|
|
8541
|
+
after?: Date | number;
|
|
8542
|
+
before?: Date | number;
|
|
8543
|
+
};
|
|
8544
|
+
/**
|
|
8545
|
+
* Filter objects by updatedAt timestamp.
|
|
8546
|
+
*/
|
|
8547
|
+
declare const updated: (range: TimeRange) => Any$3;
|
|
8548
|
+
/**
|
|
8549
|
+
* Filter objects by createdAt timestamp.
|
|
8550
|
+
*/
|
|
8551
|
+
declare const created: (range: TimeRange) => Any$3;
|
|
8552
|
+
type ChildOfOptions = {
|
|
8553
|
+
/** Whether to match transitively (grandchildren, etc.). Defaults to true. */
|
|
8554
|
+
transitive?: boolean;
|
|
8555
|
+
};
|
|
8556
|
+
/**
|
|
8557
|
+
* Filter objects that are children of the specified parent(s).
|
|
8558
|
+
* Accepts ECHO objects, DXN values, or arrays of either.
|
|
8559
|
+
* With transitive=true (default), also matches grandchildren and beyond.
|
|
8560
|
+
*/
|
|
8561
|
+
declare const childOf: (parents: Unknown | DXN | (Unknown | DXN)[], options?: ChildOfOptions) => Any$3;
|
|
8562
|
+
/**
|
|
8563
|
+
* Negate the filter.
|
|
8564
|
+
*/
|
|
8565
|
+
declare const not: <F extends Any$3>(filter: F) => Filter<Type$2<F>>;
|
|
8566
|
+
/**
|
|
8567
|
+
* Combine filters with a logical AND.
|
|
8568
|
+
*/
|
|
8569
|
+
declare const and: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
|
|
8570
|
+
/**
|
|
8571
|
+
* Combine filters with a logical OR.
|
|
8572
|
+
*/
|
|
8573
|
+
declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Filter<Type$2<Filters[number]>>;
|
|
8574
|
+
/**
|
|
8575
|
+
* Returns a human-readable string representation of a Filter AST.
|
|
8576
|
+
*/
|
|
8577
|
+
declare const pretty$1: (filter: Any$3) => string;
|
|
8387
8578
|
//#endregion
|
|
8388
|
-
//#region ../echo/dist/types/src/
|
|
8389
|
-
type Unknown$1 = Ref<Unknown>;
|
|
8579
|
+
//#region ../echo/dist/types/src/internal/JsonSchema/json-schema-type.d.ts
|
|
8390
8580
|
/**
|
|
8391
|
-
*
|
|
8581
|
+
* Describes a schema for the JSON-schema objects stored in ECHO.
|
|
8582
|
+
* Contains extensions for ECHO (e.g., references).
|
|
8583
|
+
* Ref: https://json-schema.org/draft-07/schema
|
|
8584
|
+
*/
|
|
8585
|
+
declare const _JsonSchemaType: Struct<{
|
|
8586
|
+
/**
|
|
8587
|
+
* Identifier for this schema.
|
|
8588
|
+
* This schema might be referenced by $ref clause in other schemas.
|
|
8589
|
+
*/
|
|
8590
|
+
$id: optional<typeof String$>;
|
|
8591
|
+
/**
|
|
8592
|
+
* Schema of this schema.
|
|
8593
|
+
* Set to "https://json-schema.org/draft-07/schema".
|
|
8594
|
+
*/
|
|
8595
|
+
$schema: optional<typeof String$>;
|
|
8596
|
+
/**
|
|
8597
|
+
* Reference to another schema.
|
|
8598
|
+
*/
|
|
8599
|
+
$ref: optional<typeof String$>;
|
|
8600
|
+
/**
|
|
8601
|
+
* Comments are ignored when interpreting the schema.
|
|
8602
|
+
*/
|
|
8603
|
+
$comment: optional<typeof String$>;
|
|
8604
|
+
/**
|
|
8605
|
+
* Defines whether this schema is an object schema or a relation schema.
|
|
8606
|
+
*/
|
|
8607
|
+
entityKind: optional<Enums<typeof EntityKind>>;
|
|
8608
|
+
/**
|
|
8609
|
+
* Typename of this schema.
|
|
8610
|
+
* Only on schema representing an ECHO object.
|
|
8611
|
+
*
|
|
8612
|
+
* @example 'com.example.type.my-type'
|
|
8613
|
+
*/
|
|
8614
|
+
typename: optional<typeof String$>;
|
|
8615
|
+
/**
|
|
8616
|
+
* Version of this schema.
|
|
8617
|
+
* Custom dialect for ECHO.
|
|
8618
|
+
*/
|
|
8619
|
+
version: optional<typeof String$>;
|
|
8620
|
+
/**
|
|
8621
|
+
* Target of this relation.
|
|
8622
|
+
* Only for relation schemas.
|
|
8623
|
+
* The referenced schema must be an object schema.
|
|
8624
|
+
*/
|
|
8625
|
+
relationTarget: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8626
|
+
/**
|
|
8627
|
+
* Source of this relation.
|
|
8628
|
+
* Only for relation schemas.
|
|
8629
|
+
* The referenced schema must be an object schema.
|
|
8630
|
+
*/
|
|
8631
|
+
relationSource: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8632
|
+
/**
|
|
8633
|
+
* Title of this schema.
|
|
8634
|
+
*/
|
|
8635
|
+
title: optional<typeof String$>;
|
|
8636
|
+
/**
|
|
8637
|
+
* Description of this schema.
|
|
8638
|
+
*/
|
|
8639
|
+
description: optional<typeof String$>;
|
|
8640
|
+
/**
|
|
8641
|
+
* Whether this schema is read-only.
|
|
8642
|
+
*/
|
|
8643
|
+
readOnly: optional<typeof Boolean$>;
|
|
8644
|
+
/**
|
|
8645
|
+
* Whether this schema is write-only.
|
|
8646
|
+
*/
|
|
8647
|
+
writeOnly: optional<typeof Boolean$>;
|
|
8648
|
+
/**
|
|
8649
|
+
* Examples of instances of this schema.
|
|
8650
|
+
*/
|
|
8651
|
+
examples: optional<Array$<typeof Any$4>>;
|
|
8652
|
+
/**
|
|
8653
|
+
* Default value for this schema.
|
|
8654
|
+
*/
|
|
8655
|
+
default: optional<typeof Any$4>;
|
|
8656
|
+
/**
|
|
8657
|
+
* This schema only matches values that are equal to this value.
|
|
8658
|
+
*/
|
|
8659
|
+
const: optional<typeof Any$4>;
|
|
8660
|
+
/**
|
|
8661
|
+
* This schema only matches one of the values in this array.
|
|
8662
|
+
*/
|
|
8663
|
+
enum: optional<Array$<typeof Any$4>>;
|
|
8664
|
+
/**
|
|
8665
|
+
* Base type of the schema.
|
|
8666
|
+
*/
|
|
8667
|
+
type: optional<Union<[Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>, Array$<Literal<["array", "boolean", "integer", "null", "number", "object", "string"]>>]>>;
|
|
8668
|
+
multipleOf: optional<filter<typeof Number$>>;
|
|
8669
|
+
maximum: optional<typeof Number$>;
|
|
8670
|
+
exclusiveMaximum: optional<typeof Number$>;
|
|
8671
|
+
minimum: optional<typeof Number$>;
|
|
8672
|
+
exclusiveMinimum: optional<typeof Number$>;
|
|
8673
|
+
maxLength: optional<filter<typeof Number$>>;
|
|
8674
|
+
/**
|
|
8675
|
+
* Regex pattern for strings.
|
|
8676
|
+
*/
|
|
8677
|
+
pattern: optional<typeof String$>;
|
|
8678
|
+
/**
|
|
8679
|
+
* Serialized from {@link FormatAnnotationId}.
|
|
8680
|
+
*/
|
|
8681
|
+
format: optional<typeof String$>;
|
|
8682
|
+
minLength: optional<filter<typeof Number$>>;
|
|
8683
|
+
items: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, Array$<suspend<JsonSchemaType, JsonSchemaType, never>>]>>;
|
|
8684
|
+
additionalItems: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
|
|
8685
|
+
maxItems: optional<filter<typeof Number$>>;
|
|
8686
|
+
minItems: optional<filter<typeof Number$>>;
|
|
8687
|
+
uniqueItems: optional<typeof Boolean$>;
|
|
8688
|
+
contains: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8689
|
+
maxProperties: optional<filter<typeof Number$>>;
|
|
8690
|
+
minProperties: optional<filter<typeof Number$>>;
|
|
8691
|
+
required: optional<Array$<typeof String$>>;
|
|
8692
|
+
/**
|
|
8693
|
+
* Non-standard JSON Schema extension.
|
|
8694
|
+
* Defines the order of properties in the object.
|
|
8695
|
+
* The unmentioned properties are placed at the end.
|
|
8696
|
+
*
|
|
8697
|
+
* Related: https://github.com/json-schema/json-schema/issues/119
|
|
8698
|
+
*/
|
|
8699
|
+
propertyOrder: optional<Array$<typeof String$>>;
|
|
8700
|
+
additionalProperties: optional<Union<[suspend<JsonSchemaType, JsonSchemaType, never>, typeof Boolean$]>>;
|
|
8701
|
+
properties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8702
|
+
patternProperties: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8703
|
+
propertyNames: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8704
|
+
definitions: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8705
|
+
dependencies: optional<Record$<typeof String$, suspend<string | readonly string[] | JsonSchemaType, string | readonly string[] | JsonSchemaType, never>>>;
|
|
8706
|
+
contentMediaType: optional<typeof String$>;
|
|
8707
|
+
contentEncoding: optional<typeof String$>;
|
|
8708
|
+
if: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8709
|
+
then: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8710
|
+
else: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8711
|
+
allOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8712
|
+
anyOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8713
|
+
oneOf: optional<Array$<suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8714
|
+
not: optional<suspend<JsonSchemaType, JsonSchemaType, never>>;
|
|
8715
|
+
$defs: optional<Record$<typeof String$, suspend<JsonSchemaType, JsonSchemaType, never>>>;
|
|
8716
|
+
currency: optional<typeof String$>;
|
|
8717
|
+
reference: optional<Struct<{
|
|
8718
|
+
schema: suspend<JsonSchemaType, JsonSchemaType, never>;
|
|
8719
|
+
schemaVersion: optional<typeof String$>;
|
|
8720
|
+
schemaObject: optional<typeof String$>;
|
|
8721
|
+
}>>;
|
|
8722
|
+
/**
|
|
8723
|
+
* ECHO-specific annotations.
|
|
8724
|
+
*/
|
|
8725
|
+
annotations: optional<Struct<{
|
|
8726
|
+
/**
|
|
8727
|
+
* Label for this schema.
|
|
8728
|
+
* Mapped from {@link LabelAnnotationId}.
|
|
8729
|
+
*/
|
|
8730
|
+
labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
|
|
8731
|
+
/**
|
|
8732
|
+
* Generator function for this schema.
|
|
8733
|
+
* Mapped from {@link GeneratorAnnotationId}.
|
|
8734
|
+
*/
|
|
8735
|
+
generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
|
|
8736
|
+
/**
|
|
8737
|
+
* {@link PropertyMeta} annotations get serialized here.
|
|
8738
|
+
*/
|
|
8739
|
+
meta: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8740
|
+
/**
|
|
8741
|
+
* @deprecated
|
|
8742
|
+
*/
|
|
8743
|
+
type: optional<Struct<{
|
|
8744
|
+
typename: typeof String$;
|
|
8745
|
+
version: typeof String$;
|
|
8746
|
+
schemaId: optional<typeof String$>;
|
|
8747
|
+
}>>;
|
|
8748
|
+
/**
|
|
8749
|
+
* @deprecated Superseded by `meta`.
|
|
8750
|
+
*/
|
|
8751
|
+
annotations: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8752
|
+
}>>;
|
|
8753
|
+
/**
|
|
8754
|
+
* @deprecated Use `annotations` instead.
|
|
8755
|
+
*/
|
|
8756
|
+
echo: optional<Struct<{
|
|
8757
|
+
/**
|
|
8758
|
+
* Label for this schema.
|
|
8759
|
+
* Mapped from {@link LabelAnnotationId}.
|
|
8760
|
+
*/
|
|
8761
|
+
labelProp: optional<Union<[Schema<JsonPath, JsonPath, never>, Array$<Schema<JsonPath, JsonPath, never>>]>>;
|
|
8762
|
+
/**
|
|
8763
|
+
* Generator function for this schema.
|
|
8764
|
+
* Mapped from {@link GeneratorAnnotationId}.
|
|
8765
|
+
*/
|
|
8766
|
+
generator: optional<Union<[typeof String$, Tuple2<typeof String$, typeof Number$>]>>;
|
|
8767
|
+
/**
|
|
8768
|
+
* {@link PropertyMeta} annotations get serialized here.
|
|
8769
|
+
*/
|
|
8770
|
+
meta: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8771
|
+
/**
|
|
8772
|
+
* @deprecated
|
|
8773
|
+
*/
|
|
8774
|
+
type: optional<Struct<{
|
|
8775
|
+
typename: typeof String$;
|
|
8776
|
+
version: typeof String$;
|
|
8777
|
+
schemaId: optional<typeof String$>;
|
|
8778
|
+
}>>;
|
|
8779
|
+
/**
|
|
8780
|
+
* @deprecated Superseded by `meta`.
|
|
8781
|
+
*/
|
|
8782
|
+
annotations: optional<Record$<typeof String$, typeof Any$4>>;
|
|
8783
|
+
}>>;
|
|
8784
|
+
}>;
|
|
8785
|
+
/**
|
|
8786
|
+
* https://json-schema.org/draft-07/schema
|
|
8392
8787
|
*/
|
|
8393
|
-
|
|
8788
|
+
interface JsonSchemaType extends Schema.Type<typeof _JsonSchemaType> {}
|
|
8789
|
+
declare const JsonSchemaType: Schema<JsonSchemaType>;
|
|
8394
8790
|
//#endregion
|
|
8395
|
-
//#region ../echo/dist/types/src/
|
|
8396
|
-
declare const
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8791
|
+
//#region ../echo/dist/types/src/internal/Ref/ref.d.ts
|
|
8792
|
+
declare const RefTypeId: unique symbol;
|
|
8793
|
+
/**
|
|
8794
|
+
* Reference Schema.
|
|
8795
|
+
*/
|
|
8796
|
+
interface RefSchema$1<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
|
|
8797
|
+
/**
|
|
8798
|
+
* Type of the `Ref` function and extra methods attached to it.
|
|
8799
|
+
*/
|
|
8800
|
+
interface RefFn {
|
|
8801
|
+
<S$1 extends Schema.Any>(schema: S$1): RefSchema$1<Schema.Type<S$1>>;
|
|
8802
|
+
/**
|
|
8803
|
+
* @returns True if the object is a reference.
|
|
8804
|
+
*/
|
|
8805
|
+
isRef: (obj: unknown) => obj is Ref<any>;
|
|
8806
|
+
/**
|
|
8807
|
+
* @returns True if the reference points to the given object id.
|
|
8808
|
+
*/
|
|
8809
|
+
hasObjectId: (id: ObjectId) => (ref: Ref<any>) => boolean;
|
|
8810
|
+
/**
|
|
8811
|
+
* @returns True if the schema is a reference schema.
|
|
8812
|
+
*/
|
|
8813
|
+
isRefSchema: (schema: Schema<any, any>) => schema is RefSchema$1<any>;
|
|
8814
|
+
/**
|
|
8815
|
+
* @returns True if the schema AST is a reference schema.
|
|
8816
|
+
*/
|
|
8817
|
+
isRefSchemaAST: (ast: AST) => boolean;
|
|
8818
|
+
/**
|
|
8819
|
+
* Constructs a reference that points to the given object.
|
|
8820
|
+
*/
|
|
8821
|
+
make: <T$1 extends AnyEntity>(object: T$1) => Ref<T$1>;
|
|
8822
|
+
/**
|
|
8823
|
+
* Constructs a reference that points to the object specified by the provided DXN.
|
|
8824
|
+
*/
|
|
8825
|
+
fromDXN: (dxn: DXN) => Ref<any>;
|
|
8826
|
+
}
|
|
8827
|
+
/**
|
|
8828
|
+
* Schema builder for references.
|
|
8829
|
+
*/
|
|
8830
|
+
declare const Ref: RefFn;
|
|
8831
|
+
/**
|
|
8832
|
+
* Represents materialized reference to a target.
|
|
8833
|
+
* This is the data type for the fields marked as ref.
|
|
8834
|
+
*/
|
|
8835
|
+
interface Ref<T$1> extends Pipeable {
|
|
8836
|
+
/**
|
|
8837
|
+
* Target object DXN.
|
|
8838
|
+
*/
|
|
8839
|
+
get dxn(): DXN;
|
|
8840
|
+
/**
|
|
8841
|
+
* Returns true if the reference has a target available (inlined or resolver set).
|
|
8842
|
+
*/
|
|
8843
|
+
get isAvailable(): boolean;
|
|
8844
|
+
/**
|
|
8845
|
+
* @returns The reference target.
|
|
8846
|
+
* May return `undefined` if the object is not loaded in the working set.
|
|
8847
|
+
* Accessing this property, even if it returns `undefined` will trigger the object to be loaded to the working set.
|
|
8848
|
+
*/
|
|
8849
|
+
get target(): T$1 | undefined;
|
|
8850
|
+
/**
|
|
8851
|
+
* @returns Promise that will resolves with the target object.
|
|
8852
|
+
* Will load the object from disk if it is not present in the working set.
|
|
8853
|
+
* @throws If the object is not available locally.
|
|
8854
|
+
*/
|
|
8855
|
+
load(): Promise<T$1>;
|
|
8856
|
+
/**
|
|
8857
|
+
* @returns Promise that will resolves with the target object or undefined if the object is not loaded locally.
|
|
8858
|
+
*/
|
|
8859
|
+
tryLoad(): Promise<T$1 | undefined>;
|
|
8860
|
+
/**
|
|
8861
|
+
* Do not inline the target object in the reference.
|
|
8862
|
+
* Makes .target unavailable unless the reference is connected to a database context.
|
|
8863
|
+
*
|
|
8864
|
+
* When serialized with toJSON, the difference is between:
|
|
8865
|
+
* `{ "/": "dxn:..." }`
|
|
8866
|
+
* and
|
|
8867
|
+
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8868
|
+
*
|
|
8869
|
+
* Clones the reference object.
|
|
8870
|
+
*/
|
|
8871
|
+
noInline(): Ref<T$1>;
|
|
8872
|
+
/**
|
|
8873
|
+
* Serializes the reference to a JSON object.
|
|
8874
|
+
* The serialization format is compatible with the IPLD-style encoded references.
|
|
8875
|
+
* When a reference has a saved target (i.e. the target or object holding the reference is not in the database),
|
|
8876
|
+
* the target is included in the serialized object.
|
|
8877
|
+
*
|
|
8878
|
+
* Examples:
|
|
8879
|
+
* `{ "/": "dxn:..." }`
|
|
8880
|
+
* `{ "/": "dxn:...", "target": { ... } }`
|
|
8881
|
+
*/
|
|
8882
|
+
encode(): EncodedReference;
|
|
8883
|
+
[RefTypeId]: {
|
|
8884
|
+
_T: T$1;
|
|
8885
|
+
};
|
|
8886
|
+
}
|
|
8887
|
+
declare namespace Ref {
|
|
8888
|
+
/**
|
|
8889
|
+
* Target of the reference.
|
|
8890
|
+
*/
|
|
8891
|
+
type Target<R$1> = R$1 extends Ref<infer U> ? U : never;
|
|
8892
|
+
}
|
|
8893
|
+
interface RefResolver {
|
|
8894
|
+
/**
|
|
8895
|
+
* Resolve ref synchronously from the objects in the working set.
|
|
8896
|
+
*
|
|
8897
|
+
* @param dxn
|
|
8898
|
+
* @param load If true the resolver should attempt to load the object from disk.
|
|
8899
|
+
* @param onLoad Callback to call when the object is loaded.
|
|
8900
|
+
*/
|
|
8901
|
+
resolveSync(dxn: DXN, load: boolean, onLoad?: () => void): AnyProperties | undefined;
|
|
8902
|
+
/**
|
|
8903
|
+
* Resolver ref asynchronously.
|
|
8904
|
+
*/
|
|
8905
|
+
resolve(dxn: DXN): Promise<AnyProperties | undefined>;
|
|
8906
|
+
resolveSchema(dxn: DXN): Promise<Schema.AnyNoContext | undefined>;
|
|
8907
|
+
}
|
|
8400
8908
|
//#endregion
|
|
8401
|
-
//#region ../echo/dist/types/src/
|
|
8909
|
+
//#region ../echo/dist/types/src/internal/Obj/typed-object.d.ts
|
|
8402
8910
|
/**
|
|
8403
|
-
*
|
|
8404
|
-
*
|
|
8911
|
+
* Definition for an object type that can be stored in an ECHO database.
|
|
8912
|
+
* Implements effect schema to define object properties.
|
|
8913
|
+
* Has a typename and version.
|
|
8914
|
+
*
|
|
8915
|
+
* In contrast to {@link EchoSchema} this definition is not recorded in the database.
|
|
8916
|
+
*
|
|
8917
|
+
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8405
8918
|
*/
|
|
8406
|
-
|
|
8407
|
-
readonly [SchemaKindId]: K$1;
|
|
8408
|
-
};
|
|
8919
|
+
interface TypedObject<A$1 = any, I$1 = any> extends TypeMeta, Schema<A$1, I$1> {}
|
|
8409
8920
|
/**
|
|
8410
|
-
*
|
|
8921
|
+
* Typed object that could be used as a prototype in class definitions.
|
|
8922
|
+
* This is an internal API type.
|
|
8923
|
+
*
|
|
8924
|
+
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8411
8925
|
*/
|
|
8412
|
-
|
|
8926
|
+
interface TypedObjectPrototype<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8927
|
+
/** Type constructor. */
|
|
8928
|
+
new (): AnyEntity & A$1;
|
|
8929
|
+
}
|
|
8930
|
+
//#endregion
|
|
8931
|
+
//#region ../echo/dist/types/src/internal/Type/persistent-schema.d.ts
|
|
8413
8932
|
/**
|
|
8414
|
-
*
|
|
8933
|
+
* Persistent representation of a schema.
|
|
8415
8934
|
*/
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8935
|
+
declare const PersistentSchema: EchoObjectSchema<Struct<{
|
|
8936
|
+
name: optional<typeof String$>;
|
|
8937
|
+
typename: refine<string, typeof String$>;
|
|
8938
|
+
version: refine<string, typeof String$>;
|
|
8939
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8940
|
+
}>, Readonly<{
|
|
8941
|
+
name: optional<typeof String$>;
|
|
8942
|
+
typename: refine<string, typeof String$>;
|
|
8943
|
+
version: refine<string, typeof String$>;
|
|
8944
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8945
|
+
}>>;
|
|
8946
|
+
interface PersistentSchema extends Schema.Type<typeof PersistentSchema> {}
|
|
8947
|
+
//#endregion
|
|
8948
|
+
//#region ../echo/dist/types/src/internal/Type/echo-schema.d.ts
|
|
8949
|
+
/**
|
|
8950
|
+
* Base schema type.
|
|
8951
|
+
*/
|
|
8952
|
+
interface BaseSchema<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8953
|
+
get readonly(): boolean;
|
|
8954
|
+
get mutable(): EchoSchema<A$1, I$1>;
|
|
8955
|
+
get snapshot(): Schema<A$1, I$1>;
|
|
8956
|
+
get jsonSchema(): JsonSchemaType;
|
|
8420
8957
|
}
|
|
8421
|
-
|
|
8422
|
-
id: ObjectId;
|
|
8423
|
-
} & Record<string, unknown>, {
|
|
8424
|
-
id: string;
|
|
8425
|
-
} & Record<string, unknown>> & EchoSchemaKind<EntityKind.Relation> & TypeMeta;
|
|
8958
|
+
declare const EchoSchema_base: TypedObjectPrototype<any, any>;
|
|
8426
8959
|
/**
|
|
8427
|
-
*
|
|
8428
|
-
*
|
|
8429
|
-
* A relation has `id`, source, and target fields plus any additional properties.
|
|
8960
|
+
* Represents a schema that is persisted in the ECHO database.
|
|
8961
|
+
* Schema can me mutable or readonly (specified by the {@link EchoSchema.readonly} field).
|
|
8430
8962
|
*
|
|
8431
|
-
*
|
|
8432
|
-
*
|
|
8963
|
+
* Schema that can be modified at runtime via the API.
|
|
8964
|
+
* Is an instance of effect-schema (`Schema.Schema.AnyNoContext`) so it can be used in the same way as a regular schema.
|
|
8965
|
+
* IMPORTANT: The schema AST will change reactively when the schema is updated, including synced updates from remote peers.
|
|
8966
|
+
*
|
|
8967
|
+
* The class constructor is a schema instance itself, and can be used in the echo object definitions:
|
|
8433
8968
|
*
|
|
8434
8969
|
* @example
|
|
8435
8970
|
* ```ts
|
|
8436
|
-
*
|
|
8437
|
-
*
|
|
8438
|
-
*
|
|
8439
|
-
*
|
|
8440
|
-
*
|
|
8971
|
+
* export class TableType extends Schema.Struct({...}).pipe(Type.object({ typename: 'com.example.type.table', version: '0.1.0' })){
|
|
8972
|
+
* title: Schema.String,
|
|
8973
|
+
* schema: Schema.optional(ref(EchoSchema)),
|
|
8974
|
+
* props: Schema.mutable(S.Array(TablePropSchema)),
|
|
8975
|
+
* }) {}
|
|
8441
8976
|
* ```
|
|
8977
|
+
*
|
|
8978
|
+
* The ECHO API will translate any references to PersistentSchema objects to be resolved as EchoSchema objects.
|
|
8979
|
+
*/
|
|
8980
|
+
declare class EchoSchema<A$1 = any, I$1 = any> extends EchoSchema_base implements BaseSchema<A$1, I$1> {
|
|
8981
|
+
private readonly _persistentSchema;
|
|
8982
|
+
private _schema;
|
|
8983
|
+
private _isDirty;
|
|
8984
|
+
/**
|
|
8985
|
+
* Schema kind key that marks this as an ECHO schema.
|
|
8986
|
+
* Makes EchoSchema satisfy the Type.AnyObj type.
|
|
8987
|
+
*/
|
|
8988
|
+
readonly [SchemaKindId]: EntityKind.Object;
|
|
8989
|
+
constructor(_persistentSchema: PersistentSchema);
|
|
8990
|
+
get [TypeId$1](): {
|
|
8991
|
+
_A: (_: any) => any;
|
|
8992
|
+
_I: (_: any) => any;
|
|
8993
|
+
_R: (_: never) => never;
|
|
8994
|
+
};
|
|
8995
|
+
get Type(): A$1;
|
|
8996
|
+
get Encoded(): I$1;
|
|
8997
|
+
get Context(): never;
|
|
8998
|
+
get ast(): AST;
|
|
8999
|
+
get annotations(): (annotations: Annotations.GenericSchema<any>) => Schema<any, any, never>;
|
|
9000
|
+
get pipe(): Schema.AnyNoContext['pipe'];
|
|
9001
|
+
get kind(): EntityKind.Object;
|
|
9002
|
+
get typename(): string;
|
|
9003
|
+
get version(): string;
|
|
9004
|
+
get readonly(): boolean;
|
|
9005
|
+
/**
|
|
9006
|
+
* Returns an immutable schema snapshot of the current state of the schema.
|
|
9007
|
+
*/
|
|
9008
|
+
get snapshot(): Schema.AnyNoContext;
|
|
9009
|
+
/**
|
|
9010
|
+
* Returns the JSON schema for the schema.
|
|
9011
|
+
*/
|
|
9012
|
+
get jsonSchema(): JsonSchemaType;
|
|
9013
|
+
/**
|
|
9014
|
+
* Returns a mutable schema.
|
|
9015
|
+
*/
|
|
9016
|
+
get mutable(): EchoSchema;
|
|
9017
|
+
/**
|
|
9018
|
+
* Id of the ECHO object containing the schema.
|
|
9019
|
+
*/
|
|
9020
|
+
get id(): ObjectId;
|
|
9021
|
+
/**
|
|
9022
|
+
* Short name of the schema.
|
|
9023
|
+
*/
|
|
9024
|
+
get name(): string | undefined;
|
|
9025
|
+
get [SchemaMetaSymbol](): SchemaMeta;
|
|
9026
|
+
/**
|
|
9027
|
+
* Reference to the underlying persistent schema object.
|
|
9028
|
+
*/
|
|
9029
|
+
get persistentSchema(): PersistentType;
|
|
9030
|
+
getProperties(): PropertySignature$1[];
|
|
9031
|
+
/**
|
|
9032
|
+
* @throws Error if the schema is readonly.
|
|
9033
|
+
*/
|
|
9034
|
+
updateTypename(typename: string): void;
|
|
9035
|
+
/**
|
|
9036
|
+
* @throws Error if the schema is readonly.
|
|
9037
|
+
*/
|
|
9038
|
+
addFields(fields: Struct.Fields): void;
|
|
9039
|
+
/**
|
|
9040
|
+
* @throws Error if the schema is readonly.
|
|
9041
|
+
*/
|
|
9042
|
+
updateFields(fields: Struct.Fields): void;
|
|
9043
|
+
/**
|
|
9044
|
+
* @throws Error if the schema is readonly.
|
|
9045
|
+
*/
|
|
9046
|
+
updateFieldPropertyName({
|
|
9047
|
+
before,
|
|
9048
|
+
after
|
|
9049
|
+
}: {
|
|
9050
|
+
before: PropertyKey;
|
|
9051
|
+
after: PropertyKey;
|
|
9052
|
+
}): void;
|
|
9053
|
+
/**
|
|
9054
|
+
* @throws Error if the schema is readonly.
|
|
9055
|
+
*/
|
|
9056
|
+
removeFields(fieldNames: string[]): void;
|
|
9057
|
+
/**
|
|
9058
|
+
* Wrapper for Obj.change that handles the change context for the persistent schema.
|
|
9059
|
+
*/
|
|
9060
|
+
private _change;
|
|
9061
|
+
/**
|
|
9062
|
+
* Called by DatabaseSchemaRegistry on update.
|
|
9063
|
+
*/
|
|
9064
|
+
_invalidate(): void;
|
|
9065
|
+
/**
|
|
9066
|
+
* Rebuilds this schema if it is dirty.
|
|
9067
|
+
*/
|
|
9068
|
+
_rebuild(): void;
|
|
9069
|
+
_getSchema(): Schema.AnyNoContext;
|
|
9070
|
+
}
|
|
9071
|
+
//#endregion
|
|
9072
|
+
//#region ../echo/dist/types/src/Relation.d.ts
|
|
9073
|
+
type Endpoints$1<Source, Target$1> = {
|
|
9074
|
+
[Source]: Source;
|
|
9075
|
+
[Target$1]: Target$1;
|
|
9076
|
+
};
|
|
9077
|
+
/**
|
|
9078
|
+
* Get relation source type.
|
|
9079
|
+
*/
|
|
9080
|
+
type SourceOf<A$1> = A$1 extends Endpoints$1<infer S, infer _T> ? S : never;
|
|
9081
|
+
/**
|
|
9082
|
+
* Get relation target type.
|
|
9083
|
+
*/
|
|
9084
|
+
type TargetOf<A$1> = A$1 extends Endpoints$1<infer _S, infer T> ? T : never;
|
|
9085
|
+
//#endregion
|
|
9086
|
+
//#region ../echo/dist/types/src/Type.d.ts
|
|
9087
|
+
/**
|
|
9088
|
+
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9089
|
+
*/
|
|
9090
|
+
declare const RuntimeType: typeof EchoSchema;
|
|
9091
|
+
/**
|
|
9092
|
+
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9093
|
+
*/
|
|
9094
|
+
type RuntimeType = EchoSchema;
|
|
9095
|
+
/**
|
|
9096
|
+
* Type that marks a schema as an ECHO schema.
|
|
9097
|
+
* The value indicates the entity kind (Object or Relation).
|
|
8442
9098
|
*/
|
|
8443
|
-
|
|
9099
|
+
type EchoSchemaKind<K$1 extends EntityKind = EntityKind> = {
|
|
9100
|
+
readonly [SchemaKindId]: K$1;
|
|
9101
|
+
};
|
|
8444
9102
|
/**
|
|
8445
|
-
* TypeScript type for an ECHO
|
|
8446
|
-
* `T` is the instance type produced by the schema
|
|
8447
|
-
* `Source` and `Target` are the endpoint types.
|
|
9103
|
+
* TypeScript type for an ECHO object schema.
|
|
9104
|
+
* `T` is the instance type produced by the schema.
|
|
8448
9105
|
* `Fields` is the optional struct fields type for introspection.
|
|
9106
|
+
*
|
|
9107
|
+
* @example
|
|
9108
|
+
* ```ts
|
|
9109
|
+
* const PersonSchema: Type.Obj<Person> = Schema.Struct({
|
|
9110
|
+
* name: Schema.String,
|
|
9111
|
+
* }).pipe(Type.object({ typename: 'Person', version: '0.1.0' }));
|
|
9112
|
+
*
|
|
9113
|
+
* // Access fields for introspection:
|
|
9114
|
+
* Object.keys(PersonSchema.fields); // ['name']
|
|
9115
|
+
* ```
|
|
8449
9116
|
*/
|
|
8450
|
-
interface
|
|
9117
|
+
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
9118
|
/**
|
|
8452
9119
|
* The fields defined in the original struct schema.
|
|
8453
9120
|
* Allows accessing field definitions for introspection.
|
|
8454
9121
|
*/
|
|
8455
9122
|
readonly fields: Fields;
|
|
8456
9123
|
}
|
|
9124
|
+
/**
|
|
9125
|
+
* Structural base type for any ECHO object schema.
|
|
9126
|
+
* Accepts both static schemas (created with Type.object()) and EchoSchema.
|
|
9127
|
+
* NOTE: Does not include the brand symbol to avoid TS4053 declaration portability issues.
|
|
9128
|
+
* Use Type.isObjectSchema() for runtime type guards.
|
|
9129
|
+
*/
|
|
9130
|
+
type ObjectSchemaBase = Schema.AnyNoContext & {
|
|
9131
|
+
readonly typename: string;
|
|
9132
|
+
readonly version: string;
|
|
9133
|
+
};
|
|
9134
|
+
/**
|
|
9135
|
+
* Type that represents any ECHO object schema.
|
|
9136
|
+
* Accepts both static schemas (Type.object()) and mutable schemas (EchoSchema).
|
|
9137
|
+
*/
|
|
9138
|
+
type AnyObj = ObjectSchemaBase;
|
|
9139
|
+
declare const PersistentType: Obj$1<PersistentSchema>;
|
|
9140
|
+
interface PersistentType extends Schema.Type<typeof PersistentType> {}
|
|
8457
9141
|
/**
|
|
8458
9142
|
* Structural base type for any ECHO relation schema.
|
|
8459
9143
|
* Accepts static schemas (created with Type.relation()).
|
|
@@ -8464,25 +9148,16 @@ type RelationSchemaBase = Schema.AnyNoContext & {
|
|
|
8464
9148
|
readonly typename: string;
|
|
8465
9149
|
readonly version: string;
|
|
8466
9150
|
};
|
|
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
|
-
}
|
|
9151
|
+
/**
|
|
9152
|
+
* Type that represents any ECHO relation schema.
|
|
9153
|
+
* Accepts static schemas (Type.relation()).
|
|
9154
|
+
*/
|
|
9155
|
+
type AnyRelation = RelationSchemaBase;
|
|
9156
|
+
/**
|
|
9157
|
+
* Type alias for any ECHO entity schema (object or relation).
|
|
9158
|
+
* Use this in type annotations for schema parameters.
|
|
9159
|
+
*/
|
|
9160
|
+
type AnyEntity$1 = AnyObj | AnyRelation;
|
|
8486
9161
|
//#endregion
|
|
8487
9162
|
//#region ../echo/dist/types/src/Obj.d.ts
|
|
8488
9163
|
/**
|
|
@@ -8492,7 +9167,7 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
|
|
|
8492
9167
|
/**
|
|
8493
9168
|
* Object type with specific properties.
|
|
8494
9169
|
*/
|
|
8495
|
-
|
|
9170
|
+
type OfShape<Props$1> = BaseObj & Props$1;
|
|
8496
9171
|
/**
|
|
8497
9172
|
* Object with no known properties beyond id and kind.
|
|
8498
9173
|
* Use this when the object's schema/properties are not known.
|
|
@@ -8501,134 +9176,383 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
|
|
|
8501
9176
|
* NOTE: This is a TypeScript type only, not a schema.
|
|
8502
9177
|
* To validate that a value is an ECHO object, use `Schema.is(Type.Obj)`.
|
|
8503
9178
|
*/
|
|
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;
|
|
9179
|
+
interface Unknown$2 extends BaseObj {}
|
|
8509
9180
|
/**
|
|
8510
|
-
*
|
|
8511
|
-
*
|
|
9181
|
+
* Runtime Effect schema for any ECHO object.
|
|
9182
|
+
* Use for validation, parsing, or as a reference target for collections.
|
|
9183
|
+
*
|
|
9184
|
+
* NOTE: `Schema.is(Type.Obj)` does STRUCTURAL validation only (checks for `id` field).
|
|
9185
|
+
* Use `Obj.isObject()` for proper ECHO instance type guards that check the KindId brand.
|
|
9186
|
+
*
|
|
9187
|
+
* @example
|
|
9188
|
+
* ```ts
|
|
9189
|
+
* // Structural type guard (accepts any object with id field)
|
|
9190
|
+
* if (Schema.is(Type.Obj)(unknownValue)) { ... }
|
|
9191
|
+
*
|
|
9192
|
+
* // ECHO instance type guard (checks KindId brand)
|
|
9193
|
+
* if (Obj.isObject(unknownValue)) { ... }
|
|
9194
|
+
*
|
|
9195
|
+
* // Reference to any object type
|
|
9196
|
+
* const Collection = Schema.Struct({
|
|
9197
|
+
* objects: Schema.Array(Ref.Ref(Obj.Unknown)),
|
|
9198
|
+
* }).pipe(Type.object({ typename: 'Collection', version: '0.1.0' }));
|
|
9199
|
+
* ```
|
|
8512
9200
|
*/
|
|
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
|
-
};
|
|
9201
|
+
declare const Unknown$2: Obj$1<Unknown$2>;
|
|
9202
|
+
/**
|
|
9203
|
+
* JSON-encoded properties for objects.
|
|
9204
|
+
*/
|
|
9205
|
+
interface BaseObjJson {
|
|
9206
|
+
id: string;
|
|
8536
9207
|
}
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
declare const fromAst$1: (ast: Filter$1) => Any$3;
|
|
9208
|
+
//#endregion
|
|
9209
|
+
//#region ../echo/dist/types/src/Ref.d.ts
|
|
8540
9210
|
/**
|
|
8541
|
-
*
|
|
9211
|
+
* Instance type for a reference.
|
|
9212
|
+
*
|
|
9213
|
+
* Reference can point to any object or relation.
|
|
9214
|
+
* References are lazy loaded.
|
|
9215
|
+
*
|
|
9216
|
+
* `ref.dxn` is the DXN of the referenced object.
|
|
9217
|
+
*
|
|
9218
|
+
* @example
|
|
9219
|
+
* ```ts
|
|
9220
|
+
* const taskRef: Ref<Task> = Ref.make(task);
|
|
9221
|
+
*
|
|
9222
|
+
* await taskRef.load(); // Returns Promise<Task>
|
|
9223
|
+
* yield* Database.load(taskRef); // Effectful version.
|
|
9224
|
+
*
|
|
9225
|
+
* database.makeRef(dxn); // Create a ref from a DXN.
|
|
9226
|
+
* ```
|
|
8542
9227
|
*/
|
|
8543
|
-
|
|
9228
|
+
type Ref$1<T$1> = Ref<T$1>;
|
|
9229
|
+
type Unknown$1 = Ref<Unknown$2>;
|
|
8544
9230
|
/**
|
|
8545
|
-
*
|
|
9231
|
+
* Factory function to create a Ref schema for the given target schema.
|
|
9232
|
+
* Use this in schema definitions to declare reference fields.
|
|
9233
|
+
*
|
|
9234
|
+
* @example
|
|
9235
|
+
* ```ts
|
|
9236
|
+
* const Task = Schema.Struct({
|
|
9237
|
+
* assignee: Ref.Ref(Person), // Creates a Ref schema
|
|
9238
|
+
* }).pipe(Type.object({ typename: 'Task', version: '0.1.0' }));
|
|
9239
|
+
* ```
|
|
8546
9240
|
*/
|
|
8547
|
-
declare const
|
|
8548
|
-
declare const id: (...ids: ObjectId[]) => Any$3;
|
|
9241
|
+
declare const Ref$1: <S$1 extends Schema.Any>(schema: S$1) => RefSchema<Schema.Type<S$1>>;
|
|
8549
9242
|
/**
|
|
8550
|
-
*
|
|
9243
|
+
* TypeScript type for a Ref schema.
|
|
9244
|
+
* This is the type of the SCHEMA itself, not the runtime ref instance.
|
|
9245
|
+
* For the instance type, use `Ref.Ref<T>` from the Ref module.
|
|
9246
|
+
*
|
|
9247
|
+
* @example
|
|
9248
|
+
* ```ts
|
|
9249
|
+
* // Schema type annotation (rarely needed, usually inferred):
|
|
9250
|
+
* const refSchema: Ref.RefSchema<typeof Task> = Ref.Ref(Task);
|
|
9251
|
+
*
|
|
9252
|
+
* // Instance type annotation (use Ref.Ref instead):
|
|
9253
|
+
* const refInstance: Ref.Ref<Task> = Ref.make(task);
|
|
9254
|
+
* ```
|
|
8551
9255
|
*/
|
|
8552
|
-
|
|
9256
|
+
interface RefSchema<T$1 extends Unknown> extends RefSchema$1<T$1> {}
|
|
8553
9257
|
/**
|
|
8554
|
-
*
|
|
9258
|
+
* Extract reference target.
|
|
8555
9259
|
*/
|
|
8556
|
-
|
|
9260
|
+
type Target<R$1 extends Unknown$1> = R$1 extends Ref<infer T> ? T : never;
|
|
8557
9261
|
/**
|
|
8558
|
-
*
|
|
9262
|
+
* Reference resolver.
|
|
8559
9263
|
*/
|
|
8560
|
-
|
|
9264
|
+
type Resolver = RefResolver;
|
|
9265
|
+
//#endregion
|
|
9266
|
+
//#region ../echo/dist/types/src/JsonSchema.d.ts
|
|
8561
9267
|
/**
|
|
8562
|
-
*
|
|
9268
|
+
* Serializable JsonSchema type definition.
|
|
8563
9269
|
*/
|
|
8564
|
-
|
|
9270
|
+
type JsonSchema = JsonSchemaType;
|
|
9271
|
+
declare const JsonSchema: Schema<JsonSchemaType>;
|
|
9272
|
+
//#endregion
|
|
9273
|
+
//#region ../echo/dist/types/src/QueryResult.d.ts
|
|
8565
9274
|
/**
|
|
8566
|
-
*
|
|
9275
|
+
* Individual query result entry.
|
|
8567
9276
|
*/
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
9277
|
+
type Entry$1<T$1> = {
|
|
9278
|
+
id: string;
|
|
9279
|
+
/**
|
|
9280
|
+
* May not be present for remote results.
|
|
9281
|
+
*/
|
|
9282
|
+
result?: T$1;
|
|
9283
|
+
match?: {
|
|
9284
|
+
/**
|
|
9285
|
+
* Higher means better match.
|
|
9286
|
+
*/
|
|
9287
|
+
rank: number;
|
|
9288
|
+
};
|
|
9289
|
+
/**
|
|
9290
|
+
* Query resolution metadata.
|
|
9291
|
+
*/
|
|
9292
|
+
resolution?: {
|
|
9293
|
+
source: 'remote' | 'local' | 'index';
|
|
9294
|
+
/**
|
|
9295
|
+
* Query resolution time in milliseconds.
|
|
9296
|
+
*/
|
|
9297
|
+
time: number;
|
|
9298
|
+
};
|
|
9299
|
+
};
|
|
9300
|
+
type RunOptions = {
|
|
9301
|
+
timeout?: number;
|
|
9302
|
+
};
|
|
9303
|
+
type SubscriptionOptions = {
|
|
9304
|
+
/**
|
|
9305
|
+
* Fire the callback immediately.
|
|
9306
|
+
*/
|
|
9307
|
+
fire?: boolean;
|
|
9308
|
+
};
|
|
9309
|
+
interface QueryResult<T$1> {
|
|
9310
|
+
/**
|
|
9311
|
+
* Currently available results along with their match metadata.
|
|
9312
|
+
*/
|
|
9313
|
+
readonly entries: Entry$1<T$1>[];
|
|
9314
|
+
/**
|
|
9315
|
+
* Currently available results.
|
|
9316
|
+
*/
|
|
9317
|
+
readonly results: T$1[];
|
|
9318
|
+
/**
|
|
9319
|
+
* Returns all known results.
|
|
9320
|
+
*/
|
|
9321
|
+
run(opts?: RunOptions): Promise<T$1[]>;
|
|
9322
|
+
/**
|
|
9323
|
+
* Returns all known results along with their match metadata.
|
|
9324
|
+
*/
|
|
9325
|
+
runEntries(opts?: RunOptions): Promise<Entry$1<T$1>[]>;
|
|
9326
|
+
/**
|
|
9327
|
+
* Returns currently available results synchronously.
|
|
9328
|
+
*/
|
|
9329
|
+
runSync(): T$1[];
|
|
9330
|
+
/**
|
|
9331
|
+
* Returns currently available results synchronously along with their match metadata.
|
|
9332
|
+
*/
|
|
9333
|
+
runSyncEntries(): Entry$1<T$1>[];
|
|
9334
|
+
/**
|
|
9335
|
+
* Returns first result.
|
|
9336
|
+
*/
|
|
9337
|
+
first(opts?: RunOptions): Promise<T$1>;
|
|
9338
|
+
/**
|
|
9339
|
+
* Returns first result if there is one.
|
|
9340
|
+
*/
|
|
9341
|
+
firstOrUndefined(opts?: RunOptions): Promise<T$1 | undefined>;
|
|
9342
|
+
/**
|
|
9343
|
+
* Subscribes to changes in query results.
|
|
9344
|
+
*/
|
|
9345
|
+
subscribe(callback?: (query: QueryResult<T$1>) => void, opts?: SubscriptionOptions): CleanupFn;
|
|
9346
|
+
}
|
|
9347
|
+
//#endregion
|
|
9348
|
+
//#region ../echo/dist/types/src/SchemaRegistry.d.ts
|
|
9349
|
+
type Query$1 = {
|
|
9350
|
+
/**
|
|
9351
|
+
* Filter by schema ID.
|
|
9352
|
+
* Schema id is a DXN with `echo` or `type` kind.
|
|
9353
|
+
*/
|
|
9354
|
+
id?: string | string[];
|
|
9355
|
+
/**
|
|
9356
|
+
* Id of the backing ECHO object.
|
|
9357
|
+
*/
|
|
9358
|
+
backingObjectId?: ObjectId | ObjectId[];
|
|
9359
|
+
/**
|
|
9360
|
+
* One or more typenames to filter by.
|
|
9361
|
+
*/
|
|
9362
|
+
typename?: string | string[];
|
|
9363
|
+
/**
|
|
9364
|
+
* [Semver Range](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges) for the schema version.
|
|
9365
|
+
*/
|
|
9366
|
+
version?: string;
|
|
9367
|
+
/**
|
|
9368
|
+
* Where to look for the schema.
|
|
9369
|
+
*
|
|
9370
|
+
* Database schema are stored in the database of the current space.
|
|
9371
|
+
* Runtime schema are registered in the runtime.
|
|
9372
|
+
*
|
|
9373
|
+
* @default ['database']
|
|
9374
|
+
*/
|
|
9375
|
+
location?: ('database' | 'runtime')[];
|
|
9376
|
+
/**
|
|
9377
|
+
* Include system schemas.
|
|
9378
|
+
* @default false
|
|
9379
|
+
*
|
|
9380
|
+
* The system schema include but are not limited to:
|
|
9381
|
+
* - org.dxos.type.schema
|
|
9382
|
+
*/
|
|
9383
|
+
includeSystem?: boolean;
|
|
8571
9384
|
};
|
|
8572
9385
|
/**
|
|
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.
|
|
9386
|
+
* Input for schema registration.
|
|
9387
|
+
* The typename, version and schema mutability metadata is read from the schema annotations.
|
|
9388
|
+
*
|
|
9389
|
+
* Accepts:
|
|
9390
|
+
* - Branded ECHO schemas created with Type.Obj() or Type.Relation()
|
|
9391
|
+
* - JSON schema with typename and version
|
|
8594
9392
|
*/
|
|
8595
|
-
|
|
9393
|
+
type RegisterSchemaInput = AnyEntity$1 | {
|
|
9394
|
+
typename: string;
|
|
9395
|
+
version: string;
|
|
9396
|
+
jsonSchema: JsonSchema;
|
|
9397
|
+
/**
|
|
9398
|
+
* Display name of the schema.
|
|
9399
|
+
*/
|
|
9400
|
+
name?: string;
|
|
9401
|
+
};
|
|
9402
|
+
type ExtractQueryResult<Query$3> = Query$3 extends {
|
|
9403
|
+
location: ('database' | 'runtime')[];
|
|
9404
|
+
} ? AnyEntity$1 : RuntimeType;
|
|
9405
|
+
interface SchemaRegistry {
|
|
9406
|
+
/**
|
|
9407
|
+
* Checks if the provided schema is registered.
|
|
9408
|
+
*/
|
|
9409
|
+
hasSchema(schema: AnyEntity$1): boolean;
|
|
9410
|
+
/**
|
|
9411
|
+
* Registers the provided schema.
|
|
9412
|
+
*
|
|
9413
|
+
* @returns Mutable runtime instances of schemas that were registered.
|
|
9414
|
+
*
|
|
9415
|
+
* The behavior of this method depends on the state of the database.
|
|
9416
|
+
* The general principle is that the schema will be upserted into the space.
|
|
9417
|
+
* If an equivalent schema with the same name and version already exists, the method does nothing.
|
|
9418
|
+
* If a different schema with the same name and version exists, the method throws an error.
|
|
9419
|
+
* If no schema with the same name and version exists, a new schema will be inserted based on semantic versioning rules.
|
|
9420
|
+
*/
|
|
9421
|
+
register(input: RegisterSchemaInput[]): Promise<RuntimeType[]>;
|
|
9422
|
+
/**
|
|
9423
|
+
*
|
|
9424
|
+
*/
|
|
9425
|
+
query<Q extends NoExcessProperties<Query$1, Q>>(query?: Q & Query$1): QueryResult<ExtractQueryResult<Q>>;
|
|
9426
|
+
}
|
|
9427
|
+
//#endregion
|
|
9428
|
+
//#region ../echo/dist/types/src/Hypergraph.d.ts
|
|
8596
9429
|
/**
|
|
8597
|
-
*
|
|
9430
|
+
* Resolution context.
|
|
9431
|
+
* Affects how non-absolute DXNs are resolved.
|
|
8598
9432
|
*/
|
|
8599
|
-
|
|
9433
|
+
interface RefResolutionContext {
|
|
9434
|
+
/**
|
|
9435
|
+
* Space that the resolution is happening from.
|
|
9436
|
+
*/
|
|
9437
|
+
space?: SpaceId;
|
|
9438
|
+
/**
|
|
9439
|
+
* Queue that the resolution is happening from.
|
|
9440
|
+
* This queue will be searched first, and then the space it belongs to.
|
|
9441
|
+
*/
|
|
9442
|
+
queue?: DXN;
|
|
9443
|
+
}
|
|
9444
|
+
interface RefResolverOptions {
|
|
9445
|
+
/**
|
|
9446
|
+
* Resolution context.
|
|
9447
|
+
* Affects how non-absolute DXNs are resolved.
|
|
9448
|
+
*/
|
|
9449
|
+
context?: RefResolutionContext;
|
|
9450
|
+
/**
|
|
9451
|
+
* Middleware to change the resolved object before returning it.
|
|
9452
|
+
* @deprecated On track to be removed.
|
|
9453
|
+
*/
|
|
9454
|
+
middleware?: (obj: AnyProperties) => AnyProperties;
|
|
9455
|
+
}
|
|
8600
9456
|
/**
|
|
8601
|
-
*
|
|
9457
|
+
* Manages cross-space database interactions.
|
|
8602
9458
|
*/
|
|
8603
|
-
|
|
9459
|
+
interface Hypergraph extends Queryable {
|
|
9460
|
+
get schemaRegistry(): SchemaRegistry;
|
|
9461
|
+
/**
|
|
9462
|
+
* Query objects.
|
|
9463
|
+
*/
|
|
9464
|
+
query: QueryFn;
|
|
9465
|
+
/**
|
|
9466
|
+
* Creates a reference to an existing object in the database.
|
|
9467
|
+
*
|
|
9468
|
+
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9469
|
+
* NOTE: Difference from `Ref.fromDXN`
|
|
9470
|
+
* `Ref.fromDXN(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9471
|
+
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9472
|
+
*/
|
|
9473
|
+
makeRef<T$1 extends Unknown = Unknown>(dxn: DXN): Ref$1<T$1>;
|
|
9474
|
+
/**
|
|
9475
|
+
* @param hostDb Host database for reference resolution.
|
|
9476
|
+
* @param middleware Called with the loaded object. The caller may change the object.
|
|
9477
|
+
* @returns Result of `onLoad`.
|
|
9478
|
+
*/
|
|
9479
|
+
createRefResolver(options: RefResolverOptions): Resolver;
|
|
9480
|
+
/**
|
|
9481
|
+
* Get a database by space ID.
|
|
9482
|
+
* @returns The database for the given space ID, or undefined if not found.
|
|
9483
|
+
*/
|
|
9484
|
+
getDatabase(spaceId: SpaceId): Database | undefined;
|
|
9485
|
+
}
|
|
9486
|
+
//#endregion
|
|
9487
|
+
//#region ../echo/dist/types/src/Collection.d.ts
|
|
8604
9488
|
/**
|
|
8605
|
-
*
|
|
8606
|
-
* @param values - Values to check against.
|
|
9489
|
+
* A an ordered set of objects.
|
|
8607
9490
|
*/
|
|
8608
|
-
declare const
|
|
9491
|
+
declare const Collection: Obj$1<{
|
|
9492
|
+
readonly name?: string | undefined;
|
|
9493
|
+
readonly objects: readonly Ref<OfKind<EntityKind.Object> & Unknown$2>[];
|
|
9494
|
+
}, Struct.Fields>;
|
|
9495
|
+
interface Collection extends Schema.Type<typeof Collection> {}
|
|
9496
|
+
//#endregion
|
|
9497
|
+
//#region ../echo/dist/types/src/Feed.d.ts
|
|
8609
9498
|
/**
|
|
8610
|
-
*
|
|
8611
|
-
*
|
|
9499
|
+
* Runtime schema for a Feed object.
|
|
9500
|
+
*
|
|
9501
|
+
* @example
|
|
9502
|
+
* ```ts
|
|
9503
|
+
* const feed = Obj.make(Feed.Feed, { name: 'notifications', kind: 'org.dxos.plugin.notifications.v1' });
|
|
9504
|
+
* ```
|
|
8612
9505
|
*/
|
|
8613
|
-
declare const
|
|
9506
|
+
declare const Feed: Obj$1<{
|
|
9507
|
+
readonly kind?: string | undefined;
|
|
9508
|
+
readonly name?: string | undefined;
|
|
9509
|
+
readonly namespace?: "data" | "trace" | undefined;
|
|
9510
|
+
}, Struct.Fields>;
|
|
8614
9511
|
/**
|
|
8615
|
-
*
|
|
8616
|
-
* @param from - Start of the range (inclusive).
|
|
8617
|
-
* @param to - End of the range (exclusive).
|
|
9512
|
+
* TypeScript instance type for a Feed object.
|
|
8618
9513
|
*/
|
|
8619
|
-
|
|
9514
|
+
interface Feed extends Schema.Type<typeof Feed> {}
|
|
9515
|
+
//#endregion
|
|
9516
|
+
//#region ../echo/dist/types/src/View.d.ts
|
|
8620
9517
|
/**
|
|
8621
|
-
*
|
|
9518
|
+
* Views are generated or user-defined projections of a schema's properties.
|
|
9519
|
+
* They are used to configure the visual representation of the data.
|
|
8622
9520
|
*/
|
|
8623
|
-
declare const
|
|
9521
|
+
declare const ViewSchema: Obj$1<{
|
|
9522
|
+
readonly query: {
|
|
9523
|
+
readonly ast: QuerySelectClause | QueryFilterClause | QueryReferenceTraversalClause | QueryIncomingReferencesClause | QueryRelationClause | QueryRelationTraversalClause | QueryHierarchyTraversalClause | QueryUnionClause | QuerySetDifferenceClause | QueryOrderClause | QueryOptionsClause | QueryLimitClause | QueryFromClause;
|
|
9524
|
+
readonly raw?: string | undefined;
|
|
9525
|
+
};
|
|
9526
|
+
readonly projection: {
|
|
9527
|
+
readonly schema?: JsonSchemaType | undefined;
|
|
9528
|
+
readonly fields: readonly {
|
|
9529
|
+
readonly id: string;
|
|
9530
|
+
readonly path: JsonPath;
|
|
9531
|
+
readonly visible?: boolean | undefined;
|
|
9532
|
+
readonly referencePath?: JsonPath | undefined;
|
|
9533
|
+
}[];
|
|
9534
|
+
readonly pivotFieldId?: string | undefined;
|
|
9535
|
+
};
|
|
9536
|
+
}, Struct.Fields>;
|
|
9537
|
+
interface View extends Schema.Type<typeof ViewSchema> {}
|
|
8624
9538
|
/**
|
|
8625
|
-
*
|
|
9539
|
+
* View instance type.
|
|
8626
9540
|
*/
|
|
8627
|
-
declare const
|
|
9541
|
+
declare const View: Obj$1<View>;
|
|
9542
|
+
//#endregion
|
|
9543
|
+
//#region ../echo/dist/types/src/Dataset.d.ts
|
|
8628
9544
|
/**
|
|
8629
|
-
*
|
|
9545
|
+
* Abstart set of objects, represented by a view, feed, or collection.
|
|
8630
9546
|
*/
|
|
8631
|
-
declare const
|
|
9547
|
+
declare const Dataset: Union<[Obj$1<{
|
|
9548
|
+
readonly kind?: string | undefined;
|
|
9549
|
+
readonly name?: string | undefined;
|
|
9550
|
+
readonly namespace?: "data" | "trace" | undefined;
|
|
9551
|
+
}, Struct.Fields>, Obj$1<{
|
|
9552
|
+
readonly name?: string | undefined;
|
|
9553
|
+
readonly objects: readonly Ref<OfKind<EntityKind.Object> & Unknown$2>[];
|
|
9554
|
+
}, Struct.Fields>, Obj$1<View, Struct.Fields>]>;
|
|
9555
|
+
type Dataset = Feed | Collection | View;
|
|
8632
9556
|
declare namespace Order_d_exports {
|
|
8633
9557
|
export { Any$2 as Any, Order, natural, property, rank };
|
|
8634
9558
|
}
|
|
@@ -8647,7 +9571,7 @@ declare const property: <T$1>(property: keyof T$1 & string, direction: OrderDire
|
|
|
8647
9571
|
*/
|
|
8648
9572
|
declare const rank: <T$1>(direction?: OrderDirection) => Order<T$1>;
|
|
8649
9573
|
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 };
|
|
9574
|
+
export { Any$1 as Any, Query, Type$1 as Type, all, from, fromAst, is, pretty, select, type$1 as type, without };
|
|
8651
9575
|
}
|
|
8652
9576
|
/**
|
|
8653
9577
|
* All property paths inside T that are references.
|
|
@@ -8657,76 +9581,150 @@ interface Query<T$1> {
|
|
|
8657
9581
|
'~Query': {
|
|
8658
9582
|
value: T$1;
|
|
8659
9583
|
};
|
|
8660
|
-
ast: Query$
|
|
9584
|
+
ast: Query$2;
|
|
8661
9585
|
/**
|
|
8662
9586
|
* Filter the current selection based on a filter.
|
|
8663
9587
|
* @param filter - Filter to select the objects.
|
|
8664
9588
|
* @returns Query for the selected objects.
|
|
8665
9589
|
*/
|
|
8666
|
-
select(filter: Filter<T$1>): Query<T$1>;
|
|
8667
|
-
select(props: Props<T$1>): Query<T$1>;
|
|
9590
|
+
'select'(filter: Filter<T$1>): Query<T$1>;
|
|
9591
|
+
'select'(props: Props<T$1>): Query<T$1>;
|
|
8668
9592
|
/**
|
|
8669
9593
|
* Traverse an outgoing reference.
|
|
8670
9594
|
* @param key - Property path inside T that is a reference or optional reference.
|
|
8671
9595
|
* @returns Query for the target of the reference.
|
|
8672
9596
|
*/
|
|
8673
|
-
reference<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$1 ? Target
|
|
9597
|
+
'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
9598
|
/**
|
|
8675
9599
|
* Find objects referencing this object.
|
|
8676
9600
|
* @param target - Schema of the referencing object. If not provided, matches any type.
|
|
8677
9601
|
* @param key - Property path inside the referencing object that is a reference. If not provided, matches any property.
|
|
8678
9602
|
* @returns Query for the referencing objects.
|
|
8679
9603
|
*/
|
|
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>;
|
|
9604
|
+
'referencedBy'<S$1 extends Schema.All>(target: S$1 | string, key: RefPropKey<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9605
|
+
'referencedBy'<S$1 extends Schema.All>(target: S$1 | string): Query<Schema.Type<S$1>>;
|
|
9606
|
+
'referencedBy'(): Query<any>;
|
|
8683
9607
|
/**
|
|
8684
9608
|
* Find relations where this object is the source.
|
|
8685
9609
|
* @returns Query for the relation objects.
|
|
8686
9610
|
* @param relation - Schema of the relation.
|
|
8687
9611
|
* @param predicates - Predicates to filter the relation objects.
|
|
8688
9612
|
*/
|
|
8689
|
-
sourceOf<S$1 extends Schema.All>(relation
|
|
9613
|
+
'sourceOf'<S$1 extends Schema.All>(relation?: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
8690
9614
|
/**
|
|
8691
9615
|
* Find relations where this object is the target.
|
|
8692
9616
|
* @returns Query for the relation objects.
|
|
8693
9617
|
* @param relation - Schema of the relation.
|
|
8694
9618
|
* @param predicates - Predicates to filter the relation objects.
|
|
8695
9619
|
*/
|
|
8696
|
-
targetOf<S$1 extends Schema.All>(relation
|
|
9620
|
+
'targetOf'<S$1 extends Schema.All>(relation?: S$1 | string, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
8697
9621
|
/**
|
|
8698
9622
|
* For a query for relations, get the source objects.
|
|
8699
9623
|
* @returns Query for the source objects.
|
|
8700
9624
|
*/
|
|
8701
|
-
source(): Query<
|
|
9625
|
+
'source'(): Query<SourceOf<T$1>>;
|
|
8702
9626
|
/**
|
|
8703
9627
|
* For a query for relations, get the target objects.
|
|
8704
9628
|
* @returns Query for the target objects.
|
|
8705
9629
|
*/
|
|
8706
|
-
target(): Query<
|
|
9630
|
+
'target'(): Query<TargetOf<T$1>>;
|
|
9631
|
+
/**
|
|
9632
|
+
* Get the parent object of the current selection.
|
|
9633
|
+
* @returns Query for the parent objects.
|
|
9634
|
+
*/
|
|
9635
|
+
'parent'(): Query<any>;
|
|
9636
|
+
/**
|
|
9637
|
+
* Get all child objects of the current selection.
|
|
9638
|
+
* @returns Query for the child objects.
|
|
9639
|
+
*/
|
|
9640
|
+
'children'(): Query<any>;
|
|
8707
9641
|
/**
|
|
8708
9642
|
* Order the query results.
|
|
8709
9643
|
* Orders are specified in priority order. The first order will be applied first, etc.
|
|
8710
9644
|
* @param order - Order to sort the results.
|
|
8711
9645
|
* @returns Query for the ordered results.
|
|
8712
9646
|
*/
|
|
8713
|
-
orderBy(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
|
|
9647
|
+
'orderBy'(...order: NonEmptyArray<Order<T$1>>): Query<T$1>;
|
|
8714
9648
|
/**
|
|
8715
9649
|
* Limit the number of results.
|
|
8716
9650
|
* @param limit - Maximum number of results to return.
|
|
8717
9651
|
* @returns Query for the limited results.
|
|
8718
9652
|
*/
|
|
8719
|
-
limit(limit: number): Query<T$1>;
|
|
9653
|
+
'limit'(limit: number): Query<T$1>;
|
|
9654
|
+
/**
|
|
9655
|
+
* Query from selected databases only.
|
|
9656
|
+
*
|
|
9657
|
+
* Example:
|
|
9658
|
+
*
|
|
9659
|
+
* ```ts
|
|
9660
|
+
* Query.select(Filter.type(Person)).from(db);
|
|
9661
|
+
* ```
|
|
9662
|
+
*
|
|
9663
|
+
* @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
|
|
9664
|
+
*/
|
|
9665
|
+
'from'(database: Database | Database[], options?: {
|
|
9666
|
+
includeFeeds?: boolean;
|
|
9667
|
+
}): Query<T$1>;
|
|
9668
|
+
/**
|
|
9669
|
+
* Query from selected feeds only.
|
|
9670
|
+
*
|
|
9671
|
+
* Example:
|
|
9672
|
+
*
|
|
9673
|
+
* ```ts
|
|
9674
|
+
* Query.select(Filter.type(Person)).from(feed);
|
|
9675
|
+
* ```
|
|
9676
|
+
*
|
|
9677
|
+
*/
|
|
9678
|
+
'from'(feeds: Feed | Feed[]): Query<T$1>;
|
|
9679
|
+
/**
|
|
9680
|
+
* Query from all accessible spaces.
|
|
9681
|
+
*
|
|
9682
|
+
* Example:
|
|
9683
|
+
*
|
|
9684
|
+
* ```ts
|
|
9685
|
+
* Query.select(Filter.type(Person)).from('all-accessible-spaces');
|
|
9686
|
+
* ```
|
|
9687
|
+
*
|
|
9688
|
+
* @param options.includeFeeds [false] - Whether to include feeds in the query. Default is to query from automerge documents only.
|
|
9689
|
+
*/
|
|
9690
|
+
'from'(allSpaces: 'all-accessible-spaces', options?: {
|
|
9691
|
+
includeFeeds?: boolean;
|
|
9692
|
+
}): Query<T$1>;
|
|
9693
|
+
/**
|
|
9694
|
+
* Query from a dataset.
|
|
9695
|
+
* Currently only feeds are supported.
|
|
9696
|
+
*
|
|
9697
|
+
* Example:
|
|
9698
|
+
*
|
|
9699
|
+
* ```ts
|
|
9700
|
+
* Query.type(Person).from(feed);
|
|
9701
|
+
* ```
|
|
9702
|
+
*/
|
|
9703
|
+
'from'(dataset: Dataset): Query<T$1>;
|
|
9704
|
+
/**
|
|
9705
|
+
* Query from the results of another query.
|
|
9706
|
+
*
|
|
9707
|
+
* Example:
|
|
9708
|
+
*
|
|
9709
|
+
* ```ts
|
|
9710
|
+
* Query.select(Filter.props({ foo: 'foo' })).from(Query.select(Filter.type(Contact)).reference('org'));
|
|
9711
|
+
* ```
|
|
9712
|
+
*/
|
|
9713
|
+
'from'(query: Any$1): Query<T$1>;
|
|
9714
|
+
/**
|
|
9715
|
+
* Query from a raw scope specification.
|
|
9716
|
+
*/
|
|
9717
|
+
'from'(scope: Scope): Query<T$1>;
|
|
8720
9718
|
/**
|
|
8721
9719
|
* Add options to a query.
|
|
8722
9720
|
*/
|
|
8723
|
-
options(options: QueryOptions): Query<T$1>;
|
|
9721
|
+
'options'(options: QueryOptions): Query<T$1>;
|
|
8724
9722
|
}
|
|
8725
9723
|
type Any$1 = Query<any>;
|
|
8726
9724
|
type Type$1<Q extends Any$1> = Q extends Query<infer T> ? T : never;
|
|
8727
9725
|
declare const is: (value: unknown) => value is Any$1;
|
|
8728
9726
|
/** Construct a query from an ast. */
|
|
8729
|
-
declare const fromAst: (ast: Query$
|
|
9727
|
+
declare const fromAst: (ast: Query$2) => Any$1;
|
|
8730
9728
|
/**
|
|
8731
9729
|
* Select objects based on a filter.
|
|
8732
9730
|
* @param filter - Filter to select the objects.
|
|
@@ -8741,7 +9739,10 @@ declare const select: <F extends Any$3>(filter: F) => Query<Type$2<F>>;
|
|
|
8741
9739
|
*
|
|
8742
9740
|
* Shorthand for: `Query.select(Filter.type(schema, predicates))`.
|
|
8743
9741
|
*/
|
|
8744
|
-
declare const type$1:
|
|
9742
|
+
declare const type$1: {
|
|
9743
|
+
<S$1 extends Schema.All>(schema: S$1, predicates?: Props<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9744
|
+
(schema: string, predicates?: Props<unknown>): Query<any>;
|
|
9745
|
+
};
|
|
8745
9746
|
/**
|
|
8746
9747
|
* Combine results of multiple queries.
|
|
8747
9748
|
* @param queries - Queries to combine.
|
|
@@ -8755,6 +9756,195 @@ declare const all: (...queries: Any$1[]) => Any$1;
|
|
|
8755
9756
|
* @returns Query for the results of the source query minus the results of the exclude query.
|
|
8756
9757
|
*/
|
|
8757
9758
|
declare const without: <T$1>(source: Query<T$1>, exclude: Query<T$1>) => Query<T$1>;
|
|
9759
|
+
/**
|
|
9760
|
+
* Create a query scoped to a data source.
|
|
9761
|
+
* The returned query selects everything from the source; chain `.select()` to narrow results.
|
|
9762
|
+
*
|
|
9763
|
+
* @param source - Data source: database, feed, 'all-accessible-spaces', or another query.
|
|
9764
|
+
* @returns Query scoped to the given source.
|
|
9765
|
+
*/
|
|
9766
|
+
declare const from: (source: Database | Database[] | Feed | Feed[] | Any$1 | Scope | "all-accessible-spaces", options?: {
|
|
9767
|
+
includeFeeds?: boolean;
|
|
9768
|
+
}) => Any$1;
|
|
9769
|
+
/**
|
|
9770
|
+
* Returns a human-readable string representation of a Query AST.
|
|
9771
|
+
*/
|
|
9772
|
+
declare const pretty: (query: Any$1) => string;
|
|
9773
|
+
//#endregion
|
|
9774
|
+
//#region ../echo/dist/types/src/Database.d.ts
|
|
9775
|
+
/**
|
|
9776
|
+
* `query` API function declaration.
|
|
9777
|
+
*/
|
|
9778
|
+
interface QueryFn {
|
|
9779
|
+
<Q extends Any$1>(query: Q): QueryResult<Type$1<Q>>;
|
|
9780
|
+
<F extends Any$3>(filter: F): QueryResult<Type$2<F>>;
|
|
9781
|
+
}
|
|
9782
|
+
/**
|
|
9783
|
+
* Common interface for Database and Queue.
|
|
9784
|
+
*/
|
|
9785
|
+
interface Queryable {
|
|
9786
|
+
query: QueryFn;
|
|
9787
|
+
}
|
|
9788
|
+
type GetObjectByIdOptions = {
|
|
9789
|
+
deleted?: boolean;
|
|
9790
|
+
};
|
|
9791
|
+
type ObjectPlacement = 'root-doc' | 'linked-doc';
|
|
9792
|
+
type AddOptions = {
|
|
9793
|
+
/**
|
|
9794
|
+
* Where to place the object in the Automerge document tree.
|
|
9795
|
+
* Root document is always loaded with the space.
|
|
9796
|
+
* Linked documents are loaded lazily.
|
|
9797
|
+
* Placing large number of objects in the root document may slow down the initial load.
|
|
9798
|
+
*
|
|
9799
|
+
* @default 'linked-doc'
|
|
9800
|
+
*/
|
|
9801
|
+
placeIn?: ObjectPlacement;
|
|
9802
|
+
};
|
|
9803
|
+
type FlushOptions = {
|
|
9804
|
+
/**
|
|
9805
|
+
* Write any pending changes to disk.
|
|
9806
|
+
* @default true
|
|
9807
|
+
*/
|
|
9808
|
+
disk?: boolean;
|
|
9809
|
+
/**
|
|
9810
|
+
* Wait for pending index updates.
|
|
9811
|
+
* @default true
|
|
9812
|
+
*/
|
|
9813
|
+
indexes?: boolean;
|
|
9814
|
+
/**
|
|
9815
|
+
* Flush pending updates to objects and queries.
|
|
9816
|
+
* @default false
|
|
9817
|
+
*/
|
|
9818
|
+
updates?: boolean;
|
|
9819
|
+
};
|
|
9820
|
+
/**
|
|
9821
|
+
* Identifier denoting an ECHO Database.
|
|
9822
|
+
*/
|
|
9823
|
+
declare const TypeId: unique symbol;
|
|
9824
|
+
type TypeId = typeof TypeId;
|
|
9825
|
+
/**
|
|
9826
|
+
* ECHO Database interface.
|
|
9827
|
+
*/
|
|
9828
|
+
interface Database extends Queryable {
|
|
9829
|
+
readonly [TypeId]: TypeId;
|
|
9830
|
+
get spaceId(): SpaceId;
|
|
9831
|
+
get schemaRegistry(): SchemaRegistry;
|
|
9832
|
+
get graph(): Hypergraph;
|
|
9833
|
+
toJSON(): object;
|
|
9834
|
+
/**
|
|
9835
|
+
* Return object by local ID.
|
|
9836
|
+
*/
|
|
9837
|
+
getObjectById<T$1 extends Unknown$2 = OfShape<AnyProperties>>(id: string, opts?: GetObjectByIdOptions): T$1 | undefined;
|
|
9838
|
+
/**
|
|
9839
|
+
* Query objects.
|
|
9840
|
+
*/
|
|
9841
|
+
query: QueryFn;
|
|
9842
|
+
/**
|
|
9843
|
+
* Creates a reference to an existing object in the database.
|
|
9844
|
+
*
|
|
9845
|
+
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9846
|
+
* NOTE: Difference from `Ref.fromDXN`
|
|
9847
|
+
* `Ref.fromDXN(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9848
|
+
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9849
|
+
*/
|
|
9850
|
+
makeRef<T$1 extends Unknown = Unknown>(dxn: DXN): Ref<T$1>;
|
|
9851
|
+
/**
|
|
9852
|
+
* Adds object to the database.
|
|
9853
|
+
*/
|
|
9854
|
+
add<T$1 extends Unknown = Unknown>(obj: T$1, opts?: AddOptions): T$1;
|
|
9855
|
+
/**
|
|
9856
|
+
* Removes object from the database.
|
|
9857
|
+
*/
|
|
9858
|
+
remove(obj: Unknown): void;
|
|
9859
|
+
/**
|
|
9860
|
+
* Wait for all pending changes to be saved to disk.
|
|
9861
|
+
* Optionaly waits for changes to be propagated to indexes and event handlers.
|
|
9862
|
+
*/
|
|
9863
|
+
flush(opts?: FlushOptions): Promise<void>;
|
|
9864
|
+
}
|
|
9865
|
+
declare const Database: Schema<Database>;
|
|
9866
|
+
//#endregion
|
|
9867
|
+
//#region ../echo/dist/types/src/internal/Entity/object.d.ts
|
|
9868
|
+
/**
|
|
9869
|
+
* Object schema type with kind marker.
|
|
9870
|
+
*/
|
|
9871
|
+
type EchoObjectSchema<Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields> = EchoTypeSchema<Self, {}, EntityKind.Object, Fields>;
|
|
9872
|
+
/**
|
|
9873
|
+
* Schema for Obj entity types.
|
|
9874
|
+
* Pipeable function to add ECHO object annotations to a schema.
|
|
9875
|
+
*/
|
|
9876
|
+
declare const EchoObjectSchema: {
|
|
9877
|
+
(meta: TypeMeta): <Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields>(self: Self & {
|
|
9878
|
+
fields?: Fields;
|
|
9879
|
+
}) => EchoObjectSchema<Self, Fields>;
|
|
9880
|
+
};
|
|
9881
|
+
//#endregion
|
|
9882
|
+
//#region ../echo/dist/types/src/Entity.d.ts
|
|
9883
|
+
declare const KindId$1: "~@dxos/echo/Kind";
|
|
9884
|
+
type KindId$1 = typeof KindId;
|
|
9885
|
+
declare const Kind: typeof EntityKind;
|
|
9886
|
+
type Kind = EntityKind;
|
|
9887
|
+
/**
|
|
9888
|
+
* Assigns a kind to an Object or Relation instance.
|
|
9889
|
+
* NOTE: Needed to make `isRelation` and `isObject` checks work.
|
|
9890
|
+
*/
|
|
9891
|
+
interface OfKind<K$1 extends Kind> {
|
|
9892
|
+
readonly [KindId$1]: K$1;
|
|
9893
|
+
readonly id: ObjectId;
|
|
9894
|
+
}
|
|
9895
|
+
/**
|
|
9896
|
+
* Unknown Obj or Relation (reactive).
|
|
9897
|
+
*/
|
|
9898
|
+
interface Unknown extends OfKind<Kind> {}
|
|
9899
|
+
//#endregion
|
|
9900
|
+
//#region ../echo/dist/types/src/internal/common/types/base.d.ts
|
|
9901
|
+
/**
|
|
9902
|
+
* Base type for all data objects (reactive, ECHO, and other raw objects).
|
|
9903
|
+
* NOTE: This describes the base type for all database objects.
|
|
9904
|
+
* It is stricter than `T extends {}` or `T extends object`.
|
|
9905
|
+
*/
|
|
9906
|
+
type AnyProperties = Record<string, any>;
|
|
9907
|
+
/**
|
|
9908
|
+
* Canonical type for all ECHO entities (objects and relations).
|
|
9909
|
+
* @depreacted Remove, use Entity.Unknown instead.
|
|
9910
|
+
*/
|
|
9911
|
+
interface AnyEntity {
|
|
9912
|
+
readonly id: ObjectId;
|
|
9913
|
+
}
|
|
9914
|
+
//#endregion
|
|
9915
|
+
//#region ../echo/dist/types/src/internal/common/types/entity.d.ts
|
|
9916
|
+
/**
|
|
9917
|
+
* String key used to identify the kind of an entity instance (object or relation).
|
|
9918
|
+
*/
|
|
9919
|
+
declare const KindId: "~@dxos/echo/Kind";
|
|
9920
|
+
type KindId = typeof KindId;
|
|
9921
|
+
/**
|
|
9922
|
+
* String key used to identify the kind of a schema (object schema or relation schema).
|
|
9923
|
+
* Parallels KindId which identifies instance kinds.
|
|
9924
|
+
*/
|
|
9925
|
+
declare const SchemaKindId: "~@dxos/echo/SchemaKind";
|
|
9926
|
+
type SchemaKindId = typeof SchemaKindId;
|
|
9927
|
+
/**
|
|
9928
|
+
* Kinds of entities stored in ECHO: objects and relations.
|
|
9929
|
+
*/
|
|
9930
|
+
declare enum EntityKind {
|
|
9931
|
+
Object = "object",
|
|
9932
|
+
Relation = "relation",
|
|
9933
|
+
}
|
|
9934
|
+
//#endregion
|
|
9935
|
+
//#region ../echo/dist/types/src/internal/Annotation/annotations.d.ts
|
|
9936
|
+
declare const TypeMeta: Struct<{
|
|
9937
|
+
typename: refine<string, typeof String$>;
|
|
9938
|
+
version: refine<string, typeof String$>;
|
|
9939
|
+
}>;
|
|
9940
|
+
interface TypeMeta extends Schema.Type<typeof TypeMeta> {}
|
|
9941
|
+
/**
|
|
9942
|
+
* SchemaMeta.
|
|
9943
|
+
*/
|
|
9944
|
+
declare const SchemaMetaSymbol: unique symbol;
|
|
9945
|
+
type SchemaMeta = TypeMeta & {
|
|
9946
|
+
id: string;
|
|
9947
|
+
};
|
|
8758
9948
|
//#endregion
|
|
8759
9949
|
//#region src/query-lite/query-lite.d.ts
|
|
8760
9950
|
declare const Order2: typeof Order_d_exports;
|