wirejs-deploy-amplify-basic 0.0.132-async-api → 0.0.134

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');
@@ -117,9 +117,7 @@ export const handler: LambdaFunctionURLHandler = async (event, context) => {
117
117
  };
118
118
  }
119
119
 
120
- console.log('Starting background job');
121
120
  await handler(...calls.args)
122
- console.log('Background job completed');
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.100-async-api"
6
+ "wirejs-resources": "^0.1.102"
7
7
  }
8
8
  }
@@ -1,7 +1,6 @@
1
1
  import { Resource, BackgroundJob as BaseBackgroundJob } from 'wirejs-resources';
2
2
  export type BackgroundJobDefinition = {
3
3
  absoluteId: string;
4
- timeoutSeconds: number;
5
4
  };
6
5
  /**
7
6
  * A function that will be executed in the background.
@@ -19,11 +18,9 @@ export type BackgroundJobDefinition = {
19
18
  * 3. In local development, **timeouts are not enforced.** (Yet.)
20
19
  */
21
20
  export declare class BackgroundJob<T extends (...args: any) => Promise<void>> extends Resource implements Omit<BaseBackgroundJob<T>, '#private'> {
22
- #private;
23
21
  static registeredJobs: Record<string, BackgroundJob<any>>;
24
22
  constructor(scope: Resource | string, id: string, options: {
25
23
  handler: T;
26
- timeoutSeconds?: number;
27
24
  });
28
25
  /**
29
26
  * Serializes parameter data and schedules background execution.
@@ -18,17 +18,21 @@ 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
- #timeoutSeconds;
21
+ // #timeoutSeconds: number;
22
22
  static registeredJobs = {};
23
23
  constructor(scope, id, options) {
24
24
  super(scope, id);
25
- if (options.timeoutSeconds && (options.timeoutSeconds < 1 || options.timeoutSeconds > 900)) {
26
- throw new Error('timeoutSeconds must be between 1 and 900 seconds.');
27
- }
28
- this.#timeoutSeconds = options.timeoutSeconds ?? 900;
25
+ // TODO
26
+ // if (options.timeoutSeconds && (
27
+ // options.timeoutSeconds < 1 || options.timeoutSeconds > 900
28
+ // )) {
29
+ // throw new Error('timeoutSeconds must be between 1 and 900 seconds.');
30
+ // }
31
+ // this.#timeoutSeconds = options.timeoutSeconds ?? 900;
29
32
  addResource('BackgroundJob', {
30
33
  absoluteId: this.absoluteId,
31
- timeoutSeconds: this.#timeoutSeconds,
34
+ // TODO
35
+ // timeoutSeconds: this.#timeoutSeconds,
32
36
  });
33
37
  BackgroundJob.registeredJobs[this.absoluteId] = options.handler;
34
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.132-async-api",
3
+ "version": "0.0.134",
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.100-async-api"
45
+ "wirejs-resources": "^0.1.102"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@aws-amplify/backend": "^1.14.0",