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.
- package/amplify-backend-assets/functions/api/handler.ts +1 -3
- package/amplify-backend-assets/functions/api/resource.ts +2 -1
- package/amplify-hosting-assets/compute/default/package.json +1 -1
- package/dist/resources/background-job.d.ts +0 -3
- package/dist/resources/background-job.js +10 -6
- package/package.json +2 -2
|
@@ -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'
|
|
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,
|
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
45
|
+
"wirejs-resources": "^0.1.102"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@aws-amplify/backend": "^1.14.0",
|