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

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.
@@ -3,12 +3,12 @@ import {
3
3
  defineBackend,
4
4
  } from '@aws-amplify/backend';
5
5
  import { RemovalPolicy, NestedStack } from "aws-cdk-lib";
6
- import { CfnPermission, FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
6
+ import { FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
7
7
  import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
8
8
  import { Table, AttributeType, BillingMode } from 'aws-cdk-lib/aws-dynamodb';
9
- import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
9
+ import { AnyPrincipal, PolicyStatement } from 'aws-cdk-lib/aws-iam';
10
10
 
11
- import { TableDefinition, Resource, indexName } from 'wirejs-resources';
11
+ import { TableDefinition, indexName } from 'wirejs-resources';
12
12
  import { TableIndexes } from './constructs/table-indexes';
13
13
  import { RealtimeService } from './constructs/realtime-service';
14
14
  import { api } from './functions/api/resource';
@@ -209,8 +209,9 @@ backend.api.addEnvironment(
209
209
  * Client configuration
210
210
  */
211
211
  const apiUrl = backend.api.resources.lambda.addFunctionUrl({
212
- authType: FunctionUrlAuthType.NONE
212
+ authType: FunctionUrlAuthType.NONE,
213
213
  });
214
+ apiUrl.grantInvokeUrl(new AnyPrincipal());
214
215
 
215
216
  backend.addOutput({
216
217
  custom: {
@@ -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.101-async-api"
6
+ "wirejs-resources": "^0.1.103"
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.133-async-api",
3
+ "version": "0.0.135",
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.101-async-api"
45
+ "wirejs-resources": "^0.1.103"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@aws-amplify/backend": "^1.14.0",