@awsless/awsless 0.0.395 → 0.0.397
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 +47 -36
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/server.js +6 -1
- package/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -11120,25 +11120,36 @@ var SsmStore = class {
|
|
|
11120
11120
|
}
|
|
11121
11121
|
async list() {
|
|
11122
11122
|
debug("Load remote config values");
|
|
11123
|
-
const
|
|
11124
|
-
new GetParametersByPathCommand({
|
|
11125
|
-
Path: configParameterPrefix(this.props.appConfig.name),
|
|
11126
|
-
WithDecryption: true,
|
|
11127
|
-
MaxResults: 10,
|
|
11128
|
-
Recursive: true
|
|
11129
|
-
})
|
|
11130
|
-
);
|
|
11131
|
-
debug("Done loading remote config values");
|
|
11123
|
+
const path = configParameterPrefix(this.props.appConfig.name);
|
|
11132
11124
|
const values = {};
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11125
|
+
let token;
|
|
11126
|
+
while (true) {
|
|
11127
|
+
const result = await this.client.send(
|
|
11128
|
+
new GetParametersByPathCommand({
|
|
11129
|
+
Path: path,
|
|
11130
|
+
WithDecryption: true,
|
|
11131
|
+
MaxResults: 10,
|
|
11132
|
+
Recursive: true,
|
|
11133
|
+
NextToken: token
|
|
11134
|
+
})
|
|
11135
|
+
);
|
|
11136
|
+
result.Parameters?.forEach((param) => {
|
|
11137
|
+
const name = param.Name.substring(configParameterPrefix(this.props.appConfig.name).length).substring(1);
|
|
11138
|
+
values[name] = param.Value || "";
|
|
11139
|
+
});
|
|
11140
|
+
if (result.NextToken) {
|
|
11141
|
+
token = result.NextToken;
|
|
11142
|
+
} else {
|
|
11143
|
+
break;
|
|
11144
|
+
}
|
|
11145
|
+
}
|
|
11146
|
+
debug("Done loading remote config values");
|
|
11137
11147
|
return values;
|
|
11138
11148
|
}
|
|
11139
11149
|
};
|
|
11140
11150
|
|
|
11141
11151
|
// src/feature/config/index.ts
|
|
11152
|
+
import { constantCase as constantCase4 } from "change-case";
|
|
11142
11153
|
var configFeature = defineFeature({
|
|
11143
11154
|
name: "config",
|
|
11144
11155
|
async onTypeGen(ctx) {
|
|
@@ -11173,9 +11184,9 @@ var configFeature = defineFeature({
|
|
|
11173
11184
|
const configs = ctx.stackConfig.configs ?? [];
|
|
11174
11185
|
for (const name of configs) {
|
|
11175
11186
|
ctx.registerConfig(name);
|
|
11187
|
+
ctx.addEnv(`CONFIG_${constantCase4(name)}`, name);
|
|
11176
11188
|
}
|
|
11177
11189
|
if (configs.length) {
|
|
11178
|
-
ctx.addEnv("CONFIG", configs.join(","));
|
|
11179
11190
|
ctx.onStackPolicy((policy) => {
|
|
11180
11191
|
policy.addStatement({
|
|
11181
11192
|
actions: [
|
|
@@ -11462,7 +11473,7 @@ var functionFeature = defineFeature({
|
|
|
11462
11473
|
});
|
|
11463
11474
|
|
|
11464
11475
|
// src/feature/graphql/index.ts
|
|
11465
|
-
import { constantCase as
|
|
11476
|
+
import { constantCase as constantCase5, paramCase as paramCase5 } from "change-case";
|
|
11466
11477
|
import { generate } from "@awsless/graphql";
|
|
11467
11478
|
import { mergeTypeDefs } from "@graphql-tools/merge";
|
|
11468
11479
|
import { readFile as readFile5 } from "fs/promises";
|
|
@@ -11737,9 +11748,9 @@ var graphqlFeature = defineFeature({
|
|
|
11737
11748
|
evaluateTargetHealth: false
|
|
11738
11749
|
}
|
|
11739
11750
|
});
|
|
11740
|
-
ctx.bind(`GRAPHQL_${
|
|
11751
|
+
ctx.bind(`GRAPHQL_${constantCase5(id)}_ENDPOINT`, domainName);
|
|
11741
11752
|
} else {
|
|
11742
|
-
ctx.bind(`GRAPHQL_${
|
|
11753
|
+
ctx.bind(`GRAPHQL_${constantCase5(id)}_ENDPOINT`, api.graphql.uri);
|
|
11743
11754
|
}
|
|
11744
11755
|
}
|
|
11745
11756
|
},
|
|
@@ -11821,7 +11832,7 @@ var graphqlFeature = defineFeature({
|
|
|
11821
11832
|
|
|
11822
11833
|
// src/feature/http/index.ts
|
|
11823
11834
|
import { aws as aws9, Node as Node8 } from "@awsless/formation";
|
|
11824
|
-
import { camelCase as camelCase4, constantCase as
|
|
11835
|
+
import { camelCase as camelCase4, constantCase as constantCase6 } from "change-case";
|
|
11825
11836
|
import { relative as relative3 } from "path";
|
|
11826
11837
|
var parseRoute = (route) => {
|
|
11827
11838
|
const [method, ...paths] = route.split(" ");
|
|
@@ -11950,7 +11961,7 @@ var httpFeature = defineFeature({
|
|
|
11950
11961
|
dnsName: loadBalancer.dnsName
|
|
11951
11962
|
}
|
|
11952
11963
|
});
|
|
11953
|
-
ctx.bind(`HTTP_${
|
|
11964
|
+
ctx.bind(`HTTP_${constantCase6(id)}_ENDPOINT`, domainName);
|
|
11954
11965
|
}
|
|
11955
11966
|
},
|
|
11956
11967
|
onStack(ctx) {
|
|
@@ -12256,7 +12267,7 @@ var onFailureFeature = defineFeature({
|
|
|
12256
12267
|
|
|
12257
12268
|
// src/feature/pubsub/index.ts
|
|
12258
12269
|
import { aws as aws13, Node as Node12 } from "@awsless/formation";
|
|
12259
|
-
import { constantCase as
|
|
12270
|
+
import { constantCase as constantCase7 } from "change-case";
|
|
12260
12271
|
var pubsubFeature = defineFeature({
|
|
12261
12272
|
name: "pubsub",
|
|
12262
12273
|
onApp(ctx) {
|
|
@@ -12281,7 +12292,7 @@ var pubsubFeature = defineFeature({
|
|
|
12281
12292
|
sourceArn: authorizer.arn,
|
|
12282
12293
|
action: "lambda:InvokeFunction"
|
|
12283
12294
|
});
|
|
12284
|
-
ctx.bind(`PUBSUB_${
|
|
12295
|
+
ctx.bind(`PUBSUB_${constantCase7(id)}_AUTHORIZER`, name);
|
|
12285
12296
|
const endpoint = new aws13.iot.Endpoint(group, "endpoint", {
|
|
12286
12297
|
type: "data-ats"
|
|
12287
12298
|
});
|
|
@@ -12302,9 +12313,9 @@ var pubsubFeature = defineFeature({
|
|
|
12302
12313
|
type: "CNAME",
|
|
12303
12314
|
records: [endpoint.address]
|
|
12304
12315
|
});
|
|
12305
|
-
ctx.bind(`PUBSUB_${
|
|
12316
|
+
ctx.bind(`PUBSUB_${constantCase7(id)}_ENDPOINT`, domainName);
|
|
12306
12317
|
} else {
|
|
12307
|
-
ctx.bind(`PUBSUB_${
|
|
12318
|
+
ctx.bind(`PUBSUB_${constantCase7(id)}_ENDPOINT`, endpoint.address);
|
|
12308
12319
|
}
|
|
12309
12320
|
}
|
|
12310
12321
|
ctx.onGlobalPolicy((policy) => {
|
|
@@ -12343,7 +12354,7 @@ var pubsubFeature = defineFeature({
|
|
|
12343
12354
|
|
|
12344
12355
|
// src/feature/queue/index.ts
|
|
12345
12356
|
import { aws as aws14, Node as Node13 } from "@awsless/formation";
|
|
12346
|
-
import { camelCase as camelCase5, constantCase as
|
|
12357
|
+
import { camelCase as camelCase5, constantCase as constantCase8 } from "change-case";
|
|
12347
12358
|
import deepmerge3 from "deepmerge";
|
|
12348
12359
|
import { relative as relative4 } from "path";
|
|
12349
12360
|
var typeGenCode3 = `
|
|
@@ -12427,7 +12438,7 @@ var queueFeature = defineFeature({
|
|
|
12427
12438
|
actions: ["sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:GetQueueAttributes"],
|
|
12428
12439
|
resources: [queue2.arn]
|
|
12429
12440
|
});
|
|
12430
|
-
ctx.addEnv(`QUEUE_${
|
|
12441
|
+
ctx.addEnv(`QUEUE_${constantCase8(ctx.stack.name)}_${constantCase8(id)}_URL`, queue2.url);
|
|
12431
12442
|
ctx.onStackPolicy((policy2) => {
|
|
12432
12443
|
policy2.addStatement(queue2.permissions);
|
|
12433
12444
|
});
|
|
@@ -12437,7 +12448,7 @@ var queueFeature = defineFeature({
|
|
|
12437
12448
|
|
|
12438
12449
|
// src/feature/rest/index.ts
|
|
12439
12450
|
import { aws as aws15, Node as Node14 } from "@awsless/formation";
|
|
12440
|
-
import { constantCase as
|
|
12451
|
+
import { constantCase as constantCase9 } from "change-case";
|
|
12441
12452
|
var restFeature = defineFeature({
|
|
12442
12453
|
name: "rest",
|
|
12443
12454
|
onApp(ctx) {
|
|
@@ -12485,7 +12496,7 @@ var restFeature = defineFeature({
|
|
|
12485
12496
|
}
|
|
12486
12497
|
});
|
|
12487
12498
|
record.dependsOn(domain, mapping);
|
|
12488
|
-
ctx.bind(`REST_${
|
|
12499
|
+
ctx.bind(`REST_${constantCase9(id)}_ENDPOINT`, domainName);
|
|
12489
12500
|
} else {
|
|
12490
12501
|
}
|
|
12491
12502
|
}
|
|
@@ -12528,7 +12539,7 @@ var restFeature = defineFeature({
|
|
|
12528
12539
|
});
|
|
12529
12540
|
|
|
12530
12541
|
// src/feature/rpc/index.ts
|
|
12531
|
-
import { camelCase as camelCase6, constantCase as
|
|
12542
|
+
import { camelCase as camelCase6, constantCase as constantCase10, paramCase as paramCase6 } from "change-case";
|
|
12532
12543
|
import { Asset as Asset5, aws as aws17, Node as Node16, Output as Output3 } from "@awsless/formation";
|
|
12533
12544
|
import { mebibytes as mebibytes2 } from "@awsless/size";
|
|
12534
12545
|
import { dirname as dirname10, join as join9, relative as relative5 } from "path";
|
|
@@ -12812,9 +12823,9 @@ var rpcFeature = defineFeature({
|
|
|
12812
12823
|
name: fullDomainName,
|
|
12813
12824
|
alias: cdn.aliasTarget
|
|
12814
12825
|
});
|
|
12815
|
-
ctx.bind(`RPC_${
|
|
12826
|
+
ctx.bind(`RPC_${constantCase10(id)}_ENDPOINT`, fullDomainName);
|
|
12816
12827
|
} else {
|
|
12817
|
-
ctx.bind(`RPC_${
|
|
12828
|
+
ctx.bind(`RPC_${constantCase10(id)}_ENDPOINT`, cdn.aliasTarget.dnsName);
|
|
12818
12829
|
}
|
|
12819
12830
|
}
|
|
12820
12831
|
},
|
|
@@ -12841,7 +12852,7 @@ var rpcFeature = defineFeature({
|
|
|
12841
12852
|
|
|
12842
12853
|
// src/feature/search/index.ts
|
|
12843
12854
|
import { aws as aws18, Node as Node17 } from "@awsless/formation";
|
|
12844
|
-
import { constantCase as
|
|
12855
|
+
import { constantCase as constantCase11 } from "change-case";
|
|
12845
12856
|
var typeGenCode4 = `
|
|
12846
12857
|
import { AnyStruct, Table } from '@awsless/open-search'
|
|
12847
12858
|
|
|
@@ -12897,7 +12908,7 @@ var searchFeature = defineFeature({
|
|
|
12897
12908
|
]
|
|
12898
12909
|
});
|
|
12899
12910
|
}
|
|
12900
|
-
ctx.addEnv(`SEARCH_${
|
|
12911
|
+
ctx.addEnv(`SEARCH_${constantCase11(ctx.stack.name)}_${constantCase11(id)}_DOMAIN`, openSearch.domainEndpoint);
|
|
12901
12912
|
ctx.onStackPolicy((policy) => {
|
|
12902
12913
|
policy.addStatement({
|
|
12903
12914
|
actions: ["es:ESHttp*"],
|
|
@@ -12935,7 +12946,7 @@ var getContentType = (file) => {
|
|
|
12935
12946
|
};
|
|
12936
12947
|
|
|
12937
12948
|
// src/feature/site/index.ts
|
|
12938
|
-
import { constantCase as
|
|
12949
|
+
import { constantCase as constantCase12 } from "change-case";
|
|
12939
12950
|
var siteFeature = defineFeature({
|
|
12940
12951
|
name: "site",
|
|
12941
12952
|
onStack(ctx) {
|
|
@@ -13134,7 +13145,7 @@ var siteFeature = defineFeature({
|
|
|
13134
13145
|
});
|
|
13135
13146
|
}
|
|
13136
13147
|
ctx.bind(
|
|
13137
|
-
`SITE_${
|
|
13148
|
+
`SITE_${constantCase12(ctx.stack.name)}_${constantCase12(id)}_ENDPOINT`,
|
|
13138
13149
|
domainName ? domainName : distribution.domainName
|
|
13139
13150
|
);
|
|
13140
13151
|
}
|
|
@@ -13272,7 +13283,7 @@ var storeFeature = defineFeature({
|
|
|
13272
13283
|
|
|
13273
13284
|
// src/feature/stream/index.ts
|
|
13274
13285
|
import { aws as aws21, Node as Node20 } from "@awsless/formation";
|
|
13275
|
-
import { constantCase as
|
|
13286
|
+
import { constantCase as constantCase13 } from "change-case";
|
|
13276
13287
|
var streamFeature = defineFeature({
|
|
13277
13288
|
name: "stream",
|
|
13278
13289
|
onStack(ctx) {
|
|
@@ -13291,7 +13302,7 @@ var streamFeature = defineFeature({
|
|
|
13291
13302
|
const streamKey = new aws21.ivs.StreamKey(group, "key", {
|
|
13292
13303
|
channel: channel.arn
|
|
13293
13304
|
});
|
|
13294
|
-
const prefix = `STREAM_${
|
|
13305
|
+
const prefix = `STREAM_${constantCase13(ctx.stack.name)}_${constantCase13(id)}`;
|
|
13295
13306
|
ctx.bind(`${prefix}_ENDPOINT`, channel.playbackUrl);
|
|
13296
13307
|
ctx.addEnv(`${prefix}_INGEST_ENDPOINT`, channel.ingestEndpoint);
|
|
13297
13308
|
ctx.addEnv(`${prefix}_STREAM_KEY`, streamKey.value);
|
|
Binary file
|
package/dist/server.js
CHANGED
|
@@ -319,7 +319,12 @@ var IS_TEST = process.env.NODE_ENV === "test";
|
|
|
319
319
|
var CONFIGS = process.env.CONFIG;
|
|
320
320
|
var loadConfigData = /* @__NO_SIDE_EFFECTS__ */ async () => {
|
|
321
321
|
if (!IS_TEST && CONFIGS) {
|
|
322
|
-
const keys =
|
|
322
|
+
const keys = [];
|
|
323
|
+
for (const key of Object.keys(process.env)) {
|
|
324
|
+
if (key.startsWith("CONFIG_")) {
|
|
325
|
+
keys.push(process.env[key]);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
323
328
|
if (keys.length > 0) {
|
|
324
329
|
const paths = {};
|
|
325
330
|
for (const key of keys) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.397",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@awsless/iot": "^0.0.2",
|
|
32
32
|
"@awsless/lambda": "^0.0.27",
|
|
33
|
-
"@awsless/open-search": "^0.0.15",
|
|
34
|
-
"@awsless/mqtt": "^0.0.2",
|
|
35
|
-
"@awsless/s3": "^0.0.18",
|
|
36
33
|
"@awsless/redis": "^0.0.13",
|
|
37
|
-
"@awsless/
|
|
38
|
-
"@awsless/
|
|
34
|
+
"@awsless/mqtt": "^0.0.2",
|
|
35
|
+
"@awsless/sns": "^0.0.7",
|
|
39
36
|
"@awsless/sqs": "^0.0.7",
|
|
37
|
+
"@awsless/validate": "^0.0.16",
|
|
40
38
|
"@awsless/ssm": "^0.0.7",
|
|
41
|
-
"@awsless/
|
|
39
|
+
"@awsless/s3": "^0.0.18",
|
|
40
|
+
"@awsless/weak-cache": "^0.0.1",
|
|
41
|
+
"@awsless/open-search": "^0.0.15"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -115,10 +115,10 @@
|
|
|
115
115
|
"@awsless/code": "^0.0.10",
|
|
116
116
|
"@awsless/duration": "^0.0.1",
|
|
117
117
|
"@awsless/formation": "^0.0.57",
|
|
118
|
-
"@awsless/ts-file-cache": "^0.0.10",
|
|
119
|
-
"@awsless/graphql": "^0.0.9",
|
|
120
118
|
"@awsless/size": "^0.0.1",
|
|
121
|
-
"@awsless/validate": "^0.0.
|
|
119
|
+
"@awsless/validate": "^0.0.16",
|
|
120
|
+
"@awsless/graphql": "^0.0.9",
|
|
121
|
+
"@awsless/ts-file-cache": "^0.0.10"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
124
|
"@node-rs/bcrypt": "^1.10.5"
|