├── .editorconfig ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── src ├── do.ts └── index.ts ├── tsconfig.json └── wrangler.jsonc /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.yml] 12 | indent_style = space 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | 3 | logs 4 | _.log 5 | npm-debug.log_ 6 | yarn-debug.log* 7 | yarn-error.log* 8 | lerna-debug.log* 9 | .pnpm-debug.log* 10 | 11 | # Diagnostic reports (https://nodejs.org/api/report.html) 12 | 13 | report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json 14 | 15 | # Runtime data 16 | 17 | pids 18 | _.pid 19 | _.seed 20 | \*.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | 24 | lib-cov 25 | 26 | # Coverage directory used by tools like istanbul 27 | 28 | coverage 29 | \*.lcov 30 | 31 | # nyc test coverage 32 | 33 | .nyc_output 34 | 35 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 36 | 37 | .grunt 38 | 39 | # Bower dependency directory (https://bower.io/) 40 | 41 | bower_components 42 | 43 | # node-waf configuration 44 | 45 | .lock-wscript 46 | 47 | # Compiled binary addons (https://nodejs.org/api/addons.html) 48 | 49 | build/Release 50 | 51 | # Dependency directories 52 | 53 | node_modules/ 54 | jspm_packages/ 55 | 56 | # Snowpack dependency directory (https://snowpack.dev/) 57 | 58 | web_modules/ 59 | 60 | # TypeScript cache 61 | 62 | \*.tsbuildinfo 63 | 64 | # Optional npm cache directory 65 | 66 | .npm 67 | 68 | # Optional eslint cache 69 | 70 | .eslintcache 71 | 72 | # Optional stylelint cache 73 | 74 | .stylelintcache 75 | 76 | # Microbundle cache 77 | 78 | .rpt2_cache/ 79 | .rts2_cache_cjs/ 80 | .rts2_cache_es/ 81 | .rts2_cache_umd/ 82 | 83 | # Optional REPL history 84 | 85 | .node_repl_history 86 | 87 | # Output of 'npm pack' 88 | 89 | \*.tgz 90 | 91 | # Yarn Integrity file 92 | 93 | .yarn-integrity 94 | 95 | # dotenv environment variable files 96 | 97 | .env 98 | .env.development.local 99 | .env.test.local 100 | .env.production.local 101 | .env.local 102 | 103 | # parcel-bundler cache (https://parceljs.org/) 104 | 105 | .cache 106 | .parcel-cache 107 | 108 | # Next.js build output 109 | 110 | .next 111 | out 112 | 113 | # Nuxt.js build / generate output 114 | 115 | .nuxt 116 | dist 117 | 118 | # Gatsby files 119 | 120 | .cache/ 121 | 122 | # Comment in the public line in if your project uses Gatsby and not Next.js 123 | 124 | # https://nextjs.org/blog/next-9-1#public-directory-support 125 | 126 | # public 127 | 128 | # vuepress build output 129 | 130 | .vuepress/dist 131 | 132 | # vuepress v2.x temp and cache directory 133 | 134 | .temp 135 | .cache 136 | 137 | # Docusaurus cache and generated files 138 | 139 | .docusaurus 140 | 141 | # Serverless directories 142 | 143 | .serverless/ 144 | 145 | # FuseBox cache 146 | 147 | .fusebox/ 148 | 149 | # DynamoDB Local files 150 | 151 | .dynamodb/ 152 | 153 | # TernJS port file 154 | 155 | .tern-port 156 | 157 | # Stores VSCode versions used for testing VSCode extensions 158 | 159 | .vscode-test 160 | 161 | # yarn v2 162 | 163 | .yarn/cache 164 | .yarn/unplugged 165 | .yarn/build-state.yml 166 | .yarn/install-state.gz 167 | .pnp.\* 168 | 169 | # wrangler project 170 | 171 | .dev.vars 172 | .wrangler/ 173 | 174 | # macOS 175 | .DS_Store 176 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 140, 3 | "singleQuote": true, 4 | "semi": true, 5 | "useTabs": true 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cloudflare Workflow Wait For Action Demo 2 | 3 | This demo repo demonstrates how to implement a pausable workflow using Cloudflare Workers, combining Durable Objects and Workflows. The application shows how to create a workflow that can pause execution and resume based on an external trigger (KV update in the example). 4 | 5 | ## What it Does 6 | 7 | 1. When triggered, the workflow starts and pauses itself 8 | 2. A Durable Object monitors a KV namespace for a status change 9 | 3. When the KV value is updated to 'true', the workflow automatically resumes 10 | 4. The Durable Object uses an alarm system to periodically check the KV status 11 | 12 | Using a value in KV is just an example, you could publish a message to a queue that updates a D1 database, or even the Durable Object itself, and then have the DO wait for that action to complete before resuming the workflow. 13 | 14 | ## Cloudflare Products Used 15 | 16 | - Cloudflare Workers 17 | - Durable Objects (for state management and alarm functionality) 18 | - Workflows (for orchestrating the pause/resume flow) 19 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "workflows-starter", 3 | "version": "0.0.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "workflows-starter", 9 | "version": "0.0.1", 10 | "devDependencies": { 11 | "@cloudflare/workers-types": "^4.20250204.0", 12 | "typescript": "^5.0.4", 13 | "wrangler": "^3.107.3" 14 | }, 15 | "engines": { 16 | "pnpm": "^9.1.4" 17 | } 18 | }, 19 | "node_modules/@cloudflare/kv-asset-handler": { 20 | "version": "0.3.4", 21 | "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.3.4.tgz", 22 | "integrity": "sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==", 23 | "dev": true, 24 | "license": "MIT OR Apache-2.0", 25 | "dependencies": { 26 | "mime": "^3.0.0" 27 | }, 28 | "engines": { 29 | "node": ">=16.13" 30 | } 31 | }, 32 | "node_modules/@cloudflare/workerd-darwin-64": { 33 | "version": "1.20250129.0", 34 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250129.0.tgz", 35 | "integrity": "sha512-M+xETVnl+xy2dfDDWmp0XXr2rttl70a6bljQygl0EmYmNswFTcYbQWCaBuNBo9kabU59rLKr4a/b3QZ07NoL/g==", 36 | "cpu": [ 37 | "x64" 38 | ], 39 | "dev": true, 40 | "optional": true, 41 | "os": [ 42 | "darwin" 43 | ], 44 | "engines": { 45 | "node": ">=16" 46 | } 47 | }, 48 | "node_modules/@cloudflare/workerd-darwin-arm64": { 49 | "version": "1.20250129.0", 50 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250129.0.tgz", 51 | "integrity": "sha512-c4PQUyIMp+bCMxZkAMBzXgTHjRZxeYCujDbb3staestqgRbenzcfauXsMd6np35ng+EE1uBgHNPV4+7fC0ZBfg==", 52 | "cpu": [ 53 | "arm64" 54 | ], 55 | "dev": true, 56 | "optional": true, 57 | "os": [ 58 | "darwin" 59 | ], 60 | "engines": { 61 | "node": ">=16" 62 | } 63 | }, 64 | "node_modules/@cloudflare/workerd-linux-64": { 65 | "version": "1.20250129.0", 66 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250129.0.tgz", 67 | "integrity": "sha512-xJx8LwWFxsm5U3DETJwRuOmT5RWBqm4FmA4itYXvcEICca9pWJDB641kT4PnpypwDNmYOebhU7A+JUrCRucG0w==", 68 | "cpu": [ 69 | "x64" 70 | ], 71 | "dev": true, 72 | "optional": true, 73 | "os": [ 74 | "linux" 75 | ], 76 | "engines": { 77 | "node": ">=16" 78 | } 79 | }, 80 | "node_modules/@cloudflare/workerd-linux-arm64": { 81 | "version": "1.20250129.0", 82 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250129.0.tgz", 83 | "integrity": "sha512-dR//npbaX5p323huBVNIy5gaWubQx6CC3aiXeK0yX4aD5ar8AjxQFb2U/Sgjeo65Rkt53hJWqC7IwRpK/eOxrA==", 84 | "cpu": [ 85 | "arm64" 86 | ], 87 | "dev": true, 88 | "optional": true, 89 | "os": [ 90 | "linux" 91 | ], 92 | "engines": { 93 | "node": ">=16" 94 | } 95 | }, 96 | "node_modules/@cloudflare/workerd-windows-64": { 97 | "version": "1.20250129.0", 98 | "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250129.0.tgz", 99 | "integrity": "sha512-OeO+1nPj/ocAE3adFar/tRFGRkbCrBnrOYXq0FUBSpyNHpDdA9/U3PAw5CN4zvjfTnqXZfTxTFeqoruqzRzbtg==", 100 | "cpu": [ 101 | "x64" 102 | ], 103 | "dev": true, 104 | "optional": true, 105 | "os": [ 106 | "win32" 107 | ], 108 | "engines": { 109 | "node": ">=16" 110 | } 111 | }, 112 | "node_modules/@cloudflare/workers-types": { 113 | "version": "4.20250204.0", 114 | "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250204.0.tgz", 115 | "integrity": "sha512-mWoQbYaP+nYztx9I7q9sgaiNlT54Cypszz0RfzMxYnT5W3NXDuwGcjGB+5B5H5VB8tEC2dYnBRpa70lX94ueaQ==", 116 | "dev": true 117 | }, 118 | "node_modules/@cspotcode/source-map-support": { 119 | "version": "0.8.1", 120 | "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", 121 | "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", 122 | "dev": true, 123 | "dependencies": { 124 | "@jridgewell/trace-mapping": "0.3.9" 125 | }, 126 | "engines": { 127 | "node": ">=12" 128 | } 129 | }, 130 | "node_modules/@esbuild-plugins/node-globals-polyfill": { 131 | "version": "0.2.3", 132 | "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz", 133 | "integrity": "sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==", 134 | "dev": true, 135 | "license": "ISC", 136 | "peerDependencies": { 137 | "esbuild": "*" 138 | } 139 | }, 140 | "node_modules/@esbuild-plugins/node-modules-polyfill": { 141 | "version": "0.2.2", 142 | "resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz", 143 | "integrity": "sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==", 144 | "dev": true, 145 | "license": "ISC", 146 | "dependencies": { 147 | "escape-string-regexp": "^4.0.0", 148 | "rollup-plugin-node-polyfills": "^0.2.1" 149 | }, 150 | "peerDependencies": { 151 | "esbuild": "*" 152 | } 153 | }, 154 | "node_modules/@esbuild/android-arm": { 155 | "version": "0.17.19", 156 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", 157 | "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", 158 | "cpu": [ 159 | "arm" 160 | ], 161 | "dev": true, 162 | "license": "MIT", 163 | "optional": true, 164 | "os": [ 165 | "android" 166 | ], 167 | "engines": { 168 | "node": ">=12" 169 | } 170 | }, 171 | "node_modules/@esbuild/android-arm64": { 172 | "version": "0.17.19", 173 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", 174 | "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", 175 | "cpu": [ 176 | "arm64" 177 | ], 178 | "dev": true, 179 | "license": "MIT", 180 | "optional": true, 181 | "os": [ 182 | "android" 183 | ], 184 | "engines": { 185 | "node": ">=12" 186 | } 187 | }, 188 | "node_modules/@esbuild/android-x64": { 189 | "version": "0.17.19", 190 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", 191 | "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", 192 | "cpu": [ 193 | "x64" 194 | ], 195 | "dev": true, 196 | "license": "MIT", 197 | "optional": true, 198 | "os": [ 199 | "android" 200 | ], 201 | "engines": { 202 | "node": ">=12" 203 | } 204 | }, 205 | "node_modules/@esbuild/darwin-arm64": { 206 | "version": "0.17.19", 207 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", 208 | "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", 209 | "cpu": [ 210 | "arm64" 211 | ], 212 | "dev": true, 213 | "license": "MIT", 214 | "optional": true, 215 | "os": [ 216 | "darwin" 217 | ], 218 | "engines": { 219 | "node": ">=12" 220 | } 221 | }, 222 | "node_modules/@esbuild/darwin-x64": { 223 | "version": "0.17.19", 224 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", 225 | "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", 226 | "cpu": [ 227 | "x64" 228 | ], 229 | "dev": true, 230 | "license": "MIT", 231 | "optional": true, 232 | "os": [ 233 | "darwin" 234 | ], 235 | "engines": { 236 | "node": ">=12" 237 | } 238 | }, 239 | "node_modules/@esbuild/freebsd-arm64": { 240 | "version": "0.17.19", 241 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", 242 | "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", 243 | "cpu": [ 244 | "arm64" 245 | ], 246 | "dev": true, 247 | "license": "MIT", 248 | "optional": true, 249 | "os": [ 250 | "freebsd" 251 | ], 252 | "engines": { 253 | "node": ">=12" 254 | } 255 | }, 256 | "node_modules/@esbuild/freebsd-x64": { 257 | "version": "0.17.19", 258 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", 259 | "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", 260 | "cpu": [ 261 | "x64" 262 | ], 263 | "dev": true, 264 | "license": "MIT", 265 | "optional": true, 266 | "os": [ 267 | "freebsd" 268 | ], 269 | "engines": { 270 | "node": ">=12" 271 | } 272 | }, 273 | "node_modules/@esbuild/linux-arm": { 274 | "version": "0.17.19", 275 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", 276 | "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", 277 | "cpu": [ 278 | "arm" 279 | ], 280 | "dev": true, 281 | "license": "MIT", 282 | "optional": true, 283 | "os": [ 284 | "linux" 285 | ], 286 | "engines": { 287 | "node": ">=12" 288 | } 289 | }, 290 | "node_modules/@esbuild/linux-arm64": { 291 | "version": "0.17.19", 292 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", 293 | "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", 294 | "cpu": [ 295 | "arm64" 296 | ], 297 | "dev": true, 298 | "license": "MIT", 299 | "optional": true, 300 | "os": [ 301 | "linux" 302 | ], 303 | "engines": { 304 | "node": ">=12" 305 | } 306 | }, 307 | "node_modules/@esbuild/linux-ia32": { 308 | "version": "0.17.19", 309 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", 310 | "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", 311 | "cpu": [ 312 | "ia32" 313 | ], 314 | "dev": true, 315 | "license": "MIT", 316 | "optional": true, 317 | "os": [ 318 | "linux" 319 | ], 320 | "engines": { 321 | "node": ">=12" 322 | } 323 | }, 324 | "node_modules/@esbuild/linux-loong64": { 325 | "version": "0.17.19", 326 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", 327 | "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", 328 | "cpu": [ 329 | "loong64" 330 | ], 331 | "dev": true, 332 | "license": "MIT", 333 | "optional": true, 334 | "os": [ 335 | "linux" 336 | ], 337 | "engines": { 338 | "node": ">=12" 339 | } 340 | }, 341 | "node_modules/@esbuild/linux-mips64el": { 342 | "version": "0.17.19", 343 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", 344 | "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", 345 | "cpu": [ 346 | "mips64el" 347 | ], 348 | "dev": true, 349 | "license": "MIT", 350 | "optional": true, 351 | "os": [ 352 | "linux" 353 | ], 354 | "engines": { 355 | "node": ">=12" 356 | } 357 | }, 358 | "node_modules/@esbuild/linux-ppc64": { 359 | "version": "0.17.19", 360 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", 361 | "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", 362 | "cpu": [ 363 | "ppc64" 364 | ], 365 | "dev": true, 366 | "license": "MIT", 367 | "optional": true, 368 | "os": [ 369 | "linux" 370 | ], 371 | "engines": { 372 | "node": ">=12" 373 | } 374 | }, 375 | "node_modules/@esbuild/linux-riscv64": { 376 | "version": "0.17.19", 377 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", 378 | "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", 379 | "cpu": [ 380 | "riscv64" 381 | ], 382 | "dev": true, 383 | "license": "MIT", 384 | "optional": true, 385 | "os": [ 386 | "linux" 387 | ], 388 | "engines": { 389 | "node": ">=12" 390 | } 391 | }, 392 | "node_modules/@esbuild/linux-s390x": { 393 | "version": "0.17.19", 394 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", 395 | "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", 396 | "cpu": [ 397 | "s390x" 398 | ], 399 | "dev": true, 400 | "license": "MIT", 401 | "optional": true, 402 | "os": [ 403 | "linux" 404 | ], 405 | "engines": { 406 | "node": ">=12" 407 | } 408 | }, 409 | "node_modules/@esbuild/linux-x64": { 410 | "version": "0.17.19", 411 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", 412 | "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", 413 | "cpu": [ 414 | "x64" 415 | ], 416 | "dev": true, 417 | "license": "MIT", 418 | "optional": true, 419 | "os": [ 420 | "linux" 421 | ], 422 | "engines": { 423 | "node": ">=12" 424 | } 425 | }, 426 | "node_modules/@esbuild/netbsd-x64": { 427 | "version": "0.17.19", 428 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", 429 | "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", 430 | "cpu": [ 431 | "x64" 432 | ], 433 | "dev": true, 434 | "license": "MIT", 435 | "optional": true, 436 | "os": [ 437 | "netbsd" 438 | ], 439 | "engines": { 440 | "node": ">=12" 441 | } 442 | }, 443 | "node_modules/@esbuild/openbsd-x64": { 444 | "version": "0.17.19", 445 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", 446 | "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", 447 | "cpu": [ 448 | "x64" 449 | ], 450 | "dev": true, 451 | "license": "MIT", 452 | "optional": true, 453 | "os": [ 454 | "openbsd" 455 | ], 456 | "engines": { 457 | "node": ">=12" 458 | } 459 | }, 460 | "node_modules/@esbuild/sunos-x64": { 461 | "version": "0.17.19", 462 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", 463 | "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", 464 | "cpu": [ 465 | "x64" 466 | ], 467 | "dev": true, 468 | "license": "MIT", 469 | "optional": true, 470 | "os": [ 471 | "sunos" 472 | ], 473 | "engines": { 474 | "node": ">=12" 475 | } 476 | }, 477 | "node_modules/@esbuild/win32-arm64": { 478 | "version": "0.17.19", 479 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", 480 | "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", 481 | "cpu": [ 482 | "arm64" 483 | ], 484 | "dev": true, 485 | "license": "MIT", 486 | "optional": true, 487 | "os": [ 488 | "win32" 489 | ], 490 | "engines": { 491 | "node": ">=12" 492 | } 493 | }, 494 | "node_modules/@esbuild/win32-ia32": { 495 | "version": "0.17.19", 496 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", 497 | "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", 498 | "cpu": [ 499 | "ia32" 500 | ], 501 | "dev": true, 502 | "license": "MIT", 503 | "optional": true, 504 | "os": [ 505 | "win32" 506 | ], 507 | "engines": { 508 | "node": ">=12" 509 | } 510 | }, 511 | "node_modules/@esbuild/win32-x64": { 512 | "version": "0.17.19", 513 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", 514 | "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", 515 | "cpu": [ 516 | "x64" 517 | ], 518 | "dev": true, 519 | "license": "MIT", 520 | "optional": true, 521 | "os": [ 522 | "win32" 523 | ], 524 | "engines": { 525 | "node": ">=12" 526 | } 527 | }, 528 | "node_modules/@fastify/busboy": { 529 | "version": "2.1.1", 530 | "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", 531 | "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", 532 | "dev": true, 533 | "engines": { 534 | "node": ">=14" 535 | } 536 | }, 537 | "node_modules/@jridgewell/resolve-uri": { 538 | "version": "3.1.2", 539 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", 540 | "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", 541 | "dev": true, 542 | "engines": { 543 | "node": ">=6.0.0" 544 | } 545 | }, 546 | "node_modules/@jridgewell/sourcemap-codec": { 547 | "version": "1.5.0", 548 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", 549 | "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", 550 | "dev": true 551 | }, 552 | "node_modules/@jridgewell/trace-mapping": { 553 | "version": "0.3.9", 554 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 555 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 556 | "dev": true, 557 | "dependencies": { 558 | "@jridgewell/resolve-uri": "^3.0.3", 559 | "@jridgewell/sourcemap-codec": "^1.4.10" 560 | } 561 | }, 562 | "node_modules/acorn": { 563 | "version": "8.14.0", 564 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", 565 | "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", 566 | "dev": true, 567 | "bin": { 568 | "acorn": "bin/acorn" 569 | }, 570 | "engines": { 571 | "node": ">=0.4.0" 572 | } 573 | }, 574 | "node_modules/acorn-walk": { 575 | "version": "8.3.4", 576 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", 577 | "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", 578 | "dev": true, 579 | "dependencies": { 580 | "acorn": "^8.11.0" 581 | }, 582 | "engines": { 583 | "node": ">=0.4.0" 584 | } 585 | }, 586 | "node_modules/as-table": { 587 | "version": "1.0.55", 588 | "resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz", 589 | "integrity": "sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==", 590 | "dev": true, 591 | "dependencies": { 592 | "printable-characters": "^1.0.42" 593 | } 594 | }, 595 | "node_modules/blake3-wasm": { 596 | "version": "2.1.5", 597 | "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", 598 | "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", 599 | "dev": true, 600 | "license": "MIT" 601 | }, 602 | "node_modules/confbox": { 603 | "version": "0.1.8", 604 | "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", 605 | "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", 606 | "dev": true 607 | }, 608 | "node_modules/cookie": { 609 | "version": "0.7.2", 610 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 611 | "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 612 | "dev": true, 613 | "engines": { 614 | "node": ">= 0.6" 615 | } 616 | }, 617 | "node_modules/data-uri-to-buffer": { 618 | "version": "2.0.2", 619 | "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.2.tgz", 620 | "integrity": "sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==", 621 | "dev": true 622 | }, 623 | "node_modules/defu": { 624 | "version": "6.1.4", 625 | "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", 626 | "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", 627 | "dev": true 628 | }, 629 | "node_modules/esbuild": { 630 | "version": "0.17.19", 631 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", 632 | "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", 633 | "dev": true, 634 | "hasInstallScript": true, 635 | "license": "MIT", 636 | "bin": { 637 | "esbuild": "bin/esbuild" 638 | }, 639 | "engines": { 640 | "node": ">=12" 641 | }, 642 | "optionalDependencies": { 643 | "@esbuild/android-arm": "0.17.19", 644 | "@esbuild/android-arm64": "0.17.19", 645 | "@esbuild/android-x64": "0.17.19", 646 | "@esbuild/darwin-arm64": "0.17.19", 647 | "@esbuild/darwin-x64": "0.17.19", 648 | "@esbuild/freebsd-arm64": "0.17.19", 649 | "@esbuild/freebsd-x64": "0.17.19", 650 | "@esbuild/linux-arm": "0.17.19", 651 | "@esbuild/linux-arm64": "0.17.19", 652 | "@esbuild/linux-ia32": "0.17.19", 653 | "@esbuild/linux-loong64": "0.17.19", 654 | "@esbuild/linux-mips64el": "0.17.19", 655 | "@esbuild/linux-ppc64": "0.17.19", 656 | "@esbuild/linux-riscv64": "0.17.19", 657 | "@esbuild/linux-s390x": "0.17.19", 658 | "@esbuild/linux-x64": "0.17.19", 659 | "@esbuild/netbsd-x64": "0.17.19", 660 | "@esbuild/openbsd-x64": "0.17.19", 661 | "@esbuild/sunos-x64": "0.17.19", 662 | "@esbuild/win32-arm64": "0.17.19", 663 | "@esbuild/win32-ia32": "0.17.19", 664 | "@esbuild/win32-x64": "0.17.19" 665 | } 666 | }, 667 | "node_modules/escape-string-regexp": { 668 | "version": "4.0.0", 669 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", 670 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 671 | "dev": true, 672 | "license": "MIT", 673 | "engines": { 674 | "node": ">=10" 675 | }, 676 | "funding": { 677 | "url": "https://github.com/sponsors/sindresorhus" 678 | } 679 | }, 680 | "node_modules/estree-walker": { 681 | "version": "0.6.1", 682 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", 683 | "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", 684 | "dev": true, 685 | "license": "MIT" 686 | }, 687 | "node_modules/exit-hook": { 688 | "version": "2.2.1", 689 | "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz", 690 | "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==", 691 | "dev": true, 692 | "engines": { 693 | "node": ">=6" 694 | }, 695 | "funding": { 696 | "url": "https://github.com/sponsors/sindresorhus" 697 | } 698 | }, 699 | "node_modules/fsevents": { 700 | "version": "2.3.3", 701 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 702 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 703 | "dev": true, 704 | "hasInstallScript": true, 705 | "license": "MIT", 706 | "optional": true, 707 | "os": [ 708 | "darwin" 709 | ], 710 | "engines": { 711 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 712 | } 713 | }, 714 | "node_modules/get-source": { 715 | "version": "2.0.12", 716 | "resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz", 717 | "integrity": "sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==", 718 | "dev": true, 719 | "dependencies": { 720 | "data-uri-to-buffer": "^2.0.0", 721 | "source-map": "^0.6.1" 722 | } 723 | }, 724 | "node_modules/glob-to-regexp": { 725 | "version": "0.4.1", 726 | "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", 727 | "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", 728 | "dev": true 729 | }, 730 | "node_modules/magic-string": { 731 | "version": "0.25.9", 732 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", 733 | "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", 734 | "dev": true, 735 | "license": "MIT", 736 | "dependencies": { 737 | "sourcemap-codec": "^1.4.8" 738 | } 739 | }, 740 | "node_modules/mime": { 741 | "version": "3.0.0", 742 | "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", 743 | "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", 744 | "dev": true, 745 | "license": "MIT", 746 | "bin": { 747 | "mime": "cli.js" 748 | }, 749 | "engines": { 750 | "node": ">=10.0.0" 751 | } 752 | }, 753 | "node_modules/miniflare": { 754 | "version": "3.20250129.0", 755 | "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20250129.0.tgz", 756 | "integrity": "sha512-qYlGEjMl/2kJdgNaztj4hpA64d6Dl79Lx/NL61p/v5XZRiWanBOTgkQqdPxCKZOj6KQnioqhC7lfd6jDXKSs2A==", 757 | "dev": true, 758 | "dependencies": { 759 | "@cspotcode/source-map-support": "0.8.1", 760 | "acorn": "^8.8.0", 761 | "acorn-walk": "^8.2.0", 762 | "exit-hook": "^2.2.1", 763 | "glob-to-regexp": "^0.4.1", 764 | "stoppable": "^1.1.0", 765 | "undici": "^5.28.4", 766 | "workerd": "1.20250129.0", 767 | "ws": "^8.18.0", 768 | "youch": "^3.2.2", 769 | "zod": "^3.22.3" 770 | }, 771 | "bin": { 772 | "miniflare": "bootstrap.js" 773 | }, 774 | "engines": { 775 | "node": ">=16.13" 776 | } 777 | }, 778 | "node_modules/mlly": { 779 | "version": "1.7.4", 780 | "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", 781 | "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", 782 | "dev": true, 783 | "dependencies": { 784 | "acorn": "^8.14.0", 785 | "pathe": "^2.0.1", 786 | "pkg-types": "^1.3.0", 787 | "ufo": "^1.5.4" 788 | } 789 | }, 790 | "node_modules/mlly/node_modules/pathe": { 791 | "version": "2.0.2", 792 | "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.2.tgz", 793 | "integrity": "sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==", 794 | "dev": true 795 | }, 796 | "node_modules/mustache": { 797 | "version": "4.2.0", 798 | "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", 799 | "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", 800 | "dev": true, 801 | "bin": { 802 | "mustache": "bin/mustache" 803 | } 804 | }, 805 | "node_modules/ohash": { 806 | "version": "1.1.4", 807 | "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.4.tgz", 808 | "integrity": "sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g==", 809 | "dev": true 810 | }, 811 | "node_modules/path-to-regexp": { 812 | "version": "6.3.0", 813 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", 814 | "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", 815 | "dev": true, 816 | "license": "MIT" 817 | }, 818 | "node_modules/pathe": { 819 | "version": "1.1.2", 820 | "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", 821 | "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", 822 | "dev": true 823 | }, 824 | "node_modules/pkg-types": { 825 | "version": "1.3.1", 826 | "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", 827 | "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", 828 | "dev": true, 829 | "dependencies": { 830 | "confbox": "^0.1.8", 831 | "mlly": "^1.7.4", 832 | "pathe": "^2.0.1" 833 | } 834 | }, 835 | "node_modules/pkg-types/node_modules/pathe": { 836 | "version": "2.0.2", 837 | "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.2.tgz", 838 | "integrity": "sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==", 839 | "dev": true 840 | }, 841 | "node_modules/printable-characters": { 842 | "version": "1.0.42", 843 | "resolved": "https://registry.npmjs.org/printable-characters/-/printable-characters-1.0.42.tgz", 844 | "integrity": "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==", 845 | "dev": true 846 | }, 847 | "node_modules/rollup-plugin-inject": { 848 | "version": "3.0.2", 849 | "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", 850 | "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", 851 | "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.", 852 | "dev": true, 853 | "license": "MIT", 854 | "dependencies": { 855 | "estree-walker": "^0.6.1", 856 | "magic-string": "^0.25.3", 857 | "rollup-pluginutils": "^2.8.1" 858 | } 859 | }, 860 | "node_modules/rollup-plugin-node-polyfills": { 861 | "version": "0.2.1", 862 | "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", 863 | "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", 864 | "dev": true, 865 | "license": "MIT", 866 | "dependencies": { 867 | "rollup-plugin-inject": "^3.0.0" 868 | } 869 | }, 870 | "node_modules/rollup-pluginutils": { 871 | "version": "2.8.2", 872 | "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", 873 | "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", 874 | "dev": true, 875 | "license": "MIT", 876 | "dependencies": { 877 | "estree-walker": "^0.6.1" 878 | } 879 | }, 880 | "node_modules/source-map": { 881 | "version": "0.6.1", 882 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 883 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 884 | "dev": true, 885 | "engines": { 886 | "node": ">=0.10.0" 887 | } 888 | }, 889 | "node_modules/sourcemap-codec": { 890 | "version": "1.4.8", 891 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 892 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", 893 | "deprecated": "Please use @jridgewell/sourcemap-codec instead", 894 | "dev": true, 895 | "license": "MIT" 896 | }, 897 | "node_modules/stacktracey": { 898 | "version": "2.1.8", 899 | "resolved": "https://registry.npmjs.org/stacktracey/-/stacktracey-2.1.8.tgz", 900 | "integrity": "sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==", 901 | "dev": true, 902 | "dependencies": { 903 | "as-table": "^1.0.36", 904 | "get-source": "^2.0.12" 905 | } 906 | }, 907 | "node_modules/stoppable": { 908 | "version": "1.1.0", 909 | "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", 910 | "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", 911 | "dev": true, 912 | "engines": { 913 | "node": ">=4", 914 | "npm": ">=6" 915 | } 916 | }, 917 | "node_modules/typescript": { 918 | "version": "5.7.2", 919 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", 920 | "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", 921 | "dev": true, 922 | "license": "Apache-2.0", 923 | "bin": { 924 | "tsc": "bin/tsc", 925 | "tsserver": "bin/tsserver" 926 | }, 927 | "engines": { 928 | "node": ">=14.17" 929 | } 930 | }, 931 | "node_modules/ufo": { 932 | "version": "1.5.4", 933 | "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", 934 | "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", 935 | "dev": true 936 | }, 937 | "node_modules/undici": { 938 | "version": "5.28.5", 939 | "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", 940 | "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", 941 | "dev": true, 942 | "dependencies": { 943 | "@fastify/busboy": "^2.0.0" 944 | }, 945 | "engines": { 946 | "node": ">=14.0" 947 | } 948 | }, 949 | "node_modules/unenv": { 950 | "version": "2.0.0-rc.1", 951 | "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.1.tgz", 952 | "integrity": "sha512-PU5fb40H8X149s117aB4ytbORcCvlASdtF97tfls4BPIyj4PeVxvpSuy1jAptqYHqB0vb2w2sHvzM0XWcp2OKg==", 953 | "dev": true, 954 | "dependencies": { 955 | "defu": "^6.1.4", 956 | "mlly": "^1.7.4", 957 | "ohash": "^1.1.4", 958 | "pathe": "^1.1.2", 959 | "ufo": "^1.5.4" 960 | } 961 | }, 962 | "node_modules/workerd": { 963 | "version": "1.20250129.0", 964 | "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250129.0.tgz", 965 | "integrity": "sha512-Rprz8rxKTF4l6q/nYYI07lBetJnR19mGipx+u/a27GZOPKMG5SLIzA2NciZlJaB2Qd5YY+4p/eHOeKqo5keVWA==", 966 | "dev": true, 967 | "hasInstallScript": true, 968 | "bin": { 969 | "workerd": "bin/workerd" 970 | }, 971 | "engines": { 972 | "node": ">=16" 973 | }, 974 | "optionalDependencies": { 975 | "@cloudflare/workerd-darwin-64": "1.20250129.0", 976 | "@cloudflare/workerd-darwin-arm64": "1.20250129.0", 977 | "@cloudflare/workerd-linux-64": "1.20250129.0", 978 | "@cloudflare/workerd-linux-arm64": "1.20250129.0", 979 | "@cloudflare/workerd-windows-64": "1.20250129.0" 980 | } 981 | }, 982 | "node_modules/wrangler": { 983 | "version": "3.107.3", 984 | "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.107.3.tgz", 985 | "integrity": "sha512-N9ZMDHZ+DI5/B0yclr3bG57U/Zw7wSzGdpO2l7j6+3q8yUf+4Fk0Rvneo2t8rjLewKlvqgt9D9siFuo8MXJ55Q==", 986 | "dev": true, 987 | "dependencies": { 988 | "@cloudflare/kv-asset-handler": "0.3.4", 989 | "@esbuild-plugins/node-globals-polyfill": "0.2.3", 990 | "@esbuild-plugins/node-modules-polyfill": "0.2.2", 991 | "blake3-wasm": "2.1.5", 992 | "esbuild": "0.17.19", 993 | "miniflare": "3.20250129.0", 994 | "path-to-regexp": "6.3.0", 995 | "unenv": "2.0.0-rc.1", 996 | "workerd": "1.20250129.0" 997 | }, 998 | "bin": { 999 | "wrangler": "bin/wrangler.js", 1000 | "wrangler2": "bin/wrangler.js" 1001 | }, 1002 | "engines": { 1003 | "node": ">=16.17.0" 1004 | }, 1005 | "optionalDependencies": { 1006 | "fsevents": "~2.3.2" 1007 | }, 1008 | "peerDependencies": { 1009 | "@cloudflare/workers-types": "^4.20250129.0" 1010 | }, 1011 | "peerDependenciesMeta": { 1012 | "@cloudflare/workers-types": { 1013 | "optional": true 1014 | } 1015 | } 1016 | }, 1017 | "node_modules/ws": { 1018 | "version": "8.18.0", 1019 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", 1020 | "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", 1021 | "dev": true, 1022 | "engines": { 1023 | "node": ">=10.0.0" 1024 | }, 1025 | "peerDependencies": { 1026 | "bufferutil": "^4.0.1", 1027 | "utf-8-validate": ">=5.0.2" 1028 | }, 1029 | "peerDependenciesMeta": { 1030 | "bufferutil": { 1031 | "optional": true 1032 | }, 1033 | "utf-8-validate": { 1034 | "optional": true 1035 | } 1036 | } 1037 | }, 1038 | "node_modules/youch": { 1039 | "version": "3.3.4", 1040 | "resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz", 1041 | "integrity": "sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==", 1042 | "dev": true, 1043 | "dependencies": { 1044 | "cookie": "^0.7.1", 1045 | "mustache": "^4.2.0", 1046 | "stacktracey": "^2.1.8" 1047 | } 1048 | }, 1049 | "node_modules/zod": { 1050 | "version": "3.24.1", 1051 | "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", 1052 | "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", 1053 | "dev": true, 1054 | "funding": { 1055 | "url": "https://github.com/sponsors/colinhacks" 1056 | } 1057 | } 1058 | } 1059 | } 1060 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "workflows-starter", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "deploy": "wrangler deploy", 6 | "start": "wrangler dev" 7 | }, 8 | "devDependencies": { 9 | "@cloudflare/workers-types": "^4.20250204.0", 10 | "typescript": "^5.0.4", 11 | "wrangler": "^3.107.3" 12 | }, 13 | "packageManager": "pnpm@9.1.4", 14 | "engines": { 15 | "pnpm": "^9.1.4" 16 | }, 17 | "pnpm": { 18 | "overrides": { 19 | "esbuild": "0.21.4" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/do.ts: -------------------------------------------------------------------------------- 1 | import { DurableObject } from "cloudflare:workers"; 2 | import { Env } from "./index"; 3 | 4 | export class DurableObjectExample extends DurableObject { 5 | constructor(ctx: DurableObjectState, env: Env) { 6 | super(ctx, env); 7 | } 8 | 9 | async waitForKvUpdate(instanceId: string, retryPeriod: number) { 10 | // We need to persist the instanceId so we can resume the workflow later 11 | this.ctx.storage.put('instanceId', instanceId); 12 | 13 | // we need to persist the retryPeriod so the alarm can use it 14 | this.ctx.storage.put('retryPeriod', retryPeriod); 15 | 16 | // Set the alarm to go off in retryPeriod seconds 17 | this.ctx.storage.setAlarm(Date.now() + retryPeriod * 1000); 18 | } 19 | 20 | async alarm() { 21 | // Retrieve the state from the KV 22 | const complete = await this.env.WAIT_EXAMPLE_KV.get('complete'); 23 | 24 | // If it has been updated to true, resume the workflow 25 | // For the demo, KV will be updated manually in the UI or via the CLI 26 | // Careful if you run this yourself, you may end up with a lot of alarms triggering if you forget to update KV 27 | if (complete === 'true') { 28 | console.log('Complete is true, resuming workflow'); 29 | const instanceId = await this.ctx.storage.get('instanceId'); 30 | const workflow = await this.env.MY_WORKFLOW.get(instanceId as string); 31 | await workflow.resume(); 32 | } else { 33 | // If it has not been updated to true, set the alarm to go off in retryPeriod seconds 34 | console.log('Complete is false, setting alarm'); 35 | const retryPeriod = parseInt(await this.ctx.storage.get('retryPeriod') as string); 36 | 37 | this.ctx.storage.setAlarm(Date.now() + retryPeriod * 1000); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { WorkflowEntrypoint, WorkflowStep, WorkflowEvent } from 'cloudflare:workers'; 2 | import { DurableObjectExample } from './do'; 3 | export { DurableObjectExample }; 4 | 5 | export type Env = { 6 | MY_WORKFLOW: Workflow; 7 | WAIT_EXAMPLE_KV: KVNamespace; 8 | DURABLE_OBJECT_EXAMPLE: DurableObjectNamespace; 9 | }; 10 | 11 | // User-defined params passed to your workflow 12 | type Params = {}; 13 | 14 | export class MyWorkflow extends WorkflowEntrypoint { 15 | async run(event: WorkflowEvent, step: WorkflowStep) { 16 | await step.do('pause', async () => { 17 | // Persist some state that we can use to determine if the workflow should resume 18 | this.env.WAIT_EXAMPLE_KV.put('complete', 'false'); 19 | 20 | // Get the Durable Object instance that will be used to wait for the KV update 21 | // and trigger a resume of the workflow 22 | const id = this.env.DURABLE_OBJECT_EXAMPLE.idFromName(`workflow-${event.instanceId}`); 23 | const durableObjectExample = this.env.DURABLE_OBJECT_EXAMPLE.get(id); 24 | await durableObjectExample.waitForKvUpdate(event.instanceId, 10); 25 | 26 | // Pause the workflow 27 | const workflow = await this.env.MY_WORKFLOW.get(event.instanceId); 28 | await workflow.pause(); 29 | }); 30 | 31 | // This will be run once the Durable Object resumes the workflow 32 | await step.do('finish', async () => { 33 | console.log('finish'); 34 | }); 35 | } 36 | } 37 | 38 | // This is just here to start a Workflow instance 39 | export default { 40 | async fetch(req: Request, env: Env): Promise { 41 | let url = new URL(req.url); 42 | 43 | if (url.pathname.startsWith('/favicon')) { 44 | return Response.json({}, { status: 404 }); 45 | } 46 | 47 | // Get the status of an existing instance, if provided 48 | let id = url.searchParams.get('instanceId'); 49 | 50 | if (id) { 51 | let instance = await env.MY_WORKFLOW.get(id); 52 | return Response.json({ 53 | status: await instance.status(), 54 | }); 55 | } 56 | 57 | // Spawn a new instance and return the ID and status 58 | let instance = await env.MY_WORKFLOW.create(); 59 | 60 | return Response.json({ 61 | id: instance.id, 62 | details: await instance.status(), 63 | }); 64 | }, 65 | }; 66 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 15 | "lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, 16 | "jsx": "react" /* Specify what JSX code is generated. */, 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "es2022" /* Specify what module code is generated. */, 28 | // "rootDir": "./", /* Specify the root folder within your source files. */ 29 | "moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */, 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | "types": [ 35 | "@cloudflare/workers-types/experimental", 36 | "@cloudflare/workers-types/2023-07-01" 37 | ] /* Specify type package names to be included without being referenced in a source file. */, 38 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 39 | "resolveJsonModule": true /* Enable importing .json files */, 40 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 41 | 42 | /* JavaScript Support */ 43 | "allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */, 44 | "checkJs": false /* Enable error reporting in type-checked JavaScript files. */, 45 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 46 | 47 | /* Emit */ 48 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 49 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 50 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 51 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 52 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 53 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 54 | // "removeComments": true, /* Disable emitting comments. */ 55 | "noEmit": true /* Disable emitting files from a compilation. */, 56 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 57 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 58 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 59 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 60 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 61 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 62 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 63 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 64 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 65 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 66 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 67 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 68 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 69 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 70 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 71 | 72 | /* Interop Constraints */ 73 | "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, 74 | "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */, 75 | // "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */, 76 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 77 | "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 78 | 79 | /* Type Checking */ 80 | "strict": true /* Enable all strict type-checking options. */, 81 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 82 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 83 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 84 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 85 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 86 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 87 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 88 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 89 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 90 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 91 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 92 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 93 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 94 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 95 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 96 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 97 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 98 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 99 | 100 | /* Completeness */ 101 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 102 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 103 | }, 104 | "exclude": ["test"] 105 | } 106 | -------------------------------------------------------------------------------- /wrangler.jsonc: -------------------------------------------------------------------------------- 1 | /** 2 | * For more details on how to configure Wrangler, refer to: 3 | * https://developers.cloudflare.com/workers/wrangler/configuration/ 4 | */ 5 | { 6 | "$schema": "node_modules/wrangler/config-schema.json", 7 | "name": "workflows-wait-for-action", 8 | "main": "src/index.ts", 9 | "compatibility_date": "2024-10-22", 10 | "observability": { 11 | "enabled": false, 12 | "head_sampling_rate": 1 13 | }, 14 | "workflows": [ 15 | { 16 | "name": "workflows-starter", 17 | "binding": "MY_WORKFLOW", 18 | "class_name": "MyWorkflow" 19 | } 20 | ], 21 | "kv_namespaces": [ 22 | { 23 | "binding": "WAIT_EXAMPLE_KV", 24 | "id": "cbba6578386f403c85cbe942bb4cd8aa" 25 | } 26 | ], 27 | "migrations": [ 28 | { 29 | "new_sqlite_classes": [ 30 | "DurableObjectExample" 31 | ], 32 | "tag": "v1" 33 | } 34 | ], 35 | "durable_objects": { 36 | "bindings": [ 37 | { 38 | "class_name": "DurableObjectExample", 39 | "name": "DURABLE_OBJECT_EXAMPLE" 40 | } 41 | ] 42 | }, 43 | } 44 | --------------------------------------------------------------------------------