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