@omegup/msync 0.0.5 → 0.0.6
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/index.d.ts +3 -2
- package/index.esm.js +4 -1
- package/index.js +4 -0
- package/package.json +1 -1
- package/lib/accumulators/index.d.ts +0 -10
- package/lib/aggregate/$merge.d.ts +0 -8
- package/lib/aggregate/$upsert.d.ts +0 -9
- package/lib/aggregate/group/$group-merge.d.ts +0 -12
- package/lib/aggregate/group/index.d.ts +0 -2
- package/lib/aggregate/group/utils/sub-group.d.ts +0 -6
- package/lib/aggregate/group/utils/sub-merge.d.ts +0 -15
- package/lib/aggregate/index.d.ts +0 -8
- package/lib/aggregate/lookup/$lookup-delta.d.ts +0 -10
- package/lib/aggregate/lookup/$lookup-raw.d.ts +0 -9
- package/lib/aggregate/lookup/index.d.ts +0 -11
- package/lib/aggregate/match/$match-delta.d.ts +0 -3
- package/lib/aggregate/match/$match.d.ts +0 -3
- package/lib/aggregate/match/index.d.ts +0 -2
- package/lib/aggregate/mongo-stages.d.ts +0 -13
- package/lib/aggregate/out.d.ts +0 -34
- package/lib/aggregate/prefix.d.ts +0 -33
- package/lib/aggregate/raws.d.ts +0 -17
- package/lib/aggregate/set/$replace-with-each.d.ts +0 -12
- package/lib/aggregate/set/$set-delta.d.ts +0 -5
- package/lib/aggregate/set/$set.d.ts +0 -6
- package/lib/aggregate/set/index.d.ts +0 -1
- package/lib/aggregate/unwind/$unwind-delta.d.ts +0 -5
- package/lib/aggregate/unwind/index.d.ts +0 -5
- package/lib/boot/boot-simpl.d.ts +0 -14
- package/lib/boot/boot.d.ts +0 -16
- package/lib/boot/index.d.ts +0 -2
- package/lib/expression/arith.d.ts +0 -26
- package/lib/expression/array.d.ts +0 -25
- package/lib/expression/concat.d.ts +0 -30
- package/lib/expression/date.d.ts +0 -16
- package/lib/expression/expr-base.d.ts +0 -5
- package/lib/expression/index.d.ts +0 -7
- package/lib/expression/logic.d.ts +0 -21
- package/lib/expression/range.d.ts +0 -6
- package/lib/expression/val.d.ts +0 -25
- package/lib/field/field.d.ts +0 -25
- package/lib/field/index.d.ts +0 -1
- package/lib/machine.d.ts +0 -9
- package/lib/predicate/$eq.d.ts +0 -13
- package/lib/predicate/$expr.d.ts +0 -3
- package/lib/predicate/$in.d.ts +0 -2
- package/lib/predicate/index.d.ts +0 -3
- package/lib/predicate/utils.d.ts +0 -5
- package/lib/query/index.d.ts +0 -1
- package/lib/query/logic.d.ts +0 -11
- package/lib/stream/aggregate.d.ts +0 -7
- package/lib/types/accumulator.d.ts +0 -30
- package/lib/types/aggregate.d.ts +0 -9
- package/lib/types/expr.d.ts +0 -27
- package/lib/types/extern.d.ts +0 -3
- package/lib/types/index.d.ts +0 -8
- package/lib/types/lookup.d.ts +0 -19
- package/lib/types/machine.d.ts +0 -17
- package/lib/types/predicate.d.ts +0 -14
- package/lib/types/query.d.ts +0 -12
- package/lib/types/stream.d.ts +0 -55
- package/lib/update/index.d.ts +0 -1
- package/lib/update/updater.d.ts +0 -19
- package/lib/utils/before.d.ts +0 -3
- package/lib/utils/coll.d.ts +0 -5
- package/lib/utils/db-indexes.d.ts +0 -4
- package/lib/utils/guard.d.ts +0 -18
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/json.d.ts +0 -9
- package/lib/utils/log.d.ts +0 -1
- package/lib/utils/map-object.d.ts +0 -41
- package/lib/utils/merge/combiners.d.ts +0 -6
- package/lib/utils/merge/index.d.ts +0 -2
- package/lib/utils/merge/merge.d.ts +0 -7
- package/lib/utils/merge/next-winner.d.ts +0 -3
- package/lib/utils/merge/types.d.ts +0 -19
- package/lib/utils/merge/utils.d.ts +0 -4
- package/lib/utils/tear-down.d.ts +0 -2
- package/lib/watch.d.ts +0 -15
- package/test/mongodb.d.ts +0 -9
- package/test/uri.d.ts +0 -1
- package/types/class.d.ts +0 -1
- package/types/extern.d.ts +0 -3
- package/types/global.d.ts +0 -44
- package/types/hkt.d.ts +0 -56
- package/types/index.d.ts +0 -6
- package/types/json.d.ts +0 -54
- package/types/mongo.d.ts +0 -24
- package/types/view.d.ts +0 -35
package/index.d.ts
CHANGED
|
@@ -570,7 +570,8 @@ declare const ite: {
|
|
|
570
570
|
<T, D, C = unknown>(cond: Expr<unknown, D, C>, then: Expr<T, D, C>, orelse: Expr<T, D, C>): Expr<T, D, C>;
|
|
571
571
|
<T, R1, R2, F extends HKT<R1 | R2>, C = unknown>(cond: BoolExpr<App<F, R1>, App<F, R2>, C>, then: Expr<T, App<F, R1>, C>, orelse: Expr<T, App<F, R2>, C>): Expr<T, App<F, R1 | R2>, C>;
|
|
572
572
|
};
|
|
573
|
-
declare const and: <D, C = unknown>(
|
|
573
|
+
declare const and: <D, C = unknown>(...expr: Expr<boolean, D, C>[]) => Expr<boolean, D, C>;
|
|
574
|
+
declare const or: <D, C = unknown>(...expr: Expr<boolean, D, C>[]) => Expr<boolean, D, C>;
|
|
574
575
|
declare const eq: <T, D, C = unknown>(a: Expr<T, D, C>) => (b: Expr<T, D, C>) => Expr<boolean, D, C>;
|
|
575
576
|
declare const sub: <T, D, Ctx, P extends O>(a: Expr<T, D, Ctx>, f: Field<P, D, Ctx>) => Expr<T, P, Ctx>;
|
|
576
577
|
declare const eqTyped: <T1 extends Dom, T2 extends Dom, F extends HKT<Dom>, C = unknown, Dom = unknown>(a: Expr<T1 | T2, App<F, T1 | T2>, C>, b: Expr<T1, App<F, T1 | T2>, C>) => BoolExpr<App<F, T1>, App<F, T2>, C>;
|
|
@@ -639,4 +640,4 @@ declare const enablePreAndPostImages: <T extends doc>(coll: Collection<T>) => Pr
|
|
|
639
640
|
declare const prepare: (testName?: string) => Promise<MongoClient$1>;
|
|
640
641
|
declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
|
|
641
642
|
|
|
642
|
-
export { $accumulator, $and, $countDict, $entries, $eq, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $pushDict, $rand, $replaceWith, $set, $sum, $unwind, $unwindDelta, $upsert, type Accumulators, type Arr, type AsLiteral, type Delta, type DeltaAccumulator, type DeltaAccumulators, Expr, type ExprHKT, type Exprs, type ExprsExact, type ExprsExactHKT, type ExprsPart, Field, type ID, type Loose, Machine, type Merge, type MergeArgs, type MergeInto, type MergeMapOArgs, type Model, type N, type NoRaw, type O, type OPick, type OPickD, type RONoRaw, type RORec, type RawStages, type Rec, type Replace, type SnapshotStreamExecutionResult, type StrKey, type Strict, type TS, Type, type WriteonlyCollection, add, and, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, type doc, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, func, gt, gte, inArray, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, type notArr, notNull, now, pair, prepare, rand, range, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap };
|
|
643
|
+
export { $accumulator, $and, $countDict, $entries, $eq, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $pushDict, $rand, $replaceWith, $set, $sum, $unwind, $unwindDelta, $upsert, type Accumulators, type Arr, type AsLiteral, type Delta, type DeltaAccumulator, type DeltaAccumulators, Expr, type ExprHKT, type Exprs, type ExprsExact, type ExprsExactHKT, type ExprsPart, Field, type ID, type Loose, Machine, type Merge, type MergeArgs, type MergeInto, type MergeMapOArgs, type Model, type N, type NoRaw, type O, type OPick, type OPickD, type RONoRaw, type RORec, type RawStages, type Rec, type Replace, type SnapshotStreamExecutionResult, type StrKey, type Strict, type TS, Type, type WriteonlyCollection, add, and, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, type doc, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, func, gt, gte, inArray, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, type notArr, notNull, now, or, pair, prepare, rand, range, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap };
|
package/index.esm.js
CHANGED
|
@@ -129,6 +129,9 @@ const ite = ((cond, then, orelse) => asExpr({
|
|
|
129
129
|
const and = (...expr) => asExpr({
|
|
130
130
|
raw: f => asExprRaw({ $and: expr.map(e => e.raw(f).get()) }),
|
|
131
131
|
});
|
|
132
|
+
const or = (...expr) => asExpr({
|
|
133
|
+
raw: f => asExprRaw({ $or: expr.map(e => e.raw(f).get()) }),
|
|
134
|
+
});
|
|
132
135
|
const eq = (a) => (b) => asExpr({
|
|
133
136
|
raw: f => asExprRaw({ $eq: [a.raw(f).get(), b.raw(f).get()] }),
|
|
134
137
|
});
|
|
@@ -1612,4 +1615,4 @@ const makeCol = async (docs, database, name) => {
|
|
|
1612
1615
|
}
|
|
1613
1616
|
};
|
|
1614
1617
|
|
|
1615
|
-
export { $accumulator, $and, $countDict, $entries, $eq, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $pushDict, $rand, $replaceWith, $set, $sum, $unwind, $unwindDelta, $upsert, Field, Machine, add, and, array, ceil, comp, concat$1 as concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first$1 as first, firstSure, floor, from, func, gt, gte, inArray, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, notNull, now, pair, prepare, rand, range, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap };
|
|
1618
|
+
export { $accumulator, $and, $countDict, $entries, $eq, $expr, $getField, $group, $groupId, $groupMerge, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $keys, $let, $lookup, $lt, $lte, $map, $map1, $match, $matchDelta, $merge, $merge_, $ne, $nin, $nor, $or, $pushDict, $rand, $replaceWith, $set, $sum, $unwind, $unwindDelta, $upsert, Field, Machine, add, and, array, ceil, comp, concat$1 as concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, enablePreAndPostImages, eq, eqTyped, except, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first$1 as first, firstSure, floor, from, func, gt, gte, inArray, isArray, ite, last, log, lt, lte, makeCol, map1, mapVal, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, notNull, now, or, pair, prepare, rand, range, root, set, setField, size, slice, sortArray, staging, startOf, str, sub, subtract, to, toInt, val, weekPart, wrap };
|
package/index.js
CHANGED
|
@@ -131,6 +131,9 @@ const ite = ((cond, then, orelse) => asExpr({
|
|
|
131
131
|
const and = (...expr) => asExpr({
|
|
132
132
|
raw: f => asExprRaw({ $and: expr.map(e => e.raw(f).get()) }),
|
|
133
133
|
});
|
|
134
|
+
const or = (...expr) => asExpr({
|
|
135
|
+
raw: f => asExprRaw({ $or: expr.map(e => e.raw(f).get()) }),
|
|
136
|
+
});
|
|
134
137
|
const eq = (a) => (b) => asExpr({
|
|
135
138
|
raw: f => asExprRaw({ $eq: [a.raw(f).get(), b.raw(f).get()] }),
|
|
136
139
|
});
|
|
@@ -1712,6 +1715,7 @@ exports.nil = nil;
|
|
|
1712
1715
|
exports.noop = noop;
|
|
1713
1716
|
exports.notNull = notNull;
|
|
1714
1717
|
exports.now = now;
|
|
1718
|
+
exports.or = or;
|
|
1715
1719
|
exports.pair = pair;
|
|
1716
1720
|
exports.prepare = prepare;
|
|
1717
1721
|
exports.rand = rand;
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AppMap, Arr, N, O, Rec } from '../../types';
|
|
2
|
-
import type { ExprHKT } from '../expression/concat';
|
|
3
|
-
import { type NoRaw } from '../expression/val';
|
|
4
|
-
import type { DeltaAccumulator, Expr, Part } from '../types';
|
|
5
|
-
export declare const $sum: <D extends O, C = unknown>(expr: Expr<number | N, D, C>) => DeltaAccumulator<D, number, C>;
|
|
6
|
-
export declare const $accumulator: <D, T, Ctx, A extends readonly unknown[]>(init: () => NoRaw<T>, accumulateArgs: AppMap<ExprHKT<Part<D>, Ctx>, A>, accumulate: (a: NoRaw<T>, ...args: NoRaw<A>) => NoRaw<T>, merge: (...args: NoRaw<[T | N, T]>) => NoRaw<T>) => DeltaAccumulator<D, T, Ctx>;
|
|
7
|
-
export declare const $countDict: <D extends O, C = unknown>(expr: Expr<string, D, C>) => DeltaAccumulator<D, Rec<string, number>, C>;
|
|
8
|
-
export declare const $pushDict: <D extends O, V, C = unknown>(key: Expr<string, D, C>, value: Expr<V, D, C>) => DeltaAccumulator<D, Rec<string, Rec<"0" | "1", Arr<V>>>, C>;
|
|
9
|
-
export declare const $keys: <D extends O, C = unknown>(expr: Expr<Rec<string, number>, D, C>) => Expr<Arr<string>, D, C>;
|
|
10
|
-
export declare const $entries: <D extends O, V, C = unknown>(expr: Expr<Rec<string, Rec<"1" | "0", Arr<V>>>, D, C>) => Expr<Arr<Rec<"k", string> & Rec<"v", V>>, D, C>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OPick, RWCollection } from '../../types';
|
|
2
|
-
import type { ID, N, Rec, Replace, StrKey, doc } from '../../types/json';
|
|
3
|
-
import type { Model, OutInput, RawStages, TS } from '../types';
|
|
4
|
-
import { type ExactKeys } from '../utils/map-object';
|
|
5
|
-
type Allowed<K extends string> = Exclude<K, keyof (TS & ID)>;
|
|
6
|
-
type Patch<V, KK extends StrKey<V>> = ((OPick<V, Allowed<KK>> & ID) | (Rec<Allowed<KK>, N> & ID)) & TS;
|
|
7
|
-
export declare const $merge: <V extends Model & ID>() => <KK extends StrKey<V>, Out extends doc>(out: RWCollection<Out | Replace<Out, Patch<V, KK>>, Out>, keys: ExactKeys<Allowed<KK>>) => RawStages<unknown, OutInput<OPick<V, Allowed<KK>> & ID>, "out">;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RWCollection } from '../../types';
|
|
2
|
-
import type { ID, doc } from '../../types/json';
|
|
3
|
-
import type { Del, OutInput, RawStages, TS } from '../types';
|
|
4
|
-
type ND = {
|
|
5
|
-
readonly deletedAt?: null;
|
|
6
|
-
};
|
|
7
|
-
export type Merge<T extends ID> = (T & ND & TS) | Del;
|
|
8
|
-
export declare const $upsert: <T extends doc>(out: RWCollection<Merge<T>>) => RawStages<unknown, OutInput<T>, "out">;
|
|
9
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RWCollection, WriteonlyCollection } from '../../../types';
|
|
2
|
-
import type { AsLiteral, ID, O, Rec, Replace, doc, notArr } from '../../../types/json';
|
|
3
|
-
import { type ExprsExact } from '../../expression/concat';
|
|
4
|
-
import type { Delta, DeltaAccumulators, Expr, RawStages, TS } from '../../types';
|
|
5
|
-
import type { MergeInto } from '../out';
|
|
6
|
-
import { type Extra, type IdAndTsKeys, type Loose, type Strict, type V_Grp } from './utils/sub-merge';
|
|
7
|
-
type Denied<GID = never> = keyof (TS & ID) | GID;
|
|
8
|
-
type GI<GG> = Exclude<GG, keyof TS>;
|
|
9
|
-
export declare const $groupMerge: <T extends O, Grp extends notArr, V extends O, GG extends string, EE = {}, Out extends Loose<Grp, V, GG> = Loose<Grp, V, GG>>(id: Expr<Grp, T>, args: DeltaAccumulators<T, O & Omit<V, Denied<GI<GG>>>>, out: MergeInto<Strict<Grp, V, GG, EE>, Out, WriteonlyCollection<Replace<Out, Strict<Grp, V, GG, EE>>>>, gid: AsLiteral<GI<GG>>, extra: ExprsExact<Extra<EE, V, GG>, V_Grp<V, GG, Grp>>, idPrefix?: string) => RawStages<unknown, Delta<T>, "out">;
|
|
10
|
-
export declare const $groupId: <T extends O, V extends O, EE = {}, Out extends Loose<string, V, "_id"> = Loose<string, V, "_id">>(id: Expr<string, T>, args: DeltaAccumulators<T, O & Omit<V, Denied>>, out: RWCollection<Replace<Out, Strict<string, V, "_id", EE>>, Out>, extra: ExprsExact<Omit<EE, IdAndTsKeys | keyof Omit<V, IdAndTsKeys>>, doc & Omit<V, IdAndTsKeys>>) => RawStages<unknown, Delta<T>, "out">;
|
|
11
|
-
export declare const $group: <T extends O, Grp extends notArr, V extends O, EE = {}, Out extends Loose<Grp, V, "_grp"> = Loose<Grp, V, "_grp">>(id: Expr<Grp, T>, args: DeltaAccumulators<T, O & Omit<V, Denied<"_grp">>>, out: RWCollection<Strict<Grp, V, "_grp", EE>, Out>, extra: ExprsExact<Omit<EE, IdAndTsKeys | "_grp" | keyof Omit<V, IdAndTsKeys | "_grp">>, Rec<"_grp", Grp> & Omit<V, IdAndTsKeys | "_grp">>, idPrefix?: string) => RawStages<unknown, Delta<T>, "out">;
|
|
12
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { O, RORec, Rec } from '../../../../types';
|
|
2
|
-
import { type ExprsExact } from '../../../expression/concat';
|
|
3
|
-
import type { Delta, Expr, RawStages } from '../../../types';
|
|
4
|
-
import type { DeltaAccumulators } from '../../../types/accumulator';
|
|
5
|
-
export type WithItem<V, Grp> = Rec<'_id', Grp> & Rec<'item', O<V>>;
|
|
6
|
-
export declare const subGroup: <T extends O, Grp, V extends O, GID extends string>(id: Expr<Grp, T>, args: DeltaAccumulators<T, V>, addGrp: <D extends Rec<"_id", Grp>>(src: ExprsExact<V, D>) => ExprsExact<RORec<GID, Grp> & V, D>) => RawStages<unknown, Delta<T>, Rec<GID, Grp> & V>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AsLiteral, ID, O, Rec, Replace, WriteonlyCollection, notArr } from '../../../../types';
|
|
2
|
-
import { type ExprsExact } from '../../../expression/concat';
|
|
3
|
-
import type { RawStages, TS } from '../../../types';
|
|
4
|
-
import type { DeltaAccumulators } from '../../../types/accumulator';
|
|
5
|
-
import { type MergeInto } from '../../out';
|
|
6
|
-
type GI<GG> = Exclude<GG, keyof TS>;
|
|
7
|
-
export type IdAndTsKeys = keyof (TS & ID);
|
|
8
|
-
type V<VV, GG extends string> = Omit<VV, IdAndTsKeys | GI<GG>>;
|
|
9
|
-
export type Prepare<Grp, GG extends string> = TS & ID & Rec<GI<GG>, Grp>;
|
|
10
|
-
export type Loose<Grp, VV, GG extends string> = Prepare<Grp, GG> & Partial<V<VV, GG>>;
|
|
11
|
-
export type Strict<Grp, VV, GG extends string, EE> = Prepare<Grp, GG> & V<VV, GG> & Omit<EE, IdAndTsKeys | GI<GG> | keyof V<VV, GG>>;
|
|
12
|
-
export type V_Grp<VV, GG extends string, Grp> = Rec<GI<GG>, Grp> & V<VV, GG>;
|
|
13
|
-
export type Extra<EE, VV, GG extends string> = Omit<EE, IdAndTsKeys | GI<GG> | keyof V<VV, GG>>;
|
|
14
|
-
export declare const subMerge: <T extends O, Grp extends notArr, VV extends O, GG extends string, EE = {}, Out extends Loose<Grp, VV, GG> = Loose<Grp, VV, GG>>(args: DeltaAccumulators<T, V<VV, GG>>, out: MergeInto<Strict<Grp, VV, GG, EE>, Out, WriteonlyCollection<Replace<Out, Strict<Grp, VV, GG, EE>>>>, gid: AsLiteral<GI<GG>>, extra: ExprsExact<Extra<EE, VV, GG>, V_Grp<VV, GG, Grp>>, idPrefix: string) => RawStages<unknown, V_Grp<VV, GG, Grp>, "out">;
|
|
15
|
-
export {};
|
package/lib/aggregate/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AsLiteral, ID, N, O, Rec } from '../../../types';
|
|
2
|
-
import { Field } from '../../field';
|
|
3
|
-
import type { BA, Before, Delta, RawStages, TStages, UBefore } from '../../types';
|
|
4
|
-
type s = string;
|
|
5
|
-
type Both<K1 extends s, LE, KK2 extends s, RE> = Delta<Rec<K1, LE> & Rec<Exclude<KK2, BA | K1>, RE> & ID>;
|
|
6
|
-
export declare const $lookupDelta: <LQ extends O, LE extends LQ & O, RQ extends O, RE extends RQ, BRB extends UBefore<RQ>, RS extends UBefore<RQ>, S, K1 extends s, KK2 extends s>({ field1, field2 }: {
|
|
7
|
-
field1: Field<LQ, S | N>;
|
|
8
|
-
field2: Field<RQ, S | N>;
|
|
9
|
-
}, { coll, exec, input }: TStages<RS, UBefore<RQ>, BRB, Before<RE>>, k1: AsLiteral<K1>, k2: AsLiteral<Exclude<KK2, BA | K1>>, k: K1 | Exclude<KK2, BA | K1> | false) => RawStages<unknown, Delta<LE>, Both<K1, LE, KK2, RE>>;
|
|
10
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { App, AsLiteral, HKT, ID, O, Rec } from '../../../types';
|
|
2
|
-
import { type Field } from '../../field';
|
|
3
|
-
import type { Before, RawStages, TStages } from '../../types';
|
|
4
|
-
type s = string;
|
|
5
|
-
export declare const $lookupRaw: <LQ extends O, LE extends LQ & ID, RQ extends O, RE extends RQ & ID, BRB extends Before<RQ>, RS, S, As extends s>({ field1, field2 }: {
|
|
6
|
-
field1: Field<LQ, S>;
|
|
7
|
-
field2: Field<RQ, S>;
|
|
8
|
-
}, { coll, exec, input }: TStages<RS, Before<RQ>, BRB, Before<RE>>, k2: AsLiteral<As>, k: "left" | "right" | false) => <F extends HKT<O, O>>(f: <T extends O>() => Field<App<F, T>, T>) => RawStages<App<F, LQ>, App<F, LE>, App<F, LE & Rec<As, RE> & ID>>;
|
|
9
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AsLiteral, O, RORec, doc, notArr } from '../../../types';
|
|
2
|
-
import { type Field } from '../../field';
|
|
3
|
-
import type { SnapshotStream, SnapshotStreamExecutionResult } from '../../types/stream';
|
|
4
|
-
type Params<As extends string, LQ extends O, RQ extends O, RE extends RQ, S extends notArr> = {
|
|
5
|
-
localField: Field<LQ, S>;
|
|
6
|
-
foreignField: Field<RQ, S>;
|
|
7
|
-
from: SnapshotStreamExecutionResult<RQ, RE>;
|
|
8
|
-
as: AsLiteral<As>;
|
|
9
|
-
};
|
|
10
|
-
export declare const $lookup: <As extends string, LQ extends doc, RQ extends O, RE extends RQ & doc, S extends notArr>(p: Params<As, LQ, RQ, RE, S>) => <LE extends LQ>(l: SnapshotStream<LQ, LE>) => SnapshotStream<LQ, LE & RORec<As, RE>>;
|
|
11
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Arr, O, Rec } from '../../types';
|
|
2
|
-
import type { Accumulators, Expr, LookupArgs, Query, RawStages } from '../types';
|
|
3
|
-
import type { Updater } from '../update/updater';
|
|
4
|
-
export * from './raws';
|
|
5
|
-
type s = string;
|
|
6
|
-
export declare const $match_: <Q, T extends Q & O, C = unknown>(query?: Query<T, C>) => RawStages<O<T>, T, T, C>;
|
|
7
|
-
export declare const $set_: <Q, T extends Q & O, V extends Q & O, C = unknown>(updater: Updater<T, T, V, C>) => RawStages<O<Q>, T, V, C, 1>;
|
|
8
|
-
export declare const $replaceWith_: <T extends O, V extends O, C = unknown>(expr: Expr<V, T, C>) => RawStages<O, T, V, C, 1>;
|
|
9
|
-
export declare const $unwind_: <T extends O, K extends s, U>(k: K) => RawStages<O<T>, T & Rec<K, Arr<U>>, T & Rec<K, U>>;
|
|
10
|
-
export declare const $group_: <V extends O>() => <ID, T extends O, C = unknown>(id: Expr<ID, T, C>, args: Accumulators<T, V, C>) => RawStages<O, T, Rec<"_id", ID> & V, C, 1>;
|
|
11
|
-
export declare const $documents_: <T extends O, C>(docs: Expr<Arr<T>, unknown, C>) => RawStages<unknown, null, T, C, 1>;
|
|
12
|
-
export declare const $project_: <T extends O, K extends import("../..").StrKey<T>>(projection: import("../utils/map-object").ExactKeys<K>) => RawStages<T, T, T, unknown, 1>;
|
|
13
|
-
export declare const $simpleLookup_: <T extends O, U extends O, R, K extends s, Ctx, C = unknown, S = string>(args: LookupArgs<T, U, R, K, Ctx, C, S>) => RawStages<O<T>, T, T & Rec<K, Arr<U>>, C, 1>;
|
package/lib/aggregate/out.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { O, RWCollection, ReadonlyCollection, Replace, jsonItem } from '../../types';
|
|
2
|
-
import type { ExprsExact } from '../expression/concat';
|
|
3
|
-
import { type Field } from '../field';
|
|
4
|
-
import type { RawStages } from '../types';
|
|
5
|
-
export type MergeInto<T extends O, Out extends O, E = unknown> = {
|
|
6
|
-
whenNotMatched: 'insert';
|
|
7
|
-
into: RWCollection<T, Out>;
|
|
8
|
-
} | {
|
|
9
|
-
whenNotMatched: 'discard' | 'fail';
|
|
10
|
-
into: ReadonlyCollection<Out> & E;
|
|
11
|
-
};
|
|
12
|
-
export type MergeArgs<T extends O, Out extends O, Ctx, In extends O> = {
|
|
13
|
-
on: Field<T, jsonItem> & Field<Out, jsonItem>;
|
|
14
|
-
} & MergeInto<T, Out> & (({
|
|
15
|
-
stages?: undefined;
|
|
16
|
-
} & ({
|
|
17
|
-
whenMatched: 'keepExisting' | 'fail';
|
|
18
|
-
} | {
|
|
19
|
-
whenMatched: 'replace';
|
|
20
|
-
into: RWCollection<T, Out>;
|
|
21
|
-
} | {
|
|
22
|
-
whenMatched: 'merge';
|
|
23
|
-
into: RWCollection<Replace<Out, T>, Out>;
|
|
24
|
-
})) | {
|
|
25
|
-
stages: true;
|
|
26
|
-
into: RWCollection<In, Out>;
|
|
27
|
-
whenMatched: RawStages<unknown, Out, In>;
|
|
28
|
-
} | {
|
|
29
|
-
stages: 'ctx';
|
|
30
|
-
vars: ExprsExact<Ctx, T>;
|
|
31
|
-
into: RWCollection<In, Out>;
|
|
32
|
-
whenMatched: RawStages<unknown, Out, In, Ctx>;
|
|
33
|
-
});
|
|
34
|
-
export declare const $merge_: <T extends O, Out extends O = T, Ctx = unknown, In extends O = Out>({ into, on, whenNotMatched, ...notMatched }: MergeArgs<T, Out, Ctx, In>) => RawStages<unknown, T, "out", unknown, number>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { App, HKT, O2, O3, O, RawObj } from '../../types';
|
|
2
|
-
import type { Delta, DeltaStages, FRawStages, RawStages, Stream, TStages } from '../types';
|
|
3
|
-
import type { Equal } from '../utils/guard';
|
|
4
|
-
type n = number;
|
|
5
|
-
export declare const asStages: <Q, T extends Q, V extends Q, C = unknown, M extends n = number>(x: readonly RawObj[]) => RawStages<Q, T, V, C, M>;
|
|
6
|
-
export declare const same: <T extends Dom, V extends Dom, F extends HKT<Dom, Q>, Dom = unknown, Q = unknown, C = unknown, M extends n = number>(_: Equal<Dom, T, V>) => RawStages<Q, App<F, T>, App<F, V>, C, M>;
|
|
7
|
-
export declare const concatStages: <Q, T extends Q, V extends Q, W extends Q, C, M extends n = number>(part1: RawStages<Q, T, V, C, M>, part2: RawStages<Q, V, W, C, M>) => RawStages<Q, T, W, C, M>;
|
|
8
|
-
export declare const concatFStages: <Q, T extends Q & O, V extends Q & O, W extends Q & O, C, M extends n = number>(part1: FRawStages<Q, T, V, C, M>, part2: FRawStages<Q, V, W, C, M>) => FRawStages<Q, T, W, C, M>;
|
|
9
|
-
export declare const concatDelta: <Q extends O, T extends Q, V extends Q, W extends Q>(part1: DeltaStages<Q, T, V>, part2: DeltaStages<Q, V, W>) => DeltaStages<Q, T, W>;
|
|
10
|
-
type Concat<out Q, in T extends Q, out V extends Q, in out C, in out M extends n = n> = {
|
|
11
|
-
with: <Q2, W extends Q2>(extra: RawStages<Q | Q2, V, W, C, M>) => Concat<Q | Q2, T, W, C, M>;
|
|
12
|
-
stages: RawStages<Q, T, V, C, M>;
|
|
13
|
-
};
|
|
14
|
-
type FConcat<out Q, in T extends Q & O, out V extends Q & O, in out C, in out M extends n = n> = {
|
|
15
|
-
with: <Q2, W extends Q2 & O>(extra: FRawStages<Q | Q2, V, W, C, M>) => FConcat<Q | Q2, T, W, C, M>;
|
|
16
|
-
stages: FRawStages<Q, T, V, C, M>;
|
|
17
|
-
};
|
|
18
|
-
export type DeltaPipe<Q extends O, T extends Q, F extends HKT<O2>, G extends HKT<O3>> = {
|
|
19
|
-
with: <Q2 extends O, V extends Q2>(map: (a: Stream<Q, T, F, G>) => Stream<Q | Q2, V, F, G>) => DeltaPipe<Q | Q2, V, F, G>;
|
|
20
|
-
then: <Q2 extends O, V extends Q2>(next: App<G, [Q2 | T, T, V]>) => DeltaPipe<Q | Q2, V, F, G>;
|
|
21
|
-
get: () => App<F, [Q, T]>;
|
|
22
|
-
};
|
|
23
|
-
export declare const pipe: <Q extends O, S extends Q, T extends Q, F extends HKT<O2>, G extends HKT<O3>>(stream: Stream<Q, S, F, G>, s: App<G, [Q, S, T]>, concat: <Q_1 extends O, T_1 extends Q_1, V extends Q_1, W extends Q_1>(part1: App<G, [Q_1, T_1, V]>, part2: App<G, [Q_1, V, W]>) => App<G, [Q_1, T_1, W]>, empty: <T_2 extends Q>() => App<G, [Q, T_2, T_2]>) => DeltaPipe<Q, T, F, G>;
|
|
24
|
-
type Link = <T, C = unknown, M extends n = n>() => Concat<T, T, T, C, M>;
|
|
25
|
-
type FLink = <T extends O, C = unknown, M extends n = n>() => FConcat<T, T, T, C, M>;
|
|
26
|
-
export declare const link: Link;
|
|
27
|
-
export declare const flink: FLink;
|
|
28
|
-
export declare const emptyDelta: <T extends O>() => {
|
|
29
|
-
delta: RawStages<Delta<T>, Delta<T>, Delta<T>, unknown, number>;
|
|
30
|
-
raw: <F extends HKT<O>>() => RawStages<App<F, T>, App<F, T>, App<F, T>, unknown, number>;
|
|
31
|
-
};
|
|
32
|
-
export declare const concatTStages: <S, Q, B extends Q, T extends Q, V extends Q>({ coll, exec, input }: TStages<S, Q, B, T>, stages: RawStages<Q, T, V>) => TStages<S, Q, B, V>;
|
|
33
|
-
export {};
|
package/lib/aggregate/raws.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { App, Arr, ConstHKT, HKT, O, Rec, StrKey, rawItem } from '../../types';
|
|
2
|
-
import type { ExprsExact } from '../expression/concat';
|
|
3
|
-
import { type Field } from '../field';
|
|
4
|
-
import type { Accumulators, Expr, FRawStages, LookupArgs, Query, RawStages } from '../types';
|
|
5
|
-
import type { Updater } from '../update/updater';
|
|
6
|
-
import { type ExactKeys } from '../utils/map-object';
|
|
7
|
-
type s = string;
|
|
8
|
-
export declare const $match1: <T extends O, C = unknown>(query?: Query<T, C>) => FRawStages<T, T, T, C>;
|
|
9
|
-
export declare const $set1: <Q, T extends Q & O, V extends Q & O, C = unknown>(updater: Updater<T, T, V, C>) => FRawStages<Q, T, V, C, 1>;
|
|
10
|
-
export declare const $project1: <T extends O, K extends StrKey<T>>(projection: ExactKeys<K>) => RawStages<T, T, T, unknown, 1>;
|
|
11
|
-
export declare const $replaceWith1: <T extends O, V extends O, C = unknown>(expr: Expr<V, T, C>) => FRawStages<O, T, V, C, 1>;
|
|
12
|
-
export declare const $unwind1: <T extends O, K extends s, R>(k: K) => FRawStages<T, T & Rec<K, Arr<R>>, T & Rec<K, R>>;
|
|
13
|
-
export declare const $group1: <T extends O, ID, V extends O, C>(id: Expr<ID, T, C>, args: Accumulators<T, V, C>) => <F extends HKT<O, O>>(f: <T_1 extends O>() => Field<App<F, T_1>, T_1>) => RawStages<O, App<F, T>, Rec<"_id", ID> & V, C, 1>;
|
|
14
|
-
export declare const $documents1: <Q extends O, T extends Q & O, C>(docs: Expr<Arr<T>, unknown, C>) => <F extends HKT<O, O>>(f: <T_1 extends O>() => Field<App<F, T_1>, T_1>) => RawStages<unknown, null, App<F, T>, C, 1>;
|
|
15
|
-
export declare const rawVars: <T, Ctx, C, V extends O>(vars: ExprsExact<Ctx, T, C>, f: Field<V, T, unknown>) => import("../utils/map-object").ExactPart1<Ctx, ConstHKT<rawItem, unknown>>;
|
|
16
|
-
export declare const $simpleLookup1: <T extends O, U extends O, R, K extends s, Ctx, C = unknown, S = string>(args: LookupArgs<T, U, R, K, Ctx, C, S>) => FRawStages<T, T, T & Rec<K, Arr<U>>, C, 1>;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ConstHKT, HKT, I, N, O, RORec, Rec, jsonItem } from '../../../types';
|
|
2
|
-
import type { BA, Delta, Expr, FRawStages, RawStages } from '../../types';
|
|
3
|
-
import { type Updater } from '../../update/updater';
|
|
4
|
-
import { type MapK } from '../../utils/map-object';
|
|
5
|
-
export interface ParDeltaHKT<K extends BA, T extends jsonItem, E> extends HKT<jsonItem> {
|
|
6
|
-
readonly out: RORec<K, I<jsonItem, this>> & Delta<T> & E;
|
|
7
|
-
}
|
|
8
|
-
type Delta2<T extends jsonItem, BA2 extends string> = Delta<T> & Partial<RORec<BA2, T | null>>;
|
|
9
|
-
export declare const $setEach1: <T extends jsonItem, V extends jsonItem, BA2 extends string, E = unknown, C = unknown>(updater: (k: BA) => Updater<Delta<T> & Partial<RORec<BA2, T | null>> & E, T | N, V | null, C>, dict: MapK<BA2, ConstHKT<BA>>) => FRawStages<unknown, Delta2<T, BA2> & E, Rec<BA2, V | null> & Omit<Delta<T> & E, BA2>, C, 1>;
|
|
10
|
-
export declare const $setEach: <T extends O, V extends jsonItem, BA2 extends string, E = unknown, C = unknown>(updater: (k: BA) => Updater<Delta<T> & E, T | N, V | null, C>, dict: MapK<BA2, ConstHKT<BA>>) => RawStages<unknown, Delta2<T, BA2> & E, Rec<BA2, V | null> & Omit<Delta<T> & E, BA2>, C, 1>;
|
|
11
|
-
export declare const $replaceWithEach: <T extends O, V extends jsonItem, E = unknown>(expr: <K extends BA>(field: K) => Expr<V | null, Rec<K, T> & Delta<T> & E>) => RawStages<unknown, Delta<T> & E, Delta<V> & Omit<E, BA>>;
|
|
12
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { O, jsonItem } from '../../../types';
|
|
2
|
-
import type { Delta, Expr, RawStages } from '../../types';
|
|
3
|
-
import { type Updater } from '../../update/updater';
|
|
4
|
-
export declare const $replaceWithDelta: <T extends O, V extends jsonItem>(expr: Expr<V, T>) => RawStages<unknown, Delta<T>, Delta<V>>;
|
|
5
|
-
export declare const $setDelta: <T extends O, V extends O, C = unknown>(updater: Updater<T, T, V, C>) => RawStages<unknown, Delta<T>, Delta<V>, C, number>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { O, Replace } from '../../../types';
|
|
2
|
-
import type { DeltaStages, Expr, LinStages } from '../../types';
|
|
3
|
-
import { type UpdaterHKT } from '../../update/updater';
|
|
4
|
-
import type { MapO } from '../../utils/map-object';
|
|
5
|
-
export declare const $set: <V extends O>() => <R extends O, C = unknown>(fields: MapO<V, UpdaterHKT<R, R, V, C>>) => DeltaStages<O, R, Replace<R, V>, C> & LinStages<O, R, Replace<R, V>, C>;
|
|
6
|
-
export declare const $replaceWith: <T extends O, V extends O>(expr: Expr<V, T>) => DeltaStages<O, T, V> & LinStages<O, T, V>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { $replaceWith, $set } from './$set';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Arr, AsLiteral, ID, Rec, doc } from '../../../types';
|
|
2
|
-
import type { Delta, RawStages } from '../../types';
|
|
3
|
-
type s = string;
|
|
4
|
-
export declare const $unwindDelta: <K1 extends s, T extends doc, K2 extends s, U extends doc>(k1: AsLiteral<K1>, k2: AsLiteral<K2>, k: K1 | K2 | false) => RawStages<Delta<Rec<K1, T>>, Delta<Rec<K1, T> & Rec<K2, Arr<U>>>, Delta<Rec<K1, T> & Rec<K2, U> & ID>>;
|
|
5
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Arr, AsLiteral, doc, O, Rec, RORec } from '../../../types';
|
|
2
|
-
import type { DeltaStages } from '../../types';
|
|
3
|
-
export { $unwindDelta } from './$unwind-delta';
|
|
4
|
-
type s = string;
|
|
5
|
-
export declare const $unwind: <T extends doc, K extends s, U extends doc>(k: AsLiteral<K>, dict: RORec<K, "key">) => DeltaStages<O, T & Rec<K, Arr<U>>, T & Rec<K, U>>;
|
package/lib/boot/boot-simpl.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { O2, O3, OPickD, RORec, StrKey, View } from '../../types';
|
|
2
|
-
import type { HKT, I } from '../../types/hkt';
|
|
3
|
-
import type { RawStages } from '../types';
|
|
4
|
-
import type { Model, SimpleStreamExecutionResult } from '../types/stream';
|
|
5
|
-
type Allowed<K> = Exclude<K, 'deletedAt' | '_id'>;
|
|
6
|
-
type AllowedPick<V extends Model, K extends StrKey<V>> = OPickD<V, Allowed<K>>;
|
|
7
|
-
interface StreamRunnerHKT extends HKT<O2> {
|
|
8
|
-
readonly out: SimpleStreamExecutionResult<I<O2, this>[0], I<O2, this>[1]>;
|
|
9
|
-
}
|
|
10
|
-
interface StagesHKT extends HKT<O3> {
|
|
11
|
-
readonly out: RORec<'lin', RawStages<I<O3, this>[0], I<O3, this>[1], I<O3, this>[2], unknown, 1>>;
|
|
12
|
-
}
|
|
13
|
-
export declare const from: <V extends Model, KK extends StrKey<V>>(view: View<V, Allowed<KK>>, streamName: string) => import("../aggregate/prefix").DeltaPipe<AllowedPick<V, KK>, AllowedPick<V, KK>, StreamRunnerHKT, StagesHKT>;
|
|
14
|
-
export {};
|
package/lib/boot/boot.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { O2, O3, OPickD, StrKey, View } from '../../types';
|
|
2
|
-
import type { HKT, I } from '../../types/hkt';
|
|
3
|
-
import { type DeltaPipe } from '../aggregate/prefix';
|
|
4
|
-
import type { SnapshotStreamExecutionResult } from '../types';
|
|
5
|
-
import type { DeltaStages, Model } from '../types/stream';
|
|
6
|
-
type Allowed<K> = Exclude<K, 'deletedAt' | '_id'>;
|
|
7
|
-
type AllowedPick<V extends Model, K extends StrKey<V>> = OPickD<V, Allowed<K>>;
|
|
8
|
-
export declare const streamNames: Record<string, string>;
|
|
9
|
-
export interface SnapshotStreamHKT extends HKT<O2> {
|
|
10
|
-
readonly out: SnapshotStreamExecutionResult<I<O2, this>[0], I<O2, this>[1]>;
|
|
11
|
-
}
|
|
12
|
-
export interface DeltaHKT extends HKT<O3> {
|
|
13
|
-
readonly out: DeltaStages<I<O3, this>[0], I<O3, this>[1], I<O3, this>[2]>;
|
|
14
|
-
}
|
|
15
|
-
export declare const staging: <V extends Model, KK extends StrKey<V>>(view: View<V, Allowed<KK>>, streamName: string) => DeltaPipe<AllowedPick<V, KK>, AllowedPick<V, KK>, SnapshotStreamHKT, DeltaHKT>;
|
|
16
|
-
export {};
|
package/lib/boot/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Expr } from '../types';
|
|
2
|
-
export declare const max: <D, C>(...expr: Expr<number, D, C>[]) => Expr<number, D, C>;
|
|
3
|
-
export declare const lt: <D, C>(expr_0: Expr<number, D, C>, expr_1: Expr<number, D, C>) => Expr<boolean, D, C>;
|
|
4
|
-
export declare const gt: <D, C>(expr_0: Expr<number, D, C>, expr_1: Expr<number, D, C>) => Expr<boolean, D, C>;
|
|
5
|
-
export declare const lte: {
|
|
6
|
-
<D, C>(...expr: [Expr<Date, D, C>, Expr<Date, D, C>]): Expr<boolean, D, C>;
|
|
7
|
-
<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<boolean, D, C>;
|
|
8
|
-
};
|
|
9
|
-
export declare const gte: {
|
|
10
|
-
<D, C>(...expr: [Expr<Date, D, C>, Expr<Date, D, C>]): Expr<boolean, D, C>;
|
|
11
|
-
<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<boolean, D, C>;
|
|
12
|
-
};
|
|
13
|
-
type Num = number | null | undefined;
|
|
14
|
-
export declare function subtract<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<number, D, C>;
|
|
15
|
-
export declare function subtract<D, C>(...expr: [Expr<Num, D, C>, Expr<Num, D, C>]): Expr<Num, D, C>;
|
|
16
|
-
export declare function add<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<number, D, C>;
|
|
17
|
-
export declare function add<D, C>(...expr: [Expr<Num, D, C>, Expr<Num, D, C>]): Expr<Num, D, C>;
|
|
18
|
-
export declare function divide<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<number, D, C>;
|
|
19
|
-
export declare function divide<D, C>(...expr: [Expr<Num, D, C>, Expr<Num, D, C>]): Expr<Num, D, C>;
|
|
20
|
-
export declare function multiply<D, C>(...expr: [Expr<number, D, C>, Expr<number, D, C>]): Expr<number, D, C>;
|
|
21
|
-
export declare function multiply<D, C>(...expr: [Expr<Num, D, C>, Expr<Num, D, C>]): Expr<Num, D, C>;
|
|
22
|
-
export declare function floor<D, C>(expr: Expr<number, D, C>): Expr<number, D, C>;
|
|
23
|
-
export declare function floor<D, C>(expr: Expr<Num, D, C>): Expr<Num, D, C>;
|
|
24
|
-
export declare function ceil<D, C>(expr: Expr<number, D, C>): Expr<number, D, C>;
|
|
25
|
-
export declare function ceil<D, C>(expr: Expr<Num, D, C>): Expr<Num, D, C>;
|
|
26
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { App, Arr, HKT, N, RORec, notArr } from '../../types';
|
|
2
|
-
import type { Expr } from '../types';
|
|
3
|
-
export declare const size: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<number, D, C>;
|
|
4
|
-
export declare const filterDefined: <T, D, C = unknown>(expr: Expr<Arr<T | N>, D, C>) => Expr<Arr<T>, D, C>;
|
|
5
|
-
export declare const filter: <T, D, K extends string, C = unknown>({ as, cond, expr, limit, }: {
|
|
6
|
-
expr: Expr<Arr<T>, D, C>;
|
|
7
|
-
as: K;
|
|
8
|
-
cond: Expr<unknown, D, C & RORec<K, T>>;
|
|
9
|
-
limit?: Expr<number, D, C>;
|
|
10
|
-
}) => Expr<Arr<T>, D, C>;
|
|
11
|
-
export declare const sortArray: <T, D, C, K extends keyof T>({ sortBy, expr, order, }: {
|
|
12
|
-
expr: Expr<Arr<T>, D, C>;
|
|
13
|
-
sortBy: K;
|
|
14
|
-
order?: 1 | -1;
|
|
15
|
-
}) => Expr<Arr<T>, D, C>;
|
|
16
|
-
export declare const isArray: <T extends notArr, D, C, F extends HKT<T | Arr<T>>>(expr: Expr<T | Arr<T>, D & (App<F, T> | App<F, Arr<T>>), C>) => import("../types").BoolExpr<D & App<F, Arr<T>>, D & App<F, T>, C>;
|
|
17
|
-
export declare const array: <T, D, C = unknown>(...exprs: Expr<T, D, C>[]) => Expr<Arr<T>, D, C>;
|
|
18
|
-
export declare const concatArray: <T, D, C>(...exprs: Expr<Arr<T>, D, C>[]) => Expr<Arr<T>, D, C>;
|
|
19
|
-
export declare const first: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<T | null, D, C>;
|
|
20
|
-
export declare const firstSure: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<T, D, C>;
|
|
21
|
-
export declare const last: <T, D, C>(expr: Expr<Arr<T>, D, C>) => Expr<T | null, D, C>;
|
|
22
|
-
export declare const mergeObjects: <T1, T2, D, C = unknown>(exprs_0: Expr<T1, D, C>, exprs_1: Expr<T2, D, C>) => Expr<T1 & T2, D, C>;
|
|
23
|
-
export declare const inArray: <T, D, C = unknown>(exprs_0: Expr<T, D, C>, exprs_1: Expr<Arr<T>, D, C>) => Expr<boolean, D, C>;
|
|
24
|
-
export declare const slice: <T, D, C>(array: Expr<Arr<T>, D, C>, start: Expr<number, D, C>, end: Expr<number, D, C>) => Expr<Arr<T>, D, C>;
|
|
25
|
-
export declare const except: <T, D, C>(a: Expr<Arr<T>, D, C>, b: Expr<Arr<T>, D, C>) => Expr<Arr<T>, D, C>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { App, HKT, I, IdHKT, O, RORec, StrKey } from '../../types';
|
|
2
|
-
import type { Expr } from '../types';
|
|
3
|
-
import { type Exact, type ExactPart, type MapO, type MergeHKT } from '../utils/map-object';
|
|
4
|
-
export declare const concat: <D, C>(...expr: Expr<string, D, C>[]) => Expr<string, D, C>;
|
|
5
|
-
export declare const str: <D, C>(expr: Expr<unknown, D, C>) => Expr<string, D, C>;
|
|
6
|
-
export declare const toInt: <D, C>(expr: Expr<unknown, D, C>) => Expr<number, D, C>;
|
|
7
|
-
export declare const fieldM: <M extends RORec<Dom, Ref>, T extends RORec<Ref, unknown>, D, Dom extends string = StrKey<M>, Ref extends string = StrKey<T>, C = unknown>(expr: { readonly [K in Ref]: Expr<T[K], D, C>; }, m: Pick<M, Dom>) => Expr<O<{ readonly [K in Dom]: T[M[K]]; }>, D, C>;
|
|
8
|
-
export type Exprs<out T, in D, in C = unknown> = {
|
|
9
|
-
readonly [K in StrKey<T>]: Expr<T[K], D, C>;
|
|
10
|
-
};
|
|
11
|
-
type MergeExactArgs<T1, T2, F extends HKT<T1[StrKey<T1>] | T2[StrKey<T2>]>> = readonly [
|
|
12
|
-
Exact<Omit<T1, keyof T2>, F>,
|
|
13
|
-
Exact<T2, F>
|
|
14
|
-
];
|
|
15
|
-
export declare const mergeExact: <T1, T2, F extends HKT<T1[StrKey<T1>] | T2[StrKey<T2>]>, E = unknown>(exprsExact1: Exact<Omit<T1, keyof T2>, F>, exprsExact2: Exact<T2, F>) => Exact<T2 & Omit<T1, keyof T2> & Pick<E, symbol & keyof E>, F>;
|
|
16
|
-
export type MergeMapOArgs<T1, T2, F1 extends HKT<StrKey<Omit<T1, StrKey<T2>>>>, F2 extends HKT<StrKey<T2>>> = readonly [MapO<Omit<T1, StrKey<T2>>, F1>, MapO<T2, F2>];
|
|
17
|
-
export declare const mergeExact0: <T1, T2, F1 extends HKT<StrKey<Omit<T1, StrKey<T2>>>>, F2 extends HKT<StrKey<T2>>, E = unknown>(exprsExact1: MapO<Omit<T1, StrKey<T2>>, F1>, exprsExact2: MapO<T2, F2>) => MapO<T2 & Omit<T1, StrKey<T2>> & Pick<E, symbol & keyof E>, MergeHKT<T1, T2, F1, F2, StrKey<T2>>>;
|
|
18
|
-
export declare const mergeExpr: <T1, T2, D, C = unknown, E = unknown>(exprs_0: Exact<Omit<T1, keyof T2>, ExprHKT<D, C, IdHKT<unknown>>>, exprs_1: Exact<T2, ExprHKT<D, C, IdHKT<unknown>>>) => ExprsExact<T2 & Omit<T1, keyof T2> & Pick<E, symbol & keyof E>, D, C>;
|
|
19
|
-
export type ExprsPart<T, D, C> = ExactPart<T, ExprHKT<D, C>>;
|
|
20
|
-
export interface ExprHKT<D, C = unknown, F extends HKT = IdHKT> extends HKT<unknown> {
|
|
21
|
-
readonly out: Expr<App<F, I<unknown, this>>, D, C>;
|
|
22
|
-
}
|
|
23
|
-
export type ExprsExact<T, D, C = unknown, F extends HKT = IdHKT> = Exact<T, ExprHKT<D, C, F>>;
|
|
24
|
-
export interface ExprsExactHKT<E, D, C = unknown, F extends HKT = IdHKT> extends HKT {
|
|
25
|
-
readonly out: ExprsExact<E & I<unknown, this>, D, C, F>;
|
|
26
|
-
}
|
|
27
|
-
export declare const pair: <T, D, C, P extends StrKey<T>>(k: P, v: Expr<T[P], D, C>) => ExprsExact<T, D, C>[P];
|
|
28
|
-
export declare const fieldF: <F extends HKT>() => <T extends object, D, C = unknown>(exprs: ExprsExact<T, D, C, F>) => Expr<O<{ [K in keyof T]: App<F, T[K]>; }>, D, C>;
|
|
29
|
-
export declare const field: <T extends object, D, C = unknown>(exprs: ExprsExact<T, D, C>) => Expr<O<T>, D, C>;
|
|
30
|
-
export {};
|
package/lib/expression/date.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Arr } from '../../types';
|
|
2
|
-
import type { Expr } from '../types';
|
|
3
|
-
export declare const dayAndMonthPart: <D, C>(date: Expr<Date, D, C>) => Expr<string, D, C>;
|
|
4
|
-
export declare const now: <D, C>() => Expr<Date, D, C>;
|
|
5
|
-
export declare const monthPart: <D, C>(date: Expr<Date, D, C>) => Expr<string, D, C>;
|
|
6
|
-
export declare const weekPart: <D, C>(date: Expr<Date, D, C>) => Expr<string, D, C>;
|
|
7
|
-
export declare const dateAdd: <D, C>(date: Expr<Date, D, C>, amount: Expr<number, D, C>, unit: Expr<"year" | "week" | "month" | "day" | "hour" | "minute" | "second", D, C>) => Expr<Date, D, C>;
|
|
8
|
-
export declare const maxDate: <D, C>(expr: Expr<Arr<Date>, D, C>) => Expr<Date, D, C>;
|
|
9
|
-
export declare const minDate: <D, C>(expr: Expr<Arr<Date>, D, C>) => Expr<Date, D, C>;
|
|
10
|
-
export declare const datePart: <D, C>(date: Expr<Date, D, C>) => Expr<string, D, C>;
|
|
11
|
-
export declare const startOf: <D, C>(startDate: Expr<Date, D, C>, freq: Expr<"week" | "day" | "month" | "year", D, C>, offset: Expr<number, D, C>) => Expr<Date, D, C>;
|
|
12
|
-
export declare const dateDiff: <D, C>({ end, unit, start, }: {
|
|
13
|
-
start: Expr<Date, D, C>;
|
|
14
|
-
end: Expr<Date, D, C>;
|
|
15
|
-
unit: Expr<"week" | "day" | "month" | "year", D, C>;
|
|
16
|
-
}) => Expr<number, D, C>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { rawItem } from '../../types';
|
|
2
|
-
import type { BoolExpr, Expr, ExprRaw } from '../types';
|
|
3
|
-
export declare const asExprRaw: <T, Doc, Ctx>(raw: rawItem) => ExprRaw<T, Doc, Ctx>;
|
|
4
|
-
export declare const asExpr: <T, Doc, Ctx = unknown>(r: Pick<Expr<T, Doc, Ctx>, "raw">) => Expr<T, Doc, Ctx>;
|
|
5
|
-
export declare const asBoolExpr: <D1, D2, Ctx = unknown>(r: Pick<BoolExpr<D1, D2, Ctx>, "raw">) => BoolExpr<D1, D2, Ctx>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { App, HKT, O, jsonItem, rawItem } from '../../types';
|
|
2
|
-
import type { Field } from '../field';
|
|
3
|
-
import type { BoolExpr, Expr } from '../types';
|
|
4
|
-
export declare const ite: {
|
|
5
|
-
<T, D, C = unknown>(cond: Expr<unknown, D, C>, then: Expr<T, D, C>, orelse: Expr<T, D, C>): Expr<T, D, C>;
|
|
6
|
-
<T, R1, R2, F extends HKT<R1 | R2>, C = unknown>(cond: BoolExpr<App<F, R1>, App<F, R2>, C>, then: Expr<T, App<F, R1>, C>, orelse: Expr<T, App<F, R2>, C>): Expr<T, App<F, R1 | R2>, C>;
|
|
7
|
-
};
|
|
8
|
-
export declare const and: <D, C = unknown>(expr_0: Expr<boolean, D, C>, expr_1: Expr<boolean, D, C>) => Expr<boolean, D, C>;
|
|
9
|
-
export declare const eq: <T, D, C = unknown>(a: Expr<T, D, C>) => (b: Expr<T, D, C>) => Expr<boolean, D, C>;
|
|
10
|
-
export declare const sub: <T, D, Ctx, P extends O>(a: Expr<T, D, Ctx>, f: Field<P, D, Ctx>) => Expr<T, P, Ctx>;
|
|
11
|
-
export declare const eqTyped: <T1 extends Dom, T2 extends Dom, F extends HKT<Dom>, C = unknown, Dom = unknown>(a: Expr<T1 | T2, App<F, T1 | T2>, C>, b: Expr<T1, App<F, T1 | T2>, C>) => BoolExpr<App<F, T1>, App<F, T2>, C>;
|
|
12
|
-
export declare const ne: <T, K, D, C>(a: Expr<T, D, C>) => (b: Expr<K, D, C>) => Expr<boolean, D, C>;
|
|
13
|
-
export declare const notNull: <T, K, D, C>(a: Expr<T, D, C>) => Expr<boolean, D, C>;
|
|
14
|
-
export declare const $ifNull: <R, D, C>(...expr: [...Expr<R | null | undefined, D, C>[], Expr<R, D, C>]) => Expr<R, D, C>;
|
|
15
|
-
export declare const exprMapVal: <K extends string, T extends Partial<Record<K, rawItem>>, D, C>(expr: Expr<K, D, C>, map: { readonly [P in K]: Expr<T[P], D, C>; }, or?: Expr<T[K], D, C>) => Expr<T[K & keyof T], D, C>;
|
|
16
|
-
export declare const mapVal: <K extends string, T extends Partial<Record<K, rawItem>>, D, C>(expr: Expr<K, D, C>, map: T, or: T[K & keyof T]) => Expr<T[K & keyof T], D, C>;
|
|
17
|
-
export declare const setField: <K extends string, T, V, D, C>({ field, input, value, }: {
|
|
18
|
-
field: Expr<K, D, C>;
|
|
19
|
-
input: Expr<T, D, C>;
|
|
20
|
-
value: Expr<V, D, C>;
|
|
21
|
-
}) => Expr<T & Record<K, V>, D, C>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Arr, RORec } from '../../types';
|
|
2
|
-
import { Field } from '../field';
|
|
3
|
-
import type { Expr } from '../types';
|
|
4
|
-
export declare const range: <D, C>(start: Expr<number, D, C>, end: Expr<number, D, C>, step?: Expr<number, D, C>) => Expr<Arr<number>, D, C>;
|
|
5
|
-
export declare const $map1: <T, R, D, C>(ex: Expr<Arr<T>, D, C>, map: (i: Field<unknown, T, RORec<"item", T>>) => Expr<R, D, RORec<"item", T> & C>) => Expr<Arr<R>, D, C>;
|
|
6
|
-
export declare const $map: <T, R, D, C = unknown>(ex: Expr<Arr<T>, D, C>, map: (i: Expr<T, D, RORec<"item", T>>) => Expr<R, D, RORec<"item", T> & C>) => Expr<Arr<R>, D, C>;
|
package/lib/expression/val.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Timestamp } from 'mongodb';
|
|
2
|
-
import type { Arr, N, O, RORec, StrKey, jsonItem, rawItem } from '../../types';
|
|
3
|
-
import type { Expr } from '../types';
|
|
4
|
-
import type { ExprsExact } from './concat';
|
|
5
|
-
export declare const val: <T extends rawItem>(val: T) => Expr<T, unknown>;
|
|
6
|
-
export declare const current: Expr<Timestamp, unknown>;
|
|
7
|
-
export declare const $let: <T, D, C, V extends RORec<string, jsonItem>>(vars: ExprsExact<V, D, C>, inExpr: Expr<T, D, C & V>) => Expr<T, D, C>;
|
|
8
|
-
export declare const nil: Expr<null, unknown>;
|
|
9
|
-
export declare const $getField: {
|
|
10
|
-
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T, D, C>, field: K): Expr<T[K], D, C>;
|
|
11
|
-
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T | N, D, C>, field: K): Expr<T[K] | null, D, C>;
|
|
12
|
-
};
|
|
13
|
-
export type NoRaw<T> = T extends Arr<infer U> ? NoRaw<U>[] : T extends readonly unknown[] ? {
|
|
14
|
-
[K in keyof T]: NoRaw<T[K]>;
|
|
15
|
-
} : T extends O ? {
|
|
16
|
-
[K in StrKey<T>]: NoRaw<T[K]>;
|
|
17
|
-
} : T;
|
|
18
|
-
export type RONoRaw<T> = T extends Arr<infer U> ? readonly RONoRaw<U>[] : T extends readonly unknown[] ? {
|
|
19
|
-
readonly [K in keyof T]: RONoRaw<T[K]>;
|
|
20
|
-
} : T extends O ? {
|
|
21
|
-
readonly [K in StrKey<T>]: RONoRaw<T[K]>;
|
|
22
|
-
} : T;
|
|
23
|
-
export declare const func: <T extends jsonItem, A extends readonly jsonItem[], D, C = unknown>(f: (...args: NoRaw<A>) => RONoRaw<T>, ...args: { [X in keyof A]: Expr<A[X], D, C>; }) => Expr<T, D, C>;
|
|
24
|
-
export declare const rand: () => string;
|
|
25
|
-
export declare const $rand: Expr<string, unknown, unknown>;
|