diff --git a/import_map.json b/import_map.json index c3b40ea1..de000f67 100644 --- a/import_map.json +++ b/import_map.json @@ -2,7 +2,7 @@ "imports": { "deco-sites/fashion/": "./", "deco-sites/std/": "https://denopkg.com/deco-sites/std@1.0.1/", - "$live/": "https://denopkg.com/deco-cx/live@a856b6cf6d45f1437dc1fa801c0429c32a3f7db4/", + "$live/": "https://denopkg.com/deco-cx/live@5652f4cd05886f17da58ab5d27bcfa14a8e42276/", "$fresh/": "https://deno.land/x/fresh@1.1.5/", "preact": "https://esm.sh/preact@10.13.2", "preact/": "https://esm.sh/preact@10.13.2/", diff --git a/live.gen.ts b/live.gen.ts index 2fc2e911..5449fa12 100644 --- a/live.gen.ts +++ b/live.gen.ts @@ -41,12 +41,13 @@ import * as $live_inspect from "$live/routes/live/inspect/[...block].ts"; import * as $live_meta from "$live/routes/live/_meta.ts"; import * as $live_previews from "$live/routes/live/previews/[...block].tsx"; import * as $live_catchall from "$live/routes/[...catchall].tsx"; +import * as i1$0 from "$live/loaders/workflows/get.ts"; import * as i2$$$$$0 from "$live/handlers/devPage.ts"; import * as i2$$$$$1 from "$live/handlers/fresh.ts"; -import * as i1$2 from "$live/handlers/redirect.ts"; +import * as i1$$2 from "$live/handlers/redirect.ts"; import * as i2$$$$$2 from "$live/handlers/router.ts"; import * as i2$$$$$3 from "$live/handlers/routesSelection.ts"; -import * as i1$5 from "$live/handlers/workflowRunner.ts"; +import * as i1$$5 from "$live/handlers/workflowRunner.ts"; import * as i2$$$$$$0 from "$live/pages/LivePage.tsx"; import * as i2$$$$0 from "$live/sections/PageInclude.tsx"; import * as i2$$$$1 from "$live/sections/Slot.tsx"; @@ -60,8 +61,10 @@ import * as i2$$$$$$$5 from "$live/matchers/MatchSite.ts"; import * as i2$$$$$$$6 from "$live/matchers/MatchUserAgent.ts"; import * as i2$$$$$$$$0 from "$live/flags/audience.ts"; import * as i2$$$$$$$$1 from "$live/flags/everyone.ts"; -import * as i1$$$$$$0 from "$live/actions/workflows/run.ts"; -import * as i1$$$$$$1 from "$live/actions/workflows/start.ts"; +import * as i1$$$$$$$0 from "$live/actions/workflows/cancel.ts"; +import * as i1$$$$$$$1 from "$live/actions/workflows/run.ts"; +import * as i1$$$$$$$2 from "$live/actions/workflows/signal.ts"; +import * as i1$$$$$$$3 from "$live/actions/workflows/start.ts"; import * as i2$0 from "deco-sites/std/functions/occProductDetailsPage.ts"; import * as i2$1 from "deco-sites/std/functions/segment.ts"; import * as i2$2 from "deco-sites/std/functions/shopifyProductDetailsPage.ts"; @@ -156,20 +159,27 @@ const manifest = { "deco-sites/std/sections/SEOPLP.tsx": i2$$$$11, }, "actions": { - "$live/actions/workflows/run.ts": i1$$$$$$0, - "$live/actions/workflows/start.ts": i1$$$$$$1, + "$live/actions/workflows/cancel.ts": i1$$$$$$$0, + "$live/actions/workflows/run.ts": i1$$$$$$$1, + "$live/actions/workflows/signal.ts": i1$$$$$$$2, + "$live/actions/workflows/start.ts": i1$$$$$$$3, "deco-sites/fashion/actions/charge.ts": $$$$$$$$$$$0, }, "workflows": { "deco-sites/fashion/workflows/simple.ts": $$$$$$$$$$$$0, }, + "loaders": { + "$live/loaders/workflows/get.ts": i1$0, + "deco-sites/std/loaders/vtexLegacyProductDetailsPage.ts": i2$$$0, + "deco-sites/std/loaders/vtexLegacyRelatedProductsLoader.ts": i2$$$1, + }, "handlers": { "$live/handlers/devPage.ts": i2$$$$$0, "$live/handlers/fresh.ts": i2$$$$$1, - "$live/handlers/redirect.ts": i1$2, + "$live/handlers/redirect.ts": i1$$2, "$live/handlers/router.ts": i2$$$$$2, "$live/handlers/routesSelection.ts": i2$$$$$3, - "$live/handlers/workflowRunner.ts": i1$5, + "$live/handlers/workflowRunner.ts": i1$$5, }, "pages": { "$live/pages/LivePage.tsx": i2$$$$$$0, @@ -217,10 +227,6 @@ const manifest = { "deco-sites/std/accounts/vtex.ts": i2$$3, "deco-sites/std/accounts/yourViews.ts": i2$$4, }, - "loaders": { - "deco-sites/std/loaders/vtexLegacyProductDetailsPage.ts": i2$$$0, - "deco-sites/std/loaders/vtexLegacyRelatedProductsLoader.ts": i2$$$1, - }, "config": config, "baseUrl": import.meta.url, }; diff --git a/runtime.ts b/runtime.ts index 8ab46686..87716769 100644 --- a/runtime.ts +++ b/runtime.ts @@ -2,4 +2,3 @@ import { withManifest } from "$live/clients/withManifest.ts"; import type { Manifest } from "./live.gen.ts"; export const Runtime = withManifest(); - diff --git a/schemas.gen.json b/schemas.gen.json index 006545ce..61d7651d 100644 --- a/schemas.gen.json +++ b/schemas.gen.json @@ -2529,6 +2529,81 @@ ], "title": "deco-sites/std/commerce/yourViews/client.ts@ConfigYourViews" }, + "ZGVjby1jeC9kdXJhYmxlL2JhY2tlbmRzL2JhY2tlbmQudHM=@WorkflowExecution": { + "anyOf": [ + { + "$ref": "#/definitions/Resolvable" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "alias": { + "type": "string", + "title": "Alias" + }, + "completedAt": { + "title": "Completed At" + }, + "status": { + "title": "Status" + }, + "metadata": { + "title": "Metadata" + }, + "input": { + "title": "Input" + }, + "output": { + "title": "Output" + } + }, + "required": [ + "id", + "alias", + "status" + ], + "title": "deco-cx/durable/backends/backend.ts@WorkflowExecution" + }, + { + "title": "$live/loaders/workflows/get.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlL2xvYWRlcnMvd29ya2Zsb3dzL2dldC50cw==@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "$live/loaders/workflows/get.ts" + ], + "default": "$live/loaders/workflows/get.ts" + } + } + } + ] + }, + "ZGVjby1jeC9saXZlL2xvYWRlcnMvd29ya2Zsb3dzL2dldC50cw==@Props": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "Id" + } + }, + "required": [ + "id" + ], + "title": "deco-cx/live/loaders/workflows/get.ts@Props" + }, "ZGVjby1zaXRlcy9zdGQvbG9hZGVycy92dGV4TGVnYWN5UHJvZHVjdERldGFpbHNQYWdlLnRz@Props": { "type": "object", "properties": { @@ -4767,6 +4842,26 @@ "required": [], "title": "deco-cx/live/flags/everyone.ts@EveryoneConfig" }, + "ZGVjby1jeC9saXZlL2FjdGlvbnMvd29ya2Zsb3dzL2NhbmNlbC50cw==@Props": { + "type": "object", + "properties": { + "executionId": { + "type": "string", + "title": "Execution Id" + }, + "reason": { + "type": [ + "string", + "null" + ], + "title": "Reason" + } + }, + "required": [ + "executionId" + ], + "title": "deco-cx/live/actions/workflows/cancel.ts@Props" + }, "ZGVjby1jeC9kdXJhYmxlL2hhbmRsZXIudHM=@RunRequest": { "type": "object", "properties": { @@ -4811,13 +4906,40 @@ ], "title": "deco-cx/live/actions/workflows/run.ts@Props" }, + "ZGVjby1jeC9saXZlL2FjdGlvbnMvd29ya2Zsb3dzL3NpZ25hbC50cw==@Props": { + "type": "object", + "properties": { + "signal": { + "type": "string", + "title": "Signal" + }, + "executionId": { + "type": "string", + "title": "Execution Id" + }, + "payload": { + "title": "Payload" + } + }, + "required": [ + "signal", + "executionId" + ], + "title": "deco-cx/live/actions/workflows/signal.ts@Props" + }, "ZGVjby1jeC9saXZlL2FjdGlvbnMvd29ya2Zsb3dzL3N0YXJ0LnRz@Props": { "type": "object", "properties": { "workflow": { - "type": "string", "title": "Workflow" }, + "id": { + "type": [ + "string", + "null" + ], + "title": "Id" + }, "props": { "type": [ "object", @@ -5375,6 +5497,27 @@ } } }, + "JGxpdmUvbG9hZGVycy93b3JrZmxvd3MvZ2V0LnRz": { + "title": "$live/loaders/workflows/get.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlL2xvYWRlcnMvd29ya2Zsb3dzL2dldC50cw==@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "$live/loaders/workflows/get.ts" + ], + "default": "$live/loaders/workflows/get.ts" + } + } + }, "ZGVjby1zaXRlcy9zdGQvbG9hZGVycy92dGV4TGVnYWN5UHJvZHVjdERldGFpbHNQYWdlLnRz": { "title": "deco-sites/std/loaders/vtexLegacyProductDetailsPage.ts", "type": "object", @@ -6459,6 +6602,27 @@ } } }, + "JGxpdmUvYWN0aW9ucy93b3JrZmxvd3MvY2FuY2VsLnRz": { + "title": "$live/actions/workflows/cancel.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlL2FjdGlvbnMvd29ya2Zsb3dzL2NhbmNlbC50cw==@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "$live/actions/workflows/cancel.ts" + ], + "default": "$live/actions/workflows/cancel.ts" + } + } + }, "JGxpdmUvYWN0aW9ucy93b3JrZmxvd3MvcnVuLnRz": { "title": "$live/actions/workflows/run.ts", "type": "object", @@ -6480,6 +6644,27 @@ } } }, + "JGxpdmUvYWN0aW9ucy93b3JrZmxvd3Mvc2lnbmFsLnRz": { + "title": "$live/actions/workflows/signal.ts", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ZGVjby1jeC9saXZlL2FjdGlvbnMvd29ya2Zsb3dzL3NpZ25hbC50cw==@Props" + } + ], + "required": [ + "__resolveType" + ], + "properties": { + "__resolveType": { + "type": "string", + "enum": [ + "$live/actions/workflows/signal.ts" + ], + "default": "$live/actions/workflows/signal.ts" + } + } + }, "JGxpdmUvYWN0aW9ucy93b3JrZmxvd3Mvc3RhcnQudHM=": { "title": "$live/actions/workflows/start.ts", "type": "object", @@ -6678,6 +6863,9 @@ { "$ref": "#/definitions/Resolvable" }, + { + "$ref": "#/definitions/JGxpdmUvbG9hZGVycy93b3JrZmxvd3MvZ2V0LnRz" + }, { "$ref": "#/definitions/ZGVjby1zaXRlcy9zdGQvbG9hZGVycy92dGV4TGVnYWN5UHJvZHVjdERldGFpbHNQYWdlLnRz" }, @@ -6896,9 +7084,15 @@ { "$ref": "#/definitions/Resolvable" }, + { + "$ref": "#/definitions/JGxpdmUvYWN0aW9ucy93b3JrZmxvd3MvY2FuY2VsLnRz" + }, { "$ref": "#/definitions/JGxpdmUvYWN0aW9ucy93b3JrZmxvd3MvcnVuLnRz" }, + { + "$ref": "#/definitions/JGxpdmUvYWN0aW9ucy93b3JrZmxvd3Mvc2lnbmFsLnRz" + }, { "$ref": "#/definitions/JGxpdmUvYWN0aW9ucy93b3JrZmxvd3Mvc3RhcnQudHM=" }, diff --git a/workflows/simple.ts b/workflows/simple.ts index 3fe629f9..9fe0828e 100644 --- a/workflows/simple.ts +++ b/workflows/simple.ts @@ -20,7 +20,8 @@ export default function Simple({ sleepTime }: Props): Workflow { value: 20, }, }); + const { newValue } = yield _ctx.waitForSignal("my-signal"); console.log("the charged value", chargedValue2); - console.log("TOTAL", chargedValue1.value + chargedValue2.value); + return chargedValue1.value + chargedValue2.value + newValue; }; }