wirejs-deploy-amplify-basic 0.0.133-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.
|
@@ -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",
|