@iota-uz/sdk 0.46.0 → 0.47.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/README.md +5 -0
- package/dist/client-host/identity.d.ts +4 -4
- package/dist/client-host/identity.js +2 -2
- package/dist/lens/{CascadePanel-Bha4qY7J.js → CascadePanel-BlYJd18G.js} +1 -1
- package/dist/lens/{ChartDataEquivalent-Bwgn4yYB.js → ChartDataEquivalent-B6xSOdzC.js} +1 -1
- package/dist/lens/{ChartPanel-BZpzBuwl.js → ChartPanel-BIJjrs5D.js} +159 -159
- package/dist/lens/{CoveragePanel-D40AuKkD.js → CoveragePanel-CHtXDMtt.js} +1 -1
- package/dist/lens/{GaugePanel-C9k2TuJH.js → GaugePanel-By0TOJPa.js} +1 -1
- package/dist/lens/LensDashboard.d.ts +13 -0
- package/dist/lens/LensDashboard.d.ts.map +1 -1
- package/dist/lens/{MapPanel-ZYxfDsPM.js → MapPanel-Cw4ELCiM.js} +3 -3
- package/dist/lens/{MetricFlowPanel-CmESLoLK.js → MetricFlowPanel-Gr5wi3nI.js} +2 -2
- package/dist/lens/{MetricHierarchyPanel-UZVuJ5P2.js → MetricHierarchyPanel-VLA_5LXX.js} +2 -2
- package/dist/lens/{MetricRelationshipPanel-CXLdScAy.js → MetricRelationshipPanel-DFP566_c.js} +2 -2
- package/dist/lens/{PrintReport-lrfdCTZO.js → PrintReport-C0OV1iHP.js} +5 -5
- package/dist/lens/{QualityChip-BYz-DHfs.js → QualityChip-DTi-0jdh.js} +1 -1
- package/dist/lens/SaveInvestigation-CX1Abyl8.js +309 -0
- package/dist/lens/TablePanel-BusKU7cU.js +994 -0
- package/dist/lens/{adapter-CeAqYWqm.js → adapter-CQg4-M7p.js} +7 -7
- package/dist/lens/contract/schemas.d.ts +2 -0
- package/dist/lens/contract/schemas.d.ts.map +1 -1
- package/dist/lens/contract/types.d.ts +12 -0
- package/dist/lens/contract/types.d.ts.map +1 -1
- package/dist/lens/{dashboardEdit-DKVE_6J_.js → dashboardEdit-CJgCVfi_.js} +1 -1
- package/dist/lens/explore/DrillOverlay.d.ts +38 -0
- package/dist/lens/explore/DrillOverlay.d.ts.map +1 -1
- package/dist/lens/explore/ExplorePanel.d.ts.map +1 -1
- package/dist/lens/explore/SaveInvestigation.d.ts +21 -0
- package/dist/lens/explore/SaveInvestigation.d.ts.map +1 -0
- package/dist/lens/explore/drillHost.d.ts +25 -0
- package/dist/lens/explore/drillHost.d.ts.map +1 -0
- package/dist/lens/explore/investigation.d.ts +174 -0
- package/dist/lens/explore/investigation.d.ts.map +1 -0
- package/dist/lens/explore/provenanceLabels.d.ts +10 -0
- package/dist/lens/explore/provenanceLabels.d.ts.map +1 -0
- package/dist/lens/index-DR7Hf8Km.js +19805 -0
- package/dist/lens/{index-DkVTXC8W.js → index-DZFw4cqF.js} +1 -1
- package/dist/lens/index.d.ts +7 -1
- package/dist/lens/index.d.ts.map +1 -1
- package/dist/lens/index.js +67 -53
- package/dist/lens/{install-CQ_iMuAE.js → install-B2lTK6uo.js} +1 -1
- package/dist/lens/{install-Ch0_qifK.js → install-BXr4Mnc0.js} +1 -1
- package/dist/lens/{install-CKmxqMe1.js → install-CicNQ_ks.js} +1 -1
- package/dist/lens/{install-BwD_xNlp.js → install-d8A0WPiw.js} +1 -1
- package/dist/lens/{keys-BBmWdfaH.js → keys-C-Akc9lZ.js} +2 -2
- package/dist/lens/panels/ChartPanel.d.ts.map +1 -1
- package/dist/lens/panels/TablePanel.d.ts.map +1 -1
- package/dist/lens/panels/actions.d.ts.map +1 -1
- package/dist/lens/panels/panelFailure.d.ts.map +1 -1
- package/dist/lens/{prefetch-BXoUIIgq.js → prefetch-C9kxuIs8.js} +2 -2
- package/dist/lens/{prefetchPanels-a-zs_bDm.js → prefetchPanels-gbY9RIqL.js} +1 -1
- package/dist/lens/{print-CpgWJxDG.js → print-CllsAP3d.js} +1 -1
- package/dist/lens/reports/ReportCompositionEditor.d.ts +8 -2
- package/dist/lens/reports/ReportCompositionEditor.d.ts.map +1 -1
- package/dist/lens/reports/ReportDefinitionEditor.d.ts +54 -0
- package/dist/lens/reports/ReportDefinitionEditor.d.ts.map +1 -0
- package/dist/lens/reports/ReportPicker.d.ts +6 -0
- package/dist/lens/reports/ReportPicker.d.ts.map +1 -1
- package/dist/lens/reports/dashboardEdit.d.ts +3 -0
- package/dist/lens/reports/dashboardEdit.d.ts.map +1 -1
- package/dist/lens/reports/editing.d.ts +35 -0
- package/dist/lens/reports/editing.d.ts.map +1 -1
- package/dist/lens/reports/picker.d.ts +4 -1
- package/dist/lens/reports/picker.d.ts.map +1 -1
- package/dist/lens/runtime/index.d.ts +0 -1
- package/dist/lens/runtime/index.d.ts.map +1 -1
- package/dist/lens/runtime/messages.d.ts +2 -2
- package/dist/lens/runtime/messages.d.ts.map +1 -1
- package/dist/lens/runtime/provider.d.ts +5 -1
- package/dist/lens/runtime/provider.d.ts.map +1 -1
- package/dist/lens/runtime/returnContext.d.ts +62 -0
- package/dist/lens/runtime/returnContext.d.ts.map +1 -0
- package/dist/lens/runtime/tableSummary.d.ts +9 -0
- package/dist/lens/runtime/tableSummary.d.ts.map +1 -0
- package/dist/lens/{scales-BLf9OweG.js → scales-CO6Q9RtG.js} +1 -1
- package/dist/lens/style.css +1 -1
- package/dist/runtime/README.md +24 -0
- package/dist/runtime/assert.d.ts +51 -0
- package/dist/runtime/assert.js +172 -0
- package/dist/runtime/build/README.txt +1 -0
- package/dist/runtime/build/extract.mjs +342 -0
- package/dist/runtime/build/shared-exports.json +388 -0
- package/dist/runtime/build/test-child.mjs +136 -0
- package/dist/runtime/build/theme/tailwind.config.js +121 -0
- package/dist/runtime/build/theme/theme.css +462 -0
- package/dist/runtime/build/theme/utilities.css +1 -0
- package/dist/runtime/build/vendor/lib/lib.d.ts +22 -0
- package/dist/runtime/build/vendor/lib/lib.decorators.d.ts +384 -0
- package/dist/runtime/build/vendor/lib/lib.decorators.legacy.d.ts +22 -0
- package/dist/runtime/build/vendor/lib/lib.dom.asynciterable.d.ts +41 -0
- package/dist/runtime/build/vendor/lib/lib.dom.d.ts +28983 -0
- package/dist/runtime/build/vendor/lib/lib.dom.iterable.d.ts +491 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.collection.d.ts +147 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.core.d.ts +597 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.d.ts +28 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.generator.d.ts +77 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.iterable.d.ts +590 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.promise.d.ts +81 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.proxy.d.ts +128 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.reflect.d.ts +144 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.symbol.d.ts +46 -0
- package/dist/runtime/build/vendor/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/dist/runtime/build/vendor/lib/lib.es2016.array.include.d.ts +116 -0
- package/dist/runtime/build/vendor/lib/lib.es2016.d.ts +21 -0
- package/dist/runtime/build/vendor/lib/lib.es2016.full.d.ts +23 -0
- package/dist/runtime/build/vendor/lib/lib.es2016.intl.d.ts +31 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.d.ts +26 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.date.d.ts +31 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.full.d.ts +23 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.intl.d.ts +44 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.object.d.ts +49 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.string.d.ts +45 -0
- package/dist/runtime/build/vendor/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.intl.d.ts +83 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.promise.d.ts +30 -0
- package/dist/runtime/build/vendor/lib/lib.es2018.regexp.d.ts +37 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.array.d.ts +79 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.intl.d.ts +23 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.object.d.ts +33 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.string.d.ts +37 -0
- package/dist/runtime/build/vendor/lib/lib.es2019.symbol.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.bigint.d.ts +731 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.d.ts +27 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.date.d.ts +42 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.intl.d.ts +474 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.number.d.ts +28 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.promise.d.ts +47 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.string.d.ts +44 -0
- package/dist/runtime/build/vendor/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.d.ts +23 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.intl.d.ts +166 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.promise.d.ts +48 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.string.d.ts +33 -0
- package/dist/runtime/build/vendor/lib/lib.es2021.weakref.d.ts +78 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.array.d.ts +121 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.d.ts +25 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.error.d.ts +75 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.intl.d.ts +121 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.object.d.ts +26 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.regexp.d.ts +39 -0
- package/dist/runtime/build/vendor/lib/lib.es2022.string.d.ts +25 -0
- package/dist/runtime/build/vendor/lib/lib.es2023.array.d.ts +924 -0
- package/dist/runtime/build/vendor/lib/lib.es2023.collection.d.ts +21 -0
- package/dist/runtime/build/vendor/lib/lib.es2023.d.ts +22 -0
- package/dist/runtime/build/vendor/lib/lib.es2023.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2023.intl.d.ts +56 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.collection.d.ts +29 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.d.ts +26 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.object.d.ts +29 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.promise.d.ts +35 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.regexp.d.ts +25 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/dist/runtime/build/vendor/lib/lib.es2024.string.d.ts +29 -0
- package/dist/runtime/build/vendor/lib/lib.es5.d.ts +4585 -0
- package/dist/runtime/build/vendor/lib/lib.es6.d.ts +23 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.array.d.ts +35 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.collection.d.ts +96 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.d.ts +25 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.decorators.d.ts +28 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.disposable.d.ts +193 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.full.d.ts +24 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.intl.d.ts +21 -0
- package/dist/runtime/build/vendor/lib/lib.esnext.iterator.d.ts +148 -0
- package/dist/runtime/build/vendor/node-types/assert/strict.d.ts +111 -0
- package/dist/runtime/build/vendor/node-types/assert.d.ts +1115 -0
- package/dist/runtime/build/vendor/node-types/async_hooks.d.ts +619 -0
- package/dist/runtime/build/vendor/node-types/buffer.buffer.d.ts +477 -0
- package/dist/runtime/build/vendor/node-types/buffer.d.ts +1941 -0
- package/dist/runtime/build/vendor/node-types/child_process.d.ts +1480 -0
- package/dist/runtime/build/vendor/node-types/cluster.d.ts +578 -0
- package/dist/runtime/build/vendor/node-types/compatibility/iterators.d.ts +21 -0
- package/dist/runtime/build/vendor/node-types/console.d.ts +453 -0
- package/dist/runtime/build/vendor/node-types/constants.d.ts +21 -0
- package/dist/runtime/build/vendor/node-types/crypto.d.ts +5484 -0
- package/dist/runtime/build/vendor/node-types/dgram.d.ts +715 -0
- package/dist/runtime/build/vendor/node-types/diagnostics_channel.d.ts +576 -0
- package/dist/runtime/build/vendor/node-types/dns/promises.d.ts +503 -0
- package/dist/runtime/build/vendor/node-types/dns.d.ts +923 -0
- package/dist/runtime/build/vendor/node-types/domain.d.ts +166 -0
- package/dist/runtime/build/vendor/node-types/events.d.ts +967 -0
- package/dist/runtime/build/vendor/node-types/fs/promises.d.ts +1354 -0
- package/dist/runtime/build/vendor/node-types/fs.d.ts +4777 -0
- package/dist/runtime/build/vendor/node-types/globals.d.ts +170 -0
- package/dist/runtime/build/vendor/node-types/globals.typedarray.d.ts +41 -0
- package/dist/runtime/build/vendor/node-types/http.d.ts +2246 -0
- package/dist/runtime/build/vendor/node-types/http2.d.ts +2882 -0
- package/dist/runtime/build/vendor/node-types/https.d.ts +585 -0
- package/dist/runtime/build/vendor/node-types/index.d.ts +101 -0
- package/dist/runtime/build/vendor/node-types/inspector.d.ts +323 -0
- package/dist/runtime/build/vendor/node-types/inspector.generated.d.ts +4406 -0
- package/dist/runtime/build/vendor/node-types/module.d.ts +844 -0
- package/dist/runtime/build/vendor/node-types/net.d.ts +1197 -0
- package/dist/runtime/build/vendor/node-types/os.d.ts +507 -0
- package/dist/runtime/build/vendor/node-types/package.json +140 -0
- package/dist/runtime/build/vendor/node-types/path.d.ts +200 -0
- package/dist/runtime/build/vendor/node-types/perf_hooks.d.ts +1054 -0
- package/dist/runtime/build/vendor/node-types/process.d.ts +2101 -0
- package/dist/runtime/build/vendor/node-types/punycode.d.ts +117 -0
- package/dist/runtime/build/vendor/node-types/querystring.d.ts +152 -0
- package/dist/runtime/build/vendor/node-types/readline/promises.d.ts +161 -0
- package/dist/runtime/build/vendor/node-types/readline.d.ts +600 -0
- package/dist/runtime/build/vendor/node-types/repl.d.ts +438 -0
- package/dist/runtime/build/vendor/node-types/sea.d.ts +162 -0
- package/dist/runtime/build/vendor/node-types/sqlite.d.ts +1182 -0
- package/dist/runtime/build/vendor/node-types/stream/consumers.d.ts +45 -0
- package/dist/runtime/build/vendor/node-types/stream/promises.d.ts +90 -0
- package/dist/runtime/build/vendor/node-types/stream/web.d.ts +596 -0
- package/dist/runtime/build/vendor/node-types/stream.d.ts +1707 -0
- package/dist/runtime/build/vendor/node-types/string_decoder.d.ts +67 -0
- package/dist/runtime/build/vendor/node-types/test.d.ts +2656 -0
- package/dist/runtime/build/vendor/node-types/timers/promises.d.ts +108 -0
- package/dist/runtime/build/vendor/node-types/timers.d.ts +285 -0
- package/dist/runtime/build/vendor/node-types/tls.d.ts +1314 -0
- package/dist/runtime/build/vendor/node-types/trace_events.d.ts +197 -0
- package/dist/runtime/build/vendor/node-types/ts5.6/buffer.buffer.d.ts +473 -0
- package/dist/runtime/build/vendor/node-types/ts5.6/compatibility/float16array.d.ts +71 -0
- package/dist/runtime/build/vendor/node-types/ts5.6/globals.typedarray.d.ts +36 -0
- package/dist/runtime/build/vendor/node-types/ts5.6/index.d.ts +103 -0
- package/dist/runtime/build/vendor/node-types/ts5.7/compatibility/float16array.d.ts +72 -0
- package/dist/runtime/build/vendor/node-types/ts5.7/index.d.ts +103 -0
- package/dist/runtime/build/vendor/node-types/tty.d.ts +209 -0
- package/dist/runtime/build/vendor/node-types/url.d.ts +1103 -0
- package/dist/runtime/build/vendor/node-types/util.d.ts +2379 -0
- package/dist/runtime/build/vendor/node-types/v8.d.ts +1010 -0
- package/dist/runtime/build/vendor/node-types/vm.d.ts +1160 -0
- package/dist/runtime/build/vendor/node-types/wasi.d.ts +202 -0
- package/dist/runtime/build/vendor/node-types/web-globals/abortcontroller.d.ts +34 -0
- package/dist/runtime/build/vendor/node-types/web-globals/crypto.d.ts +32 -0
- package/dist/runtime/build/vendor/node-types/web-globals/domexception.d.ts +68 -0
- package/dist/runtime/build/vendor/node-types/web-globals/events.d.ts +97 -0
- package/dist/runtime/build/vendor/node-types/web-globals/fetch.d.ts +62 -0
- package/dist/runtime/build/vendor/node-types/web-globals/navigator.d.ts +25 -0
- package/dist/runtime/build/vendor/node-types/web-globals/storage.d.ts +24 -0
- package/dist/runtime/build/vendor/node-types/web-globals/streams.d.ts +22 -0
- package/dist/runtime/build/vendor/node-types/worker_threads.d.ts +894 -0
- package/dist/runtime/build/vendor/node-types/zlib.d.ts +768 -0
- package/dist/runtime/build/vendor/node_modules/csstype/LICENSE +19 -0
- package/dist/runtime/build/vendor/node_modules/csstype/index.d.ts +22569 -0
- package/dist/runtime/build/vendor/node_modules/csstype/index.js.flow +6863 -0
- package/dist/runtime/build/vendor/node_modules/csstype/package.json +70 -0
- package/dist/runtime/build/vendor/node_modules/seroval/LICENSE +7 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/cjs/development/index.cjs +4232 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/cjs/production/index.cjs +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/esm/development/index.mjs +4209 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/esm/production/index.mjs +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/Serializer.d.ts +28 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/base-primitives.d.ts +28 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/compat.d.ts +15 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/constants.d.ts +105 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/constructors.d.ts +50 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/async-parser.d.ts +20 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/deserializer.d.ts +52 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/parser.d.ts +62 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/serializer.d.ts +103 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/context/sync-parser.d.ts +61 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/cross/index.d.ts +24 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/errors.d.ts +47 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/function-string.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/keys.d.ts +4 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/literals.d.ts +10 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/node.d.ts +8 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/opaque-reference.d.ts +9 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/plugin.d.ts +52 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/reference.d.ts +6 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/sequence.d.ts +11 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/special-reference.d.ts +16 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/stream.d.ts +17 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/string.d.ts +4 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/symbols.d.ts +14 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/tree/index.d.ts +21 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/types.d.ts +233 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/error.d.ts +6 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/get-identifier.d.ts +2 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/get-object-flag.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/is-valid-identifier.d.ts +2 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/promise-to-result.d.ts +2 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/typed-array.d.ts +6 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/core/utils/valid-properties.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval/dist/types/index.d.ts +18 -0
- package/dist/runtime/build/vendor/node_modules/seroval/package.json +67 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/Serializer.ts +119 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/base-primitives.ts +537 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/compat.ts +23 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/constants.ts +202 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/constructors.ts +265 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/async-parser.ts +666 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/deserializer.ts +832 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/parser.ts +335 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/serializer.ts +1524 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/context/sync-parser.ts +943 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/cross/index.ts +190 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/errors.ts +196 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/function-string.ts +31 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/keys.ts +17 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/literals.ts +43 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/node.ts +40 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/opaque-reference.ts +9 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/plugin.ts +105 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/reference.ts +66 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/sequence.ts +59 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/special-reference.ts +42 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/stream.ts +71 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/string.ts +86 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/symbols.ts +20 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/tree/index.ts +134 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/types.ts +377 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/error.ts +73 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/get-identifier.ts +18 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/get-object-flag.ts +14 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/is-valid-identifier.ts +12 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/promise-to-result.ts +9 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/typed-array.ts +56 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/core/utils/valid-properties.ts +34 -0
- package/dist/runtime/build/vendor/node_modules/seroval/src/index.ts +36 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/LICENSE +7 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/cjs/development/web.cjs +826 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/cjs/production/web.cjs +1 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/esm/development/web.mjs +803 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/esm/production/web.mjs +1 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/abort-signal.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/blob.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/custom-event.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/dom-exception.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/event.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/file.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/form-data.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/headers.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/image-data.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/index.d.ts +15 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/readable-stream.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/request.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/response.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/url-search-params.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/dist/types/web/url.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/package.json +70 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/abort-signal.ts +131 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/blob.ts +41 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/custom-event.ts +66 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/dom-exception.ts +57 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/event.ts +62 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/file.ts +50 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/form-data.ts +105 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/headers.ts +49 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/image-data.ts +74 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/index.ts +14 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/readable-stream.ts +148 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/request.ts +82 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/response.ts +65 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/url-search-params.ts +40 -0
- package/dist/runtime/build/vendor/node_modules/seroval-plugins/web/url.ts +37 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/dist/server.cjs +824 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/dist/server.js +770 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/dist/solid.cjs +1808 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/dist/solid.js +1753 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/jsx-runtime.d.ts +1 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/package.json +243 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/server.cjs +133 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/server.js +121 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/store.cjs +463 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/dist/store.js +454 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/package.json +46 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/types/index.d.ts +12 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/types/modifiers.d.ts +6 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/types/mutable.d.ts +5 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/types/server.d.ts +17 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/store/types/store.d.ts +108 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/index.d.ts +23 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/jsx.d.ts +4253 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/array.d.ts +44 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/observable.d.ts +36 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/scheduler.d.ts +10 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/reactive/signal.d.ts +581 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/render/Suspense.d.ts +26 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/render/component.d.ts +111 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/render/flow.d.ts +118 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/render/hydration.d.ts +24 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/render/index.d.ts +4 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/server/index.d.ts +3 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/server/reactive.d.ts +98 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/types/server/rendering.d.ts +160 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/server.cjs +900 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/server.js +786 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/web.cjs +884 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/dist/web.js +772 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/package.json +46 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/dist/storage.cjs +12 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/dist/storage.js +10 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/package.json +15 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/storage/types/index.d.ts +2 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/client.d.ts +93 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/core.d.ts +2 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/index.d.ts +50 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/jsx.d.ts +1 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/server-mock.d.ts +65 -0
- package/dist/runtime/build/vendor/node_modules/solid-js/web/types/server.d.ts +187 -0
- package/dist/runtime/build/worker.mjs +293415 -0
- package/dist/runtime/catalog/sdk-natives.json +655 -0
- package/dist/runtime/cli/iota-ext.mjs +1028 -0
- package/dist/runtime/client-host/entry.d.ts +10 -0
- package/dist/runtime/client-host/entry.js +124 -0
- package/dist/runtime/client-host/hooks.d.ts +43 -0
- package/dist/runtime/client-host/hooks.js +94 -0
- package/dist/runtime/client-host/index.d.ts +9 -0
- package/dist/runtime/client-host/index.js +9 -0
- package/dist/runtime/client-host/islands.d.ts +44 -0
- package/dist/runtime/client-host/islands.js +165 -0
- package/dist/runtime/client-host/kit.d.ts +10 -0
- package/dist/runtime/client-host/kit.js +37 -0
- package/dist/runtime/client-host/page.d.ts +53 -0
- package/dist/runtime/client-host/page.js +217 -0
- package/dist/runtime/client-host/params.d.ts +8 -0
- package/dist/runtime/client-host/params.js +36 -0
- package/dist/runtime/client-host/protocol.d.ts +78 -0
- package/dist/runtime/client-host/protocol.js +26 -0
- package/dist/runtime/client-host/shared.d.ts +12 -0
- package/dist/runtime/client-host/shared.js +49 -0
- package/dist/runtime/client-host/shell.d.ts +88 -0
- package/dist/runtime/client-host/shell.js +195 -0
- package/dist/runtime/client-host/slots.d.ts +54 -0
- package/dist/runtime/client-host/slots.js +90 -0
- package/dist/runtime/client-host/styles.d.ts +7 -0
- package/dist/runtime/client-host/styles.js +61 -0
- package/dist/runtime/client-host/transport.d.ts +45 -0
- package/dist/runtime/client-host/transport.js +115 -0
- package/dist/runtime/client.d.ts +226 -0
- package/dist/runtime/client.js +121 -0
- package/dist/runtime/contracts.d.ts +204 -0
- package/dist/runtime/contracts.js +195 -0
- package/dist/runtime/docs/authoring.md +1609 -0
- package/dist/runtime/docs/example/docs/en/admin/limits.md +10 -0
- package/dist/runtime/docs/example/docs/en/getting-started.md +13 -0
- package/dist/runtime/docs/example/docs/en/points.md +9 -0
- package/dist/runtime/docs/example/docs/ru/getting-started.md +12 -0
- package/dist/runtime/docs/example/package.json +27 -0
- package/dist/runtime/docs/example/src/ClientScreen.tsx +10 -0
- package/dist/runtime/docs/example/src/RedemptionScreen.tsx +7 -0
- package/dist/runtime/docs/example/src/RewardsScreen.module.css +13 -0
- package/dist/runtime/docs/example/src/RewardsScreen.tsx +51 -0
- package/dist/runtime/docs/example/src/client.tsx +40 -0
- package/dist/runtime/docs/example/src/contracts.ts +132 -0
- package/dist/runtime/docs/example/src/css-modules.d.ts +5 -0
- package/dist/runtime/docs/example/src/server.test.ts +156 -0
- package/dist/runtime/docs/example/src/server.ts +188 -0
- package/dist/runtime/docs/example/tsconfig.json +16 -0
- package/dist/runtime/entity.d.ts +237 -0
- package/dist/runtime/entity.js +201 -0
- package/dist/runtime/fakes.d.ts +80 -0
- package/dist/runtime/fakes.js +88 -0
- package/dist/runtime/fixtures.d.ts +34 -0
- package/dist/runtime/fixtures.js +60 -0
- package/dist/runtime/help.d.ts +22 -0
- package/dist/runtime/help.js +51 -0
- package/dist/runtime/host/context.mjs +392 -0
- package/dist/runtime/host/errors.mjs +64 -0
- package/dist/runtime/host/loader.mjs +28 -0
- package/dist/runtime/host/protocol.mjs +4 -0
- package/dist/runtime/host/register.mjs +8 -0
- package/dist/runtime/host/sdk/assert.mjs +153 -0
- package/dist/runtime/host/sdk/client-host/hooks.mjs +86 -0
- package/dist/runtime/host/sdk/client-host/protocol.mjs +30 -0
- package/dist/runtime/host/sdk/client-host/slots.mjs +82 -0
- package/dist/runtime/host/sdk/client-host/styles.mjs +45 -0
- package/dist/runtime/host/sdk/client-host/transport.mjs +102 -0
- package/dist/runtime/host/sdk/client.mjs +115 -0
- package/dist/runtime/host/sdk/contracts.mjs +185 -0
- package/dist/runtime/host/sdk/entity.mjs +183 -0
- package/dist/runtime/host/sdk/fakes.mjs +88 -0
- package/dist/runtime/host/sdk/fixtures.mjs +56 -0
- package/dist/runtime/host/sdk/help.mjs +37 -0
- package/dist/runtime/host/sdk/index.mjs +83 -0
- package/dist/runtime/host/sdk/kit.mjs +11 -0
- package/dist/runtime/host/sdk/manifest.mjs +276 -0
- package/dist/runtime/host/sdk/model.mjs +4 -0
- package/dist/runtime/host/sdk/resource.mjs +34 -0
- package/dist/runtime/host/sdk/schema.mjs +75 -0
- package/dist/runtime/host/sdk/server.mjs +43 -0
- package/dist/runtime/host/sdk/testhost.mjs +992 -0
- package/dist/runtime/host/sdk/testing.mjs +21 -0
- package/dist/runtime/host/sdk/wire.mjs +207 -0
- package/dist/runtime/host/worker.mjs +252 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/kit.d.ts +5 -0
- package/dist/runtime/kit.js +14 -0
- package/dist/runtime/manifest.d.ts +17 -0
- package/dist/runtime/manifest.js +323 -0
- package/dist/runtime/model.d.ts +224 -0
- package/dist/runtime/model.js +3 -0
- package/dist/runtime/resource.d.ts +31 -0
- package/dist/runtime/resource.js +35 -0
- package/dist/runtime/schema.d.ts +97 -0
- package/dist/runtime/schema.js +73 -0
- package/dist/runtime/server.d.ts +445 -0
- package/dist/runtime/server.js +41 -0
- package/dist/runtime/testhost.d.ts +216 -0
- package/dist/runtime/testhost.js +1146 -0
- package/dist/runtime/testing.d.ts +10 -0
- package/dist/runtime/testing.js +7 -0
- package/dist/runtime/wire.d.ts +26 -0
- package/dist/runtime/wire.js +236 -0
- package/dist/sdk-identity.cjs +3 -3
- package/dist/sdk-identity.js +3 -3
- package/dist/sdk-identity.json +2 -2
- package/dist/solid-ui/embedded-css.d.ts +2 -0
- package/dist/solid-ui/embedded-css.js +1 -0
- package/dist/solid-ui/embedded.css +2 -0
- package/dist/testing/components.d.ts +73 -0
- package/dist/testing/components.js +96 -0
- package/dist/testing/htmx.d.ts +44 -0
- package/dist/testing/htmx.js +284 -0
- package/dist/testing/index.d.ts +4 -41
- package/dist/testing/index.js +3 -206
- package/dist/testing/scenarios.d.ts +83 -0
- package/dist/testing/scenarios.js +74 -0
- package/dist/testing/wait.d.ts +7 -0
- package/dist/testing/wait.js +19 -0
- package/package.json +33 -2
- package/dist/lens/TablePanel-C09tzJOL.js +0 -980
- package/dist/lens/index-DcVtZneD.js +0 -18473
- package/dist/lens/runtime/recovery.d.ts +0 -26
- package/dist/lens/runtime/recovery.d.ts.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting started with loyalty
|
|
3
|
+
order: 1
|
|
4
|
+
audience: Cashiers and managers
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Getting started with loyalty
|
|
8
|
+
|
|
9
|
+
Clients collect points with every purchase and spend them on rewards.
|
|
10
|
+
|
|
11
|
+
* Open the [rewards page](route:acme.loyalty.rewards) to see what clients can redeem.
|
|
12
|
+
* Find out [how points are earned](points.md) before you promise anything to a client.
|
|
13
|
+
* Managers: [set the reward limits](admin/limits.md).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Начало работы с лояльностью
|
|
3
|
+
order: 1
|
|
4
|
+
audience: Кассиры и менеджеры
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Начало работы с лояльностью
|
|
8
|
+
|
|
9
|
+
Клиенты копят баллы за каждую покупку и тратят их на награды.
|
|
10
|
+
|
|
11
|
+
* Откройте [страницу наград](route:acme.loyalty.rewards), чтобы увидеть, что можно получить.
|
|
12
|
+
* Узнайте, [как начисляются баллы](points.md).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acme/loyalty",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"check": "iota-ext check",
|
|
8
|
+
"build": "iota-ext build",
|
|
9
|
+
"test": "iota-ext test"
|
|
10
|
+
},
|
|
11
|
+
"iota": {
|
|
12
|
+
"namespace": "acme.loyalty",
|
|
13
|
+
"contracts": "./src/contracts.ts",
|
|
14
|
+
"server": "./src/server.ts",
|
|
15
|
+
"client": "./src/client.tsx",
|
|
16
|
+
"capabilities": { "network": ["api.partner.example"], "secrets": ["PARTNER_TOKEN"] }
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@iota-uz/sdk": "0.5.6"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.0.0",
|
|
23
|
+
"esbuild": "^0.25.0",
|
|
24
|
+
"solid-js": "^1.9.0",
|
|
25
|
+
"typescript": "~5.7.2"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PageProps } from "@iota-uz/sdk/runtime/client"
|
|
2
|
+
|
|
3
|
+
// `id` is typed by the platform's route: a number, decoded from the path before the page renders.
|
|
4
|
+
export default function ClientScreen(props: PageProps<{ id: number }>) {
|
|
5
|
+
return (
|
|
6
|
+
<section>
|
|
7
|
+
<h1>Client {props.params.id}</h1>
|
|
8
|
+
</section>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { href, type Infer } from "@iota-uz/sdk/runtime"
|
|
2
|
+
import type { PageProps } from "@iota-uz/sdk/runtime/client"
|
|
3
|
+
import * as c from "./contracts"
|
|
4
|
+
|
|
5
|
+
export default function RedemptionScreen(props: PageProps<Infer<typeof c.RedemptionRoute.params>>) {
|
|
6
|
+
return <a href={href(c.RedemptionRoute, { id: props.params.id })}>Redemption {props.params.id}</a>
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* Scoped: the build makes these class names unique to this package, so they cannot leak into the host or other packages. */
|
|
2
|
+
.board {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.reward {
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-bottom: 1px solid currentcolor;
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 0.75rem;
|
|
12
|
+
padding-bottom: 0.5rem;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { For, Show, createSignal } from "solid-js"
|
|
2
|
+
import { helpHref, isError, Slot, useCommand, useQuery, type PageProps } from "@iota-uz/sdk/runtime/client"
|
|
3
|
+
import { Button, Card } from "@iota-uz/sdk/solid-ui"
|
|
4
|
+
import * as c from "./contracts"
|
|
5
|
+
import styles from "./RewardsScreen.module.css"
|
|
6
|
+
|
|
7
|
+
export default function RewardsScreen(_props: PageProps) {
|
|
8
|
+
const rewards = useQuery(c.Catalog, { onlyActive: true })
|
|
9
|
+
const create = useCommand(c.CreateReward)
|
|
10
|
+
const [name, setName] = createSignal("")
|
|
11
|
+
const [failure, setFailure] = createSignal("")
|
|
12
|
+
return (
|
|
13
|
+
<section class={`${styles.board} p-6`}>
|
|
14
|
+
<h1 class="text-xl font-semibold">Rewards</h1>
|
|
15
|
+
<a href={helpHref("getting-started")}>How does loyalty work?</a>
|
|
16
|
+
<Card>
|
|
17
|
+
<input value={name()} onInput={(e) => setName(e.currentTarget.value)} />
|
|
18
|
+
<Button
|
|
19
|
+
variant="primary"
|
|
20
|
+
loading={create.pending()}
|
|
21
|
+
onClick={async () => {
|
|
22
|
+
try {
|
|
23
|
+
await create.run({ name: name(), cost: 100 })
|
|
24
|
+
rewards.refetch()
|
|
25
|
+
} catch (err) {
|
|
26
|
+
setFailure(isError(err, c.NotEnoughPoints) ? `need ${err.body.params.need}` : String(err))
|
|
27
|
+
}
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
Add
|
|
31
|
+
</Button>
|
|
32
|
+
</Card>
|
|
33
|
+
<Show when={failure() !== ""}>
|
|
34
|
+
<p role="alert">{failure()}</p>
|
|
35
|
+
</Show>
|
|
36
|
+
<Show when={rewards.data()}>
|
|
37
|
+
{(rows) => (
|
|
38
|
+
<ul>
|
|
39
|
+
<For each={rows()}>
|
|
40
|
+
{(r) => (
|
|
41
|
+
<li class={styles.reward}>
|
|
42
|
+
{r.name}: {r.cost} <Slot slot={c.RewardActions} props={{ reward: r.name }} />
|
|
43
|
+
</li>
|
|
44
|
+
)}
|
|
45
|
+
</For>
|
|
46
|
+
</ul>
|
|
47
|
+
)}
|
|
48
|
+
</Show>
|
|
49
|
+
</section>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Browser graph: pages, navigation, slot contributions and cell renderers (Solid). It imports contracts, never the server entry.
|
|
2
|
+
import { lazy } from "solid-js"
|
|
3
|
+
import { cell, navigation, page, slot } from "@iota-uz/sdk/runtime/client"
|
|
4
|
+
import * as crm from "@iota-kit/crm"
|
|
5
|
+
import * as c from "./contracts"
|
|
6
|
+
|
|
7
|
+
// A page of its own: ID, path and navigation entry.
|
|
8
|
+
export const rewards = page("acme.loyalty.rewards", {
|
|
9
|
+
path: "/loyalty/rewards",
|
|
10
|
+
nav: { label: { en: "Rewards", ru: "Награды" }, group: "acme.loyalty.menu", icon: "gift" },
|
|
11
|
+
permission: c.Manage,
|
|
12
|
+
component: lazy(() => import("./RewardsScreen")),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
// A page bound to a route: typed params, ID "<route id>.page".
|
|
16
|
+
export const redemption = page(c.RedemptionRoute, {
|
|
17
|
+
component: lazy(() => import("./RedemptionScreen")),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
// `nav.group` above refers to a group declared here, by its ID.
|
|
21
|
+
export const nav = navigation({
|
|
22
|
+
groups: [{ id: "acme.loyalty.menu", label: { en: "Loyalty", ru: "Лояльность" } }],
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// How the tier column renders in the native clients list.
|
|
26
|
+
export const tierCell = cell(c.TierColumn, (props) => <span class={`tier tier-${props.value}`}>{props.value}</span>)
|
|
27
|
+
|
|
28
|
+
// A component in the CRM's client sidebar, a slot the platform declares. Additive: no binding, active while this
|
|
29
|
+
// version is, shown only to viewers holding `Manage` (the server decides), after contributions with a smaller order.
|
|
30
|
+
export const loyaltyCard = slot(crm.ClientSidebar, (props) => <p class="loyalty-card">Loyalty for client {props.clientId}</p>, {
|
|
31
|
+
order: 10,
|
|
32
|
+
permission: c.Manage,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// A contribution to a slot of our own package (declared in contracts.ts), typed by it.
|
|
36
|
+
export const exportAction = slot(c.RewardActions, (props) => <button type="button">Export {props.reward}</button>)
|
|
37
|
+
|
|
38
|
+
// A page for the platform's client view route: a replacement candidate, served only once an administrator binds it
|
|
39
|
+
// to the `screen` slot of `crm.routes.clientView`.
|
|
40
|
+
export const clientView = page(crm.ClientView, { component: lazy(() => import("./ClientScreen")) })
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Pure contracts of acme.loyalty: every resource the package declares. No handlers, no Node, no Solid.
|
|
2
|
+
import {
|
|
3
|
+
$, column, command, contactResolver, defineSlot, deliveryPolicy, domainError, entity, event, field, issue, notice, operation, overlay, permission, query,
|
|
4
|
+
route, t, workflow,
|
|
5
|
+
} from "@iota-uz/sdk/runtime"
|
|
6
|
+
import * as core from "@iota-kit/core"
|
|
7
|
+
import * as crm from "@iota-kit/crm"
|
|
8
|
+
|
|
9
|
+
// ---- permissions
|
|
10
|
+
export const Manage = permission("acme.loyalty.manage", { label: { en: "Manage loyalty", ru: "Управление лояльностью" } })
|
|
11
|
+
|
|
12
|
+
// ---- data
|
|
13
|
+
// An overlay adds our fields to the platform's client; absence of a row reads the defaults.
|
|
14
|
+
export const ClientLoyalty = overlay(
|
|
15
|
+
"acme.loyalty.clientLoyalty",
|
|
16
|
+
crm.Client,
|
|
17
|
+
{
|
|
18
|
+
tier: field.enum(["standard", "silver", "gold"]).default("standard"),
|
|
19
|
+
points: field.int().default(0),
|
|
20
|
+
note: field.text().optional(),
|
|
21
|
+
smsOptOut: field.bool().default(false),
|
|
22
|
+
},
|
|
23
|
+
{ access: { fields: { note: [Manage] } } },
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// The overlay field shows up as a column of the native clients list (sort, filter, export).
|
|
27
|
+
export const TierColumn = column(crm.ListsClients, {
|
|
28
|
+
id: "acme.loyalty.tier",
|
|
29
|
+
field: ClientLoyalty.fields.tier,
|
|
30
|
+
label: { en: "Loyalty tier", ru: "Уровень" },
|
|
31
|
+
filterable: true,
|
|
32
|
+
sortable: true,
|
|
33
|
+
exportable: true,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
export const Reward = entity("acme.loyalty.reward", {
|
|
37
|
+
name: field.text({ maxLength: 80 }).unique(),
|
|
38
|
+
cost: field.int(),
|
|
39
|
+
active: field.bool().default(true),
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const Redemption = entity(
|
|
43
|
+
"acme.loyalty.redemption",
|
|
44
|
+
{
|
|
45
|
+
client: field.ref(crm.Client).index(),
|
|
46
|
+
reward: field.ref(Reward),
|
|
47
|
+
cost: field.int(),
|
|
48
|
+
status: field.enum(["pending", "approved", "rejected"]).default("pending"),
|
|
49
|
+
requestedBy: field.ref(core.User),
|
|
50
|
+
},
|
|
51
|
+
// Managers see every redemption, everybody else the ones they requested.
|
|
52
|
+
{ access: { read: [{ when: Manage, rows: "all" }, { rows: { requestedBy: $.user } }] } },
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
// ---- errors
|
|
56
|
+
export const NotEnoughPoints = domainError("acme.loyalty.notEnoughPoints", t.object({ have: t.int(), need: t.int() }))
|
|
57
|
+
export const RewardUnavailable = domainError("acme.loyalty.rewardUnavailable", t.object({ reward: t.string() }))
|
|
58
|
+
export const CostMustBePositive = issue("acme.loyalty.costMustBePositive", t.object({ min: t.int() }))
|
|
59
|
+
export const DeltaTooLarge = issue("acme.loyalty.deltaTooLarge", t.object({ max: t.int() }))
|
|
60
|
+
|
|
61
|
+
// ---- callables
|
|
62
|
+
// An operation is an atomic domain primitive other packages and transactions can call.
|
|
63
|
+
export const AdjustPoints = operation("acme.loyalty.adjustPoints", {
|
|
64
|
+
input: t.object({ client: t.ref(crm.Client), delta: t.int() }),
|
|
65
|
+
output: t.object({ points: t.int() }),
|
|
66
|
+
errors: [NotEnoughPoints],
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// An atomic command runs entirely in one transaction.
|
|
70
|
+
export const CreateReward = command("acme.loyalty.createReward", {
|
|
71
|
+
atomic: true,
|
|
72
|
+
input: t.object({ name: t.string(), cost: t.int() }),
|
|
73
|
+
output: t.object({ reward: t.ref(Reward) }),
|
|
74
|
+
permission: Manage,
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// An ordinary command may call the outside world between its transactions.
|
|
78
|
+
export const Redeem = command("acme.loyalty.redeem", {
|
|
79
|
+
input: t.object({ client: t.ref(crm.Client), reward: t.ref(Reward) }),
|
|
80
|
+
output: t.object({ redemption: t.ref(Redemption) }),
|
|
81
|
+
errors: [NotEnoughPoints, RewardUnavailable],
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
export const Catalog = query("acme.loyalty.catalog", {
|
|
85
|
+
input: t.object({ onlyActive: t.bool().optional() }),
|
|
86
|
+
output: t.array(t.object({ reward: t.ref(Reward), name: t.string(), cost: t.int(), active: t.bool() })),
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// ---- events, notices, workflows
|
|
90
|
+
export const PointsChanged = event("acme.loyalty.pointsChanged.v1", {
|
|
91
|
+
subject: crm.Client,
|
|
92
|
+
payload: t.object({ points: t.int(), delta: t.int() }),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const RedemptionResult = notice("acme.loyalty.redemptionResult.v1", {
|
|
96
|
+
subject: Redemption,
|
|
97
|
+
payload: t.object({ reward: t.string(), approved: t.bool() }),
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
export const PointsReminder = notice("acme.loyalty.pointsReminder.v1", {
|
|
101
|
+
subject: crm.Client,
|
|
102
|
+
payload: t.object({ points: t.int() }),
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
// Lets notifications reach a client record: where to send an SMS or an e-mail.
|
|
106
|
+
export const ClientContacts = contactResolver("acme.loyalty.clientContacts", crm.Client)
|
|
107
|
+
|
|
108
|
+
// Consent is our business policy, not a core field: asked once per target before anything is sent to a client.
|
|
109
|
+
export const ClientConsent = deliveryPolicy("acme.loyalty.clientConsent", crm.Client)
|
|
110
|
+
|
|
111
|
+
export const Approval = workflow("acme.loyalty.approval", {
|
|
112
|
+
input: t.object({ redemption: t.ref(Redemption) }),
|
|
113
|
+
output: t.object({ approved: t.bool(), voucher: t.string().nullable() }),
|
|
114
|
+
signals: { withdraw: t.object({ reason: t.string() }) },
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
export const Reminder = workflow("acme.loyalty.reminder", {
|
|
118
|
+
input: t.object({ client: t.ref(crm.Client) }),
|
|
119
|
+
output: t.object({ reminded: t.bool() }),
|
|
120
|
+
signals: { optOut: t.object({}) },
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
// ---- routes
|
|
124
|
+
export const RedemptionRoute = route("acme.loyalty.redemptionPage", {
|
|
125
|
+
path: "/loyalty/redemptions/:id",
|
|
126
|
+
params: t.object({ id: t.uuid() }),
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
// ---- slots
|
|
130
|
+
// A place in our rewards page where any package may mount a component. The host page names it, types its props
|
|
131
|
+
// and passes them; contributions are additive and need no binding.
|
|
132
|
+
export const RewardActions = defineSlot("acme.loyalty.rewardActions", { props: t.object({ reward: t.string() }) })
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Tests run in an in-memory host: no database, no Node pool, no network. `iota-ext test` runs them.
|
|
2
|
+
import {
|
|
3
|
+
assert, createTestHost, fixture, overlayFixture, test, type TestHostOptions,
|
|
4
|
+
} from "@iota-uz/sdk/runtime/testing"
|
|
5
|
+
import { ref } from "@iota-uz/sdk/runtime"
|
|
6
|
+
import { implement, recipient } from "@iota-uz/sdk/runtime/server"
|
|
7
|
+
import * as core from "@iota-kit/core"
|
|
8
|
+
import * as crm from "@iota-kit/crm"
|
|
9
|
+
import * as c from "./contracts"
|
|
10
|
+
import * as s from "./server"
|
|
11
|
+
|
|
12
|
+
const ali = fixture(crm.Client, { firstName: "Ali", phone: "+998901112233", email: "ali@example.uz" }, { key: "7" })
|
|
13
|
+
// Native fixtures need an explicit key. createdAt and updatedAt default to EPOCH; the fields the entity requires are yours.
|
|
14
|
+
const agent = fixture(core.User, { firstName: "Agent", lastName: "A", email: "agent@example.uz", uiLanguage: "en" }, { key: "42" })
|
|
15
|
+
|
|
16
|
+
function host(options: TestHostOptions = {}) {
|
|
17
|
+
return createTestHost({
|
|
18
|
+
implementations: [s.adjustPoints, s.createReward, s.redeem, s.catalog, s.approval, s.reminder, s.clientContacts, s.clientConsent, s.resultTemplates, s.reminderTemplates],
|
|
19
|
+
user: { permissions: [c.Manage.id] },
|
|
20
|
+
secrets: { PARTNER_TOKEN: "token-for-tests" },
|
|
21
|
+
...options,
|
|
22
|
+
fixtures: [ali, agent, ...(options.fixtures ?? [])],
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
test("adjusting points writes the overlay and emits an event", async () => {
|
|
27
|
+
const h = host()
|
|
28
|
+
const out = await h.transaction((tx) => s.adjustPoints.handler(tx, { client: ali.ref, delta: 40 }))
|
|
29
|
+
assert.equal(out.points, 40)
|
|
30
|
+
assert.partial(h.overlayRow(c.ClientLoyalty, ali.ref), { points: 40, tier: "standard" })
|
|
31
|
+
assert.deepEqual(h.emitted.map((e) => e.event), [c.PointsChanged.id])
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test("a declared domain error rolls the transaction back", async () => {
|
|
35
|
+
const h = host({ fixtures: [overlayFixture(c.ClientLoyalty, ali.ref, { points: 10 })] })
|
|
36
|
+
await assert.rejects(h.transaction((tx) => s.adjustPoints.handler(tx, { client: ali.ref, delta: -50 })), c.NotEnoughPoints)
|
|
37
|
+
assert.equal(h.emitted.length, 0)
|
|
38
|
+
assert.equal(h.overlayRow(c.ClientLoyalty, ali.ref)?.points, 10)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
test("a guard rejects with a validation issue", async () => {
|
|
42
|
+
const h = host({ guards: [s.deltaLimit] })
|
|
43
|
+
await assert.rejects(h.transaction((tx) => tx.call(c.AdjustPoints, { client: ali.ref, delta: 20_000 })), { kind: "validation", issue: c.DeltaTooLarge })
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test("an atomic command validates and stores", async () => {
|
|
47
|
+
const h = host()
|
|
48
|
+
await assert.rejects(h.transaction((tx) => s.createReward.handler(tx, { name: "Free", cost: 0 })), { issue: c.CostMustBePositive })
|
|
49
|
+
const created = await h.transaction((tx) => s.createReward.handler(tx, { name: " Mug ", cost: 50 }))
|
|
50
|
+
assert.deepEqual(h.table(c.Reward).map((r) => r.name), ["Mug"])
|
|
51
|
+
assert.equal(created.reward.entity, c.Reward.id)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test("redeeming checks the partner stock over fetch, then settles in one transaction", async () => {
|
|
55
|
+
const mug = fixture(c.Reward, { name: "Mug", cost: 30 })
|
|
56
|
+
const h = host({ fixtures: [mug, overlayFixture(c.ClientLoyalty, ali.ref, { points: 100 })] })
|
|
57
|
+
// fetch() is answered by the fake http routes; an unrouted request fails the test.
|
|
58
|
+
h.fakes.http.route("GET", "https://api.partner.example/stock/Mug", { status: 200, body: { available: 3 } })
|
|
59
|
+
const out = await s.redeem.handler(h.command(), { client: ali.ref, reward: mug.ref })
|
|
60
|
+
assert.equal(h.overlayRow(c.ClientLoyalty, ali.ref)?.points, 70)
|
|
61
|
+
assert.equal(h.table(c.Redemption).length, 1)
|
|
62
|
+
assert.deepEqual(h.started.map((w) => w.workflow), [c.Approval.id])
|
|
63
|
+
assert.equal(h.fakes.http.calls[0]?.headers.authorization, "Bearer token-for-tests")
|
|
64
|
+
assert.equal(out.redemption.entity, c.Redemption.id)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
test("a stock failure is a declared error and nothing is written", async () => {
|
|
68
|
+
const mug = fixture(c.Reward, { name: "Mug", cost: 30 })
|
|
69
|
+
const h = host({ fixtures: [mug, overlayFixture(c.ClientLoyalty, ali.ref, { points: 100 })] })
|
|
70
|
+
h.fakes.http.route("GET", "https://api.partner.example/stock/Mug", { status: 404 })
|
|
71
|
+
await assert.rejects(s.redeem.handler(h.command(), { client: ali.ref, reward: mug.ref }), c.RewardUnavailable)
|
|
72
|
+
assert.equal(h.table(c.Redemption).length, 0)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
test("the approval workflow waits for the human task, then settles and notifies", async () => {
|
|
76
|
+
const mug = fixture(c.Reward, { name: "Mug", cost: 30 })
|
|
77
|
+
const pending = fixture(c.Redemption, { client: ali.ref, reward: mug.ref, cost: 30, requestedBy: ref(core.User, "1") }, { key: "00000000-0000-4000-8000-000000000001" })
|
|
78
|
+
const h = host({ fixtures: [mug, pending] })
|
|
79
|
+
h.fakes.http.route("POST", "https://api.partner.example/vouchers", { status: 200, body: { code: "V-123" } })
|
|
80
|
+
|
|
81
|
+
const run = h.workflow(s.approval, { redemption: pending.ref })
|
|
82
|
+
const first = await run.run()
|
|
83
|
+
assert.equal(first.status, "suspended")
|
|
84
|
+
assert.deepEqual(run.tasks.map((t) => [t.name, t.status]), [["approve", "open"]])
|
|
85
|
+
|
|
86
|
+
run.decide("approve", { approved: true })
|
|
87
|
+
const done = await run.run()
|
|
88
|
+
assert.deepEqual(done.status === "completed" ? done.value : null, { approved: true, voucher: "V-123" })
|
|
89
|
+
|
|
90
|
+
// Rendered with the templates, delivered per recipient and channel to the fakes.
|
|
91
|
+
assert.deepEqual(h.fakes.sms.delivered.map((m) => [m.to, m.text]), [["+998901112233", 'Your reward "Mug" is approved.']])
|
|
92
|
+
assert.deepEqual(h.fakes.email.delivered.map((m) => m.to), ["ali@example.uz"])
|
|
93
|
+
assert.deepEqual(h.deliveries.map((d) => [d.channel, d.status]), [["sms", "delivered"], ["email", "delivered"]])
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
test("a delivery policy skips an opted-out SMS; the e-mail to the same client still goes out", async () => {
|
|
97
|
+
const mug = fixture(c.Reward, { name: "Mug", cost: 30 })
|
|
98
|
+
const redemption = fixture(c.Redemption, { client: ali.ref, reward: mug.ref, cost: 30, requestedBy: ref(core.User, "1") })
|
|
99
|
+
const h = host({ fixtures: [mug, redemption, overlayFixture(c.ClientLoyalty, ali.ref, { smsOptOut: true })] })
|
|
100
|
+
await h.transaction((tx) =>
|
|
101
|
+
tx.notify(c.RedemptionResult, { subject: redemption.ref, payload: { reward: "Mug", approved: true }, to: [recipient.record(ali.ref)], channels: ["sms", "email"] }),
|
|
102
|
+
)
|
|
103
|
+
assert.deepEqual(h.fakes.sms.delivered, [])
|
|
104
|
+
assert.deepEqual(h.fakes.email.delivered.map((m) => m.to), ["ali@example.uz"])
|
|
105
|
+
assert.deepEqual(h.deliveries.map((d) => [d.channel, d.status, d.reason]), [["sms", "skipped", "policy_denied:sms_opt_out"], ["email", "delivered", undefined]])
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test("one notify to a client and an ERP user: every channel is tried for every recipient", async () => {
|
|
109
|
+
const mug = fixture(c.Reward, { name: "Mug", cost: 30 })
|
|
110
|
+
const redemption = fixture(c.Redemption, { client: ali.ref, reward: mug.ref, cost: 30, requestedBy: ref(core.User, "42") })
|
|
111
|
+
const h = host({ fixtures: [mug, redemption] })
|
|
112
|
+
await h.transaction((tx) =>
|
|
113
|
+
tx.notify(c.RedemptionResult, {
|
|
114
|
+
subject: redemption.ref,
|
|
115
|
+
payload: { reward: "Mug", approved: true },
|
|
116
|
+
to: [recipient.record(ali.ref), recipient.user(agent.ref)],
|
|
117
|
+
channels: ["sms", "inApp"],
|
|
118
|
+
}),
|
|
119
|
+
)
|
|
120
|
+
assert.deepEqual(h.deliveries.map((d) => [d.recipient.kind, d.channel, d.status]), [
|
|
121
|
+
["record", "sms", "delivered"],
|
|
122
|
+
["record", "inApp", "skipped"], // in-app messages address ERP users, not client records
|
|
123
|
+
["user", "sms", "skipped"], // the core.User fixture has no phone
|
|
124
|
+
["user", "inApp", "delivered"],
|
|
125
|
+
])
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
test("an event reaches its subscription and promotes the tier", async () => {
|
|
129
|
+
const h = host()
|
|
130
|
+
await h.deliver(s.onPointsChanged, { subject: ali.ref, payload: { points: 1200, delta: 200 } })
|
|
131
|
+
assert.equal(h.overlayRow(c.ClientLoyalty, ali.ref)?.tier, "gold")
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
test("a reminder sleeps, waits for the opt-out signal and sends one SMS", async () => {
|
|
135
|
+
const h = host({ fixtures: [overlayFixture(c.ClientLoyalty, ali.ref, { points: 55 })] })
|
|
136
|
+
const run = h.workflow(s.reminder, { client: ali.ref })
|
|
137
|
+
assert.deepEqual(await run.run().then((r) => r.status === "suspended" && r.on.kind), "sleep")
|
|
138
|
+
h.clock.advance("30d")
|
|
139
|
+
assert.deepEqual(await run.run().then((r) => r.status === "suspended" && r.on.kind), "signal")
|
|
140
|
+
h.clock.advance("1d")
|
|
141
|
+
const done = await run.run()
|
|
142
|
+
assert.deepEqual(done.status === "completed" ? done.value : null, { reminded: true })
|
|
143
|
+
assert.deepEqual(h.fakes.sms.delivered.map((m) => m.text), ["You have 55 loyalty points."])
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
test("a replacement of a native command writes through the native operation", async () => {
|
|
147
|
+
// Native contracts have no handler in a test host: bind a double of the Go default.
|
|
148
|
+
const upsert = implement(crm.UpsertClient, async (_tx, input) => ({ client: input.client ?? ali.ref, created: input.client === undefined }))
|
|
149
|
+
const h = host({ implementations: [upsert, s.saveClient, s.adjustPoints] })
|
|
150
|
+
const out = await s.saveClient.handler(h.command(), { firstName: "Vali" })
|
|
151
|
+
assert.equal(out.created, true)
|
|
152
|
+
assert.equal(h.overlayRow(c.ClientLoyalty, ali.ref)?.points, 50)
|
|
153
|
+
const again = await s.saveClient.handler(h.command(), { client: ali.ref, phone: "+998900000000" })
|
|
154
|
+
assert.equal(again.created, false)
|
|
155
|
+
assert.equal(h.overlayRow(c.ClientLoyalty, ali.ref)?.points, 50)
|
|
156
|
+
})
|