wirejs-deploy-amplify-basic 0.0.131-async-api → 0.0.133-async-api

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.
@@ -87,7 +87,7 @@ export const handler: LambdaFunctionURLHandler = async (event, context) => {
87
87
  const sanitized = { ...calls };
88
88
  sanitized.selfInvocationId = sanitized.selfInvocationId.slice(0, 8);
89
89
 
90
- console.log('handling async execution', sanitized);
90
+ console.log('handling async execution');
91
91
 
92
92
  if (!calls.absoluteId) {
93
93
  console.error('Missing absoluteId in async call');
@@ -105,8 +105,8 @@ export const handler: LambdaFunctionURLHandler = async (event, context) => {
105
105
  };
106
106
  }
107
107
 
108
- const job = (BackgroundJob as any).registeredJobs[calls.absoluteId];
109
- if (!job || !isBackgroundJob(job)) {
108
+ const handler = (BackgroundJob as any).registeredJobs[calls.absoluteId];
109
+ if (!handler || typeof handler !== 'function') {
110
110
  console.error('Background job not found',
111
111
  calls.absoluteId,
112
112
  (BackgroundJob as any).registeredJobs
@@ -117,9 +117,7 @@ export const handler: LambdaFunctionURLHandler = async (event, context) => {
117
117
  };
118
118
  }
119
119
 
120
- console.log('Starting background job');
121
- await job.start(...calls.args)
122
- console.log('Background job completed');
120
+ await handler(...calls.args)
123
121
 
124
122
  return {
125
123
  statusCode: 200,
@@ -5,7 +5,8 @@ import {
5
5
  const api = defineFunction({
6
6
  entry: './handler.ts',
7
7
  runtime: 22,
8
- memoryMB: 1024
8
+ memoryMB: 1024,
9
+ timeoutSeconds: 60 * 15,
9
10
  });
10
11
 
11
12
  export { api };
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.41",
6
- "wirejs-resources": "^0.1.99-async-api"
6
+ "wirejs-resources": "^0.1.101-async-api"
7
7
  }
8
8
  }
@@ -18,12 +18,10 @@ import { addResource } from '../resource-collector.js';
18
18
  * 3. In local development, **timeouts are not enforced.** (Yet.)
19
19
  */
20
20
  export class BackgroundJob extends Resource {
21
- #handler;
22
21
  #timeoutSeconds;
23
22
  static registeredJobs = {};
24
23
  constructor(scope, id, options) {
25
24
  super(scope, id);
26
- this.#handler = options.handler;
27
25
  if (options.timeoutSeconds && (options.timeoutSeconds < 1 || options.timeoutSeconds > 900)) {
28
26
  throw new Error('timeoutSeconds must be between 1 and 900 seconds.');
29
27
  }
@@ -32,7 +30,7 @@ export class BackgroundJob extends Resource {
32
30
  absoluteId: this.absoluteId,
33
31
  timeoutSeconds: this.#timeoutSeconds,
34
32
  });
35
- BackgroundJob.registeredJobs[this.absoluteId] = this;
33
+ BackgroundJob.registeredJobs[this.absoluteId] = options.handler;
36
34
  }
37
35
  /**
38
36
  * Serializes parameter data and schedules background execution.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.131-async-api",
3
+ "version": "0.0.133-async-api",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "recursive-copy": "^2.0.14",
43
43
  "rimraf": "^6.0.1",
44
44
  "wirejs-dom": "^1.0.41",
45
- "wirejs-resources": "^0.1.99-async-api"
45
+ "wirejs-resources": "^0.1.101-async-api"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@aws-amplify/backend": "^1.14.0",