@awsless/awsless 0.0.77 → 0.0.78
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 +11 -11
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -0
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -1525,9 +1525,9 @@ var typeGenCode = `
|
|
|
1525
1525
|
import { InvokeOptions } from '@awsless/lambda'
|
|
1526
1526
|
|
|
1527
1527
|
type Invoke<Name extends string, Func extends (...args: any[]) => any> = {
|
|
1528
|
-
name: Name
|
|
1528
|
+
readonly name: Name
|
|
1529
|
+
readonly async: (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => ReturnType<Func>
|
|
1529
1530
|
(payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload'>): ReturnType<Func>
|
|
1530
|
-
async: (payload: Parameters<Func>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => ReturnType<Func>
|
|
1531
1531
|
}`;
|
|
1532
1532
|
var functionPlugin = definePlugin({
|
|
1533
1533
|
name: "function",
|
|
@@ -1800,8 +1800,8 @@ import { SendMessageOptions, SendMessageBatchOptions, BatchItem } from '@awsless
|
|
|
1800
1800
|
type Payload<Func extends (...args: any[]) => any> = Parameters<Func>[0]['Records'][number]['body']
|
|
1801
1801
|
|
|
1802
1802
|
type Send<Name extends string, Func extends (...args: any[]) => any> = {
|
|
1803
|
-
name: Name
|
|
1804
|
-
batch(items:BatchItem<Payload<Func>>[], options?:Omit<SendMessageBatchOptions, 'queue' | 'items'>): Promise<void>
|
|
1803
|
+
readonly name: Name
|
|
1804
|
+
readonly batch(items:BatchItem<Payload<Func>>[], options?:Omit<SendMessageBatchOptions, 'queue' | 'items'>): Promise<void>
|
|
1805
1805
|
(payload: Payload<Func>, options?: Omit<SendMessageOptions, 'queue' | 'payload'>): Promise<void>
|
|
1806
1806
|
}`;
|
|
1807
1807
|
var queuePlugin = definePlugin({
|
|
@@ -2197,7 +2197,7 @@ var tablePlugin = definePlugin({
|
|
|
2197
2197
|
const list3 = new TypeObject();
|
|
2198
2198
|
for (const name of Object.keys(stack.tables || {})) {
|
|
2199
2199
|
const tableName = formatName(`${config.name}-${stack.name}-${name}`);
|
|
2200
|
-
list3.addType(name, `{ name: '${tableName}' }`);
|
|
2200
|
+
list3.addType(name, `{ readonly name: '${tableName}' }`);
|
|
2201
2201
|
}
|
|
2202
2202
|
types2.addType(stack.name, list3.toString());
|
|
2203
2203
|
}
|
|
@@ -2329,7 +2329,7 @@ var storePlugin = definePlugin({
|
|
|
2329
2329
|
const list3 = new TypeObject();
|
|
2330
2330
|
for (const name of stack.stores || []) {
|
|
2331
2331
|
const storeName = formatName(`${config.name}-${stack.name}-${name}`);
|
|
2332
|
-
list3.addType(name, `{ name: '${storeName}' }`);
|
|
2332
|
+
list3.addType(name, `{ readonly name: '${storeName}' }`);
|
|
2333
2333
|
}
|
|
2334
2334
|
types2.addType(stack.name, list3.toString());
|
|
2335
2335
|
}
|
|
@@ -2428,8 +2428,8 @@ var typeGenCode3 = `
|
|
|
2428
2428
|
import { PublishOptions } from '@awsless/sns'
|
|
2429
2429
|
|
|
2430
2430
|
type Publish<Name extends string> = {
|
|
2431
|
-
name: Name
|
|
2432
|
-
(payload: unknown, options?: Omit<PublishOptions, 'topic' | 'payload'>): Promise<void>
|
|
2431
|
+
readonly name: Name
|
|
2432
|
+
readonly (payload: unknown, options?: Omit<PublishOptions, 'topic' | 'payload'>): Promise<void>
|
|
2433
2433
|
}`;
|
|
2434
2434
|
var topicPlugin = definePlugin({
|
|
2435
2435
|
name: "topic",
|
|
@@ -4152,7 +4152,7 @@ var searchPlugin = definePlugin({
|
|
|
4152
4152
|
const list3 = new TypeObject();
|
|
4153
4153
|
for (const id of stack.searchs || []) {
|
|
4154
4154
|
const name = formatName(`${config.name}-${stack.name}-${id}`);
|
|
4155
|
-
list3.addType(name, `{ name: '${name}' }`);
|
|
4155
|
+
list3.addType(name, `{ readonly name: '${name}' }`);
|
|
4156
4156
|
}
|
|
4157
4157
|
gen.addType(stack.name, list3.toString());
|
|
4158
4158
|
}
|
|
@@ -4292,7 +4292,7 @@ var cachePlugin = definePlugin({
|
|
|
4292
4292
|
for (const stack of config.stacks) {
|
|
4293
4293
|
const list3 = new TypeObject();
|
|
4294
4294
|
for (const name of Object.keys(stack.caches || {})) {
|
|
4295
|
-
list3.addType(name, `{ host: string, port: number }`);
|
|
4295
|
+
list3.addType(name, `{ readonly host: string, readonly port: number }`);
|
|
4296
4296
|
}
|
|
4297
4297
|
gen.addType(stack.name, list3.toString());
|
|
4298
4298
|
}
|
|
@@ -5835,7 +5835,7 @@ var authPlugin = definePlugin({
|
|
|
5835
5835
|
onTypeGen({ config }) {
|
|
5836
5836
|
const gen = new TypeGen("@awsless/awsless", "AuthResources");
|
|
5837
5837
|
for (const name of Object.keys(config.defaults.auth)) {
|
|
5838
|
-
gen.addType(name, `{ name: '${formatName(name)}' }`);
|
|
5838
|
+
gen.addType(name, `{ readonly name: '${formatName(`${config.name}-${name}`)}' }`);
|
|
5839
5839
|
}
|
|
5840
5840
|
return gen.toString();
|
|
5841
5841
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -8489,6 +8489,11 @@ interface FunctionResources {
|
|
|
8489
8489
|
}
|
|
8490
8490
|
declare const Function: FunctionResources;
|
|
8491
8491
|
|
|
8492
|
+
declare const getAuthName: <N extends string>(name: N) => `app-${N}`;
|
|
8493
|
+
interface AuthResources {
|
|
8494
|
+
}
|
|
8495
|
+
declare const Auth: AuthResources;
|
|
8496
|
+
|
|
8492
8497
|
declare const getTableName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app-${S}-${N}`;
|
|
8493
8498
|
interface TableResources {
|
|
8494
8499
|
}
|
|
@@ -9097,4 +9102,4 @@ declare const defineStackConfig: (config: StackConfig) => StackConfig$1 | (Stack
|
|
|
9097
9102
|
});
|
|
9098
9103
|
declare const defineAppConfig: (config: AppConfig | AppConfigFactory<AppConfig>) => CombinedDefaultPluginsConfigInput | AppConfigFactory<CombinedDefaultPluginsConfigInput>;
|
|
9099
9104
|
|
|
9100
|
-
export { APP, AppConfig, Cache, CacheResources, Config, ConfigResources, Function, FunctionResources, Plugin, Queue, QueueResources, STACK, Search, SearchResources, StackConfig, Store, StoreResources, Table, TableResources, Topic, TopicResources, defineAppConfig, definePlugin, defineStackConfig, getCacheProps, getConfigName, getFunctionName, getGlobalResourceName, getLocalResourceName, getQueueName, getSearchName, getStoreName, getTableName, getTopicName };
|
|
9105
|
+
export { APP, AppConfig, Auth, AuthResources, Cache, CacheResources, Config, ConfigResources, Function, FunctionResources, Plugin, Queue, QueueResources, STACK, Search, SearchResources, StackConfig, Store, StoreResources, Table, TableResources, Topic, TopicResources, defineAppConfig, definePlugin, defineStackConfig, getAuthName, getCacheProps, getConfigName, getFunctionName, getGlobalResourceName, getLocalResourceName, getQueueName, getSearchName, getStoreName, getTableName, getTopicName };
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,14 @@ var Function = /* @__PURE__ */ createProxy((stackName) => {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
+
// src/node/auth.ts
|
|
63
|
+
var getAuthName = getGlobalResourceName;
|
|
64
|
+
var Auth = /* @__PURE__ */ createProxy((name) => {
|
|
65
|
+
return {
|
|
66
|
+
name: getAuthName(name)
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
62
70
|
// src/node/table.ts
|
|
63
71
|
var getTableName = getLocalResourceName;
|
|
64
72
|
var Table = /* @__PURE__ */ createProxy((stack) => {
|
|
@@ -209,6 +217,7 @@ var defineAppConfig = (config) => {
|
|
|
209
217
|
};
|
|
210
218
|
export {
|
|
211
219
|
APP,
|
|
220
|
+
Auth,
|
|
212
221
|
Cache,
|
|
213
222
|
Config,
|
|
214
223
|
Function,
|
|
@@ -221,6 +230,7 @@ export {
|
|
|
221
230
|
defineAppConfig,
|
|
222
231
|
definePlugin,
|
|
223
232
|
defineStackConfig,
|
|
233
|
+
getAuthName,
|
|
224
234
|
getCacheProps,
|
|
225
235
|
getConfigName,
|
|
226
236
|
getFunctionName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@awsless/
|
|
27
|
+
"@awsless/ssm": "^0.0.7",
|
|
28
28
|
"@awsless/sns": "^0.0.6",
|
|
29
|
-
"@awsless/
|
|
30
|
-
"@awsless/
|
|
29
|
+
"@awsless/lambda": "^0.0.6",
|
|
30
|
+
"@awsless/sqs": "^0.0.6"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@aws-sdk/client-cloudformation": "^3.369.0",
|