@thisisagile/easy 17.23.1 → 17.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VKBEWDLL.mjs → chunk-2BOK6R6N.mjs} +4 -4
- package/dist/chunk-2BOK6R6N.mjs.map +1 -0
- package/dist/{chunk-HAEVUETQ.mjs → chunk-2C5WHSM5.mjs} +2 -2
- package/dist/{chunk-UWA2JPXC.mjs → chunk-4WLPMNMB.mjs} +9 -9
- package/dist/{chunk-DUMDOMES.mjs → chunk-6ATDEGSU.mjs} +3 -3
- package/dist/{chunk-P4MEAARF.mjs → chunk-6ENYJKOF.mjs} +42 -35
- package/dist/chunk-6ENYJKOF.mjs.map +1 -0
- package/dist/{chunk-MBY7DP5K.mjs → chunk-6RSOVRW4.mjs} +4 -4
- package/dist/{chunk-MBFLUJ5X.mjs → chunk-73VXBPTL.mjs} +11 -11
- package/dist/{chunk-CHV6RMJL.mjs → chunk-7OEH5Q3V.mjs} +2 -2
- package/dist/{chunk-SHTZ4ZZ2.mjs → chunk-AWT4XDU7.mjs} +4 -4
- package/dist/{chunk-QL3DRPMM.mjs → chunk-BDKRR6H2.mjs} +2 -2
- package/dist/{chunk-VI57VONC.mjs → chunk-CHLVZFAR.mjs} +2 -2
- package/dist/{chunk-RTVVXROA.mjs → chunk-CMMMDBTK.mjs} +3 -3
- package/dist/{chunk-WUHEP5NJ.mjs → chunk-D4EFIKFU.mjs} +4 -4
- package/dist/chunk-D4EFIKFU.mjs.map +1 -0
- package/dist/{chunk-3ZX4YFOK.mjs → chunk-EOIG654K.mjs} +4 -4
- package/dist/{chunk-LMVFKEDS.mjs → chunk-F2SLQDR2.mjs} +2 -2
- package/dist/{chunk-5UUY67VD.mjs → chunk-F7MQZLCR.mjs} +3 -3
- package/dist/{chunk-3LWQJAEJ.mjs → chunk-FLJXHLSM.mjs} +3 -3
- package/dist/{chunk-7WCAHERW.mjs → chunk-GA7BBYC2.mjs} +3 -3
- package/dist/{chunk-UGTCVMQQ.mjs → chunk-GSAKK3JN.mjs} +3 -3
- package/dist/{chunk-A42HFDBS.mjs → chunk-HFBHENMJ.mjs} +3 -3
- package/dist/{chunk-A42HFDBS.mjs.map → chunk-HFBHENMJ.mjs.map} +1 -1
- package/dist/{chunk-Q7FJUYZT.mjs → chunk-HO3IEF5S.mjs} +14 -3
- package/dist/chunk-HO3IEF5S.mjs.map +1 -0
- package/dist/{chunk-J7FACY7Y.mjs → chunk-I4HFLLRR.mjs} +3 -3
- package/dist/{chunk-YAB5YLHI.mjs → chunk-J5AZL5T6.mjs} +2 -2
- package/dist/{chunk-F4JCURDN.mjs → chunk-JABPZGOG.mjs} +2 -2
- package/dist/{chunk-4BH22HLY.mjs → chunk-JJQAGAQN.mjs} +3 -3
- package/dist/{chunk-5UXTE3WM.mjs → chunk-KBB2WGTO.mjs} +2 -2
- package/dist/{chunk-MTDHDEDS.mjs → chunk-LCG5GI24.mjs} +6 -6
- package/dist/{chunk-QH2LF3L3.mjs → chunk-LIDMZELG.mjs} +3 -3
- package/dist/{chunk-KBR62ITL.mjs → chunk-N5B6HSHV.mjs} +4 -4
- package/dist/{chunk-XWRQODZZ.mjs → chunk-NUA7EUWX.mjs} +6 -6
- package/dist/{chunk-DAG7KGVL.mjs → chunk-O4CJ7NSN.mjs} +2 -2
- package/dist/{chunk-TG7T4QPS.mjs → chunk-ONWMWJ43.mjs} +2 -2
- package/dist/chunk-ONWMWJ43.mjs.map +1 -0
- package/dist/{chunk-HL7ITJJT.mjs → chunk-OVORFG3O.mjs} +2 -2
- package/dist/{chunk-4WIL3EXY.mjs → chunk-PB6SCADS.mjs} +4 -4
- package/dist/{chunk-RGO5KVRQ.mjs → chunk-QNE24TSJ.mjs} +2 -2
- package/dist/{chunk-BI3DP4QA.mjs → chunk-S2VNBE5K.mjs} +3 -3
- package/dist/{chunk-7W67IZE4.mjs → chunk-ST3P6VWM.mjs} +2 -2
- package/dist/{chunk-AMIP3FS5.mjs → chunk-TLYJ2G3X.mjs} +9 -3
- package/dist/chunk-TLYJ2G3X.mjs.map +1 -0
- package/dist/{chunk-SDGUXNY3.mjs → chunk-TMAB63X5.mjs} +2 -2
- package/dist/{chunk-BE474ULY.mjs → chunk-UCNB24EO.mjs} +2 -2
- package/dist/{chunk-YODYDO2U.mjs → chunk-W53U3D4O.mjs} +2 -2
- package/dist/{chunk-UHP56ITH.mjs → chunk-WBL4BT3I.mjs} +2 -2
- package/dist/{chunk-4K6SPD7T.mjs → chunk-WDC45I5H.mjs} +4 -4
- package/dist/{chunk-KWE3VWIW.mjs → chunk-Y5NBOPDI.mjs} +5 -5
- package/dist/chunk-Y5NBOPDI.mjs.map +1 -0
- package/dist/{chunk-OWZ5I5IV.mjs → chunk-YYIIQGLL.mjs} +13 -10
- package/dist/chunk-YYIIQGLL.mjs.map +1 -0
- package/dist/{chunk-I32HDHLS.mjs → chunk-ZNUHRHPU.mjs} +2 -2
- package/dist/data/Condition.mjs +5 -4
- package/dist/data/Database.mjs +6 -5
- package/dist/data/Field.mjs +5 -4
- package/dist/data/Field.mjs.map +1 -1
- package/dist/data/InMemoryGateway.mjs +14 -13
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/domain/Audit.mjs +18 -17
- package/dist/domain/Child.mjs +15 -14
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/DateTime.d.ts +1 -2
- package/dist/domain/DateTime.mjs +14 -13
- package/dist/domain/Entity.mjs +18 -17
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.mjs +14 -13
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.mjs +14 -13
- package/dist/domain/Typo.mjs +14 -13
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/http/CacheControl.mjs +14 -13
- package/dist/http/CacheControl.mjs.map +1 -1
- package/dist/http/ContentType.mjs +6 -5
- package/dist/http/HttpStatus.mjs +6 -5
- package/dist/http/HttpVerb.mjs +6 -5
- package/dist/http/LocalRequestStore.mjs +5 -4
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/RequestOptions.mjs +9 -8
- package/dist/http/RestResult.mjs +14 -13
- package/dist/http/toResponse.mjs +15 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +48 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/process/App.mjs +7 -6
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.mjs +14 -13
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.mjs +7 -6
- package/dist/process/Search.mjs +14 -13
- package/dist/process/UseCase.d.ts +1 -1
- package/dist/process/UseCase.mjs +9 -8
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/Req.mjs +13 -12
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/services/Api.mjs +22 -21
- package/dist/services/ApiGateway.mjs +25 -24
- package/dist/services/AxiosProvider.mjs +20 -19
- package/dist/services/MappedRouteGateway.mjs +28 -27
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.mjs +26 -25
- package/dist/services/ViewRouteGateway.mjs +29 -29
- package/dist/sql/Column.mjs +13 -12
- package/dist/sql/Count.mjs +5 -4
- package/dist/sql/Delete.mjs +4 -3
- package/dist/sql/Insert.mjs +4 -3
- package/dist/sql/Select.mjs +4 -3
- package/dist/sql/SqlQuery.mjs +3 -2
- package/dist/sql/Table.mjs +22 -21
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.mjs +14 -13
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/sql/Update.mjs +4 -3
- package/dist/types/AnyKey.d.ts +2 -2
- package/dist/types/Cache.mjs +4 -3
- package/dist/types/Cache.mjs.map +1 -1
- package/dist/types/CacheAge.mjs +14 -13
- package/dist/types/Case.mjs +12 -11
- package/dist/types/Context.d.ts +1 -1
- package/dist/types/Context.mjs +5 -4
- package/dist/types/Enum.mjs +5 -4
- package/dist/types/Environment.mjs +5 -4
- package/dist/types/Environment.mjs.map +1 -1
- package/dist/types/Exception.mjs +7 -6
- package/dist/types/Gateway.mjs +9 -8
- package/dist/types/IsEqual.mjs +13 -12
- package/dist/types/Json.mjs +4 -3
- package/dist/types/List.d.ts +12 -9
- package/dist/types/List.mjs +2 -1
- package/dist/types/Meta.mjs +4 -3
- package/dist/types/Number.mjs +13 -12
- package/dist/types/Object.mjs +3 -2
- package/dist/types/PageList.mjs +13 -12
- package/dist/types/Parser.mjs +12 -11
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Repository.mjs +9 -8
- package/dist/types/Result.mjs +6 -5
- package/dist/types/Results.mjs +7 -6
- package/dist/types/Tag.mjs +4 -3
- package/dist/types/Tag.mjs.map +1 -1
- package/dist/types/Template.d.ts +0 -43
- package/dist/types/Template.mjs +6 -11
- package/dist/types/ToText.d.ts +45 -0
- package/dist/types/ToText.mjs +23 -0
- package/dist/types/ToText.mjs.map +1 -0
- package/dist/types/Try.mjs +12 -11
- package/dist/types/Uri.mjs +12 -11
- package/dist/types/Uri.mjs.map +1 -1
- package/dist/utils/If.mjs +2 -1
- package/dist/utils/Mapper.mjs +6 -5
- package/dist/utils/Promise.d.ts +2 -0
- package/dist/utils/Promise.mjs +8 -4
- package/dist/utils/Seconds.mjs +3 -2
- package/dist/utils/Sentence.mjs +4 -3
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/View.mjs +16 -16
- package/dist/validation/Contraints.mjs +13 -12
- package/dist/validation/Validate.mjs +12 -11
- package/dist/validation/When.mjs +12 -11
- package/package.json +1 -1
- package/src/domain/DateTime.ts +1 -1
- package/src/index.ts +1 -1
- package/src/process/Scope.ts +1 -1
- package/src/process/UseCase.ts +5 -5
- package/src/types/AnyKey.ts +10 -2
- package/src/types/Context.ts +6 -2
- package/src/types/Exception.ts +2 -1
- package/src/types/List.ts +17 -11
- package/src/types/Template.ts +2 -152
- package/src/types/ToText.ts +167 -0
- package/src/types/Uri.ts +1 -1
- package/src/utils/Promise.ts +5 -0
- package/src/utils/Sentence.ts +1 -1
- package/src/validation/Contraints.ts +1 -1
- package/src/validation/Validate.ts +10 -3
- package/dist/chunk-AMIP3FS5.mjs.map +0 -1
- package/dist/chunk-KWE3VWIW.mjs.map +0 -1
- package/dist/chunk-OWZ5I5IV.mjs.map +0 -1
- package/dist/chunk-P4MEAARF.mjs.map +0 -1
- package/dist/chunk-Q7FJUYZT.mjs.map +0 -1
- package/dist/chunk-TG7T4QPS.mjs.map +0 -1
- package/dist/chunk-VKBEWDLL.mjs.map +0 -1
- package/dist/chunk-WUHEP5NJ.mjs.map +0 -1
- /package/dist/{chunk-HAEVUETQ.mjs.map → chunk-2C5WHSM5.mjs.map} +0 -0
- /package/dist/{chunk-UWA2JPXC.mjs.map → chunk-4WLPMNMB.mjs.map} +0 -0
- /package/dist/{chunk-DUMDOMES.mjs.map → chunk-6ATDEGSU.mjs.map} +0 -0
- /package/dist/{chunk-MBY7DP5K.mjs.map → chunk-6RSOVRW4.mjs.map} +0 -0
- /package/dist/{chunk-MBFLUJ5X.mjs.map → chunk-73VXBPTL.mjs.map} +0 -0
- /package/dist/{chunk-CHV6RMJL.mjs.map → chunk-7OEH5Q3V.mjs.map} +0 -0
- /package/dist/{chunk-SHTZ4ZZ2.mjs.map → chunk-AWT4XDU7.mjs.map} +0 -0
- /package/dist/{chunk-QL3DRPMM.mjs.map → chunk-BDKRR6H2.mjs.map} +0 -0
- /package/dist/{chunk-VI57VONC.mjs.map → chunk-CHLVZFAR.mjs.map} +0 -0
- /package/dist/{chunk-RTVVXROA.mjs.map → chunk-CMMMDBTK.mjs.map} +0 -0
- /package/dist/{chunk-3ZX4YFOK.mjs.map → chunk-EOIG654K.mjs.map} +0 -0
- /package/dist/{chunk-LMVFKEDS.mjs.map → chunk-F2SLQDR2.mjs.map} +0 -0
- /package/dist/{chunk-5UUY67VD.mjs.map → chunk-F7MQZLCR.mjs.map} +0 -0
- /package/dist/{chunk-3LWQJAEJ.mjs.map → chunk-FLJXHLSM.mjs.map} +0 -0
- /package/dist/{chunk-7WCAHERW.mjs.map → chunk-GA7BBYC2.mjs.map} +0 -0
- /package/dist/{chunk-UGTCVMQQ.mjs.map → chunk-GSAKK3JN.mjs.map} +0 -0
- /package/dist/{chunk-J7FACY7Y.mjs.map → chunk-I4HFLLRR.mjs.map} +0 -0
- /package/dist/{chunk-YAB5YLHI.mjs.map → chunk-J5AZL5T6.mjs.map} +0 -0
- /package/dist/{chunk-F4JCURDN.mjs.map → chunk-JABPZGOG.mjs.map} +0 -0
- /package/dist/{chunk-4BH22HLY.mjs.map → chunk-JJQAGAQN.mjs.map} +0 -0
- /package/dist/{chunk-5UXTE3WM.mjs.map → chunk-KBB2WGTO.mjs.map} +0 -0
- /package/dist/{chunk-MTDHDEDS.mjs.map → chunk-LCG5GI24.mjs.map} +0 -0
- /package/dist/{chunk-QH2LF3L3.mjs.map → chunk-LIDMZELG.mjs.map} +0 -0
- /package/dist/{chunk-KBR62ITL.mjs.map → chunk-N5B6HSHV.mjs.map} +0 -0
- /package/dist/{chunk-XWRQODZZ.mjs.map → chunk-NUA7EUWX.mjs.map} +0 -0
- /package/dist/{chunk-DAG7KGVL.mjs.map → chunk-O4CJ7NSN.mjs.map} +0 -0
- /package/dist/{chunk-HL7ITJJT.mjs.map → chunk-OVORFG3O.mjs.map} +0 -0
- /package/dist/{chunk-4WIL3EXY.mjs.map → chunk-PB6SCADS.mjs.map} +0 -0
- /package/dist/{chunk-RGO5KVRQ.mjs.map → chunk-QNE24TSJ.mjs.map} +0 -0
- /package/dist/{chunk-BI3DP4QA.mjs.map → chunk-S2VNBE5K.mjs.map} +0 -0
- /package/dist/{chunk-7W67IZE4.mjs.map → chunk-ST3P6VWM.mjs.map} +0 -0
- /package/dist/{chunk-SDGUXNY3.mjs.map → chunk-TMAB63X5.mjs.map} +0 -0
- /package/dist/{chunk-BE474ULY.mjs.map → chunk-UCNB24EO.mjs.map} +0 -0
- /package/dist/{chunk-YODYDO2U.mjs.map → chunk-W53U3D4O.mjs.map} +0 -0
- /package/dist/{chunk-UHP56ITH.mjs.map → chunk-WBL4BT3I.mjs.map} +0 -0
- /package/dist/{chunk-4K6SPD7T.mjs.map → chunk-WDC45I5H.mjs.map} +0 -0
- /package/dist/{chunk-I32HDHLS.mjs.map → chunk-ZNUHRHPU.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/Try.ts","../src/types/Case.ts","../src/validation/Validate.ts","../src/validation/When.ts"],"sourcesContent":["import { isDefined, isEmpty, isTrue } from './Is';\nimport { validate } from '../validation/Validate';\nimport { Construct, Constructor, ofConstruct } from './Constructor';\nimport { Validatable } from './Validatable';\nimport { Get, ofGet } from './Get';\nimport { Func } from './Func';\nimport { Optional } from './Types';\n\nexport abstract class Try<T = unknown> implements Validatable {\n is = {\n defined: (prop?: Func<unknown, T>): Try<T> => this.filter(v => isDefined(prop ? prop(v) : v)),\n empty: (prop?: Func<unknown, T>): Try<T> => this.filter(v => isEmpty(prop ? prop(v) : v)),\n valid: (prop?: Func<unknown, T>): Try<T> => this.filter(v => validate(prop ? prop(v) : v).isValid),\n true: (prop?: Func<unknown, T>): Try<T> => this.filter(v => isTrue(prop ? prop(v) : v)),\n false: (prop?: Func<unknown, T>): Try<T> => this.filter(v => !isTrue(prop ? prop(v) : v)),\n not: {\n defined: (prop?: Func<unknown, T>): Try<T> => this.filter(v => !isDefined(prop ? prop(v) : v)),\n empty: (prop?: Func<unknown, T>): Try<T> => this.filter(v => !isEmpty(prop ? prop(v) : v)),\n valid: (prop?: Func<unknown, T>): Try<T> => this.filter(v => !validate(prop ? prop(v) : v).isValid),\n },\n };\n\n if = this.is;\n\n abstract get value(): T;\n\n abstract get error(): Error;\n\n abstract get isValid(): boolean;\n\n static of = <T>(c: Get<T | Try<T>>, ...args: unknown[]): Try<T> => {\n try {\n const out = ofGet(c, ...args);\n return new Success(out instanceof Try ? out.value : out);\n } catch (e) {\n return new Failure(e as Error);\n }\n };\n\n abstract map<U>(f: Func<U | Try<U>, T>): Try<U>;\n\n abstract recover(f: Func<T | Try<T>, Error>): Try<T>;\n\n abstract recoverFrom(type: Constructor<Error>, f: Func<T | Try<T>, Error>): Try<T>;\n\n abstract accept(f: Func<void, T>): Try<T>;\n\n abstract filter(predicate: Func<boolean, T>): Try<T>;\n\n abstract or(value: Get<T>): T;\n\n abstract orElse(value?: Get<T>): Optional<T>;\n\n abstract orThrow(error: Construct<Error>): T;\n}\n\nclass Success<T> extends Try<T> {\n constructor(readonly value: T) {\n super();\n }\n\n get error(): Error {\n throw new Error('No error found');\n }\n\n get isValid(): boolean {\n return true;\n }\n\n map<U>(f: Func<U | Try<U>, T>): Try<U> {\n return tryTo<U>(f, this.value);\n }\n\n recover(f: Func<T | Try<T>, Error>): Try<T> {\n return this;\n }\n\n recoverFrom(type: Constructor<Error>, f: Func<T | Try<T>, Error>): Try<T> {\n return this;\n }\n\n accept(f: Func<void, T>): Try<T> {\n return tryTo(() => {\n f(this.value);\n return this;\n });\n }\n\n filter(predicate: Func<boolean, T>): Try<T> {\n return tryTo(() => {\n if (predicate(this.value)) return this;\n throw new Error(`Applying filter(${predicate.toString()}) failed.`);\n });\n }\n\n or(value: Get<T>): T {\n return this.value;\n }\n\n orElse(value?: Get<T>): Optional<T> {\n return this.value;\n }\n\n orThrow(_error: Construct<Error>): T {\n return this.value;\n }\n}\n\nclass Failure<T> extends Try<T> {\n constructor(readonly error: Error) {\n super();\n }\n\n get value(): T {\n throw this.error;\n }\n\n get isValid(): boolean {\n return false;\n }\n\n map<U>(f: Func<U | Try<U>, T>): Try<U> {\n return new Failure<U>(this.error);\n }\n\n recover<U>(f: Func<U | Try<U>, Error>): Try<U> {\n return tryTo<U>(f, this.error);\n }\n\n recoverFrom<U>(type: Constructor<Error>, f: Func<T | Try<T>, Error>): Try<T> {\n return tryTo(() => (this.error instanceof type ? this.recover(f) : this));\n }\n\n accept(f: Func<void, T>): Try<T> {\n return this;\n }\n\n filter(predicate: Func<boolean, T>): Try<T> {\n return this;\n }\n\n or(value: Get<T>): T {\n return ofGet(value);\n }\n\n orElse(value?: Get<T>): Optional<T> {\n return ofGet(value);\n }\n\n orThrow(error: Construct<Error>): T {\n throw ofConstruct(error);\n }\n}\n\nexport const tryTo = <T>(c: Get<T | Try<T>>, ...args: unknown[]) => Try.of<T>(c, ...args);\n","import { Get, ofGet, Predicate } from './Get';\nimport { TypeGuard } from './TypeGuard';\nimport { Func } from './Func';\nimport { isDefined, isEmpty } from './Is';\nimport { validate } from '../validation/Validate';\nimport { tryTo } from './Try';\n\nclass CaseBuilder<V> {\n is = {\n defined: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(isDefined(prop(this.v)), out),\n empty: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(isEmpty(prop(this.v)), out),\n valid: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(validate(prop(this.v)).isValid, out),\n in: <T>(prop: Get<Array<V>, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(ofGet(prop, this.v).includes(this.v), out),\n not: {\n defined: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(!isDefined(prop(this.v)), out),\n empty: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(!isEmpty(prop(this.v)), out),\n valid: <T>(prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(!validate(prop(this.v)).isValid, out),\n in: <T>(prop: Get<Array<V>, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.v).case(!ofGet(prop, this.v).includes(this.v), out),\n },\n };\n if = this.is;\n\n constructor(readonly v: V) {}\n\n case<T>(pred: Predicate<V>, out: Get<T, V>): Case<T, V> {\n return new Case<T, V>(this.v).case(pred, out);\n }\n\n type<T, U = unknown>(guard: TypeGuard<U>, out: Func<T, U>): Case<T, V> {\n return new Case<T, V>(this.v).type<U>(guard, out);\n }\n\n equals<T>(value: V, out: Get<T, V>): Case<T, V> {\n return new Case<T, V>(this.v).equals(value, out);\n }\n}\n\nclass Case<T, V = unknown> {\n is = {\n defined: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(isDefined(prop(this.value)), out),\n empty: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(isEmpty(prop(this.value)), out),\n valid: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(validate(prop(this.value)).isValid, out),\n in: (prop: Get<Array<V>, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(ofGet(prop, this.value).includes(this.value), out),\n not: {\n defined: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(!isDefined(prop(this.value)), out),\n empty: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(!isEmpty(prop(this.value)), out),\n valid: (prop: Func<unknown, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(!validate(prop(this.value)).isValid, out),\n in: (prop: Get<Array<V>, V>, out: Get<T, V>): Case<T, V> => new Case<T, V>(this.value).case(!ofGet(prop, this.value).includes(this.value), out),\n },\n };\n if = this.is;\n\n constructor(\n protected value: V,\n protected outcome?: T\n ) {}\n\n case(pred: Predicate<V>, out: Get<T, V>): Case<T, V> {\n return tryTo(pred, this.value)\n .is.true()\n .map(() => ofGet(out, this.value))\n .map(res => new Found(this.value, res) as Case<T, V>)\n .or(this);\n }\n\n type<U>(guard: TypeGuard<U>, out: Func<T, U>): Case<T, V> {\n return tryTo(guard, this.value)\n .is.true()\n .map(() => out(this.value as unknown as U))\n .map(res => new Found(this.value, res) as Case<T, V>)\n .or(this);\n }\n\n equals(value: V, out: Get<T, V>): Case<T, V> {\n return this.case(this.value === value, out);\n }\n\n else(alt: Get<T, V>): T {\n return ofGet<T, V>(alt, this.value);\n }\n}\n\nclass Found<T, V> extends Case<T, V> {\n is = {\n defined: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n empty: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n valid: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n in: (_prop: Get<Array<V>, V>, _out: Get<T, V>): Case<T, V> => this,\n not: {\n defined: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n empty: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n valid: (_prop: Func<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n in: (_prop: Get<unknown, V>, _out: Get<T, V>): Case<T, V> => this,\n },\n };\n if = this.is;\n\n constructor(\n protected value: V,\n protected outcome: T\n ) {\n super(value, outcome);\n }\n\n case(pred: Predicate<V>, out: Get<T, V>): this {\n return this;\n }\n\n type<U>(guard: TypeGuard<U>, out: Func<T, U>): Case<T, V> {\n return this;\n }\n\n equals(value: V, out: Get<T, V>): Case<T, V> {\n return this;\n }\n\n else(alt: Get<T, V>): T {\n return this.outcome;\n }\n}\n\nexport const choose = <V>(value: V) => new CaseBuilder<V>(value);\n","import { Constraint } from './Contraints';\nimport { when } from './When';\nimport type { TemplateOptions } from '../types/Template';\nimport { isResults, Results, toResults } from '../types/Results';\nimport { toName } from '../types/Constructor';\nimport { toResult } from '../types/Result';\nimport { List, toList } from '../types/List';\nimport { meta } from '../types/Meta';\nimport { isArray, isFunction } from '../types/Is';\nimport type { Text } from '../types/Text';\nimport { asString } from '../types/Text';\nimport { choose } from '../types/Case';\nimport { isEnum } from '../types/Enum';\nimport { isValue } from '../types/Value';\nimport { isValidatable } from '../types/Validatable';\nimport { text } from '../types/ToText';\n\nexport type Validator = { property: string | symbol; constraint: Constraint; text: Text; actual?: Text };\n\nexport const asResults = (subject: unknown, template: Text, options: TemplateOptions = {}): Results =>\n toResults(toResult(text(template).parse(subject, options), toName(subject)));\n\nconst validators = (subject: unknown): List<Validator> =>\n meta(subject)\n .keys<List<Validator>>('constraint')\n .reduce((list, vs) => list.add(vs), toList<Validator>());\n\nconst runValidator = (v: Validator, subject?: unknown): Results => {\n try {\n const actual = isFunction((subject as any)[v.property]) ? (subject as any)[v.property]() : (subject as any)[v.property];\n const constraint = v.constraint(actual);\n return isResults(constraint)\n ? constraint\n : !constraint\n ? asResults(subject, v.text, {\n ...v,\n actual,\n })\n : toResults();\n } catch (e) {\n return asResults(subject, asString(e));\n }\n};\n\nconst constraints = (subject?: unknown): Results =>\n validators(subject)\n .map(vs => runValidator(vs, subject))\n .reduce((rs, r) => rs.add(...r.results), toResults());\n\nexport const validate = (subject?: unknown): Results =>\n choose(subject)\n .is.not.defined(\n s => s,\n () => toResults('Subject is not defined.')\n )\n .type(isEnum, e => (e.isValid ? toResults() : asResults(e, 'This is not a valid {type}.')))\n .type(isValue, v => (v.isValid ? toResults() : asResults(v, 'This is not a valid {type}.')))\n .type(isArray, a => a.map(i => validate(i)).reduce((rs, r) => rs.add(...r.results), toResults()))\n .type(isValidatable, v => constraints(v))\n .else(toResults());\n\nexport const validateReject = <T>(subject: T): Promise<T> => when(subject).not.isValid.reject();\n\nexport const isValid = <T>(t: T): boolean => validate(t).isValid;\n","import { validate } from './Validate';\nimport { Results } from '../types/Results';\nimport { Constructor } from '../types/Constructor';\nimport { Get, ofGet, Predicate } from '../types/Get';\nimport { isDefined, isEmpty, isIn } from '../types/Is';\nimport { toArray } from '../types/Array';\nimport { ErrorOrigin } from '../types/ErrorOrigin';\nimport { reject, resolve } from '../utils/Promise';\nimport { Exception } from '../types/Exception';\n\nexport class When<W> {\n constructor(\n readonly subject: W,\n readonly valid = true,\n private results?: Results\n ) {}\n\n get not(): When<W> {\n return this.clone(!this.valid);\n }\n\n get and(): When<W> {\n return this.clone(this.valid);\n }\n\n get isDefined(): When<W> {\n return this.clone(this.valid === isDefined(this.subject));\n }\n\n get isEmpty(): When<W> {\n return this.clone(this.valid === isEmpty(this.subject));\n }\n\n get isTrue(): When<W> {\n return this.clone(this.valid === !!this.subject);\n }\n\n get isValid(): When<W> {\n this.results = validate(this.subject);\n return this.clone(this.valid === this.results.isValid);\n }\n\n isInstance = <U>(c: Constructor<U>): When<W> => this.clone(this.valid === this.subject instanceof c);\n\n with = (pred: Predicate<W>): When<W> => this.clone(this.valid === ofGet(pred, this.subject));\n\n contains = (property: (w: W) => unknown): When<W> => this.clone(this.valid === isDefined(ofGet(property, this.subject)));\n\n in = (...items: W[]): When<W> => this.clone(this.valid === isIn(this.subject, toArray(...items)));\n\n is = (item: W): When<W> => this.clone(this.valid === (this.subject === item));\n\n reject = (error?: Get<ErrorOrigin, W>): Promise<NonNullable<W>> =>\n !this.valid ? resolve(this.subject as NonNullable<W>) : reject(ofGet(error, this.subject) ?? this.results ?? Exception.Unknown);\n\n recover = (f: (item: W) => W | Promise<W>): Promise<W> => resolve(!this.valid ? this.subject : f(this.subject));\n\n protected clone = (result = true): When<W> => new When(this.subject, result, this.results);\n}\n\nexport const when = <T>(subject: T): When<T> => new When<T>(subject);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAe,MAAf,MAAe,KAAwC;AAAA,EAC5D,KAAK;AAAA,IACH,SAAS,CAAC,SAAoC,KAAK,OAAO,OAAK,UAAU,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AAAA,IAC5F,OAAO,CAAC,SAAoC,KAAK,OAAO,OAAK,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AAAA,IACxF,OAAO,CAAC,SAAoC,KAAK,OAAO,OAAK,SAAS,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO;AAAA,IACjG,MAAM,CAAC,SAAoC,KAAK,OAAO,OAAK,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;A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AgC,KAAK,MAAM,KAAK,UAAU,MAAM,MAAM,KAAK,OAAO,CAAC;AAAA,EAE3F,WAAW,CAAC,aAAyC,KAAK,MAAM,KAAK,UAAU,UAAU,MAAM,UAAU,KAAK,OAAO,CAAC,CAAC;AAAA,EAEvH,KAAK,IAAI,UAAwB,KAAK,MAAM,KAAK,UAAU,KAAK,KAAK,SAAS,QAAQ,GAAG,KAAK,CAAC,CAAC;AAAA,EAEhG,KAAK,CAAC,SAAqB,KAAK,MAAM,KAAK,WAAW,KAAK,YAAY,KAAK;AAAA,EAE5E,SAAS,CAAC,UACR,CAAC,KAAK,QAAQ,QAAQ,KAAK,OAAyB,IAAI,OAAO,MAAM,OAAO,KAAK,OAAO,KAAK,KAAK,WAAW,UAAU,OAAO;AAAA,EAEhI,UAAU,CAAC,MAA+C,QAAQ,CAAC,KAAK,QAAQ,KAAK,UAAU,EAAE,KAAK,OAAO,CAAC;AAAA,EAEpG,QAAQ,CAAC,SAAS,SAAkB,IAAI,MAAK,KAAK,SAAS,QAAQ,KAAK,OAAO;AAC3F;AAEO,IAAM,OAAO,CAAI,YAAwB,IAAI,KAAQ,OAAO;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-GCY5A63A.mjs";
|
|
7
7
|
import {
|
|
8
8
|
tryTo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YYIIQGLL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ofGet
|
|
12
12
|
} from "./chunk-SJGQU3OG.mjs";
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
PatternColumn,
|
|
80
80
|
OrderColumn
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-ZNUHRHPU.mjs.map
|
package/dist/data/Condition.mjs
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
SortCondition,
|
|
5
5
|
isSortCondition,
|
|
6
6
|
toCondition
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TMAB63X5.mjs";
|
|
8
8
|
import "../chunk-MDXL65W4.mjs";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
11
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
12
13
|
import "../chunk-CO2AFYVD.mjs";
|
|
13
14
|
import "../chunk-BDA5LB4S.mjs";
|
|
14
15
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/data/Database.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Database,
|
|
3
3
|
DefaultProvider
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-2C5WHSM5.mjs";
|
|
5
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
6
|
+
import "../chunk-LIDMZELG.mjs";
|
|
7
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
8
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
9
|
+
import "../chunk-SSROJBD5.mjs";
|
|
9
10
|
import "../chunk-CO2AFYVD.mjs";
|
|
10
11
|
import "../chunk-BDA5LB4S.mjs";
|
|
11
12
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/data/Field.mjs
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
SortCondition,
|
|
6
6
|
toCondition
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TMAB63X5.mjs";
|
|
8
8
|
import "../chunk-MDXL65W4.mjs";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
11
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
12
|
+
import "../chunk-SSROJBD5.mjs";
|
|
12
13
|
import {
|
|
13
14
|
toArray
|
|
14
15
|
} from "../chunk-CO2AFYVD.mjs";
|
package/dist/data/Field.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/Field.ts"],"sourcesContent":["import { Condition, SortCondition, toCondition } from './Condition';\nimport { Property } from '../utils/Property';\nimport { toArray } from '../types/Array';\nimport { isDefined } from '../types/Is';\n\nexport class Field extends Property {\n is = (value: unknown): Condition => this.condition('eq', value);\n\n isNot = (value: unknown): Condition => this.condition('ne', value);\n\n isIn = (...value: unknown[]): Condition => this.condition('in', toArray(value));\n\n notIn = (...value: unknown[]): Condition => this.condition('nin', toArray(value));\n\n exists = (does: boolean): Condition => this.condition('exists', does);\n\n greater = (value: unknown): Condition => this.condition('gt', value);\n\n greaterEqual = (value: unknown): Condition => this.condition('gte', value);\n\n less = (value: unknown): Condition => this.condition('lt', value);\n\n lessEqual = (value: unknown): Condition => this.condition('lte', value);\n\n asc = (): SortCondition => new SortCondition(this.property, 1);\n\n desc = (): SortCondition => new SortCondition(this.property, -1);\n\n protected condition = (operator: string, value: unknown): Condition => toCondition(this.property, operator, value, this.options?.convert);\n}\n\nexport const isField = (f?: unknown): f is Field => isDefined(f) && f instanceof Field;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/data/Field.ts"],"sourcesContent":["import { Condition, SortCondition, toCondition } from './Condition';\nimport { Property } from '../utils/Property';\nimport { toArray } from '../types/Array';\nimport { isDefined } from '../types/Is';\n\nexport class Field extends Property {\n is = (value: unknown): Condition => this.condition('eq', value);\n\n isNot = (value: unknown): Condition => this.condition('ne', value);\n\n isIn = (...value: unknown[]): Condition => this.condition('in', toArray(value));\n\n notIn = (...value: unknown[]): Condition => this.condition('nin', toArray(value));\n\n exists = (does: boolean): Condition => this.condition('exists', does);\n\n greater = (value: unknown): Condition => this.condition('gt', value);\n\n greaterEqual = (value: unknown): Condition => this.condition('gte', value);\n\n less = (value: unknown): Condition => this.condition('lt', value);\n\n lessEqual = (value: unknown): Condition => this.condition('lte', value);\n\n asc = (): SortCondition => new SortCondition(this.property, 1);\n\n desc = (): SortCondition => new SortCondition(this.property, -1);\n\n protected condition = (operator: string, value: unknown): Condition => toCondition(this.property, operator, value, this.options?.convert);\n}\n\nexport const isField = (f?: unknown): f is Field => isDefined(f) && f instanceof Field;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,QAAN,cAAoB,SAAS;AAAA,EAClC,KAAK,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAE9D,QAAQ,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEjE,OAAO,IAAI,UAAgC,KAAK,UAAU,MAAM,QAAQ,KAAK,CAAC;AAAA,EAE9E,QAAQ,IAAI,UAAgC,KAAK,UAAU,OAAO,QAAQ,KAAK,CAAC;AAAA,EAEhF,SAAS,CAAC,SAA6B,KAAK,UAAU,UAAU,IAAI;AAAA,EAEpE,UAAU,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEnE,eAAe,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEzE,OAAO,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEhE,YAAY,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEtE,MAAM,MAAqB,IAAI,cAAc,KAAK,UAAU,CAAC;AAAA,EAE7D,OAAO,MAAqB,IAAI,cAAc,KAAK,UAAU,EAAE;AAAA,EAErD,YAAY,CAAC,UAAkB,UAA8B,YAAY,KAAK,UAAU,UAAU,OAAO,KAAK,SAAS,OAAO;AAC1I;AAEO,IAAM,UAAU,CAAC,MAA4B,UAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Gateway
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-I4HFLLRR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toPageList
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JJQAGAQN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import "../chunk-OFGI5FLG.mjs";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
12
|
+
import "../chunk-OVORFG3O.mjs";
|
|
13
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Exception
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
17
17
|
import "../chunk-WSBULPUZ.mjs";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
19
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
20
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
21
|
+
import "../chunk-LIDMZELG.mjs";
|
|
22
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
23
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
24
|
+
import "../chunk-SSROJBD5.mjs";
|
|
24
25
|
import "../chunk-CO2AFYVD.mjs";
|
|
25
26
|
import "../chunk-BDA5LB4S.mjs";
|
|
26
27
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/InMemoryGateway.ts"],"sourcesContent":["import { FetchOptions, Gateway } from '../types/Gateway';\nimport { PageList, toPageList } from '../types/PageList';\nimport { Json, JsonValue } from '../types/Json';\nimport { Id } from '../types/Id';\nimport { Optional } from '../types/Types';\nimport { isDefined } from '../types/Is';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\n\nexport class InMemoryGateway extends Gateway {\n constructor(private readonly data: Promise<PageList<Json>>) {\n super();\n }\n\n all(options?: FetchOptions): Promise<PageList<Json>> {\n return this.data.then(d => toPageList(d, d));\n }\n\n byId(id: Id): Promise<Optional<Json>> {\n return this.data.then(d => d.byId(id)).then(d => (d ? { ...d } : undefined));\n }\n\n by = (key: string, value: JsonValue): Promise<PageList<Json>> => {\n return this.data.then(d => d.filter(i => i[key] === value));\n };\n\n exists(id: Id): Promise<boolean> {\n return this.byId(id).then(d => isDefined(d));\n }\n\n add(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.exists(i.id as Id))\n .then(ex => when(ex).isTrue.reject(Exception.AlreadyExists))\n .then(() => this.data.then(d => d.add(item)))\n .then(() => ({ ...item }));\n }\n\n remove(id: Id): Promise<true> {\n return this.data\n .then(d =>\n when(d.findIndex(i => i.id === id))\n .with(i => i < 0)\n .reject(Exception.DoesNotExist)\n .then(i => d.splice(i, 1))\n )\n .then(() => true);\n }\n\n update(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.remove(i.id as Id).then(() => this.add(i)));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/data/InMemoryGateway.ts"],"sourcesContent":["import { FetchOptions, Gateway } from '../types/Gateway';\nimport { PageList, toPageList } from '../types/PageList';\nimport { Json, JsonValue } from '../types/Json';\nimport { Id } from '../types/Id';\nimport { Optional } from '../types/Types';\nimport { isDefined } from '../types/Is';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\n\nexport class InMemoryGateway extends Gateway {\n constructor(private readonly data: Promise<PageList<Json>>) {\n super();\n }\n\n all(options?: FetchOptions): Promise<PageList<Json>> {\n return this.data.then(d => toPageList(d, d));\n }\n\n byId(id: Id): Promise<Optional<Json>> {\n return this.data.then(d => d.byId(id)).then(d => (d ? { ...d } : undefined));\n }\n\n by = (key: string, value: JsonValue): Promise<PageList<Json>> => {\n return this.data.then(d => d.filter(i => i[key] === value));\n };\n\n exists(id: Id): Promise<boolean> {\n return this.byId(id).then(d => isDefined(d));\n }\n\n add(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.exists(i.id as Id))\n .then(ex => when(ex).isTrue.reject(Exception.AlreadyExists))\n .then(() => this.data.then(d => d.add(item)))\n .then(() => ({ ...item }));\n }\n\n remove(id: Id): Promise<true> {\n return this.data\n .then(d =>\n when(d.findIndex(i => i.id === id))\n .with(i => i < 0)\n .reject(Exception.DoesNotExist)\n .then(i => d.splice(i, 1))\n )\n .then(() => true);\n }\n\n update(item: Json): Promise<Json> {\n return when(item)\n .not.contains(i => i.id)\n .reject(Exception.IsMissingId)\n .then(i => this.remove(i.id as Id).then(() => this.add(i)));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,IAAM,kBAAN,cAA8B,QAAQ;AAAA,EAC3C,YAA6B,MAA+B;AAC1D,UAAM;AADqB;AAAA,EAE7B;AAAA,EAEA,IAAI,SAAiD;AACnD,WAAO,KAAK,KAAK,KAAK,OAAK,WAAW,GAAG,CAAC,CAAC;AAAA,EAC7C;AAAA,EAEA,KAAK,IAAiC;AACpC,WAAO,KAAK,KAAK,KAAK,OAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAM,IAAI,EAAE,GAAG,EAAE,IAAI,MAAU;AAAA,EAC7E;AAAA,EAEA,KAAK,CAAC,KAAa,UAA8C;AAC/D,WAAO,KAAK,KAA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GI24.mjs";
|
|
4
|
+
import "../chunk-Y5NBOPDI.mjs";
|
|
5
|
+
import "../chunk-2BOK6R6N.mjs";
|
|
6
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
7
7
|
import "../chunk-ADJAEGCT.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-CMMMDBTK.mjs";
|
|
9
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
10
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
11
11
|
import "../chunk-OFGI5FLG.mjs";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
13
|
+
import "../chunk-OVORFG3O.mjs";
|
|
14
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
15
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
16
16
|
import "../chunk-WSBULPUZ.mjs";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
18
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
19
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
20
|
+
import "../chunk-LIDMZELG.mjs";
|
|
21
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
22
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
23
|
+
import "../chunk-SSROJBD5.mjs";
|
|
23
24
|
import "../chunk-CO2AFYVD.mjs";
|
|
24
25
|
import "../chunk-BDA5LB4S.mjs";
|
|
25
26
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Child.mjs
CHANGED
|
@@ -4,27 +4,28 @@ import {
|
|
|
4
4
|
import "../chunk-SJ4YFZKO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
required
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-Y5NBOPDI.mjs";
|
|
8
8
|
import "../chunk-ADJAEGCT.mjs";
|
|
9
9
|
import {
|
|
10
10
|
Struct
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-CMMMDBTK.mjs";
|
|
12
12
|
import {
|
|
13
13
|
json
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
15
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
16
16
|
import "../chunk-OFGI5FLG.mjs";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
18
|
+
import "../chunk-OVORFG3O.mjs";
|
|
19
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
20
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
21
21
|
import "../chunk-WSBULPUZ.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
23
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
24
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
25
|
+
import "../chunk-LIDMZELG.mjs";
|
|
26
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
27
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
28
|
+
import "../chunk-SSROJBD5.mjs";
|
|
28
29
|
import "../chunk-CO2AFYVD.mjs";
|
|
29
30
|
import "../chunk-BDA5LB4S.mjs";
|
|
30
31
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Child.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Child extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, { id: this.id });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Child.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Child extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, { id: this.id });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAe,QAAf,cAA6B,OAAO;AAAA,EACpB,KAAS,KAAK,MAAM,MAAM,KAAK;AAAA,EAE1C,MAAM,GAAkB;AAChC,WAAO,KAAK,MAAM,MAAM,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC;AAAA,EAC5C;AACF;AALuB;AAAA,EAApB,SAAS;AAAA,GADU,MACC;","names":[]}
|
|
@@ -8,7 +8,7 @@ export type Duration = Partial<Record<DurationUnit, number>>;
|
|
|
8
8
|
export type DiffOptions = {
|
|
9
9
|
rounding: 'floor' | 'ceil' | 'round';
|
|
10
10
|
};
|
|
11
|
-
type DatetimeInput = string | number | Date | DateTime | null;
|
|
11
|
+
export type DatetimeInput = string | number | Date | DateTime | null;
|
|
12
12
|
export declare class DateTime extends Value<Optional<string>> {
|
|
13
13
|
protected readonly luxon: LuxonDateTime;
|
|
14
14
|
constructor(value?: DatetimeInput);
|
|
@@ -47,4 +47,3 @@ export declare class DateTime extends Value<Optional<string>> {
|
|
|
47
47
|
}
|
|
48
48
|
export declare const isDateTime: (dt?: unknown) => dt is DateTime;
|
|
49
49
|
export declare const dt: (dt?: DatetimeInput) => DateTime;
|
|
50
|
-
export {};
|
package/dist/domain/DateTime.mjs
CHANGED
|
@@ -2,22 +2,23 @@ import {
|
|
|
2
2
|
DateTime,
|
|
3
3
|
dt,
|
|
4
4
|
isDateTime
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-2BOK6R6N.mjs";
|
|
6
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
7
7
|
import "../chunk-ADJAEGCT.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
9
9
|
import "../chunk-OFGI5FLG.mjs";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
11
|
+
import "../chunk-OVORFG3O.mjs";
|
|
12
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
13
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
14
14
|
import "../chunk-WSBULPUZ.mjs";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
16
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
17
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
18
|
+
import "../chunk-LIDMZELG.mjs";
|
|
19
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
20
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
21
|
+
import "../chunk-SSROJBD5.mjs";
|
|
21
22
|
import "../chunk-CO2AFYVD.mjs";
|
|
22
23
|
import "../chunk-BDA5LB4S.mjs";
|
|
23
24
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Entity.mjs
CHANGED
|
@@ -4,32 +4,33 @@ import {
|
|
|
4
4
|
import "../chunk-SJ4YFZKO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Audit
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-LCG5GI24.mjs";
|
|
8
8
|
import {
|
|
9
9
|
required
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-Y5NBOPDI.mjs";
|
|
11
|
+
import "../chunk-2BOK6R6N.mjs";
|
|
12
|
+
import "../chunk-O4CJ7NSN.mjs";
|
|
13
13
|
import "../chunk-ADJAEGCT.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Struct
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-CMMMDBTK.mjs";
|
|
17
17
|
import {
|
|
18
18
|
json
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
20
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
21
21
|
import "../chunk-OFGI5FLG.mjs";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
23
|
+
import "../chunk-OVORFG3O.mjs";
|
|
24
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
25
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
26
26
|
import "../chunk-WSBULPUZ.mjs";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
28
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
29
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
30
|
+
import "../chunk-LIDMZELG.mjs";
|
|
31
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
32
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
33
|
+
import "../chunk-SSROJBD5.mjs";
|
|
33
34
|
import "../chunk-CO2AFYVD.mjs";
|
|
34
35
|
import "../chunk-BDA5LB4S.mjs";
|
|
35
36
|
import "../chunk-SJGQU3OG.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Entity.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { Audit } from './Audit';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Entity extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n @required() readonly created: Audit = new Audit(this.state.created);\n @required() readonly lastModified: Audit = new Audit(this.state.lastModified);\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, {\n id: this.id,\n created: this.created,\n lastModified: new Audit(),\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Entity.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { Audit } from './Audit';\nimport { required } from '../validation/Contraints';\nimport { Id, toId } from '../types/Id';\nimport { json, Json } from '../types/Json';\n\nexport abstract class Entity extends Struct {\n @required() readonly id: Id = this.state.id ?? toId();\n @required() readonly created: Audit = new Audit(this.state.created);\n @required() readonly lastModified: Audit = new Audit(this.state.lastModified);\n\n protected merge(a: unknown): Json {\n return json.merge(this, a, {\n id: this.id,\n created: this.created,\n lastModified: new Audit(),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAe,SAAf,cAA8B,OAAO;AAAA,EACrB,KAAS,KAAK,MAAM,MAAM,KAAK;AAAA,EAC/B,UAAiB,IAAI,MAAM,KAAK,MAAM,OAAO;AAAA,EAC7C,eAAsB,IAAI,MAAM,KAAK,MAAM,YAAY;AAAA,EAElE,MAAM,GAAkB;AAChC,WAAO,KAAK,MAAM,MAAM,GAAG;AAAA,MACzB,IAAI,KAAK;AAAA,MACT,SAAS,KAAK;AAAA,MACd,cAAc,IAAI,MAAM;AAAA,IAC1B,CAAC;AAAA,EACH;AACF;AAXuB;AAAA,EAApB,SAAS;AAAA,GADU,OACC;AACA;AAAA,EAApB,SAAS;AAAA,GAFU,OAEC;AACA;AAAA,EAApB,SAAS;AAAA,GAHU,OAGC;","names":[]}
|
package/dist/domain/Repo.mjs
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-S2VNBE5K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
isValidatable
|
|
12
12
|
} from "../chunk-OFGI5FLG.mjs";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
14
|
+
import "../chunk-OVORFG3O.mjs";
|
|
15
15
|
import {
|
|
16
16
|
reject,
|
|
17
17
|
resolve
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-HO3IEF5S.mjs";
|
|
19
19
|
import {
|
|
20
20
|
Exception
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
22
22
|
import "../chunk-WSBULPUZ.mjs";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
24
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
25
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
26
|
+
import "../chunk-LIDMZELG.mjs";
|
|
27
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
28
28
|
import {
|
|
29
29
|
asList
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-TLYJ2G3X.mjs";
|
|
31
|
+
import "../chunk-SSROJBD5.mjs";
|
|
31
32
|
import "../chunk-CO2AFYVD.mjs";
|
|
32
33
|
import "../chunk-BDA5LB4S.mjs";
|
|
33
34
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Repo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Repo.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Constructor } from '../types/Constructor';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { isValidatable } from '../types/Validatable';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { asList, List } from '../types/List';\nimport { reject, resolve } from '../utils/Promise';\n\nexport type RepoAction = 'add' | 'update' | 'remove';\n\nexport class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {\n constructor(\n protected ctor: Constructor<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (item: T | Json): T => (isValidatable(item) ? item : new this.ctor(item));\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(j => asList(this.ctor, j));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: T | Json): Promise<T> {\n return this.extend(this.create(t), 'add')\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'add'))\n .then(i => this.gateway.add(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n update(id: Id, json: Json): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j).update(json) as T)\n .then(i => this.extend(i, 'update'))\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'update'))\n .then(i => this.gateway.update(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n\n extend(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n validate(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n upsert(id: Id, item: Json): Promise<T> {\n return this.update(id, item).catch(e => (Exception.DoesNotExist.equals(e) ? this.add(item) : reject(e)));\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Repo.ts"],"sourcesContent":["import { Struct } from './Struct';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Constructor } from '../types/Constructor';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { isValidatable } from '../types/Validatable';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { asList, List } from '../types/List';\nimport { reject, resolve } from '../utils/Promise';\n\nexport type RepoAction = 'add' | 'update' | 'remove';\n\nexport class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {\n constructor(\n protected ctor: Constructor<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (item: T | Json): T => (isValidatable(item) ? item : new this.ctor(item));\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(j => asList(this.ctor, j));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(i => new this.ctor(i)));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(i => new this.ctor(i)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: T | Json): Promise<T> {\n return this.extend(this.create(t), 'add')\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'add'))\n .then(i => this.gateway.add(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n update(id: Id, json: Json): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => new this.ctor(j).update(json) as T)\n .then(i => this.extend(i, 'update'))\n .then(i => when(i).not.isValid.reject())\n .then(i => this.validate(i, 'update'))\n .then(i => this.gateway.update(toJson(i)))\n .then(j => new this.ctor(j));\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n\n extend(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n validate(item: T, _action?: RepoAction): Promise<T> {\n return resolve(item);\n }\n\n upsert(id: Id, item: Json): Promise<T> {\n return this.update(id, item).catch(e => (Exception.DoesNotExist.equals(e) ? this.add(item) : reject(e)));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,OAAN,cAA6D,WAAuB;AAAA,EACzF,YACY,MACO,SACjB;AACA,UAAM;AAHI;AACO;AAAA,EAGnB;AAAA,EAEA,SAAS,CAAC,SAAuB,cAAc,IAAI,IAAI,OAAO,IAAI,KAAK,KAAK,IAAI;AAAA,EAEhF,IAAI,SAAyC;AAC3C,WAAO,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAM,GAAG,IAAI,OAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC;AAAA,EAC3E;AAAA,EAEA,KAAK,IAAoB;AACvB,WAAO,KAAK,QACT,KAAK,EAAE,EACP,KAAK,OAAK,KAAK,CAAC,EAAE,IAAI,UAAU,OAAO,UAAU,YAAY,CAAC,EAC9D,KAAK,OAAK,IAAI,KAAK,KAAK,CAAC,CAAC;AAAA,EAC/B;AAAA,EAEA,SAAS,KAA6B;AACpC,WAAO,KAAK,QAAQ,MAAM,GAAG,GAAG,EAAE,KAAK,OAAK,OAAO,KAAK,MAAM,CAAC,CAAC;AAAA,EAClE;AAAA,EAEA,MAAM,KAAU,SAAyC;AACvD,WAAO,KAAK,QAAQ,GAAG,OAAO,KAAK,OAAO,EAAE,KAAK,QAAM,GAAG,IAAI,OAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC;AAAA,EACtF;AAAA,EAEA,GAAG,KAAc,OAAkB,SAAyC;AAC1E,WAAO,KAAK,QAAQ,GAAG,IAAI,SAAS,GAAG,OAAO,OAAO,EAAE,K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K,KAAK,CAAC,CAAC;AAAA,EAC/B;AAAA,EAEA,OAAO,IAA0B;AAC/B,WAAO,KAAK,QAAQ,OAAO,EAAE;AAAA,EAC/B;AAAA,EAEA,OAAO,MAAS,SAAkC;AAChD,WAAO,QAAQ,IAAI;AAAA,EACrB;AAAA,EAEA,SAAS,MAAS,SAAkC;AAClD,WAAO,QAAQ,IAAI;AAAA,EACrB;AAAA,EAEA,OAAO,IAAQ,MAAwB;AACrC,WAAO,KAAK,OAAO,IAAI,IAAI,EAAE,MAAM,OAAM,UAAU,aAAa,OAAO,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,CAAE;AAAA,EACzG;AACF;","names":[]}
|
package/dist/domain/Struct.mjs
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Struct,
|
|
3
3
|
isStruct
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-CMMMDBTK.mjs";
|
|
5
|
+
import "../chunk-GA7BBYC2.mjs";
|
|
6
|
+
import "../chunk-YYIIQGLL.mjs";
|
|
7
7
|
import "../chunk-OFGI5FLG.mjs";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
9
|
+
import "../chunk-OVORFG3O.mjs";
|
|
10
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
11
|
+
import "../chunk-HFBHENMJ.mjs";
|
|
12
12
|
import "../chunk-WSBULPUZ.mjs";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
14
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
15
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
16
|
+
import "../chunk-LIDMZELG.mjs";
|
|
17
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
18
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
19
|
+
import "../chunk-SSROJBD5.mjs";
|
|
19
20
|
import "../chunk-CO2AFYVD.mjs";
|
|
20
21
|
import "../chunk-BDA5LB4S.mjs";
|
|
21
22
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Typo.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Repository
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-S2VNBE5K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toJson
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-GA7BBYC2.mjs";
|
|
7
7
|
import {
|
|
8
8
|
when
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YYIIQGLL.mjs";
|
|
10
10
|
import "../chunk-OFGI5FLG.mjs";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ST3P6VWM.mjs";
|
|
12
|
+
import "../chunk-OVORFG3O.mjs";
|
|
13
|
+
import "../chunk-HO3IEF5S.mjs";
|
|
14
14
|
import {
|
|
15
15
|
Exception
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-HFBHENMJ.mjs";
|
|
17
17
|
import "../chunk-WSBULPUZ.mjs";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ONWMWJ43.mjs";
|
|
19
|
+
import "../chunk-6ENYJKOF.mjs";
|
|
20
|
+
import "../chunk-FLJXHLSM.mjs";
|
|
21
|
+
import "../chunk-LIDMZELG.mjs";
|
|
22
|
+
import "../chunk-KBB2WGTO.mjs";
|
|
23
|
+
import "../chunk-TLYJ2G3X.mjs";
|
|
24
|
+
import "../chunk-SSROJBD5.mjs";
|
|
24
25
|
import "../chunk-CO2AFYVD.mjs";
|
|
25
26
|
import "../chunk-BDA5LB4S.mjs";
|
|
26
27
|
import "../chunk-SJGQU3OG.mjs";
|
package/dist/domain/Typo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain/Typo.ts"],"sourcesContent":["import { View } from '../utils/View';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { List } from '../types/List';\nimport { RouteGateway } from '../services/RouteGateway';\nimport { RouteOptions } from '../services/Api';\n\nexport class Typo<T, Options extends RouteOptions = RouteOptions> extends Repository<T, Options> {\n constructor(\n protected view: View<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (j: Json): T => this.view.from(j);\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(this.create));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => this.create(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(js => js.map(this.create));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(this.create));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(this.create));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(this.create));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(j => this.create(j)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n}\n\nexport class Agent<T, Options extends FetchOptions = FetchOptions> extends Repository<T, Options> {\n constructor(private gateway: RouteGateway) {\n super();\n }\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options) as Promise<PageList<T>>;\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway.byId(id) as Promise<T>;\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids) as Promise<List<T>>;\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options) as Promise<PageList<T>>;\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options) as Promise<PageList<T>>;\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options) as Promise<PageList<T>>;\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options) as Promise<PageList<T>>;\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: Partial<T>): Promise<T> {\n return this.gateway.add(toJson(t)) as Promise<T>;\n }\n\n update(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.update({ ...toJson(t), id }) as Promise<T>;\n }\n\n upsert(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.upsert({ ...toJson(t), id }) as Promise<T>;\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/domain/Typo.ts"],"sourcesContent":["import { View } from '../utils/View';\nimport { FetchOptions, Gateway } from '../types/Gateway';\nimport { Repository } from '../types/Repository';\nimport { Json, JsonValue, toJson } from '../types/Json';\nimport { PageList } from '../types/PageList';\nimport { Id, Key } from '../types/Id';\nimport { when } from '../validation/When';\nimport { Exception } from '../types/Exception';\nimport { List } from '../types/List';\nimport { RouteGateway } from '../services/RouteGateway';\nimport { RouteOptions } from '../services/Api';\n\nexport class Typo<T, Options extends RouteOptions = RouteOptions> extends Repository<T, Options> {\n constructor(\n protected view: View<T>,\n private readonly gateway: Gateway<Options>\n ) {\n super();\n }\n\n create = (j: Json): T => this.view.from(j);\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options).then(js => js.map(this.create));\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway\n .byId(id)\n .then(j => when(j).not.isDefined.reject(Exception.DoesNotExist))\n .then(j => this.create(j));\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids).then(js => js.map(this.create));\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options).then(js => js.map(this.create));\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options).then(js => js.map(this.create));\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options).then(js => js.map(this.create));\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options).then(js => js.map(j => this.create(j)));\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n}\n\nexport class Agent<T, Options extends FetchOptions = FetchOptions> extends Repository<T, Options> {\n constructor(private gateway: RouteGateway) {\n super();\n }\n\n all(options?: Options): Promise<PageList<T>> {\n return this.gateway.all(options) as Promise<PageList<T>>;\n }\n\n byId(id: Id): Promise<T> {\n return this.gateway.byId(id) as Promise<T>;\n }\n\n byIds(...ids: Id[]): Promise<List<T>> {\n return this.gateway.byIds(...ids) as Promise<List<T>>;\n }\n\n byKey(key: Key, options?: Options): Promise<PageList<T>> {\n return this.gateway.by('key', key, options) as Promise<PageList<T>>;\n }\n\n by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.by(key.toString(), value, options) as Promise<PageList<T>>;\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<T>> {\n return this.gateway.search(q, options) as Promise<PageList<T>>;\n }\n\n filter(options?: Options): Promise<PageList<T>> {\n return this.gateway.filter(options) as Promise<PageList<T>>;\n }\n\n exists(id: Id): Promise<boolean> {\n return this.gateway.exists(id);\n }\n\n add(t: Partial<T>): Promise<T> {\n return this.gateway.add(toJson(t)) as Promise<T>;\n }\n\n update(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.update({ ...toJson(t), id }) as Promise<T>;\n }\n\n upsert(id: Id, t: Partial<T>): Promise<T> {\n return this.gateway.upsert({ ...toJson(t), id }) as Promise<T>;\n }\n\n remove(id: Id): Promise<boolean> {\n return this.gateway.remove(id);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,OAAN,cAAmE,WAAuB;AAAA,EAC/F,YACY,MACO,SACjB;AACA,UAAM;AAHI;AACO;AAAA,EAGnB;AAAA,EAEA,SAAS,CAAC,MAAe,KAAK,KAAK,KAAK,CAAC;AAAA,EAEzC,IAAI,SAAyC;AAC3C,WAAO,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AAAA,EACjE;AAAA,EAEA,KAAK,IAAoB;AACvB,WAAO,KAAK,QACT,KAAK,EAAE,EACP,KAAK,OAAK,KAAK,CAAC,EAAE,IAAI,UAAU,OAAO,UAAU,YAAY,CAAC,EAC9D,KAAK,OAAK,KAAK,OAAO,CAAC,CAAC;AAAA,EAC7B;AAAA,EAEA,SAAS,KAA6B;AACpC,WAAO,KAAK,QAAQ,MAAM,GAAG,GAAG,EAAE,KAAK,QAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AAAA,EAClE;AAAA,EAEA,MAAM,KAAU,SAAyC;AACvD,WAAO,KAAK,QAAQ,GAAG,OAAO,KAAK,OAAO,EAAE,KAAK,QAAM,GAAG,IAAI,KAAK,MAAM,CAA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