@geekmidas/cloud 1.0.1 → 1.1.1
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/README.md +125 -0
- package/package.json +18 -5
- package/src/sst/Api.ts +309 -0
- package/src/sst/App.ts +80 -0
- package/src/sst/Cron.ts +113 -0
- package/src/sst/Function.ts +128 -0
- package/src/sst/Linkable.ts +19 -0
- package/src/sst/LinkedEnvironment.ts +61 -0
- package/src/sst/Queue.ts +46 -0
- package/src/sst/Stack.ts +55 -0
- package/src/sst/Storage.ts +55 -0
- package/src/sst/Topic.ts +37 -0
- package/src/sst/__tests__/LinkedEnvironment.spec.ts +79 -0
- package/src/sst/__type-tests__/authorizers.type-test.ts +72 -0
- package/src/sst/__type-tests__/manifest.type-test.ts +77 -0
- package/src/sst/__type-tests__/messaging.type-test.ts +29 -0
- package/src/sst/__type-tests__/storage.type-test.ts +24 -0
- package/src/sst/index.ts +23 -0
- package/src/sst/naming.ts +23 -0
- package/src/sst/tsconfig.json +5 -0
- package/CHANGELOG.md +0 -13
- package/src/__tests__/utils.spec.ts +0 -256
- package/src/index.ts +0 -1
- package/src/utils/index.ts +0 -158
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -3
package/src/sst/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Api,
|
|
3
|
+
type ApiAuthorizers,
|
|
4
|
+
type ApiProps,
|
|
5
|
+
type AuthorizerName,
|
|
6
|
+
type JwtAuthorizer,
|
|
7
|
+
type LambdaAuthorizer,
|
|
8
|
+
type Route,
|
|
9
|
+
} from './Api';
|
|
10
|
+
export { App, type AppProps, type StageValues } from './App';
|
|
11
|
+
export {
|
|
12
|
+
Cron,
|
|
13
|
+
type CronExpression,
|
|
14
|
+
type CronProps,
|
|
15
|
+
type CronRate,
|
|
16
|
+
type CronSchedule,
|
|
17
|
+
} from './Cron';
|
|
18
|
+
export { Function, type FunctionProps } from './Function';
|
|
19
|
+
export { type GkmLinkable, ResourceType } from './Linkable';
|
|
20
|
+
export { Queue, type QueueProps } from './Queue';
|
|
21
|
+
export { Stack, type StackType } from './Stack';
|
|
22
|
+
export { Storage, type StorageProps } from './Storage';
|
|
23
|
+
export { Topic, type TopicProps } from './Topic';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kebab-cases an identifier: `userName` → `user-name`, `my_handler` →
|
|
3
|
+
* `my-handler`, and acronym-aware (`APIKey` → `api-key`, `XMLParser` →
|
|
4
|
+
* `xml-parser`).
|
|
5
|
+
*/
|
|
6
|
+
export function kebab(value: string): string {
|
|
7
|
+
return value
|
|
8
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
|
|
9
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
10
|
+
.replace(/[\s_]+/g, '-')
|
|
11
|
+
.toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Builds a kebab-cased, prefixed physical resource name. The `prefix` parts
|
|
16
|
+
* (e.g. `[stage, name]`) are joined and lower-cased; if `resource` already
|
|
17
|
+
* starts with that prefix it is returned as-is (kebab-cased) to avoid doubling.
|
|
18
|
+
*/
|
|
19
|
+
export function prefixedName(prefix: string[], resource: string): string {
|
|
20
|
+
const joined = prefix.join('-').toLowerCase();
|
|
21
|
+
const name = kebab(resource);
|
|
22
|
+
return name.startsWith(joined) ? name : `${joined}-${name}`;
|
|
23
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "Project config for the source-only `src/sst` constructs. It lives here (not at the package root) so editors pick it as the NEAREST tsconfig for these files and resolve the ambient `sst`/`aws`/`$util` globals from `.sst/platform` plus node's `process` — the package's main tsconfig.json excludes `src/sst`. Compiler options are shared via `../../tsconfig.sst.json`; this file only adds the file set. Run via `pnpm --filter @geekmidas/cloud ts:check:sst` after `sst install`.",
|
|
3
|
+
"extends": "../../tsconfig.sst.json",
|
|
4
|
+
"include": ["**/*", "../../.sst/platform/config.d.ts"]
|
|
5
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# @geekmidas/cloud
|
|
2
|
-
|
|
3
|
-
## 1.0.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- 🐛 [`d70c6c0`](https://github.com/geekmidas/toolbox/commit/d70c6c0aeb8a79da2473ac77dbd8255a4a2f5651) Thanks [@geekmidas](https://github.com/geekmidas)! - Fix `package.json` exports so TypeScript declarations resolve correctly under NodeNext/Bundler module resolution. Each subpath export now nests `types` inside its `import`/`require` condition, pointing at the `.d.mts` and `.d.cts` files that `tsdown` actually emits (previously the exports referenced non-existent `.d.ts` files, causing type-resolution failures for consumers). Both ESM (`.mjs`) and CJS (`.cjs`) runtime entry points are preserved. Additionally, `@geekmidas/ui` had `import` paths pointing at `.js` files that were never emitted — those are corrected to `.mjs`.
|
|
8
|
-
|
|
9
|
-
## 1.0.0
|
|
10
|
-
|
|
11
|
-
### Major Changes
|
|
12
|
-
|
|
13
|
-
- [`ff7b115`](https://github.com/geekmidas/toolbox/commit/ff7b11599f60f84ac6cdc73714c853ecf786b2e8) Thanks [@geekmidas](https://github.com/geekmidas)! - Version 1 Stable release
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
buildResourceEnv,
|
|
4
|
-
environmentCase,
|
|
5
|
-
getLocalIpAddress,
|
|
6
|
-
ResourceType,
|
|
7
|
-
} from '../utils';
|
|
8
|
-
|
|
9
|
-
describe('getLocalIpAddress', () => {
|
|
10
|
-
it('should return a valid IPv4 address or null', () => {
|
|
11
|
-
const ip = getLocalIpAddress();
|
|
12
|
-
|
|
13
|
-
if (ip !== null) {
|
|
14
|
-
// Should be a valid IPv4 format
|
|
15
|
-
const parts = ip.split('.');
|
|
16
|
-
expect(parts).toHaveLength(4);
|
|
17
|
-
for (const part of parts) {
|
|
18
|
-
const num = Number.parseInt(part, 10);
|
|
19
|
-
expect(num).toBeGreaterThanOrEqual(0);
|
|
20
|
-
expect(num).toBeLessThanOrEqual(255);
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
expect(ip).toBeNull();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should not return loopback address', () => {
|
|
28
|
-
const ip = getLocalIpAddress();
|
|
29
|
-
|
|
30
|
-
if (ip !== null) {
|
|
31
|
-
expect(ip).not.toBe('127.0.0.1');
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('environmentCase', () => {
|
|
37
|
-
it('should convert camelCase to SNAKE_CASE', () => {
|
|
38
|
-
expect(environmentCase('databaseUrl')).toBe('DATABASE_URL');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should convert PascalCase to SNAKE_CASE', () => {
|
|
42
|
-
expect(environmentCase('DatabaseUrl')).toBe('DATABASE_URL');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('should convert kebab-case to SNAKE_CASE', () => {
|
|
46
|
-
expect(environmentCase('database-url')).toBe('DATABASE_URL');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should handle single word', () => {
|
|
50
|
-
expect(environmentCase('database')).toBe('DATABASE');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should handle numbers without underscore prefix', () => {
|
|
54
|
-
expect(environmentCase('api2Endpoint')).toBe('API2_ENDPOINT');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('should handle multiple numbers', () => {
|
|
58
|
-
expect(environmentCase('value1And2')).toBe('VALUE1_AND2');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should handle already uppercase', () => {
|
|
62
|
-
expect(environmentCase('DATABASE')).toBe('DATABASE');
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('buildResourceEnv', () => {
|
|
67
|
-
it('should handle string values', () => {
|
|
68
|
-
const result = buildResourceEnv({
|
|
69
|
-
databaseUrl: 'postgres://localhost/db',
|
|
70
|
-
apiKey: 'secret-key',
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
expect(result).toEqual({
|
|
74
|
-
DATABASE_URL: 'postgres://localhost/db',
|
|
75
|
-
API_KEY: 'secret-key',
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should handle Secret resource type', () => {
|
|
80
|
-
const result = buildResourceEnv({
|
|
81
|
-
mySecret: {
|
|
82
|
-
type: ResourceType.Secret,
|
|
83
|
-
value: 'secret-value',
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
expect(result).toEqual({
|
|
88
|
-
MY_SECRET: 'secret-value',
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('should handle SSTSecret resource type', () => {
|
|
93
|
-
const result = buildResourceEnv({
|
|
94
|
-
apiToken: {
|
|
95
|
-
type: ResourceType.SSTSecret,
|
|
96
|
-
value: 'token-value',
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
expect(result).toEqual({
|
|
101
|
-
API_TOKEN: 'token-value',
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('should handle Postgres resource type', () => {
|
|
106
|
-
const result = buildResourceEnv({
|
|
107
|
-
database: {
|
|
108
|
-
type: ResourceType.Postgres,
|
|
109
|
-
database: 'mydb',
|
|
110
|
-
host: 'localhost',
|
|
111
|
-
password: 'secret',
|
|
112
|
-
port: 5432,
|
|
113
|
-
username: 'user',
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
expect(result).toEqual({
|
|
118
|
-
DATABASE_NAME: 'mydb',
|
|
119
|
-
DATABASE_HOST: 'localhost',
|
|
120
|
-
DATABASE_PASSWORD: 'secret',
|
|
121
|
-
DATABASE_PORT: 5432,
|
|
122
|
-
DATABASE_USERNAME: 'user',
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should handle SSTPostgres resource type', () => {
|
|
127
|
-
const result = buildResourceEnv({
|
|
128
|
-
db: {
|
|
129
|
-
type: ResourceType.SSTPostgres,
|
|
130
|
-
database: 'testdb',
|
|
131
|
-
host: 'db.example.com',
|
|
132
|
-
password: 'pass123',
|
|
133
|
-
port: 5432,
|
|
134
|
-
username: 'admin',
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
expect(result).toEqual({
|
|
139
|
-
DB_NAME: 'testdb',
|
|
140
|
-
DB_HOST: 'db.example.com',
|
|
141
|
-
DB_PASSWORD: 'pass123',
|
|
142
|
-
DB_PORT: 5432,
|
|
143
|
-
DB_USERNAME: 'admin',
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it('should handle Bucket resource type', () => {
|
|
148
|
-
const result = buildResourceEnv({
|
|
149
|
-
uploads: {
|
|
150
|
-
type: ResourceType.Bucket,
|
|
151
|
-
name: 'my-uploads-bucket',
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
expect(result).toEqual({
|
|
156
|
-
UPLOADS_NAME: 'my-uploads-bucket',
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('should handle SSTBucket resource type', () => {
|
|
161
|
-
const result = buildResourceEnv({
|
|
162
|
-
assets: {
|
|
163
|
-
type: ResourceType.SSTBucket,
|
|
164
|
-
name: 'assets-bucket',
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
expect(result).toEqual({
|
|
169
|
-
ASSETS_NAME: 'assets-bucket',
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('should handle SnsTopic resource type', () => {
|
|
174
|
-
const result = buildResourceEnv({
|
|
175
|
-
notifications: {
|
|
176
|
-
type: ResourceType.SnsTopic,
|
|
177
|
-
arn: 'arn:aws:sns:us-east-1:123456789:my-topic',
|
|
178
|
-
},
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
expect(result).toEqual({
|
|
182
|
-
NOTIFICATIONS_ARN: 'arn:aws:sns:us-east-1:123456789:my-topic',
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it('should ignore ApiGatewayV2 resource type', () => {
|
|
187
|
-
const result = buildResourceEnv({
|
|
188
|
-
api: {
|
|
189
|
-
type: ResourceType.ApiGatewayV2,
|
|
190
|
-
url: 'https://api.example.com',
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
expect(result).toEqual({});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it('should ignore Function resource type', () => {
|
|
198
|
-
const result = buildResourceEnv({
|
|
199
|
-
handler: {
|
|
200
|
-
type: ResourceType.Function,
|
|
201
|
-
name: 'my-function',
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
expect(result).toEqual({});
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
it('should ignore Vpc resource type', () => {
|
|
209
|
-
const result = buildResourceEnv({
|
|
210
|
-
network: {
|
|
211
|
-
type: ResourceType.Vpc,
|
|
212
|
-
bastion: 'bastion-host',
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
expect(result).toEqual({});
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('should handle mixed resources', () => {
|
|
220
|
-
const result = buildResourceEnv({
|
|
221
|
-
directValue: 'direct-string',
|
|
222
|
-
secret: {
|
|
223
|
-
type: ResourceType.Secret,
|
|
224
|
-
value: 'secret-val',
|
|
225
|
-
},
|
|
226
|
-
database: {
|
|
227
|
-
type: ResourceType.Postgres,
|
|
228
|
-
database: 'app',
|
|
229
|
-
host: 'localhost',
|
|
230
|
-
password: 'pass',
|
|
231
|
-
port: 5432,
|
|
232
|
-
username: 'user',
|
|
233
|
-
},
|
|
234
|
-
bucket: {
|
|
235
|
-
type: ResourceType.Bucket,
|
|
236
|
-
name: 'my-bucket',
|
|
237
|
-
},
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
expect(result).toEqual({
|
|
241
|
-
DIRECT_VALUE: 'direct-string',
|
|
242
|
-
SECRET: 'secret-val',
|
|
243
|
-
DATABASE_NAME: 'app',
|
|
244
|
-
DATABASE_HOST: 'localhost',
|
|
245
|
-
DATABASE_PASSWORD: 'pass',
|
|
246
|
-
DATABASE_PORT: 5432,
|
|
247
|
-
DATABASE_USERNAME: 'user',
|
|
248
|
-
BUCKET_NAME: 'my-bucket',
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
it('should return empty object for empty input', () => {
|
|
253
|
-
const result = buildResourceEnv({});
|
|
254
|
-
expect(result).toEqual({});
|
|
255
|
-
});
|
|
256
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { buildResourceEnv } from './utils';
|
package/src/utils/index.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import os from 'node:os';
|
|
2
|
-
import snakecase from 'lodash.snakecase';
|
|
3
|
-
|
|
4
|
-
export function getLocalIpAddress() {
|
|
5
|
-
const networkInterfaces = os.networkInterfaces();
|
|
6
|
-
for (const interfaceName in networkInterfaces) {
|
|
7
|
-
const addresses = networkInterfaces[interfaceName] || [];
|
|
8
|
-
for (const addressInfo of addresses) {
|
|
9
|
-
// Look for an IPv4 address that is not internal (loopback)
|
|
10
|
-
if (addressInfo.family === 'IPv4' && !addressInfo.internal) {
|
|
11
|
-
return addressInfo.address;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return null; // No suitable IP address found
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function environmentCase(name: string) {
|
|
19
|
-
return snakecase(name)
|
|
20
|
-
.toUpperCase()
|
|
21
|
-
.replace(/_\d+/g, (r) => {
|
|
22
|
-
return r.replace('_', '');
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export enum ResourceType {
|
|
26
|
-
ApiGatewayV2 = 'sst.aws.ApiGatewayV2',
|
|
27
|
-
Postgres = 'sst.aws.Postgres',
|
|
28
|
-
Function = 'sst.aws.Function',
|
|
29
|
-
Bucket = 'sst.aws.Bucket',
|
|
30
|
-
Vpc = 'sst.aws.Vpc',
|
|
31
|
-
Secret = 'sst.sst.Secret',
|
|
32
|
-
SSTSecret = 'sst:sst:Secret',
|
|
33
|
-
SSTFunction = 'sst:sst:Function',
|
|
34
|
-
SSTApiGatewayV2 = 'sst:aws:ApiGatewayV2',
|
|
35
|
-
SSTPostgres = 'sst:aws:Postgres',
|
|
36
|
-
SSTBucket = 'sst:aws:Bucket',
|
|
37
|
-
SnsTopic = 'sst:aws:SnsTopic',
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const secret = (name: string, value: Secret) => ({
|
|
41
|
-
[environmentCase(name)]: value.value,
|
|
42
|
-
});
|
|
43
|
-
const postgres = (key: string, value: Postgres) => {
|
|
44
|
-
const prefix = `${environmentCase(key)}`;
|
|
45
|
-
return {
|
|
46
|
-
[`${prefix}_NAME`]: value.database,
|
|
47
|
-
[`${prefix}_HOST`]: value.host,
|
|
48
|
-
[`${prefix}_PASSWORD`]: value.password,
|
|
49
|
-
[`${prefix}_PORT`]: value.port,
|
|
50
|
-
[`${prefix}_USERNAME`]: value.username,
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const bucket = (name: string, value: Bucket) => {
|
|
55
|
-
const prefix = `${environmentCase(name)}`;
|
|
56
|
-
return {
|
|
57
|
-
[`${prefix}_NAME`]: value.name,
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const topic = (name: string, value: SnsTopic) => {
|
|
62
|
-
const prefix = `${environmentCase(name)}`;
|
|
63
|
-
const key = `${prefix}_ARN`;
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
[key]: value.arn,
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const noop = (_name: string, _value: any) => ({});
|
|
71
|
-
|
|
72
|
-
const processors: Record<ResourceType, ResourceProcessor<any>> = {
|
|
73
|
-
[ResourceType.ApiGatewayV2]: noop,
|
|
74
|
-
[ResourceType.Function]: noop,
|
|
75
|
-
[ResourceType.Vpc]: noop,
|
|
76
|
-
[ResourceType.Secret]: secret,
|
|
77
|
-
[ResourceType.Postgres]: postgres,
|
|
78
|
-
[ResourceType.Bucket]: bucket,
|
|
79
|
-
|
|
80
|
-
[ResourceType.SSTSecret]: secret,
|
|
81
|
-
[ResourceType.SSTBucket]: bucket,
|
|
82
|
-
[ResourceType.SSTFunction]: noop,
|
|
83
|
-
[ResourceType.SSTPostgres]: postgres,
|
|
84
|
-
[ResourceType.SSTApiGatewayV2]: noop,
|
|
85
|
-
[ResourceType.SnsTopic]: topic,
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export function buildResourceEnv(
|
|
89
|
-
record: Record<string, Resource | string>,
|
|
90
|
-
): Record<string, string> {
|
|
91
|
-
const env: Record<string, string> = {};
|
|
92
|
-
for (const [k, value] of Object.entries(record)) {
|
|
93
|
-
if (typeof value === 'string') {
|
|
94
|
-
env[environmentCase(k)] = value;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const processor = processors[value.type];
|
|
99
|
-
if (processor) {
|
|
100
|
-
Object.assign(env, processor(k, value));
|
|
101
|
-
} else {
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return env;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type ApiGatewayV2 = {
|
|
109
|
-
type: ResourceType.ApiGatewayV2;
|
|
110
|
-
url: string;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export type Postgres = {
|
|
114
|
-
database: string;
|
|
115
|
-
host: string;
|
|
116
|
-
password: string;
|
|
117
|
-
port: number;
|
|
118
|
-
type: ResourceType.Postgres;
|
|
119
|
-
username: string;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export type Function = {
|
|
123
|
-
name: string;
|
|
124
|
-
type: ResourceType.Function;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export type Bucket = {
|
|
128
|
-
name: string;
|
|
129
|
-
type: ResourceType.Bucket;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export type SnsTopic = {
|
|
133
|
-
arn: string;
|
|
134
|
-
type: ResourceType.SnsTopic;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export type Vpc = {
|
|
138
|
-
bastion: string;
|
|
139
|
-
type: ResourceType.Vpc;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export type Secret = {
|
|
143
|
-
type: ResourceType.Secret;
|
|
144
|
-
value: string;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export type Resource =
|
|
148
|
-
| ApiGatewayV2
|
|
149
|
-
| Postgres
|
|
150
|
-
| Function
|
|
151
|
-
| Bucket
|
|
152
|
-
| Vpc
|
|
153
|
-
| Secret;
|
|
154
|
-
|
|
155
|
-
export type ResourceProcessor<K extends Resource> = (
|
|
156
|
-
name: string,
|
|
157
|
-
value: K,
|
|
158
|
-
) => Record<string, string | number>;
|
package/tsconfig.json
DELETED
package/tsdown.config.ts
DELETED