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