@geekmidas/cloud 10.0.0-alpha.13 → 10.0.0-alpha.131
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 +14 -6
- package/package.json +9 -8
- package/src/dokploy/Application.ts +45 -5
- package/src/dokploy/__tests__/Application.provider.spec.ts +62 -4
- package/src/sst/__tests__/api.spec.ts +2 -47
- package/src/sst/__tests__/bootstrap.spec.ts +15 -0
- package/src/sst/__tests__/encryption.spec.ts +90 -0
- package/src/sst/__tests__/fromManifest.integration.spec.ts +84 -0
- package/src/sst/__tests__/fromManifest.secret.spec.ts +79 -0
- package/src/sst/__tests__/fromManifest.spec.ts +379 -5
- package/src/sst/__tests__/function.spec.ts +0 -71
- package/src/sst/__tests__/surfaces.spec.ts +17 -0
- package/src/sst/__type-tests__/overrides.type-test.ts +152 -0
- package/src/sst/aws/Api.ts +16 -44
- package/src/sst/aws/Credential.ts +42 -9
- package/src/sst/aws/Cron.ts +5 -45
- package/src/sst/aws/DatabaseBootstrap.ts +6 -0
- package/src/sst/aws/Encryption.ts +91 -0
- package/src/sst/aws/ExternalApi.ts +58 -0
- package/src/sst/aws/Function.ts +9 -38
- package/src/sst/aws/Queue.ts +34 -1
- package/src/sst/aws/RestApiSurface.ts +36 -14
- package/src/sst/aws/Secret.ts +5 -3
- package/src/sst/aws/bootstrap/handler.ts +12 -1
- package/src/sst/fromManifest.ts +352 -43
- package/src/sst/index.ts +6 -1
- package/src/sst/overrides.ts +133 -0
- package/src/sst/__type-tests__/manifest.type-test.ts +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// Type-level checks that the `fromManifest` integrators accept the unified
|
|
2
|
-
// `gkm build` manifest shape (`export const manifest = { … } as const`) — both
|
|
3
|
-
// the flat and the partitioned `ManifestField` forms. Checked by `ts:check:sst`.
|
|
4
|
-
|
|
5
|
-
import type { Manifest, ManifestField, RouteInfo } from '@geekmidas/manifest';
|
|
6
|
-
import { App } from '../App';
|
|
7
|
-
import { Api } from '../aws/Api';
|
|
8
|
-
import { Cron } from '../aws/Cron';
|
|
9
|
-
import { Function } from '../aws/Function';
|
|
10
|
-
import { type GkmLinkable, ResourceType } from '../Linkable';
|
|
11
|
-
|
|
12
|
-
const stack = new App({
|
|
13
|
-
name: 'a',
|
|
14
|
-
stage: 'dev',
|
|
15
|
-
domain: 'example.com',
|
|
16
|
-
hostedZoneId: 'Z',
|
|
17
|
-
region: 'us-east-1',
|
|
18
|
-
}).stack('api');
|
|
19
|
-
|
|
20
|
-
const db: GkmLinkable = { _id: 'db', _type: ResourceType.Postgres };
|
|
21
|
-
|
|
22
|
-
// Mirrors a generated `manifest/aws.ts` — one object, `as const`.
|
|
23
|
-
const manifest = {
|
|
24
|
-
routes: [
|
|
25
|
-
{
|
|
26
|
-
path: '/users/{id}',
|
|
27
|
-
method: 'GET',
|
|
28
|
-
handler: 'users.handler',
|
|
29
|
-
authorizer: 'none',
|
|
30
|
-
environment: ['DB_HOST'],
|
|
31
|
-
timeout: 30,
|
|
32
|
-
memorySize: 1024,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
functions: [
|
|
36
|
-
{ name: 'worker', handler: 'worker.handler', environment: ['DB_URL'] },
|
|
37
|
-
],
|
|
38
|
-
crons: [
|
|
39
|
-
{ name: 'nightly', handler: 'nightly.handler', schedule: 'rate(1 day)' },
|
|
40
|
-
],
|
|
41
|
-
} as const satisfies Manifest;
|
|
42
|
-
|
|
43
|
-
// Each integrator takes the manifest *field*.
|
|
44
|
-
export const api = Api.fromManifest(stack, 'Api', manifest.routes, {
|
|
45
|
-
links: [db],
|
|
46
|
-
authorizers: { jwt: { issuer: 'https://i', audiences: ['a'] } },
|
|
47
|
-
});
|
|
48
|
-
export const workers = Function.fromManifest(stack, manifest.functions, {
|
|
49
|
-
links: [db],
|
|
50
|
-
});
|
|
51
|
-
export const crons = Cron.fromManifest(stack, manifest.crons, { links: [db] });
|
|
52
|
-
|
|
53
|
-
// The partitioned `ManifestField` form is also accepted.
|
|
54
|
-
const partitionedRoutes = {
|
|
55
|
-
admin: [
|
|
56
|
-
{
|
|
57
|
-
path: '/admin',
|
|
58
|
-
method: 'GET',
|
|
59
|
-
handler: 'admin.handler',
|
|
60
|
-
authorizer: 'iam',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
default: [
|
|
64
|
-
{
|
|
65
|
-
path: '/health',
|
|
66
|
-
method: 'GET',
|
|
67
|
-
handler: 'health.handler',
|
|
68
|
-
authorizer: 'none',
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
} satisfies ManifestField<RouteInfo>;
|
|
72
|
-
export const partitionedApi = Api.fromManifest(
|
|
73
|
-
stack,
|
|
74
|
-
'PartApi',
|
|
75
|
-
partitionedRoutes,
|
|
76
|
-
{ links: [db] },
|
|
77
|
-
);
|