@awsless/awsless 0.0.155 → 0.0.157

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
@@ -988,7 +988,7 @@ var rollupBundle = ({
988
988
  },
989
989
  plugins: [
990
990
  // @ts-ignore
991
- commonjs({ sourceMap: true, ignoreDynamicRequires: true }),
991
+ commonjs({ sourceMap: true }),
992
992
  // @ts-ignore
993
993
  nodeResolve({ preferBuiltins: true }),
994
994
  swc({
@@ -4430,9 +4430,11 @@ var Bucket = class extends Resource {
4430
4430
  "s3:GetObjectAttributes"
4431
4431
  ],
4432
4432
  resources: [
4433
- sub("arn:${AWS::Partition}:${service}:::${resourceName}", {
4434
- service: "s3",
4435
- resourceName: this.name
4433
+ sub("arn:${AWS::Partition}:s3:::${bucket}", {
4434
+ bucket: this.name
4435
+ }),
4436
+ sub("arn:${AWS::Partition}:s3:::${bucket}/*", {
4437
+ bucket: this.name
4436
4438
  })
4437
4439
  ]
4438
4440
  };
package/dist/index.d.ts CHANGED
@@ -11133,8 +11133,11 @@ declare const definePlugin: (plugin: Plugin) => Plugin;
11133
11133
 
11134
11134
  declare const APP: "app";
11135
11135
  declare const STACK: "stack";
11136
- declare const getLocalResourceName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
11137
- declare const getGlobalResourceName: <N extends string>(name: N) => `app-${N}`;
11136
+ declare function getLocalResourceName<N extends string>(name: N): `${typeof APP}-${typeof STACK}-${N}`;
11137
+ declare function getLocalResourceName<N extends string, S extends string>(name: N, stack: S): `${typeof APP}-${S}-${N}`;
11138
+ declare function getLocalResourceName<N extends string, S extends string, R extends string>(name: N, stack: S, resource: R): `${R}-${typeof APP}-${S}-${N}`;
11139
+ declare function getGlobalResourceName<N extends string>(name: N): `${typeof APP}-${N}`;
11140
+ declare function getGlobalResourceName<N extends string, R extends string>(name: N, resource: R): `${R}-${typeof APP}-${N}`;
11138
11141
 
11139
11142
  declare const getFunctionName: <S extends string, N extends string>(stack: S, name: N) => `app-${S}-${N}`;
11140
11143
  interface FunctionResources {
@@ -11142,7 +11145,7 @@ interface FunctionResources {
11142
11145
  declare const Function: FunctionResources;
11143
11146
  declare const Fn: FunctionResources;
11144
11147
 
11145
- declare const getAuthName: <N extends string>(name: N) => `app-${N}`;
11148
+ declare const getAuthName: typeof getGlobalResourceName;
11146
11149
  interface AuthResources {
11147
11150
  }
11148
11151
  declare const Auth: AuthResources;
@@ -11153,17 +11156,17 @@ declare const getAuthProps: (name: string) => {
11153
11156
  readonly clientSecret: string;
11154
11157
  };
11155
11158
 
11156
- declare const getTableName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
11159
+ declare const getTableName: typeof getLocalResourceName;
11157
11160
  interface TableResources {
11158
11161
  }
11159
11162
  declare const Table: TableResources;
11160
11163
 
11161
- declare const getTopicName: <N extends string>(name: N) => `app-${N}`;
11164
+ declare const getTopicName: typeof getGlobalResourceName;
11162
11165
  interface TopicResources {
11163
11166
  }
11164
11167
  declare const Topic: TopicResources;
11165
11168
 
11166
- declare const getQueueName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
11169
+ declare const getQueueName: typeof getLocalResourceName;
11167
11170
  interface QueueResources {
11168
11171
  }
11169
11172
  declare const Queue: QueueResources;
@@ -11176,7 +11179,7 @@ interface CacheResources {
11176
11179
  }
11177
11180
  declare const Cache: CacheResources;
11178
11181
 
11179
- declare const getStoreName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
11182
+ declare const getStoreName: <N extends string, S extends string>(name: N, stack: S) => `store-app-${S}-${N}`;
11180
11183
  interface StoreResources {
11181
11184
  }
11182
11185
  declare const Store: StoreResources;
@@ -11186,7 +11189,7 @@ interface ConfigResources {
11186
11189
  }
11187
11190
  declare const Config: ConfigResources;
11188
11191
 
11189
- declare const getSearchName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
11192
+ declare const getSearchName: typeof getLocalResourceName;
11190
11193
  interface SearchResources {
11191
11194
  }
11192
11195
  declare const Search: SearchResources;
package/dist/index.js CHANGED
@@ -7,12 +7,12 @@ import { paramCase } from "change-case";
7
7
  var APP = process.env.APP || "app";
8
8
  var STACK = process.env.STACK || "stack";
9
9
  var STAGE = process.env.STAGE || "stage";
10
- var getLocalResourceName = (name, stack = STACK) => {
11
- return `${APP}-${paramCase(stack)}-${paramCase(name)}`;
12
- };
13
- var getGlobalResourceName = (name) => {
14
- return `${APP}-${paramCase(name)}`;
15
- };
10
+ function getLocalResourceName(name, stack = STACK, resource) {
11
+ return `${resource ? paramCase(resource) + "-" : ""}${APP}-${paramCase(stack)}-${paramCase(name)}`;
12
+ }
13
+ function getGlobalResourceName(name, resource) {
14
+ return `${resource ? paramCase(resource) + "-" : ""}${APP}-${paramCase(name)}`;
15
+ }
16
16
 
17
17
  // src/node/function.ts
18
18
  import { invoke } from "@awsless/lambda";
@@ -192,7 +192,9 @@ var Cache = /* @__PURE__ */ createProxy((stack) => {
192
192
 
193
193
  // src/node/store.ts
194
194
  import { putObject, getObject, deleteObject } from "@awsless/s3";
195
- var getStoreName = getLocalResourceName;
195
+ var getStoreName = (name, stack) => {
196
+ return getLocalResourceName(name, stack, "store");
197
+ };
196
198
  var Store = /* @__PURE__ */ createProxy((stack) => {
197
199
  return createProxy((name) => {
198
200
  const bucket = getStoreName(name, stack);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.155",
3
+ "version": "0.0.157",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,9 +28,9 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/lambda": "^0.0.15",
32
- "@awsless/s3": "^0.0.8",
31
+ "@awsless/lambda": "^0.0.18",
33
32
  "@awsless/redis": "^0.0.10",
33
+ "@awsless/s3": "^0.0.8",
34
34
  "@awsless/sns": "^0.0.7",
35
35
  "@awsless/sqs": "^0.0.7",
36
36
  "@awsless/ssm": "^0.0.7",
@@ -89,7 +89,7 @@
89
89
  "wrap-ansi": "^8.1.0",
90
90
  "zod": "^3.21.4",
91
91
  "zod-to-json-schema": "^3.22.3",
92
- "@awsless/graphql": "^0.0.8",
92
+ "@awsless/graphql": "^0.0.9",
93
93
  "@awsless/code": "^0.0.10"
94
94
  },
95
95
  "scripts": {