@duplojs/agents-kit 0.1.0-beta.3 → 0.1.0-beta.7
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/README.md +11 -11
- package/dist/bin/index.mjs +2 -2
- package/dist/bin/installSkill/index.d.ts +2 -0
- package/dist/bin/{install → installSkill}/index.mjs +3 -3
- package/dist/bin/{install → installSkill}/skill.mjs +1 -1
- package/dist/bin/setup/instructions.d.ts +1 -1
- package/docs/API/10-lang/10-array/10-at.ts +4 -4
- package/docs/API/10-lang/10-array/10-coalescing.ts +3 -2
- package/docs/API/10-lang/10-array/10-indexOf.ts +1 -1
- package/docs/API/10-lang/10-array/10-is.ts +17 -3
- package/docs/API/10-lang/10-array/10-lastIndexOf.ts +1 -1
- package/docs/API/10-lang/10-chrono/10-addTime.ts +1 -1
- package/docs/API/10-lang/10-chrono/10-closestTo.ts +5 -8
- package/docs/API/10-lang/10-chrono/10-isDate.ts +15 -2
- package/docs/API/10-lang/10-chrono/10-isSerializedTheDate.ts +16 -1
- package/docs/API/10-lang/10-chrono/10-isSerializedTheTime.ts +16 -1
- package/docs/API/10-lang/10-chrono/10-isTime.ts +15 -2
- package/docs/API/10-lang/10-chrono/10-maxDate.ts +4 -8
- package/docs/API/10-lang/10-chrono/10-maxTime.ts +4 -8
- package/docs/API/10-lang/10-chrono/10-minDate.ts +4 -8
- package/docs/API/10-lang/10-chrono/10-minTime.ts +4 -8
- package/docs/API/10-lang/10-chrono/10-sortDates.ts +6 -8
- package/docs/API/10-lang/10-chrono/10-sortTimes.ts +6 -8
- package/docs/API/10-lang/10-chrono/10-subtractTime.ts +1 -1
- package/docs/API/10-lang/10-common/10-and.ts +6 -0
- package/docs/API/10-lang/10-common/10-createQueue.ts +4 -3
- package/docs/API/10-lang/10-common/10-createTransformer.ts +1 -1
- package/docs/API/10-lang/10-common/10-equal.ts +6 -0
- package/docs/API/10-lang/10-common/10-falsy.ts +19 -0
- package/docs/API/10-lang/10-common/10-instanceOf.ts +14 -3
- package/docs/API/10-lang/10-common/10-isType.ts +6 -0
- package/docs/API/10-lang/10-common/10-justExec.ts +3 -3
- package/docs/API/10-lang/10-common/10-or.ts +17 -3
- package/docs/API/10-lang/10-common/10-tap.ts +28 -0
- package/docs/API/10-lang/10-common/10-toJSON.ts +1 -1
- package/docs/API/10-lang/10-common/10-toNative.ts +1 -1
- package/docs/API/10-lang/10-common/10-toRegExp.ts +1 -1
- package/docs/API/10-lang/10-common/10-truthy.ts +19 -0
- package/docs/API/10-lang/10-common/10-whenNot.ts +44 -13
- package/docs/API/10-lang/10-common/index.llms.md +4 -0
- package/docs/API/10-lang/10-dataStructure/10-typeStructureIdentifier.ts +2 -2
- package/docs/API/10-lang/10-either/10-asyncGroup.ts +1 -1
- package/docs/API/10-lang/10-either/10-asyncSafeCallback.ts +4 -2
- package/docs/API/10-lang/10-either/10-extractErrorInLeft.ts +45 -0
- package/docs/API/10-lang/10-either/10-forwardAssertsSelection.ts +1 -1
- package/docs/API/10-lang/10-either/10-group.ts +1 -1
- package/docs/API/10-lang/10-either/10-hasInformation.ts +6 -0
- package/docs/API/10-lang/10-either/10-isLeft.ts +10 -1
- package/docs/API/10-lang/10-either/10-isRight.ts +10 -1
- package/docs/API/10-lang/10-either/10-isSelected.ts +13 -1
- package/docs/API/10-lang/10-either/10-keepAsRightSelection.ts +1 -1
- package/docs/API/10-lang/10-either/10-matchInformation.ts +7 -5
- package/docs/API/10-lang/10-either/10-matchInformationCombination.ts +61 -0
- package/docs/API/10-lang/10-either/10-matchInformationCombinationOtherwise.ts +62 -0
- package/docs/API/10-lang/10-either/10-matchInformationOtherwise.ts +7 -5
- package/docs/API/10-lang/10-either/10-rightAsyncPipe.ts +2 -1
- package/docs/API/10-lang/10-either/10-rightPipe.ts +1 -1
- package/docs/API/10-lang/10-either/10-safeCallback.ts +1 -1
- package/docs/API/10-lang/10-either/10-unwrapOr.ts +2 -2
- package/docs/API/10-lang/10-either/10-unwrapOtherwise.ts +2 -2
- package/docs/API/10-lang/10-either/10-whenHasInformation.ts +4 -3
- package/docs/API/10-lang/10-either/10-whenHasInformationOtherwise.ts +5 -5
- package/docs/API/10-lang/10-either/10-whenIsLeft.ts +2 -2
- package/docs/API/10-lang/10-either/10-whenIsLeftOtherwise.ts +5 -5
- package/docs/API/10-lang/10-either/10-whenIsRight.ts +2 -2
- package/docs/API/10-lang/10-either/10-whenIsRightOtherwise.ts +7 -7
- package/docs/API/10-lang/10-either/10-whenIsSelected.ts +5 -5
- package/docs/API/10-lang/10-either/10-whenIsSelectedOtherwise.ts +5 -5
- package/docs/API/10-lang/10-either/index.llms.md +12 -0
- package/docs/API/10-lang/10-generator/10-asyncConcat.ts +7 -10
- package/docs/API/10-lang/10-generator/10-asyncFlat.ts +6 -6
- package/docs/API/10-lang/10-generator/10-concat.ts +3 -3
- package/docs/API/10-lang/10-generator/10-flat.ts +2 -2
- package/docs/API/10-lang/10-generator/10-map.ts +1 -1
- package/docs/API/10-lang/10-generator/10-reduce.ts +1 -1
- package/docs/API/10-lang/10-number/10-betweenThan.ts +43 -0
- package/docs/API/10-lang/10-number/10-betweenThanOrEqual.ts +43 -0
- package/docs/API/10-lang/10-number/10-greaterThan.ts +35 -0
- package/docs/API/10-lang/10-number/10-greaterThanOrEqual.ts +35 -0
- package/docs/API/10-lang/10-number/10-isEven.ts +33 -0
- package/docs/API/10-lang/10-number/10-isInteger.ts +33 -0
- package/docs/API/10-lang/10-number/10-isMultipleOf.ts +35 -0
- package/docs/API/10-lang/10-number/10-isNegative.ts +33 -0
- package/docs/API/10-lang/10-number/10-isNotZero.ts +33 -0
- package/docs/API/10-lang/10-number/10-isOdd.ts +33 -0
- package/docs/API/10-lang/10-number/10-isPositive.ts +33 -0
- package/docs/API/10-lang/10-number/10-isSafe.ts +33 -0
- package/docs/API/10-lang/10-number/10-isStrictNegative.ts +34 -0
- package/docs/API/10-lang/10-number/10-isStrictPositive.ts +33 -0
- package/docs/API/10-lang/10-number/10-lessThan.ts +35 -0
- package/docs/API/10-lang/10-number/10-lessThanOrEqual.ts +35 -0
- package/docs/API/10-lang/10-number/10-max.ts +19 -0
- package/docs/API/10-lang/10-number/10-maxOf.ts +19 -0
- package/docs/API/10-lang/10-number/10-min.ts +19 -0
- package/docs/API/10-lang/10-number/10-minOf.ts +19 -0
- package/docs/API/10-lang/10-number/10-sort.ts +19 -0
- package/docs/API/10-lang/10-number/10-sum.ts +19 -0
- package/docs/API/10-lang/10-number/index.llms.md +92 -0
- package/docs/API/10-lang/10-number/index.md +3 -0
- package/docs/API/10-lang/10-object/10-assign.ts +41 -0
- package/docs/API/10-lang/10-object/10-countKeys.ts +15 -0
- package/docs/API/10-lang/10-object/10-deepDiscriminate.ts +63 -0
- package/docs/API/10-lang/10-object/10-deepOverride.ts +35 -0
- package/docs/API/10-lang/10-object/10-discriminate.ts +55 -0
- package/docs/API/10-lang/10-object/10-discriminateEntryKey.ts +43 -0
- package/docs/API/10-lang/10-object/10-discriminateEntryValue.ts +44 -0
- package/docs/API/10-lang/10-object/10-entries.ts +19 -0
- package/docs/API/10-lang/10-object/10-entry.ts +17 -0
- package/docs/API/10-lang/10-object/10-fromEntries.ts +23 -0
- package/docs/API/10-lang/10-object/10-getDeepProperty.ts +26 -0
- package/docs/API/10-lang/10-object/10-getProperty.ts +24 -0
- package/docs/API/10-lang/10-object/10-hasKeys.ts +43 -0
- package/docs/API/10-lang/10-object/10-isSimple.ts +38 -0
- package/docs/API/10-lang/10-object/10-keys.ts +19 -0
- package/docs/API/10-lang/10-object/10-omit.ts +39 -0
- package/docs/API/10-lang/10-object/10-override.ts +24 -0
- package/docs/API/10-lang/10-object/10-pick.ts +41 -0
- package/docs/API/10-lang/10-object/10-to.ts +40 -0
- package/docs/API/10-lang/10-object/10-transformProperties.ts +43 -0
- package/docs/API/10-lang/10-object/10-transformProperty.ts +39 -0
- package/docs/API/10-lang/10-object/10-values.ts +19 -0
- package/docs/API/10-lang/10-object/index.llms.md +92 -0
- package/docs/API/10-lang/10-object/index.md +3 -0
- package/docs/API/10-lang/10-path/10-computeRelative.ts +19 -0
- package/docs/API/10-lang/10-path/10-concatSegment.ts +28 -0
- package/docs/API/10-lang/10-path/10-create.ts +21 -0
- package/docs/API/10-lang/10-path/10-createAbsolute.ts +21 -0
- package/docs/API/10-lang/10-path/10-createAbsoluteOrThrow.ts +16 -0
- package/docs/API/10-lang/10-path/10-createMatcher.ts +50 -0
- package/docs/API/10-lang/10-path/10-createOrThrow.ts +16 -0
- package/docs/API/10-lang/10-path/10-createSegment.ts +26 -0
- package/docs/API/10-lang/10-path/10-createSegmentOrThrow.ts +16 -0
- package/docs/API/10-lang/10-path/10-declareAbsolutePath.ts +15 -0
- package/docs/API/10-lang/10-path/10-declarePath.ts +15 -0
- package/docs/API/10-lang/10-path/10-declareSegment.ts +15 -0
- package/docs/API/10-lang/10-path/10-getBaseName.ts +22 -0
- package/docs/API/10-lang/10-path/10-getExtensionName.ts +22 -0
- package/docs/API/10-lang/10-path/10-getParentFolderPath.ts +25 -0
- package/docs/API/10-lang/10-path/10-is.ts +46 -0
- package/docs/API/10-lang/10-path/10-isAbsolute.ts +46 -0
- package/docs/API/10-lang/10-path/10-isSegment.ts +42 -0
- package/docs/API/10-lang/10-path/10-normalize.ts +26 -0
- package/docs/API/10-lang/10-path/10-resolveFrom.ts +37 -0
- package/docs/API/10-lang/10-path/10-resolveRelative.ts +23 -0
- package/docs/API/10-lang/10-path/index.llms.md +88 -0
- package/docs/API/10-lang/10-path/index.md +3 -0
- package/docs/API/10-lang/10-pattern/10-exhaustive.ts +26 -0
- package/docs/API/10-lang/10-pattern/10-isMatch.ts +72 -0
- package/docs/API/10-lang/10-pattern/10-match.ts +133 -0
- package/docs/API/10-lang/10-pattern/10-matchWithEntity.ts +49 -0
- package/docs/API/10-lang/10-pattern/10-matchWithEntityOtherwise.ts +55 -0
- package/docs/API/10-lang/10-pattern/10-matchWithError.ts +45 -0
- package/docs/API/10-lang/10-pattern/10-matchWithErrorOtherwise.ts +48 -0
- package/docs/API/10-lang/10-pattern/10-matchWithFact.ts +49 -0
- package/docs/API/10-lang/10-pattern/10-matchWithFactOtherwise.ts +49 -0
- package/docs/API/10-lang/10-pattern/10-matchWithNumber.ts +33 -0
- package/docs/API/10-lang/10-pattern/10-matchWithNumberOtherwise.ts +37 -0
- package/docs/API/10-lang/10-pattern/10-matchWithString.ts +34 -0
- package/docs/API/10-lang/10-pattern/10-matchWithStringOtherwise.ts +35 -0
- package/docs/API/10-lang/10-pattern/10-matchWithTaggedObject.ts +43 -0
- package/docs/API/10-lang/10-pattern/10-matchWithTaggedObjectOtherwise.ts +49 -0
- package/docs/API/10-lang/10-pattern/10-otherwise.ts +28 -0
- package/docs/API/10-lang/10-pattern/10-union.ts +47 -0
- package/docs/API/10-lang/10-pattern/10-when.ts +46 -0
- package/docs/API/10-lang/10-pattern/10-whenNot.ts +123 -0
- package/docs/API/10-lang/10-pattern/index.llms.md +80 -0
- package/docs/API/10-lang/10-pattern/index.md +3 -0
- package/docs/API/10-lang/10-printer/10-bold.ts +12 -0
- package/docs/API/10-lang/10-printer/10-colorized.ts +18 -0
- package/docs/API/10-lang/10-printer/10-colorizedBold.ts +18 -0
- package/docs/API/10-lang/10-printer/10-primitives.md +19 -0
- package/docs/API/10-lang/10-printer/10-renderLine.ts +36 -0
- package/docs/API/10-lang/10-printer/10-renderParagraph.ts +37 -0
- package/docs/API/10-lang/10-printer/index.llms.md +29 -0
- package/docs/API/10-lang/10-printer/index.md +3 -0
- package/docs/API/10-lang/10-string/10-at.ts +18 -0
- package/docs/API/10-lang/10-string/10-capitalize.ts +18 -0
- package/docs/API/10-lang/10-string/10-charAt.ts +18 -0
- package/docs/API/10-lang/10-string/10-concat.ts +18 -0
- package/docs/API/10-lang/10-string/10-endsWith.ts +33 -0
- package/docs/API/10-lang/10-string/10-extract.ts +18 -0
- package/docs/API/10-lang/10-string/10-extractAll.ts +18 -0
- package/docs/API/10-lang/10-string/10-first.ts +17 -0
- package/docs/API/10-lang/10-string/10-includes.ts +33 -0
- package/docs/API/10-lang/10-string/10-indexOf.ts +17 -0
- package/docs/API/10-lang/10-string/10-isComposedOf.ts +33 -0
- package/docs/API/10-lang/10-string/10-isEmail.ts +56 -0
- package/docs/API/10-lang/10-string/10-isIn.ts +34 -0
- package/docs/API/10-lang/10-string/10-isKeyof.ts +37 -0
- package/docs/API/10-lang/10-string/10-isNotEmpty.ts +32 -0
- package/docs/API/10-lang/10-string/10-isNumber.ts +32 -0
- package/docs/API/10-lang/10-string/10-isTrimmed.ts +33 -0
- package/docs/API/10-lang/10-string/10-isUrl.ts +31 -0
- package/docs/API/10-lang/10-string/10-isUuid.ts +31 -0
- package/docs/API/10-lang/10-string/10-join.ts +18 -0
- package/docs/API/10-lang/10-string/10-last.ts +17 -0
- package/docs/API/10-lang/10-string/10-lastIndexOf.ts +17 -0
- package/docs/API/10-lang/10-string/10-length.ts +18 -0
- package/docs/API/10-lang/10-string/10-lengthEqual.ts +33 -0
- package/docs/API/10-lang/10-string/10-maxCharacters.ts +33 -0
- package/docs/API/10-lang/10-string/10-minCharacters.ts +33 -0
- package/docs/API/10-lang/10-string/10-normalize.ts +17 -0
- package/docs/API/10-lang/10-string/10-padEnd.ts +17 -0
- package/docs/API/10-lang/10-string/10-padStart.ts +17 -0
- package/docs/API/10-lang/10-string/10-pop.ts +17 -0
- package/docs/API/10-lang/10-string/10-prepend.ts +17 -0
- package/docs/API/10-lang/10-string/10-repeat.ts +17 -0
- package/docs/API/10-lang/10-string/10-replace.ts +18 -0
- package/docs/API/10-lang/10-string/10-replaceAll.ts +17 -0
- package/docs/API/10-lang/10-string/10-search.ts +17 -0
- package/docs/API/10-lang/10-string/10-shift.ts +17 -0
- package/docs/API/10-lang/10-string/10-slice.ts +17 -0
- package/docs/API/10-lang/10-string/10-sort.ts +19 -0
- package/docs/API/10-lang/10-string/10-sortCompare.ts +17 -0
- package/docs/API/10-lang/10-string/10-split.ts +34 -0
- package/docs/API/10-lang/10-string/10-startsWith.ts +33 -0
- package/docs/API/10-lang/10-string/10-stringify.ts +11 -0
- package/docs/API/10-lang/10-string/10-substring.ts +17 -0
- package/docs/API/10-lang/10-string/10-test.ts +17 -0
- package/docs/API/10-lang/10-string/10-to.ts +11 -0
- package/docs/API/10-lang/10-string/10-toLowerCase.ts +17 -0
- package/docs/API/10-lang/10-string/10-toUpperCase.ts +17 -0
- package/docs/API/10-lang/10-string/10-trim.ts +17 -0
- package/docs/API/10-lang/10-string/10-trimEnd.ts +17 -0
- package/docs/API/10-lang/10-string/10-trimStart.ts +17 -0
- package/docs/API/10-lang/10-string/10-uncapitalize.ts +17 -0
- package/docs/API/10-lang/10-string/index.llms.md +208 -0
- package/docs/API/10-lang/10-string/index.md +3 -0
- package/docs/API/10-lang/10-tuple/10-from.ts +50 -0
- package/docs/API/10-lang/10-tuple/10-map.ts +37 -0
- package/docs/API/10-lang/10-tuple/index.llms.md +12 -0
- package/docs/API/10-lang/10-tuple/index.md +3 -0
- package/docs/API/40-json-web-token/10-tokenHandler/10-createTokenHandler.ts +160 -0
- package/docs/API/40-json-web-token/10-tokenHandler/index.llms.md +8 -0
- package/docs/API/40-json-web-token/10-tokenHandler/index.md +3 -0
- package/docs/API/40-json-web-token/20-signer/10-createHS256.ts +24 -0
- package/docs/API/40-json-web-token/20-signer/10-createHS512.ts +24 -0
- package/docs/API/40-json-web-token/20-signer/10-createRS256.ts +28 -0
- package/docs/API/40-json-web-token/20-signer/10-createRS512.ts +28 -0
- package/docs/API/40-json-web-token/20-signer/10-factory.ts +29 -0
- package/docs/API/40-json-web-token/20-signer/index.llms.md +24 -0
- package/docs/API/40-json-web-token/20-signer/index.md +3 -0
- package/docs/API/40-json-web-token/30-cipher/10-createRSAOAEP.ts +26 -0
- package/docs/API/40-json-web-token/30-cipher/10-createRSAOAEP256.ts +26 -0
- package/docs/API/40-json-web-token/30-cipher/10-factory.ts +29 -0
- package/docs/API/40-json-web-token/30-cipher/index.llms.md +16 -0
- package/docs/API/40-json-web-token/30-cipher/index.md +3 -0
- package/docs/API/40-json-web-token/40-utils/10-AES_GCM.decrypt.ts +17 -0
- package/docs/API/40-json-web-token/40-utils/10-AES_GCM.encrypt.ts +11 -0
- package/docs/API/40-json-web-token/40-utils/10-AES_GCM.generateInitializationVector.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-HMAC.sign.ts +13 -0
- package/docs/API/40-json-web-token/40-utils/10-HMAC.verify.ts +11 -0
- package/docs/API/40-json-web-token/40-utils/10-RSA.sign.ts +14 -0
- package/docs/API/40-json-web-token/40-utils/10-RSA.verify.ts +13 -0
- package/docs/API/40-json-web-token/40-utils/10-RSA_OAEP.decrypt.ts +13 -0
- package/docs/API/40-json-web-token/40-utils/10-RSA_OAEP.encrypt.ts +10 -0
- package/docs/API/40-json-web-token/40-utils/10-decodeBase64.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-decodeBase64Url.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-decodeText.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-encodeBase64.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-encodeBase64Url.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-encodeText.ts +9 -0
- package/docs/API/40-json-web-token/40-utils/10-isBase64Url.ts +11 -0
- package/docs/API/40-json-web-token/40-utils/10-jsonParse.ts +11 -0
- package/docs/API/40-json-web-token/40-utils/10-pemToBinary.ts +11 -0
- package/docs/API/40-json-web-token/40-utils/index.llms.md +76 -0
- package/docs/API/40-json-web-token/40-utils/index.md +3 -0
- package/docs/API/40-json-web-token/index.md +3 -0
- package/docs/API/50-form/10-vue/10-construction/10-createForm.ts +48 -0
- package/docs/API/50-form/10-vue/10-construction/10-createFormField.ts +66 -0
- package/docs/API/50-form/10-vue/10-construction/10-createGridTemplates.ts +39 -0
- package/docs/API/50-form/10-vue/10-construction/10-createInput.ts +46 -0
- package/docs/API/50-form/10-vue/10-construction/10-createTemplate.ts +36 -0
- package/docs/API/50-form/10-vue/10-construction/fixtures/AddressInput.vue +19 -0
- package/docs/API/50-form/10-vue/10-construction/index.llms.md +24 -0
- package/docs/API/50-form/10-vue/10-construction/index.md +3 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useCheckLayout.ts +40 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useDisabledLayout.ts +34 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useMultiLayout.ts +32 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useRepeatLayout.ts +34 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useSectionLayout.ts +20 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useSlotLayout.ts +37 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useStepLayout.ts +31 -0
- package/docs/API/50-form/10-vue/20-layouts/10-useUnionLayout.ts +48 -0
- package/docs/API/50-form/10-vue/20-layouts/index.llms.md +36 -0
- package/docs/API/50-form/10-vue/20-layouts/index.md +3 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useCheckbox.ts +13 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useCheckboxPolicy.ts +18 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useDateInput.ts +20 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useDualRangeInput.ts +27 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useFileInput.ts +23 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useNumberInput.ts +18 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useRadioGroup.ts +31 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useRangeDateInput.ts +23 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useRangeInput.ts +18 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useRangeTimeInput.ts +23 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useSelectInput.ts +31 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useTextInput.ts +14 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useTextareaInput.ts +14 -0
- package/docs/API/50-form/10-vue/30-designSystem/10-useTimeInput.ts +20 -0
- package/docs/API/50-form/10-vue/30-designSystem/20-components.md +11 -0
- package/docs/API/50-form/10-vue/30-designSystem/index.llms.md +65 -0
- package/docs/API/50-form/10-vue/30-designSystem/index.md +3 -0
- package/docs/API/50-form/10-vue/fixtures/templates.ts +20 -0
- package/docs/API/50-form/10-vue/index.md +3 -0
- package/docs/API/50-form/index.md +3 -0
- package/docs/API/60-playwright/10-construction/10-createComponent.ts +47 -0
- package/docs/API/60-playwright/10-construction/10-createComponentInteraction.ts +28 -0
- package/docs/API/60-playwright/10-construction/10-createPage.ts +34 -0
- package/docs/API/60-playwright/10-construction/10-createStepWrapper.ts +23 -0
- package/docs/API/60-playwright/10-construction/10-createWebsite.ts +57 -0
- package/docs/API/60-playwright/10-construction/10-initClient.ts +38 -0
- package/docs/API/60-playwright/10-construction/index.llms.md +28 -0
- package/docs/API/60-playwright/10-construction/index.md +3 -0
- package/docs/API/60-playwright/20-actions/10-check.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-clear.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-click.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-dragTo.ts +10 -0
- package/docs/API/60-playwright/20-actions/10-extractContent.ts +10 -0
- package/docs/API/60-playwright/20-actions/10-fill.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-focus.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-forceClick.ts +10 -0
- package/docs/API/60-playwright/20-actions/10-hover.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-press.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-selectOption.ts +10 -0
- package/docs/API/60-playwright/20-actions/10-type.ts +10 -0
- package/docs/API/60-playwright/20-actions/10-uncheck.ts +9 -0
- package/docs/API/60-playwright/20-actions/10-withStep.ts +10 -0
- package/docs/API/60-playwright/20-actions/index.llms.md +60 -0
- package/docs/API/60-playwright/20-actions/index.md +3 -0
- package/docs/API/60-playwright/30-assertions/10-toBeBusy.ts +10 -0
- package/docs/API/60-playwright/30-assertions/10-toBeChecked.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toBeDisabled.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toBeEnabled.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toBeHidden.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toBeNotBusy.ts +10 -0
- package/docs/API/60-playwright/30-assertions/10-toBeVisible.ts +10 -0
- package/docs/API/60-playwright/30-assertions/10-toContainText.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveAttribute.ts +12 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveClass.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveNoText.ts +10 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveQuantity.ts +20 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveText.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-toHaveValue.ts +9 -0
- package/docs/API/60-playwright/30-assertions/10-withStep.ts +10 -0
- package/docs/API/60-playwright/30-assertions/index.llms.md +64 -0
- package/docs/API/60-playwright/30-assertions/index.md +3 -0
- package/docs/API/60-playwright/fixtures/component.ts +44 -0
- package/docs/API/60-playwright/index.md +3 -0
- package/docs/API.llms.md +84 -0
- package/docs/concepts/01-fundamental/01-constraint/20-manipulation.ts +9 -6
- package/docs/concepts/01-fundamental/01-constraint/30-cast.ts +9 -5
- package/docs/concepts/01-fundamental/02-currying/01-use.ts +5 -0
- package/docs/concepts/01-fundamental/02-currying/10-built-in-function.ts +28 -16
- package/docs/concepts/01-fundamental/02-currying/20-inner-pipe.ts +11 -2
- package/docs/concepts/01-fundamental/02-currying/30-async-pipe.ts +11 -2
- package/docs/concepts/01-fundamental/03-either/10-discrimination.ts +23 -12
- package/docs/concepts/01-fundamental/03-either/20-exhaustive-handling.ts +27 -10
- package/docs/concepts/01-fundamental/03-either/30-composition.ts +18 -10
- package/docs/concepts/01-fundamental/03-either/40-result-adaptation.ts +10 -4
- package/docs/concepts/01-fundamental/03-either/50-external-results.ts +16 -3
- package/docs/concepts/01-fundamental/04-data-structure/10-structure.ts +110 -59
- package/docs/concepts/01-fundamental/04-data-structure/20-constraint.ts +20 -12
- package/docs/concepts/01-fundamental/04-data-structure/30-validation.ts +13 -9
- package/docs/concepts/01-fundamental/04-data-structure/40-codecs.ts +31 -20
- package/docs/concepts/01-fundamental/04-data-structure/50-recursive.ts +10 -1
- package/docs/concepts/01-fundamental/05-chrono/10-creation.ts +39 -13
- package/docs/concepts/01-fundamental/05-chrono/20-manipulation.ts +20 -4
- package/docs/concepts/01-fundamental/05-chrono/30-serialized.ts +22 -6
- package/docs/concepts/01-fundamental/05-chrono/40-timezone.ts +5 -1
- package/docs/concepts/01-fundamental/06-modeling/20-entity.ts +29 -42
- package/docs/concepts/01-fundamental/06-modeling/30-tagged-object.ts +46 -23
- package/docs/concepts/01-fundamental/06-modeling/40-entity-lifecycle.ts +30 -33
- package/docs/concepts/01-fundamental/07-discrimination/10-entity.ts +52 -20
- package/docs/concepts/01-fundamental/07-discrimination/20-fact.ts +54 -38
- package/docs/concepts/01-fundamental/07-discrimination/30-tagged-object.ts +52 -20
- package/docs/concepts/01-fundamental/07-discrimination/40-error.ts +26 -10
- package/docs/concepts/01-fundamental/07-discrimination/50-literal.ts +29 -10
- package/docs/concepts/01-fundamental/07-discrimination/60-shape.ts +10 -2
- package/docs/concepts/01-fundamental/07-discrimination/70-predicate.ts +18 -6
- package/docs/concepts/01-fundamental/08-kind/01-identity.md +7 -0
- package/docs/concepts/01-fundamental/08-kind/20-metadata.md +11 -0
- package/docs/concepts/01-fundamental/08-kind/30-transport.md +11 -0
- package/docs/concepts/01-fundamental/08-kind/index.md +3 -0
- package/docs/concepts/02-server/10-file/10-manipulation.ts +15 -3
- package/docs/concepts/02-server/10-file/20-path.ts +22 -6
- package/docs/concepts/02-server/20-http/10-init.ts +1 -9
- package/docs/concepts/02-server/20-http/20-route.ts +40 -32
- package/docs/concepts/02-server/20-http/30-routine.ts +12 -19
- package/docs/concepts/02-server/20-http/40-jwt.ts +49 -37
- package/docs/concepts/02-server/20-http/50-open-api.ts +44 -0
- package/docs/concepts/02-server/20-http/index.md +1 -1
- package/docs/concepts/02-server/30-environment/10-platform.ts +12 -3
- package/docs/concepts/02-server/30-environment/20-variable.ts +13 -7
- package/docs/concepts/03-client/10-http/10-init.ts +11 -23
- package/docs/concepts/03-client/10-http/20-request.ts +79 -69
- package/docs/concepts/03-client/10-http/30-hook.ts +23 -23
- package/docs/concepts/03-client/20-form/10-init.ts +18 -15
- package/docs/concepts/03-client/20-form/20-input.ts +13 -6
- package/docs/concepts/03-client/20-form/30-layout.ts +44 -49
- package/docs/concepts/03-client/20-form/40-template.ts +10 -5
- package/docs/concepts/03-client/20-form/50-integration.md +11 -0
- package/docs/concepts/03-client/20-form/examples/postModeration/ThePage.vue +32 -0
- package/docs/concepts/03-client/20-form/examples/postModeration/usePostModeration.ts +80 -0
- package/docs/concepts/05-type-driven-design/01-architecture/10-boundaries.md +23 -20
- package/docs/concepts/05-type-driven-design/01-architecture/index.md +1 -1
- package/docs/concepts/05-type-driven-design/02-domains/10-entities.md +29 -37
- package/docs/concepts/05-type-driven-design/02-domains/20-aggregates.md +42 -26
- package/docs/concepts/05-type-driven-design/02-domains/30-repositories.md +20 -26
- package/docs/concepts/05-type-driven-design/02-domains/40-refinements.md +30 -0
- package/docs/concepts/05-type-driven-design/02-domains/index.md +1 -1
- package/docs/concepts/05-type-driven-design/03-applications/10-use-case.md +33 -40
- package/docs/concepts/05-type-driven-design/03-applications/20-ports.md +49 -0
- package/docs/concepts/05-type-driven-design/03-applications/index.md +1 -1
- package/docs/concepts/05-type-driven-design/04-infrastructure/10-implementation.md +27 -36
- package/docs/concepts/05-type-driven-design/04-infrastructure/index.md +1 -1
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/ports/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/ports/waitingListEntry.ts +17 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/useCases/clientGiveBackBook.ts +30 -12
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/useCases/clientRentBook.ts +9 -8
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/useCases/createBook.ts +7 -7
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/useCases/index.ts +2 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/applications/useCases/withdrawBook.ts +32 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/aggregates/clientGiveBackBook.ts +72 -13
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/aggregates/clientRentBook.ts +37 -11
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/aggregates/createBook.ts +29 -17
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/aggregates/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/aggregates/withdrawBook.ts +37 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/create.ts +4 -5
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/index.ts +2 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/rental.ts +9 -9
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/reserve.ts +37 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/returnBook.ts +11 -9
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/facts/withdraw.ts +21 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/book/index.ts +42 -11
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/client/facts/giveBackBook.ts +11 -9
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/client/facts/rentBook.ts +10 -10
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/client/index.ts +6 -29
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/waitingListEntry/facts/cancel.ts +26 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/waitingListEntry/facts/create.ts +33 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/waitingListEntry/facts/index.ts +3 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/waitingListEntry/facts/prepare.ts +23 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/entities/waitingListEntry/index.ts +79 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/refinements/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/refinements/refineLinkBetweenClientAndBorrowedBook.ts +34 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/repositories/book.ts +1 -1
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/repositories/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/business/domains/repositories/waitingListEntry.ts +19 -0
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/command/clientRentBook.ts +3 -3
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/http/checkers/bookExist.ts +2 -2
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/http/checkers/clientExist.ts +2 -2
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/http/routes/clientGiveBackBook.ts +23 -14
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/http/routes/clientRentBook.ts +7 -12
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/ports/book.ts +1 -1
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/ports/index.ts +1 -0
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/ports/waitingListEntry.ts +17 -0
- package/docs/concepts/05-type-driven-design/fixtures/infrastructure/useCases/index.ts +2 -1
- package/docs/concepts/05-type-driven-design/index.md +2 -2
- package/docs/concepts.llms.md +71 -25
- package/instructions/coding-conventions.md +2 -2
- package/package.json +17 -14
- package/skills/http-client/SKILL.md +1 -1
- package/skills/http-client/references/configuration.md +3 -1
- package/skills/http-client/references/examples/client-expectations.ts +11 -10
- package/skills/http-client/references/examples/client-streams.ts +2 -2
- package/skills/http-client/references/examples/external-client.ts +2 -2
- package/skills/http-client/references/responses.md +1 -1
- package/skills/http-server/SKILL.md +4 -9
- package/skills/http-server/references/examples/authentication.ts +2 -2
- package/skills/http-server/references/examples/inferred-client.ts +54 -0
- package/skills/http-server/references/examples/minimal-route.ts +2 -3
- package/skills/http-server/references/examples/protected-route.ts +4 -6
- package/skills/http-server/references/examples/rename-user-route.ts +4 -6
- package/skills/http-server/references/examples/user-checker.ts +2 -2
- package/skills/http-server/references/examples/user-route.ts +12 -5
- package/skills/http-server/references/initialization.md +1 -1
- package/skills/http-server/references/reusable-flows.md +3 -3
- package/skills/http-server/references/routes-and-floor.md +11 -3
- package/dist/bin/install/index.d.ts +0 -2
- package/docs/concepts/02-server/20-http/50-codegen.ts +0 -29
- package/skills/http-server/references/code-generation.md +0 -31
- package/skills/http-server/references/examples/generate-sdk.ts +0 -36
- /package/dist/bin/{install → installSkill}/skill.d.ts +0 -0
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Composition de la structure des données et des comportements d’un formulaire.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import type * as DCommon from "@duplojs/lang/common";
|
|
7
|
+
import type * as DEither from "@duplojs/lang/either";
|
|
8
|
+
import { createForm, type DetailsError, useCheckLayout, useDisabledLayout, useMultiLayout, useRepeatLayout, useSectionLayout, useSlotLayout, useStepLayout, useUnionLayout } from "@duplojs/form/vue";
|
|
7
9
|
import { templateFormAddButton, templateFormNextButton, templateFormPreviousButton, templateFormRemoveButton, templateFormResetButton, templateFormSelect, useTextareaInput, useTextInput } from "@duplojs/form/vueDesignSystem";
|
|
8
10
|
import { createGridTemplates } from "@duplojs/form/vueGrid";
|
|
9
11
|
import * as DDataStructure from "@duplojs/lang/dataStructure";
|
|
12
|
+
import type * as DString from "@duplojs/lang/string";
|
|
10
13
|
import { ref } from "vue";
|
|
11
14
|
|
|
12
15
|
const gridTemplates = createGridTemplates({
|
|
@@ -66,34 +69,34 @@ const { check: checkStructureForm, component: StructureForm, currentValue: curre
|
|
|
66
69
|
),
|
|
67
70
|
);
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// preferredContact: {
|
|
76
|
-
// readonly kind: "email" | "phone";
|
|
77
|
-
// value: string;
|
|
78
|
-
// updateKind(kind: "email" | "phone", value?: string): void;
|
|
79
|
-
// };
|
|
80
|
-
// message: string;
|
|
81
|
-
// }>
|
|
72
|
+
type _CheckContacts = DCommon.ExpectType<typeof currentStructureValue.value.contacts, [string, ...string[]], "strict">;
|
|
73
|
+
type _CheckPreferredContactKind = DCommon.ExpectType<
|
|
74
|
+
typeof currentStructureValue.value.preferredContact.kind,
|
|
75
|
+
"email" | "phone",
|
|
76
|
+
"strict"
|
|
77
|
+
>;
|
|
82
78
|
void currentStructureValue;
|
|
83
79
|
|
|
84
|
-
// DEither.Error<DetailsError> | DEither.Success<{
|
|
85
|
-
// identity: {
|
|
86
|
-
// firstName: string;
|
|
87
|
-
// lastName: string;
|
|
88
|
-
// };
|
|
89
|
-
// contacts: [string, ...string[]];
|
|
90
|
-
// preferredContact: {
|
|
91
|
-
// kind: "email" | "phone";
|
|
92
|
-
// value: string;
|
|
93
|
-
// };
|
|
94
|
-
// message: string | undefined;
|
|
95
|
-
// }>
|
|
96
80
|
const checkedStructureValue = await checkStructureForm();
|
|
81
|
+
type _CheckCheckedStructureValueLine96 = DCommon.ExpectType<
|
|
82
|
+
typeof checkedStructureValue,
|
|
83
|
+
DEither.Error<DetailsError> | DEither.Success<{
|
|
84
|
+
identity: {
|
|
85
|
+
firstName: string;
|
|
86
|
+
lastName: string;
|
|
87
|
+
};
|
|
88
|
+
contacts: [string, ...string[]];
|
|
89
|
+
preferredContact: {
|
|
90
|
+
kind: "email";
|
|
91
|
+
value: string;
|
|
92
|
+
} | {
|
|
93
|
+
kind: "phone";
|
|
94
|
+
value: string;
|
|
95
|
+
};
|
|
96
|
+
message: string | undefined;
|
|
97
|
+
}>,
|
|
98
|
+
"strict"
|
|
99
|
+
>;
|
|
97
100
|
|
|
98
101
|
void checkedStructureValue;
|
|
99
102
|
void StructureForm;
|
|
@@ -132,29 +135,21 @@ const { check: checkFlowForm, component: FlowForm, currentValue: currentFlowValu
|
|
|
132
135
|
),
|
|
133
136
|
);
|
|
134
137
|
|
|
135
|
-
|
|
136
|
-
// currentStep: 0 | 1;
|
|
137
|
-
// steps: [
|
|
138
|
-
// {
|
|
139
|
-
// fullName: string;
|
|
140
|
-
// email: string;
|
|
141
|
-
// },
|
|
142
|
-
// {
|
|
143
|
-
// company: string;
|
|
144
|
-
// notes: string;
|
|
145
|
-
// },
|
|
146
|
-
// ];
|
|
147
|
-
// }>
|
|
138
|
+
type _CheckCurrentStep = DCommon.ExpectType<typeof currentFlowValue.value.currentStep, 0 | 1, "strict">;
|
|
148
139
|
void currentFlowValue;
|
|
149
140
|
|
|
150
|
-
// DEither.Error<DetailsError> | DEither.Success<[
|
|
151
|
-
// {
|
|
152
|
-
// fullName: string;
|
|
153
|
-
// email: string & Email;
|
|
154
|
-
// },
|
|
155
|
-
// {
|
|
156
|
-
// company: string | undefined;
|
|
157
|
-
// notes: string;
|
|
158
|
-
// },
|
|
159
|
-
// ]>
|
|
160
141
|
const checkedFlowValue = await checkFlowForm();
|
|
142
|
+
type _CheckCheckedFlowValueLine160 = DCommon.ExpectType<
|
|
143
|
+
typeof checkedFlowValue,
|
|
144
|
+
DEither.Error<DetailsError> | DEither.Success<readonly [
|
|
145
|
+
{
|
|
146
|
+
fullName: string;
|
|
147
|
+
email: string & DString.Email;
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
company: string | undefined;
|
|
151
|
+
notes: string;
|
|
152
|
+
},
|
|
153
|
+
]>,
|
|
154
|
+
"strict"
|
|
155
|
+
>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { createForm, createTemplate, useMultiLayout, type InputTemplateProperties, type VueComponent } from "@duplojs/form/vue";
|
|
7
7
|
import { templateFormAddButton, templateFormNextButton, templateFormPreviousButton, templateFormRemoveButton, templateFormResetButton, templateFormSelect, useTextareaInput, useTextInput } from "@duplojs/form/vueDesignSystem";
|
|
8
8
|
import { createGridTemplates } from "@duplojs/form/vueGrid";
|
|
9
|
+
import type * as DCommon from "@duplojs/lang/common";
|
|
9
10
|
|
|
10
11
|
// Un template transforme les props système et les slots en interface Vue.
|
|
11
12
|
// Il reste générique : la connaissance métier appartient au formulaire.
|
|
@@ -81,9 +82,13 @@ const { component: TheForm, currentValue } = useForm(
|
|
|
81
82
|
// `title` utilise le template global, `subtitle` le surcharge localement,
|
|
82
83
|
// `summary` revient au template grid.
|
|
83
84
|
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
type _CheckCurrentValue = DCommon.ExpectType<
|
|
86
|
+
typeof currentValue.value,
|
|
87
|
+
{
|
|
88
|
+
title: string;
|
|
89
|
+
subtitle: string;
|
|
90
|
+
summary: string;
|
|
91
|
+
},
|
|
92
|
+
"strict"
|
|
93
|
+
>;
|
|
89
94
|
void currentValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Intégrer un formulaire dans une page Vue
|
|
2
|
+
|
|
3
|
+
Séparer la logique d'un formulaire de son rendu dans une page Vue.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Une séparation recommandée consiste à construire le formulaire et à regrouper ses opérations dans un composable. La page consomme son interface et reste centrée sur la présentation ; Form n'impose pas cette organisation.
|
|
8
|
+
|
|
9
|
+
Dans [usePostModeration.ts](./examples/postModeration/usePostModeration.ts), le composable configure les champs, choisit la variante, valide la soumission et libère le formulaire à la fin du scope Vue. Il expose le composant `ModerationForm` et les seuls états et actions utiles à la page. En cas de validation réussie, il utilise la valeur validée ; les erreurs restent affichées par les templates du formulaire.
|
|
10
|
+
|
|
11
|
+
[ThePage.vue](./examples/postModeration/ThePage.vue) monte ce composant, place le bouton de soumission dans son slot par défaut et relie son événement `submit` à l'opération du composable. Les boutons de décision illustrent le changement de variante depuis l'interface.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PrimaryButton, OutlineButton, DestructiveButton } from "@duplojs/form/vueDesignSystem";
|
|
3
|
+
import { usePostModeration } from "./usePostModeration";
|
|
4
|
+
|
|
5
|
+
const { ModerationForm, selectedDecision, submitted, selectApproval, selectRejection, submit } = usePostModeration();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<section>
|
|
10
|
+
<h1>Moderate post</h1>
|
|
11
|
+
|
|
12
|
+
<OutlineButton @click="selectApproval">
|
|
13
|
+
Approve
|
|
14
|
+
</OutlineButton>
|
|
15
|
+
|
|
16
|
+
<DestructiveButton @click="selectRejection">
|
|
17
|
+
Reject
|
|
18
|
+
</DestructiveButton>
|
|
19
|
+
|
|
20
|
+
<p>Selected decision: {{ selectedDecision }}</p>
|
|
21
|
+
|
|
22
|
+
<ModerationForm @submit="submit">
|
|
23
|
+
<PrimaryButton type="submit">
|
|
24
|
+
Submit decision
|
|
25
|
+
</PrimaryButton>
|
|
26
|
+
</ModerationForm>
|
|
27
|
+
|
|
28
|
+
<p v-if="submitted">
|
|
29
|
+
{{ submitted }}
|
|
30
|
+
</p>
|
|
31
|
+
</section>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createForm, useMultiLayout, useUnionLayout } from "@duplojs/form/vue";
|
|
2
|
+
import { templateFormAddButton, templateFormNextButton, templateFormPreviousButton, templateFormRemoveButton, templateFormResetButton, templateFormSelect, useTextareaInput, useTextInput } from "@duplojs/form/vueDesignSystem";
|
|
3
|
+
import { createGridTemplates } from "@duplojs/form/vueGrid";
|
|
4
|
+
import * as DDataStructure from "@duplojs/lang/dataStructure";
|
|
5
|
+
import * as DEither from "@duplojs/lang/either";
|
|
6
|
+
import { computed, onScopeDispose, ref } from "vue";
|
|
7
|
+
|
|
8
|
+
const templates = createGridTemplates({
|
|
9
|
+
repeat: {
|
|
10
|
+
addLabel: "Add",
|
|
11
|
+
removeLabel: "Remove",
|
|
12
|
+
addButton: templateFormAddButton,
|
|
13
|
+
removeButton: templateFormRemoveButton,
|
|
14
|
+
resetButton: templateFormResetButton,
|
|
15
|
+
},
|
|
16
|
+
step: {
|
|
17
|
+
nextLabel: "Continue",
|
|
18
|
+
previousLabel: "Back",
|
|
19
|
+
nextButton: templateFormNextButton,
|
|
20
|
+
previousButton: templateFormPreviousButton,
|
|
21
|
+
resetButton: templateFormResetButton,
|
|
22
|
+
},
|
|
23
|
+
union: { selectInputKind: templateFormSelect },
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const useForm = createForm(templates.useTemplates());
|
|
27
|
+
|
|
28
|
+
export function usePostModeration() {
|
|
29
|
+
const { component: ModerationForm, currentValue, check, dispose } = useForm(
|
|
30
|
+
useUnionLayout(
|
|
31
|
+
[
|
|
32
|
+
["approve", useTextInput({ label: "Public note" })],
|
|
33
|
+
[
|
|
34
|
+
"reject",
|
|
35
|
+
useMultiLayout({
|
|
36
|
+
reason: useTextareaInput({
|
|
37
|
+
label: "Reason for rejection",
|
|
38
|
+
dataStructure: DDataStructure.string([DDataStructure.minCharacters(1)]),
|
|
39
|
+
}),
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
],
|
|
43
|
+
{ defaultKind: "approve" },
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
const selectedDecision = computed(() => currentValue.value.kind);
|
|
47
|
+
const submitted = ref("");
|
|
48
|
+
|
|
49
|
+
function selectApproval() {
|
|
50
|
+
currentValue.value.updateKind("approve");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function selectRejection() {
|
|
54
|
+
currentValue.value.updateKind("reject");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function submit() {
|
|
58
|
+
submitted.value = "";
|
|
59
|
+
const result = await check();
|
|
60
|
+
|
|
61
|
+
if (DEither.isRight(result)) {
|
|
62
|
+
const decision = DEither.unwrapRight(result);
|
|
63
|
+
|
|
64
|
+
submitted.value = decision.kind === "approve"
|
|
65
|
+
? `Approved: ${decision.value}`
|
|
66
|
+
: `Rejected: ${decision.value.reason}`;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onScopeDispose(dispose);
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
ModerationForm,
|
|
74
|
+
selectedDecision,
|
|
75
|
+
submitted,
|
|
76
|
+
selectApproval,
|
|
77
|
+
selectRejection,
|
|
78
|
+
submit,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -1,41 +1,44 @@
|
|
|
1
1
|
### Frontières entre domaine, application et infrastructure
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Responsabilités des couches, sens des dépendances et préparation des garanties aux frontières du système.
|
|
4
|
+
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
###
|
|
7
|
+
### Faire du domaine le contrat de l'opération
|
|
8
|
+
|
|
9
|
+
Le domaine traduit les exigences du monde réel en états, préconditions, transitions et opérations coordonnées. Il définit ce qui doit se passer et les garanties nécessaires pour continuer.
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
| Couche | Responsabilité | Exemple du retour d'un livre |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Domaine | Définir les états autorisés, les faits, leur enchaînement et les capacités extérieures requises. | Exiger le lien client-livre, rendre le livre, demander la prochaine inscription en attente et réserver le livre si une inscription existe. |
|
|
14
|
+
| Application | Satisfaire les préconditions et les effets de l'agrégat avec des ports abstraits. | Fournir le résultat de sélection attendu, sauvegarder les entités transmises et propager une indisponibilité. |
|
|
15
|
+
| Infrastructure | Réaliser les ports et adapter les points d'entrée aux contrats applicatifs. | Interroger le stockage, hydrater les entités et convertir le résultat en réponse HTTP. |
|
|
16
|
+
|
|
17
|
+
Une règle encore à décider dans un use case ou un adaptateur indique un contrat métier incomplet. Les couches techniques conservent leurs choix d'implémentation, mais ces choix doivent respecter les garanties définies dans le domaine.
|
|
18
|
+
|
|
19
|
+
### Sens des dépendances
|
|
9
20
|
|
|
10
21
|
```text
|
|
11
22
|
Infrastructure → Application → Domaine
|
|
12
23
|
Infrastructure → Domaine
|
|
13
24
|
```
|
|
14
25
|
|
|
15
|
-
Le domaine
|
|
26
|
+
Le domaine n'importe ni l'application ni l'infrastructure. Il décrit ses besoins extérieurs par des [repositories](../02-domains/30-repositories.md) et ses demandes d'effets par des [workflows](../02-domains/20-aggregates.md). Il n'appelle aucune implémentation technique.
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
L'application définit les ports de ses use cases ; l'infrastructure les implémente. Changer de base de données ou de protocole d'entrée ne change donc pas les transitions du domaine.
|
|
18
29
|
|
|
19
30
|
### Respecter les responsabilités aux frontières
|
|
20
31
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- lire des données à travers un repository, dont l'implémentation les hydrate avec `map` ou `decodeMap` ;
|
|
24
|
-
- appeler une fonction pure de qualification pour établir une condition attendue par l'application ;
|
|
25
|
-
- appeler un use case et adapter son résultat au point d'entrée consommé.
|
|
26
|
-
|
|
27
|
-
Les lectures seules, comme `findById` ou `findMany`, peuvent servir une consultation ou préparer les entrées d'un use case sans imposer un use case de relais. Lorsqu'une opération comporte des règles métier, le domaine les exprime et l'application orchestre leur exécution, les effets et la persistance.
|
|
28
|
-
|
|
29
|
-
L'infrastructure passe alors par le use case : elle n'appelle directement ni `Fact` ni agrégat et ne modifie pas une entité pour réaliser une transition. Elle n'utilise pas non plus `Flag.append` ; la qualification du domaine établit le flag après avoir constaté la condition.
|
|
32
|
+
Un point d'entrée peut lire des données par un repository et appeler les qualifications pures du domaine pour préparer les paramètres d'un use case. Une lecture seule, comme `findById`, ne demande pas un use case de relais.
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Dès que l'opération conduit un cycle de vie ou des effets métier, le point d'entrée passe par un use case. Il n'appelle directement ni fait ni agrégat, et ne modifie pas une entité pour réaliser une transition. Les fonctions du domaine restent responsables de la vérification qui établit un flag ou une preuve combinatoire.
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
La signature du use case indique les [préconditions à préparer](../03-applications/10-use-case.md#préparer-les-préconditions-demandées) par le point d'entrée.
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
### Faire circuler les garanties et les résultats
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
Les structures du domaine valident les entrées externes et hydratent les données existantes. Les qualifications, refinements et repositories établissent les garanties exigées par l'opération.
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
Le domaine distingue les issues qui ont un sens pour son raisonnement. L'application sélectionne celles qui permettent de poursuivre et propage les refus, y compris les résultats techniques ajoutés par ses ports. L'infrastructure adapte le résultat final au consommateur : statut HTTP, sortie de commande ou autre protocole.
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
Le traitement des refus prévisibles et des défaillances imprévues suit les [règles des résultats et exceptions](../../01-fundamental/03-either/50-external-results.ts).
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
## Architecture
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Répartir la décision métier, la satisfaction des contrats et la réalisation technique entre domaine, application et infrastructure.
|
|
@@ -1,58 +1,50 @@
|
|
|
1
|
-
###
|
|
1
|
+
### Entités, qualifications et faits
|
|
2
|
+
|
|
3
|
+
Modéliser les données et leurs invariants, certifier leurs conditions actuelles et rendre explicites les préconditions des transitions métier.
|
|
2
4
|
|
|
3
|
-
Organisation des modèles métier, de leurs invariants, qualifications et transitions dans le domaine.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
###
|
|
7
|
+
### Décrire les valeurs possibles
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Une entité porte une identité et une forme métier stable. Ses propriétés utilisent les types qui expriment leur sens et leurs contraintes : identifiants distincts, titres bornés, collections limitées ou variantes d'état. Regrouper dans son namespace les types, structures, états, flags et l'union de ses faits permet de retrouver son cycle de vie.
|
|
9
10
|
|
|
10
|
-
Les
|
|
11
|
+
Les propriétés propres à un état appartiennent à une variante de cet état. Dans [`Book`](../fixtures/business/domains/entities/book/index.ts), `state` est une union de `TaggedObject` : disponible, emprunté, réservé ou retiré. Le client emprunteur existe dans `BorrowedState` ; `ReservedState` référence l'entrée de liste d'attente concernée. Ces informations ne deviennent pas des propriétés facultatives communes à tous les livres.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
| --- | --- |
|
|
14
|
-
| Définir le modèle | Regrouper dans le namespace TypeScript de l'entité son `createEntityNamespace`, ses `NewType`, sa définition commune, ses états, ses flags et l'union de ses `Facts`. Représenter les propriétés pouvant changer de forme par des unions, notamment de `TaggedObject`. |
|
|
15
|
-
| Qualifier une condition | Une fonction du namespace inspecte les données sans modifier les propriétés métier et ajoute le flag correspondant uniquement après vérification. La condition peut porter sur un état, une capacité ou une relation avec une autre entité. |
|
|
16
|
-
| Créer ou modifier l'entité | Une `Fact` de son dossier `facts/` porte chaque création ou modification métier, même un simple changement de propriété. Elle peut lire plusieurs entités, mais ne modifie que sa cible. `Entity.update` est réservé aux faits ; ils ajoutent les flags dont leur transition établit les conditions. |
|
|
17
|
-
| Hydrater des données existantes | Utiliser les API de mapping décrites dans [Entity](../../01-fundamental/06-modeling/20-entity.ts). Cette entrée dans le modèle ne constitue pas une création métier. |
|
|
18
|
-
| Coordonner plusieurs cibles | Prévoir un fait par entité modifiée et confier leur orchestration à un [agrégat](./20-aggregates.md). |
|
|
13
|
+
Chaque [`WaitingListEntry`](../fixtures/business/domains/entities/waitingListEntry/index.ts) représente une inscription individuelle. Plusieurs inscriptions peuvent concerner un livre, mais son état `ReservedState` n'en référence qu'une : la réservation effective. Le client reste porté par cette entrée, sans duplication de son `clientId` dans le livre.
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
Les primitives et leurs API sont présentées dans les fondamentaux : [NewType](../../01-fundamental/06-modeling/10-new-type.ts), [Entity](../../01-fundamental/06-modeling/20-entity.ts) et [TaggedObject](../../01-fundamental/06-modeling/30-tagged-object.ts).
|
|
21
16
|
|
|
22
|
-
###
|
|
17
|
+
### Qualifier une condition actuelle
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
Une qualification observe une entité sans modifier ses propriétés métier. Elle vérifie une condition puis retourne la valeur avec le `Flag` correspondant. Un flag peut certifier un état nommé ou une capacité ; plusieurs flags compatibles peuvent coexister.
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
| --- | --- | --- |
|
|
28
|
-
| Donner une identité métier à une valeur | `NewType` | Deux valeurs de même représentation mais de sens différent ne sont pas interchangeables. Les contraintes de forme sont vérifiées lors du mapping. |
|
|
29
|
-
| Décrire une forme identifiée | `TaggedObject` | Son tag permet le pattern matching et le transport entre frontières. Il décrit une shape, pas un cycle de vie ; une union de tags modélise les formes possibles d'une propriété. |
|
|
30
|
-
| Certifier une condition sur l'entité actuelle | `Flag` | Une qualification inspecte la valeur puis ajoute le flag correspondant. Le flag peut porter la payload de la vérification ; plusieurs flags peuvent coexister. |
|
|
31
|
-
| Représenter une création ou modification métier | `Fact` | Toute transition est un événement, même si l'état final ressemble à l'état initial. Une fact peut lire plusieurs entités, mais ne modifie que sa cible. |
|
|
32
|
-
| Imposer une provenance ou un ordre d'exécution | `Evidence` | La preuve identifie l'opération qui doit avoir précédé, indépendamment de la forme de la valeur. Ses contrats sont détaillés dans les [agrégats](./20-aggregates.md) et les [repositories](./30-repositories.md). |
|
|
21
|
+
[`Book.refineState`](../fixtures/business/domains/entities/book/index.ts) reconnaît l'état du livre et produit notamment `AvailableFlag` ou `BorrowedFlag`. Dans [`Client`](../fixtures/business/domains/entities/client/index.ts), l'invariant limite `borrowedBooks` à cinq identifiants. La qualification `canRentBook` vérifie que le client en possède au plus quatre avant une nouvelle location et produit `CanRentBookFlag`. Cette capacité permet au fait de préserver l'invariant en ajoutant un emprunt.
|
|
33
22
|
|
|
34
|
-
|
|
23
|
+
| Besoin | Modélisation |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| Décrire les données propres à une variante | État sous forme de `TaggedObject`. |
|
|
26
|
+
| Certifier une condition sur l'entité actuelle | Qualification et `Flag`. |
|
|
27
|
+
| Certifier une combinaison de plusieurs valeurs | [Refinement](./40-refinements.md) produisant une évidence sur le contexte. |
|
|
28
|
+
| Exiger une vérification extérieure ou une provenance | [Evidence](./20-aggregates.md#exiger-les-preuves-utiles-au-parcours) issue du contrat qui établit cette garantie. |
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
`Flag.append` appartient aux qualifications et aux faits qui établissent réellement sa condition. L'appelant consomme leur résultat ; il ne fabrique pas un flag pour contourner une précondition.
|
|
37
31
|
|
|
38
|
-
###
|
|
32
|
+
### Définir le contrat d'une transition
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
Une `Fact` représente une création ou une modification métier. Elle peut lire plusieurs entités, mais ne modifie qu'une seule cible. Chaque changement métier passe par un fait, y compris un changement de propriété qui conserve le même état nommé. Un [agrégat](./20-aggregates.md) coordonne les faits lorsque l'opération touche plusieurs cibles.
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
La signature du fait exige les états nécessaires à sa transition. [`BookRentalFact`](../fixtures/business/domains/entities/book/facts/rental.ts) reçoit un client portant `CanRentBookFlag` et un livre portant `AvailableFlag`. Il construit l'état emprunté, met à jour le livre, ajoute `BorrowedFlag` et applique le fait. Le client est lu ; sa modification appartient à [`ClientRentBookFact`](../fixtures/business/domains/entities/client/facts/rentBook.ts).
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
Une évidence appartient au contrat d'un fait si sa garantie est intrinsèque à la transition ; une provenance propre à un parcours relève de l'agrégat. Ainsi, [`PrepareWaitingListEntryFact`](../fixtures/business/domains/entities/waitingListEntry/facts/prepare.ts) exige une entrée en attente, sans imposer sa sélection lors d'un retour. [`CancelWaitingListEntryFact`](../fixtures/business/domains/entities/waitingListEntry/facts/cancel.ts) accepte une entrée en attente ou prête et un motif, pour servir aussi bien le retrait d'un livre qu'une annulation par le client.
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
### Distinguer l'événement et l'état produit
|
|
47
41
|
|
|
48
|
-
La
|
|
42
|
+
La payload du fait décrit l'événement ; celle du flag porte les informations de la condition certifiée. Elles peuvent différer. [`ReserveBookFact`](../fixtures/business/domains/entities/book/facts/reserve.ts) conserve `waitingListEntryId` et `clientId` dans sa payload. L'état réservé et son flag ne conservent que `waitingListEntryId`, suffisant pour référencer la réservation effective.
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| Transformation | Construire un `BorrowedState` avec l'identifiant du client et mettre à jour le livre. Le client est lu, sans être modifié par ce fait. |
|
|
54
|
-
| Sortie | Ajouter `BorrowedFlag` et appliquer `BookRentalFact` avec le nouvel état comme payload. `run` enveloppe la valeur `Book.Entity & Book.BorrowedFlag & BookRentalFact` dans un `Either` droit. |
|
|
44
|
+
Le fait courant porté par une entité ne constitue pas à lui seul un historique persistant. Si le métier demande cet historique, sa conservation doit être prévue par un contrat dédié.
|
|
45
|
+
|
|
46
|
+
### Poursuivre avec la nouvelle entité
|
|
55
47
|
|
|
56
|
-
|
|
48
|
+
`Entity.update` est réservé aux faits. Il reconstruit l'entité à partir de ses propriétés déclarées et ne conserve pas automatiquement les anciens flags ni le fait précédent. La transition établit les garanties de la nouvelle valeur, puis les opérations suivantes utilisent cette valeur retournée.
|
|
57
49
|
|
|
58
|
-
|
|
50
|
+
Les propriétés fournies à `update` doivent déjà satisfaire les types métier : cette opération ne réalise pas une validation runtime. Ne pas transférer les preuves de l'ancienne valeur par un spread ou un cast. Le [cycle de vie avec Flag et Fact](../../01-fundamental/06-modeling/40-entity-lifecycle.ts) détaille ces mécanismes.
|
|
@@ -1,49 +1,65 @@
|
|
|
1
|
-
###
|
|
1
|
+
### Agrégats, preuves et workflows
|
|
2
|
+
|
|
3
|
+
Définir le déroulement d'une opération métier, les preuves qui l'autorisent et les demandes commit, resolve et iterate que l'application doit satisfaire.
|
|
2
4
|
|
|
3
|
-
Contrats des transactions métier, préconditions et orchestration de faits réutilisables.
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
###
|
|
7
|
+
### Porter l'opération métier entière
|
|
8
|
+
|
|
9
|
+
Dans ce Type-Driven Design, un **agrégat est une fonction qui conduit une opération métier**. Il exige ses préconditions, coordonne les [faits](./10-entities.md#définir-le-contrat-dune-transition), relie leurs entrées et leurs sorties et détermine le résultat final.
|
|
10
|
+
|
|
11
|
+
[`clientRentBook`](../fixtures/business/domains/aggregates/clientRentBook.ts) coordonne ainsi le fait qui ajoute un emprunt au client et celui qui passe le livre à l'état emprunté.
|
|
12
|
+
|
|
13
|
+
L'agrégat fixe aussi les exigences propres à l'opération. [`CreateBookFact`](../fixtures/business/domains/entities/book/facts/create.ts) reçoit un identifiant et un titre. L'agrégat [`createBook`](../fixtures/business/domains/aggregates/createBook.ts) exige en plus que l'identifiant ait été généré et que le titre ait été vérifié comme absent du catalogue. Le fait reste réutilisable ; ce parcours de création porte ses propres preuves.
|
|
14
|
+
|
|
15
|
+
Un agrégat reste pur. Il n'appelle ni repository ni callback impure injectée : il transforme les valeurs disponibles et déclare les besoins extérieurs. À entrées et résultats fournis identiques, son raisonnement métier est identique. Un agrégat sans effet à demander peut retourner directement une valeur ou un `Either`.
|
|
16
|
+
|
|
17
|
+
### Exiger les preuves utiles au parcours
|
|
18
|
+
|
|
19
|
+
Une [Evidence](../../01-fundamental/06-modeling/50-evidence.ts) rend exigible dans les types une garantie de contexte, une relation entre valeurs ou une provenance.
|
|
20
|
+
|
|
21
|
+
Un `Book.Title` satisfait ses contraintes de forme, mais ne prouve pas que le catalogue ne contient pas déjà ce titre. Le résultat `title-not-registered` du [repository](../fixtures/business/domains/repositories/book.ts) apporte cette garantie contextuelle. De même, le [refinement client-livre](./40-refinements.md) certifie une combinaison que ni le client seul ni un livre simplement qualifié comme emprunté ne suffisent à établir.
|
|
7
22
|
|
|
8
|
-
|
|
23
|
+
`GetEvidenceResult` permet d'exiger la valeur portant une évidence précise parmi les résultats d'une fonction ou d'une méthode, y compris à travers une promesse, un `Either` ou un générateur. L'agrégat se rattache ainsi au contrat qui définit le résultat attendu sans reprendre l'ensemble de ses issues. Les noms d'évidence distinguent les garanties : deux méthodes annonçant le même type et la même évidence restent compatibles. Une identité d'opération particulière se représente avec une [SignedFunction](../../01-fundamental/06-modeling/60-signed-function.ts).
|
|
9
24
|
|
|
10
|
-
|
|
25
|
+
L'agrégat peut exiger la provenance d'une sélection ou d'un flux, puis transmettre aux faits les entités qualifiées selon leurs propres préconditions.
|
|
11
26
|
|
|
12
|
-
|
|
27
|
+
### Faire du workflow le contrat du déroulement
|
|
13
28
|
|
|
14
|
-
|
|
29
|
+
Le workflow exprime les endroits où l'opération transmet une donnée, attend un contexte supplémentaire ou applique un cycle de vie à une collection. Il précise ce que l'application doit fournir et à quel moment. Les branches métier restent dans l'agrégat ; les appels techniques restent dans l'application.
|
|
15
30
|
|
|
16
|
-
|
|
31
|
+
| Demande | Ce que le domaine impose | Liberté de réalisation technique |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `commit` | Prendre en charge une donnée à cette étape du déroulement. | Réaliser la sauvegarde ou l'action prévue par le contrat. |
|
|
34
|
+
| `resolve` | Fournir le résultat qualifié nécessaire pour poursuivre le raisonnement. | Obtenir ce résultat par l'opération extérieure appropriée. |
|
|
35
|
+
| `iterate` | Fournir les éléments du périmètre demandé et exécuter le workflow métier pour chacun. | Lire le flux progressivement et organiser son exécution. |
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
Les fixtures déclarent ces demandes avec `createWorkflow` ; l'[application](../03-applications/10-use-case.md) les satisfait avec `consumeWorkflow`.
|
|
19
38
|
|
|
20
|
-
|
|
39
|
+
### Transmettre une donnée avec commit
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
Un `commit` indique que la donnée a atteint le point où l'agrégat veut la confier à une opération extérieure. La persistance est un usage fréquent. Le commit peut aussi demander une action, par exemple l'envoi d'un courriel. Sa valeur de retour n'alimente pas le raisonnement métier du générateur.
|
|
23
42
|
|
|
24
|
-
|
|
43
|
+
Dans [`clientRentBook`](../fixtures/business/domains/aggregates/clientRentBook.ts), les faits produisent les nouvelles valeurs du client et du livre. Le premier commit les transmet ensemble ; le suivant demande le courriel d'information. L'application attend la prise en charge du premier avant de poursuivre avec le second.
|
|
25
44
|
|
|
26
|
-
|
|
45
|
+
Si l'identité de l'action importe, `withSignature<EmailRepository["sendRentInformationalEmail"]>()` exige la fonction signée correspondante. Un commit qui transmet simplement une entité laisse au use case le raccordement à sa sauvegarde.
|
|
27
46
|
|
|
28
|
-
|
|
47
|
+
### Obtenir un contexte extérieur avec resolve
|
|
29
48
|
|
|
30
|
-
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| [`CreateBookFact`](../fixtures/business/domains/entities/book/facts/create.ts) | Un `Book.Id` et un `Book.Title`. |
|
|
33
|
-
| Agrégat `createBook` | Un identifiant portant la preuve `generated` et un titre portant la preuve `title-not-registered`, exigés avec `GetEvidenceResult`. |
|
|
49
|
+
Un `resolve` intervient lorsque les données disponibles ne permettent pas de poursuivre la décision métier. Une qualification pure suffit si toute l'information est déjà présente. Quand la réponse dépend d'une collection extérieure potentiellement volumineuse, le domaine exige le résultat utile sans charger cette collection dans ses paramètres.
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
[`clientGiveBackBook`](../fixtures/business/domains/aggregates/clientGiveBackBook.ts) applique les faits de retour, puis demande la prochaine inscription en attente du livre rendu. Il exige les résultats de `WaitingListEntryRepository.findNextPendingForBook` : une entrée sélectionnée ou la preuve qu'aucune entrée n'est en attente.
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
Ces deux issues permettent de continuer. Sans inscription, l'agrégat transmet le livre disponible et le client. Avec une inscription, il applique les faits de réservation du livre et de préparation de l'entrée, puis transmet les trois entités. La décision de réserver appartient entièrement au domaine ; l'application fournit le contexte qui la rend possible.
|
|
38
54
|
|
|
39
|
-
Le
|
|
55
|
+
Le [repository](./30-repositories.md#décrire-la-garantie-au-delà-de-la-forme) précise les garanties de sélection ; l'[application](../03-applications/10-use-case.md#propager-les-arrêts-et-respecter-les-garanties-dexécution) traite l'impossibilité de satisfaire la résolution.
|
|
40
56
|
|
|
41
|
-
###
|
|
57
|
+
### Faire vivre chaque élément d'un flux avec iterate
|
|
42
58
|
|
|
43
|
-
|
|
59
|
+
Un `iterate` exprime qu'une même opération métier doit s'appliquer à chaque élément d'un ensemble. Il permet de parcourir un volume non borné sans réunir toutes les entités en mémoire et de conserver les transitions du domaine pour chacune.
|
|
44
60
|
|
|
45
|
-
|
|
61
|
+
[`withdrawBook`](../fixtures/business/domains/aggregates/withdrawBook.ts) reçoit un livre disponible ou réservé : il est encore à la bibliothèque. Après le fait de retrait et le commit du livre, il demande toutes les entrées actives de sa liste d'attente. Chaque élément doit porter la preuve du résultat de `WaitingListEntryRepository.findAllActiveByBook` et contenir une entrée en attente ou prête.
|
|
46
62
|
|
|
47
|
-
|
|
63
|
+
Le workflow imbriqué applique `CancelWaitingListEntryFact` avec le motif `book-withdrawn`, puis transmet l'entrée annulée par un commit. Une mise à jour globale en base contournerait ces faits et leurs préconditions. Le domaine conserve le choix de la transition et de son motif ; l'application fournit la génératrice asynchrone et le degré de concurrence.
|
|
48
64
|
|
|
49
|
-
Le
|
|
65
|
+
Le résultat final est le livre retiré ; le workflow n'accumule pas les entrées traitées. Le [use case de retrait](../fixtures/business/applications/useCases/withdrawBook.ts) montre le raccordement du flux et des commits. Les conséquences d'un arrêt après des effets déjà exécutés sont décrites dans la [consommation applicative](../03-applications/10-use-case.md#propager-les-arrêts-et-respecter-les-garanties-dexécution).
|