@awsless/awsless 0.0.54 → 0.0.56

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.
Files changed (2) hide show
  1. package/dist/bin.js +18 -7
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -843,8 +843,9 @@ var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "default
843
843
  format: format2,
844
844
  sourcemap: "hidden",
845
845
  exports: "auto",
846
- entryFileNames: `[name].${ext}`,
847
- manualChunks: {}
846
+ manualChunks: {},
847
+ entryFileNames: `index.${ext}`,
848
+ chunkFileNames: `[name].${ext}`
848
849
  });
849
850
  const hash = createHash("sha1");
850
851
  const files = [];
@@ -852,13 +853,11 @@ var rollupBundle = ({ format: format2 = "esm", minify = true, handler = "default
852
853
  if (item.type !== "chunk") {
853
854
  continue;
854
855
  }
855
- const base = item.isEntry ? "index" : item.name;
856
- const name = `${base}.${ext}`;
857
856
  const code = Buffer.from(item.code, "utf8");
858
857
  const map = item.map ? Buffer.from(item.map.toString(), "utf8") : void 0;
859
858
  hash.update(code);
860
859
  files.push({
861
- name,
860
+ name: item.fileName,
862
861
  code,
863
862
  map
864
863
  });
@@ -1915,7 +1914,7 @@ var Table = class extends Resource {
1915
1914
  return getAtt(this.logicalId, "StreamArn");
1916
1915
  }
1917
1916
  get permissions() {
1918
- return {
1917
+ const permissions = [{
1919
1918
  actions: [
1920
1919
  "dynamodb:DescribeTable",
1921
1920
  "dynamodb:PutItem",
@@ -1935,7 +1934,19 @@ var Table = class extends Resource {
1935
1934
  resourceName: this.name
1936
1935
  })
1937
1936
  ]
1938
- };
1937
+ }];
1938
+ const indexNames = Object.keys(this.indexes ?? {});
1939
+ if (indexNames.length > 0) {
1940
+ permissions.push({
1941
+ actions: ["dynamodb:Query"],
1942
+ resources: indexNames.map((indexName) => formatArn({
1943
+ service: "dynamodb",
1944
+ resource: "table",
1945
+ resourceName: `${this.name}/index/${indexName}`
1946
+ }))
1947
+ });
1948
+ }
1949
+ return permissions;
1939
1950
  }
1940
1951
  attributeDefinitions() {
1941
1952
  const fields = this.props.fields || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {