@astrale-os/adapter-cloudflare 0.5.0-beta.192 → 0.5.0-beta.194

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.
@@ -1,3 +1,4 @@
1
+ import { DURABLE_ENGINE_EXPORTS } from '@astrale-os/sdk/execution';
1
2
  import * as nodeModule from 'node:module';
2
3
  import { pathToFileURL } from 'node:url';
3
4
  import { compiledWasmLoader, compiledWasmSource } from './compiled-wasm-loader.js';
@@ -40,7 +41,7 @@ export async function admitWorkerBundle(path) {
40
41
  export async function admitDurableEngineBundle(path) {
41
42
  admitCompiledWasm();
42
43
  const engine = (await import(`${pathToFileURL(path).href}?admit=${Date.now()}`));
43
- if (['createEndpointHandler', 'workflow', 'TerminalError', 'CancelledError', 'TimeoutError'].some((key) => typeof engine[key] !== 'function')) {
44
+ if (DURABLE_ENGINE_EXPORTS.some((member) => typeof engine[member] !== 'function')) {
44
45
  throw new TypeError('Generated durable engine bundle does not export the platform Fetch entrypoint.');
45
46
  }
46
47
  }
@@ -1,4 +1,5 @@
1
1
  import { generatedMaterial } from '@astrale-os/sdk/deployment/build';
2
+ import { DURABLE_ENGINE_EXPORTS } from '@astrale-os/sdk/execution';
2
3
  import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
3
4
  import { dirname, join, relative, resolve } from 'node:path';
4
5
  import { SIGNING_IDENTITY_BINDING } from '../../identity/binding.js';
@@ -76,7 +77,7 @@ export async function prepareExecution(input) {
76
77
  if (declaresDurable(input.context.build)) {
77
78
  await bundle('restate', RELEASE_RESTATE,
78
79
  // Wrangler requires a default export to classify an independently bundled ESM entry.
79
- `export { createEndpointHandler, workflow, TerminalError, CancelledError, TimeoutError } from ${JSON.stringify(restateModuleSpecifier())}\nexport default {}\n`, admitDurableEngineBundle);
80
+ `export { ${DURABLE_ENGINE_EXPORTS.join(', ')} } from ${JSON.stringify(restateModuleSpecifier())}\nexport default {}\n`, admitDurableEngineBundle);
80
81
  }
81
82
  const sourcePath = join(input.directory, 'worker.gen.ts');
82
83
  const frontend = generatedMaterial(input.context.build).material.frontend;
@@ -133,13 +133,15 @@ export function captureDurableOptions(input) {
133
133
  });
134
134
  }
135
135
  function captureRetry(input) {
136
- const value = exact(input, [], ['initialIntervalMs', 'maxAttempts', 'maxIntervalMs']);
136
+ const value = exact(input, [], ['initialIntervalMs', 'maxAttempts', 'maxDurationMs', 'maxIntervalMs']);
137
137
  const initialIntervalMs = optionalNumber(value.initialIntervalMs);
138
138
  const maxAttempts = optionalNumber(value.maxAttempts);
139
+ const maxDurationMs = optionalNumber(value.maxDurationMs);
139
140
  const maxIntervalMs = optionalNumber(value.maxIntervalMs);
140
141
  return Object.freeze({
141
142
  ...(initialIntervalMs === undefined ? {} : { initialIntervalMs }),
142
143
  ...(maxAttempts === undefined ? {} : { maxAttempts }),
144
+ ...(maxDurationMs === undefined ? {} : { maxDurationMs }),
143
145
  ...(maxIntervalMs === undefined ? {} : { maxIntervalMs }),
144
146
  });
145
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/adapter-cloudflare",
3
- "version": "0.5.0-beta.192",
3
+ "version": "0.5.0-beta.194",
4
4
  "description": "Deploy an Astrale Domain through Cloudflare Workers",
5
5
  "keywords": [
6
6
  "adapter",
@@ -61,7 +61,7 @@
61
61
  "registry": "https://registry.npmjs.org/"
62
62
  },
63
63
  "dependencies": {
64
- "@astrale-os/sdk": "0.6.0-beta.37",
64
+ "@astrale-os/sdk": "0.6.0-beta.39",
65
65
  "@noble/hashes": "2.3.0",
66
66
  "@restatedev/restate-sdk-cloudflare-workers": "1.17.0",
67
67
  "hono": "^4.6.20",