@awsless/awsless 0.0.90 → 0.0.91

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/dist/bin.js CHANGED
@@ -389,6 +389,9 @@ var Function = class extends Resource {
389
389
  assumedBy: "lambda.amazonaws.com"
390
390
  });
391
391
  role.addInlinePolicy(policy);
392
+ if (props.permissions) {
393
+ policy.addStatement(props.permissions);
394
+ }
392
395
  super("AWS::Lambda::Function", _logicalId, [role]);
393
396
  this._logicalId = _logicalId;
394
397
  this.props = props;
@@ -414,13 +417,16 @@ var Function = class extends Resource {
414
417
  retention
415
418
  });
416
419
  this.addChild(logGroup);
417
- this.addPermissions({
418
- actions: ["logs:CreateLogStream"],
419
- resources: [logGroup.arn]
420
- }, {
421
- actions: ["logs:PutLogEvents"],
422
- resources: [sub("${arn}:*", { arn: logGroup.arn })]
423
- });
420
+ this.addPermissions(
421
+ {
422
+ actions: ["logs:CreateLogStream"],
423
+ resources: [logGroup.arn]
424
+ },
425
+ {
426
+ actions: ["logs:PutLogEvents"],
427
+ resources: [sub("${arn}:*", { arn: logGroup.arn })]
428
+ }
429
+ );
424
430
  return this;
425
431
  }
426
432
  warmUp(concurrency) {
@@ -460,10 +466,7 @@ var Function = class extends Resource {
460
466
  }
461
467
  get permissions() {
462
468
  return {
463
- actions: [
464
- "lambda:InvokeFunction",
465
- "lambda:InvokeAsync"
466
- ],
469
+ actions: ["lambda:InvokeFunction", "lambda:InvokeAsync"],
467
470
  resources: [
468
471
  formatArn({
469
472
  service: "lambda",
@@ -1560,12 +1563,12 @@ var schema = z6.object({
1560
1563
  }).array()
1561
1564
  });
1562
1565
  var typeGenCode = `
1563
- import { InvokeOptions } from '@awsless/lambda'
1566
+ import { InvokeOptions, InvokeResponse } from '@awsless/lambda'
1564
1567
 
1565
1568
  type Invoke<Name extends string, Func extends (...args: any[]) => any> = {
1566
1569
  readonly name: Name
1567
- readonly async: (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => ReturnType<Func>
1568
- (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload'>): ReturnType<Func>
1570
+ readonly async: (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => InvokeResponse<Func>
1571
+ (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload'>): InvokeResponse<Func>
1569
1572
  }`;
1570
1573
  var functionPlugin = definePlugin({
1571
1574
  name: "function",
package/dist/index.d.ts CHANGED
@@ -11072,6 +11072,7 @@ type FunctionProps$1 = {
11072
11072
  timeout?: Duration;
11073
11073
  ephemeralStorageSize?: Size;
11074
11074
  environment?: Record<string, string>;
11075
+ permissions?: Permission | Permission[];
11075
11076
  reserved?: number;
11076
11077
  vpc?: {
11077
11078
  securityGroupIds: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@awsless/validate": "^0.0.6",
28
- "@awsless/lambda": "^0.0.12",
28
+ "@awsless/lambda": "^0.0.13",
29
29
  "@awsless/redis": "^0.0.8",
30
30
  "@awsless/sns": "^0.0.7",
31
31
  "@awsless/sqs": "^0.0.7",