@awsless/awsless 0.0.252 → 0.0.253
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 +35 -39
- package/package.json +7 -7
package/dist/bin.js
CHANGED
|
@@ -1687,6 +1687,7 @@ var bootstrap = (program2) => {
|
|
|
1687
1687
|
import { App, Stack } from "@awsless/formation";
|
|
1688
1688
|
|
|
1689
1689
|
// src/feature/auth/index.ts
|
|
1690
|
+
import { aws as aws2, Node as Node2 } from "@awsless/formation";
|
|
1690
1691
|
import { constantCase as constantCase2 } from "change-case";
|
|
1691
1692
|
|
|
1692
1693
|
// src/feature.ts
|
|
@@ -1819,9 +1820,6 @@ var formatLocalResourceName = (appName, stackName, ns, id, seperator = "--") =>
|
|
|
1819
1820
|
].map((v) => paramCase3(v)).join(seperator);
|
|
1820
1821
|
};
|
|
1821
1822
|
|
|
1822
|
-
// src/feature/auth/index.ts
|
|
1823
|
-
import { Node as Node2, aws as aws2 } from "@awsless/formation";
|
|
1824
|
-
|
|
1825
1823
|
// src/feature/function/util.ts
|
|
1826
1824
|
import { Asset, aws } from "@awsless/formation";
|
|
1827
1825
|
import deepmerge from "deepmerge";
|
|
@@ -2791,29 +2789,12 @@ var functionFeature = defineFeature({
|
|
|
2791
2789
|
|
|
2792
2790
|
// src/feature/graphql/index.ts
|
|
2793
2791
|
import { constantCase as constantCase4, paramCase as paramCase5 } from "change-case";
|
|
2794
|
-
import { mergeTypeDefs } from "@graphql-tools/merge";
|
|
2795
2792
|
import { generate } from "@awsless/graphql";
|
|
2796
|
-
import {
|
|
2793
|
+
import { mergeTypeDefs } from "@graphql-tools/merge";
|
|
2797
2794
|
import { readFile as readFile5 } from "fs/promises";
|
|
2798
|
-
import {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
var getDomainNameById = (config2, id) => {
|
|
2802
|
-
const domains = config2.defaults.domains ?? {};
|
|
2803
|
-
if (id in domains) {
|
|
2804
|
-
if (domains[id]) {
|
|
2805
|
-
return domains[id].domain;
|
|
2806
|
-
}
|
|
2807
|
-
}
|
|
2808
|
-
throw new TypeError(`No domain registered with id: ${id}`);
|
|
2809
|
-
};
|
|
2810
|
-
var formatFullDomainName = (config2, id, subDomain) => {
|
|
2811
|
-
const domain = getDomainNameById(config2, id);
|
|
2812
|
-
if (subDomain) {
|
|
2813
|
-
return `${subDomain.replace(/\.$/, "")}.${domain}`;
|
|
2814
|
-
}
|
|
2815
|
-
return domain;
|
|
2816
|
-
};
|
|
2795
|
+
import { buildSchema, print } from "graphql";
|
|
2796
|
+
import { Asset as Asset2, aws as aws7, Node as Node7 } from "@awsless/formation";
|
|
2797
|
+
import { createHash as createHash5 } from "crypto";
|
|
2817
2798
|
|
|
2818
2799
|
// src/build/fingerprint.ts
|
|
2819
2800
|
import { createHash as createHash3 } from "crypto";
|
|
@@ -2883,6 +2864,30 @@ var findDependencies2 = async (file, code) => {
|
|
|
2883
2864
|
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join7(dirname7(file), value) : value);
|
|
2884
2865
|
};
|
|
2885
2866
|
|
|
2867
|
+
// src/util/id.ts
|
|
2868
|
+
import { createHash as createHash4 } from "crypto";
|
|
2869
|
+
var shortId = (ns) => {
|
|
2870
|
+
return createHash4("md5").update(ns).digest("hex").substring(0, 10);
|
|
2871
|
+
};
|
|
2872
|
+
|
|
2873
|
+
// src/feature/domain/util.ts
|
|
2874
|
+
var getDomainNameById = (config2, id) => {
|
|
2875
|
+
const domains = config2.defaults.domains ?? {};
|
|
2876
|
+
if (id in domains) {
|
|
2877
|
+
if (domains[id]) {
|
|
2878
|
+
return domains[id].domain;
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
throw new TypeError(`No domain registered with id: ${id}`);
|
|
2882
|
+
};
|
|
2883
|
+
var formatFullDomainName = (config2, id, subDomain) => {
|
|
2884
|
+
const domain = getDomainNameById(config2, id);
|
|
2885
|
+
if (subDomain) {
|
|
2886
|
+
return `${subDomain.replace(/\.$/, "")}.${domain}`;
|
|
2887
|
+
}
|
|
2888
|
+
return domain;
|
|
2889
|
+
};
|
|
2890
|
+
|
|
2886
2891
|
// src/feature/graphql/build/typescript/resolver.ts
|
|
2887
2892
|
import { rollup as rollup2 } from "rollup";
|
|
2888
2893
|
import { swc as swc2, minify as swcMinify2 } from "rollup-plugin-swc3";
|
|
@@ -2943,15 +2948,6 @@ var buildTypeScriptResolver = async (input, { minify = true } = {}) => {
|
|
|
2943
2948
|
return Buffer.from(code, "utf8");
|
|
2944
2949
|
};
|
|
2945
2950
|
|
|
2946
|
-
// src/feature/graphql/index.ts
|
|
2947
|
-
import { createHash as createHash5 } from "crypto";
|
|
2948
|
-
|
|
2949
|
-
// src/util/id.ts
|
|
2950
|
-
import { createHash as createHash4 } from "crypto";
|
|
2951
|
-
var shortId = (ns) => {
|
|
2952
|
-
return createHash4("md5").update(ns).digest("hex").substring(0, 10);
|
|
2953
|
-
};
|
|
2954
|
-
|
|
2955
2951
|
// src/feature/graphql/index.ts
|
|
2956
2952
|
var defaultResolver = `
|
|
2957
2953
|
export function request(ctx) {
|
|
@@ -3131,6 +3127,8 @@ var graphqlFeature = defineFeature({
|
|
|
3131
3127
|
}
|
|
3132
3128
|
});
|
|
3133
3129
|
ctx.bindEnv(`GRAPHQL_${constantCase4(id)}_ENDPOINT`, domainName);
|
|
3130
|
+
} else {
|
|
3131
|
+
ctx.bindEnv(`GRAPHQL_${constantCase4(id)}_ENDPOINT`, api.graphql.uri);
|
|
3134
3132
|
}
|
|
3135
3133
|
}
|
|
3136
3134
|
},
|
|
@@ -3138,10 +3136,7 @@ var graphqlFeature = defineFeature({
|
|
|
3138
3136
|
for (const [id, props] of Object.entries(ctx.stackConfig.graphql ?? {})) {
|
|
3139
3137
|
const defaultProps = ctx.appConfig.defaults.graphql?.[id];
|
|
3140
3138
|
if (!defaultProps) {
|
|
3141
|
-
throw new FileError(
|
|
3142
|
-
ctx.stackConfig.file,
|
|
3143
|
-
`GraphQL definition is not defined on app level for "${id}"`
|
|
3144
|
-
);
|
|
3139
|
+
throw new FileError(ctx.stackConfig.file, `GraphQL definition is not defined on app level for "${id}"`);
|
|
3145
3140
|
}
|
|
3146
3141
|
const group = new Node7(ctx.stack, "graphql", id);
|
|
3147
3142
|
const apiId = ctx.shared.get(`graphql-${id}-id`);
|
|
@@ -3201,7 +3196,7 @@ var graphqlFeature = defineFeature({
|
|
|
3201
3196
|
});
|
|
3202
3197
|
|
|
3203
3198
|
// src/feature/http/index.ts
|
|
3204
|
-
import {
|
|
3199
|
+
import { aws as aws8, Node as Node8 } from "@awsless/formation";
|
|
3205
3200
|
import { camelCase as camelCase4, constantCase as constantCase5 } from "change-case";
|
|
3206
3201
|
import { relative as relative2 } from "path";
|
|
3207
3202
|
var parseRoute = (route) => {
|
|
@@ -3529,7 +3524,7 @@ var queueFeature = defineFeature({
|
|
|
3529
3524
|
});
|
|
3530
3525
|
|
|
3531
3526
|
// src/feature/rest/index.ts
|
|
3532
|
-
import {
|
|
3527
|
+
import { aws as aws12, Node as Node12 } from "@awsless/formation";
|
|
3533
3528
|
import { constantCase as constantCase7 } from "change-case";
|
|
3534
3529
|
var restFeature = defineFeature({
|
|
3535
3530
|
name: "rest",
|
|
@@ -3574,6 +3569,7 @@ var restFeature = defineFeature({
|
|
|
3574
3569
|
});
|
|
3575
3570
|
record.dependsOn(domain, mapping);
|
|
3576
3571
|
ctx.bindEnv(`REST_${constantCase7(id)}_ENDPOINT`, domainName);
|
|
3572
|
+
} else {
|
|
3577
3573
|
}
|
|
3578
3574
|
}
|
|
3579
3575
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.253",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@awsless/lambda": "^0.0.19",
|
|
32
31
|
"@awsless/redis": "^0.0.12",
|
|
33
32
|
"@awsless/open-search": "^0.0.12",
|
|
33
|
+
"@awsless/lambda": "^0.0.19",
|
|
34
34
|
"@awsless/s3": "^0.0.10",
|
|
35
|
-
"@awsless/validate": "^0.0.14",
|
|
36
35
|
"@awsless/sns": "^0.0.7",
|
|
37
|
-
"@awsless/weak-cache": "^0.0.1",
|
|
38
36
|
"@awsless/sqs": "^0.0.7",
|
|
39
|
-
"@awsless/ssm": "^0.0.7"
|
|
37
|
+
"@awsless/ssm": "^0.0.7",
|
|
38
|
+
"@awsless/validate": "^0.0.14",
|
|
39
|
+
"@awsless/weak-cache": "^0.0.1"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@aws-appsync/utils": "^1.5.0",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"zod-to-json-schema": "^3.22.3",
|
|
101
101
|
"@awsless/duration": "^0.0.1",
|
|
102
102
|
"@awsless/formation": "^0.0.28",
|
|
103
|
-
"@awsless/validate": "^0.0.14",
|
|
104
103
|
"@awsless/size": "^0.0.1",
|
|
105
104
|
"@awsless/graphql": "^0.0.9",
|
|
106
|
-
"@awsless/code": "^0.0.10"
|
|
105
|
+
"@awsless/code": "^0.0.10",
|
|
106
|
+
"@awsless/validate": "^0.0.14"
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
109
|
"test": "pnpm code test",
|