@stacksjs/cloud 0.59.10 → 0.61.0
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/index.js +843 -754
- package/package.json +30 -30
- package/src/cloud/ai.ts +5 -12
- package/src/cloud/aws-sdk-layer/nodejs/package-lock.json +8 -6
- package/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
- package/src/cloud/cdn.ts +41 -20
- package/src/cloud/cli.ts +1 -3
- package/src/cloud/compute.ts +39 -17
- package/src/cloud/dashboard.ts +0 -1
- package/src/cloud/database.ts +34 -0
- package/src/cloud/deployment.ts +8 -7
- package/src/cloud/dns.ts +0 -1
- package/src/cloud/docs.ts +3 -4
- package/src/cloud/email.ts +57 -40
- package/src/cloud/index.ts +9 -9
- package/src/cloud/jump-box.ts +0 -1
- package/src/cloud/lambda/ask/{index.js → index.cjs} +16 -15
- package/src/cloud/lambda/summarize/index.cjs +36 -0
- package/src/cloud/permissions.ts +3 -3
- package/src/cloud/queue.ts +73 -53
- package/src/cloud/redirects.ts +11 -4
- package/src/cloud/router-layer/nodejs/package.json +2 -2
- package/src/cloud/security.ts +19 -11
- package/src/edge/origin-request.ts +2 -1
- package/src/helpers.ts +147 -132
- package/dist/cloud/ai.d.ts +0 -10
- package/dist/cloud/cdn.d.ts +0 -44
- package/dist/cloud/cli.d.ts +0 -9
- package/dist/cloud/compute.d.ts +0 -17
- package/dist/cloud/deployment.d.ts +0 -14
- package/dist/cloud/dns.d.ts +0 -7
- package/dist/cloud/docs.d.ts +0 -9
- package/dist/cloud/email.d.ts +0 -10
- package/dist/cloud/file-system.d.ts +0 -12
- package/dist/cloud/index.d.ts +0 -41
- package/dist/cloud/jump-box.d.ts +0 -12
- package/dist/cloud/network.d.ts +0 -9
- package/dist/cloud/permissions.d.ts +0 -7
- package/dist/cloud/queue.d.ts +0 -24
- package/dist/cloud/redirects.d.ts +0 -9
- package/dist/cloud/security.d.ts +0 -14
- package/dist/cloud/storage.d.ts +0 -18
- package/dist/edge/origin-request.d.ts +0 -1
- package/dist/helpers.d.ts +0 -67
- package/dist/index.d.ts +0 -2
- package/dist/types.d.ts +0 -26
- package/src/cloud/lambda/summarize/index.js +0 -35
- /package/src/cloud/lambda/cli-setup/{index.js → index.cjs} +0 -0
package/dist/cloud/dns.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export declare class DnsStack {
|
|
5
|
-
zone: route53.IHostedZone;
|
|
6
|
-
constructor(scope: Construct, props: NestedCloudProps);
|
|
7
|
-
}
|
package/dist/cloud/docs.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export interface DocsStackProps extends NestedCloudProps {
|
|
5
|
-
}
|
|
6
|
-
export declare class DocsStack {
|
|
7
|
-
originRequestFunction: lambda.Function;
|
|
8
|
-
constructor(scope: Construct, props: DocsStackProps);
|
|
9
|
-
}
|
package/dist/cloud/email.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { aws_route53 as route53, aws_s3 as s3 } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export interface EmailStackProps extends NestedCloudProps {
|
|
5
|
-
zone: route53.IHostedZone;
|
|
6
|
-
}
|
|
7
|
-
export declare class EmailStack {
|
|
8
|
-
emailBucket: s3.Bucket;
|
|
9
|
-
constructor(scope: Construct, props: EmailStackProps);
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
2
|
-
import { aws_efs as efs } from 'aws-cdk-lib';
|
|
3
|
-
import type { Construct } from 'constructs';
|
|
4
|
-
import type { NestedCloudProps } from '../types';
|
|
5
|
-
export interface FileSystemStackProps extends NestedCloudProps {
|
|
6
|
-
vpc: ec2.Vpc;
|
|
7
|
-
}
|
|
8
|
-
export declare class FileSystemStack {
|
|
9
|
-
fileSystem: efs.FileSystem;
|
|
10
|
-
accessPoint: efs.AccessPoint;
|
|
11
|
-
constructor(scope: Construct, props: FileSystemStackProps);
|
|
12
|
-
}
|
package/dist/cloud/index.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Stack } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { CloudOptions } from '../types';
|
|
4
|
-
import { AiStack } from './ai';
|
|
5
|
-
import { CdnStack } from './cdn';
|
|
6
|
-
import { CliStack } from './cli';
|
|
7
|
-
import { DnsStack } from './dns';
|
|
8
|
-
import { DocsStack } from './docs';
|
|
9
|
-
import { StorageStack } from './storage';
|
|
10
|
-
import { SecurityStack } from './security';
|
|
11
|
-
import { DeploymentStack } from './deployment';
|
|
12
|
-
import { JumpBoxStack } from './jump-box';
|
|
13
|
-
import { FileSystemStack } from './file-system';
|
|
14
|
-
import { NetworkStack } from './network';
|
|
15
|
-
import { RedirectsStack } from './redirects';
|
|
16
|
-
import { EmailStack } from './email';
|
|
17
|
-
import { PermissionsStack } from './permissions';
|
|
18
|
-
import { ComputeStack } from './compute';
|
|
19
|
-
import { QueueStack } from './queue';
|
|
20
|
-
export declare class Cloud extends Stack {
|
|
21
|
-
dns: DnsStack;
|
|
22
|
-
security: SecurityStack;
|
|
23
|
-
storage: StorageStack;
|
|
24
|
-
network: NetworkStack;
|
|
25
|
-
fileSystem: FileSystemStack;
|
|
26
|
-
jumpBox: JumpBoxStack;
|
|
27
|
-
docs: DocsStack;
|
|
28
|
-
email: EmailStack;
|
|
29
|
-
redirects: RedirectsStack;
|
|
30
|
-
permissions: PermissionsStack;
|
|
31
|
-
ai: AiStack;
|
|
32
|
-
cli: CliStack;
|
|
33
|
-
api: ComputeStack;
|
|
34
|
-
cdn: CdnStack;
|
|
35
|
-
queue: QueueStack;
|
|
36
|
-
deployment: DeploymentStack;
|
|
37
|
-
scope: Construct;
|
|
38
|
-
props: CloudOptions;
|
|
39
|
-
constructor(scope: Construct, id: string, props: CloudOptions);
|
|
40
|
-
init(): Promise<void>;
|
|
41
|
-
}
|
package/dist/cloud/jump-box.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { aws_efs as efs } from 'aws-cdk-lib';
|
|
2
|
-
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
3
|
-
import type { Construct } from 'constructs';
|
|
4
|
-
import type { NestedCloudProps } from '../types';
|
|
5
|
-
export interface JumpBoxStackProps extends NestedCloudProps {
|
|
6
|
-
vpc: ec2.Vpc;
|
|
7
|
-
fileSystem: efs.FileSystem;
|
|
8
|
-
}
|
|
9
|
-
export declare class JumpBoxStack {
|
|
10
|
-
jumpBox?: ec2.Instance;
|
|
11
|
-
constructor(scope: Construct, props: JumpBoxStackProps);
|
|
12
|
-
}
|
package/dist/cloud/network.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export interface NetworkStackProps extends NestedCloudProps {
|
|
5
|
-
}
|
|
6
|
-
export declare class NetworkStack {
|
|
7
|
-
vpc: ec2.Vpc;
|
|
8
|
-
constructor(scope: Construct, props: NetworkStackProps);
|
|
9
|
-
}
|
package/dist/cloud/queue.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Cluster, TaskDefinition } from 'aws-cdk-lib/aws-ecs';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export interface QueueStackProps extends NestedCloudProps {
|
|
5
|
-
cluster: Cluster;
|
|
6
|
-
taskDefinition: TaskDefinition;
|
|
7
|
-
}
|
|
8
|
-
export declare class QueueStack {
|
|
9
|
-
scope: Construct;
|
|
10
|
-
props: QueueStackProps;
|
|
11
|
-
constructor(scope: Construct, props: QueueStackProps);
|
|
12
|
-
init(): Promise<void>;
|
|
13
|
-
cronScheduleFromRate(rate: string): {
|
|
14
|
-
minute?: string;
|
|
15
|
-
hour?: string;
|
|
16
|
-
month?: string;
|
|
17
|
-
weekDay?: string;
|
|
18
|
-
year?: string;
|
|
19
|
-
};
|
|
20
|
-
loadModule(filePath: string): Promise<any>;
|
|
21
|
-
createQueueRule(module: {
|
|
22
|
-
default: any;
|
|
23
|
-
}, file: string): void;
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
-
import type { Construct } from 'constructs';
|
|
3
|
-
import type { NestedCloudProps } from '../types';
|
|
4
|
-
export interface RedirectsStackProps extends NestedCloudProps {
|
|
5
|
-
}
|
|
6
|
-
export declare class RedirectsStack {
|
|
7
|
-
redirectZones: route53.IHostedZone[];
|
|
8
|
-
constructor(scope: Construct, props: RedirectsStackProps);
|
|
9
|
-
}
|
package/dist/cloud/security.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { aws_route53 as route53 } from 'aws-cdk-lib';
|
|
2
|
-
import { aws_certificatemanager as acm, aws_kms as kms, aws_wafv2 as wafv2 } from 'aws-cdk-lib';
|
|
3
|
-
import type { Construct } from 'constructs';
|
|
4
|
-
import type { NestedCloudProps } from '../types';
|
|
5
|
-
export interface StorageStackProps extends NestedCloudProps {
|
|
6
|
-
zone: route53.IHostedZone;
|
|
7
|
-
}
|
|
8
|
-
export declare class SecurityStack {
|
|
9
|
-
firewall: wafv2.CfnWebACL;
|
|
10
|
-
kmsKey: kms.Key;
|
|
11
|
-
certificate: acm.Certificate;
|
|
12
|
-
constructor(scope: Construct, props: StorageStackProps);
|
|
13
|
-
getFirewallRules(): wafv2.CfnWebACL.RuleProperty[];
|
|
14
|
-
}
|
package/dist/cloud/storage.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { aws_kms as kms } from 'aws-cdk-lib';
|
|
2
|
-
import { aws_backup as backup, aws_iam as iam, aws_s3 as s3 } from 'aws-cdk-lib';
|
|
3
|
-
import type { Construct } from 'constructs';
|
|
4
|
-
import type { NestedCloudProps } from '../types';
|
|
5
|
-
export interface StorageStackProps extends NestedCloudProps {
|
|
6
|
-
kmsKey: kms.Key;
|
|
7
|
-
}
|
|
8
|
-
export declare class StorageStack {
|
|
9
|
-
publicBucket: s3.Bucket;
|
|
10
|
-
privateBucket: s3.Bucket;
|
|
11
|
-
logBucket: s3.Bucket;
|
|
12
|
-
bucketPrefix: string;
|
|
13
|
-
vault: backup.BackupVault;
|
|
14
|
-
backupPlan: backup.BackupPlan;
|
|
15
|
-
backupRole: iam.Role;
|
|
16
|
-
constructor(scope: Construct, props: StorageStackProps);
|
|
17
|
-
createBackupRole(scope: Construct): iam.Role;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function handler(event: any, context: any, callback: any): void;
|
package/dist/helpers.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { _InstanceType as InstanceType } from '@aws-sdk/client-ec2';
|
|
2
|
-
import type { CountryCode } from '@aws-sdk/client-route-53-domains';
|
|
3
|
-
import { ContactType } from '@aws-sdk/client-route-53-domains';
|
|
4
|
-
export { InstanceType };
|
|
5
|
-
export declare function getSecurityGroupId(securityGroupName: string): Promise<any>;
|
|
6
|
-
export interface PurchaseOptions {
|
|
7
|
-
domain: string;
|
|
8
|
-
years: number;
|
|
9
|
-
privacy: boolean;
|
|
10
|
-
autoRenew: boolean;
|
|
11
|
-
adminFirstName: string;
|
|
12
|
-
adminLastName: string;
|
|
13
|
-
adminOrganization: string;
|
|
14
|
-
adminAddressLine1: string;
|
|
15
|
-
adminAddressLine2: string;
|
|
16
|
-
adminCity: string;
|
|
17
|
-
adminState: string;
|
|
18
|
-
adminCountry: CountryCode;
|
|
19
|
-
adminZip: string;
|
|
20
|
-
adminPhone: string;
|
|
21
|
-
adminEmail: string;
|
|
22
|
-
techFirstName: string;
|
|
23
|
-
techLastName: string;
|
|
24
|
-
techOrganization: string;
|
|
25
|
-
techAddressLine1: string;
|
|
26
|
-
techAddressLine2: string;
|
|
27
|
-
techCity: string;
|
|
28
|
-
techState: string;
|
|
29
|
-
techCountry: CountryCode;
|
|
30
|
-
techZip: string;
|
|
31
|
-
techPhone: string;
|
|
32
|
-
techEmail: string;
|
|
33
|
-
registrantFirstName: string;
|
|
34
|
-
registrantLastName: string;
|
|
35
|
-
registrantOrganization: string;
|
|
36
|
-
registrantAddressLine1: string;
|
|
37
|
-
registrantAddressLine2: string;
|
|
38
|
-
registrantCity: string;
|
|
39
|
-
registrantState: string;
|
|
40
|
-
registrantCountry: CountryCode;
|
|
41
|
-
registrantZip: string;
|
|
42
|
-
registrantPhone: string;
|
|
43
|
-
registrantEmail: string;
|
|
44
|
-
privacyAdmin: boolean;
|
|
45
|
-
privacyTech: boolean;
|
|
46
|
-
privacyRegistrant: boolean;
|
|
47
|
-
contactType: ContactType;
|
|
48
|
-
verbose: boolean;
|
|
49
|
-
}
|
|
50
|
-
export declare function purchaseDomain(domain: string, options: PurchaseOptions): any;
|
|
51
|
-
export declare function getJumpBoxInstanceId(name?: string): Promise<string | undefined>;
|
|
52
|
-
export declare function deleteEc2Instance(id: string, stackName?: string): Promise<any>;
|
|
53
|
-
export declare function deleteJumpBox(stackName?: string): Promise<any>;
|
|
54
|
-
export declare function deleteIamUsers(): Promise<any>;
|
|
55
|
-
export declare function deleteStacksBuckets(): Promise<any>;
|
|
56
|
-
export declare function deleteStacksFunctions(): Promise<any>;
|
|
57
|
-
export declare function deleteLogGroups(): Promise<any>;
|
|
58
|
-
export declare function deleteParameterStore(): Promise<any>;
|
|
59
|
-
export declare function deleteCdkRemnants(): Promise<any>;
|
|
60
|
-
export declare function hasBeenDeployed(): Promise<any>;
|
|
61
|
-
export declare function getJumpBoxInstanceProfileName(): Promise<any>;
|
|
62
|
-
export declare function addJumpBox(stackName?: string): Promise<any>;
|
|
63
|
-
export declare function getJumpBoxSecurityGroupName(): Promise<any>;
|
|
64
|
-
export declare function getSecurityGroupFromInstanceId(instanceId: string): Promise<string | undefined>;
|
|
65
|
-
export declare function isFirstDeployment(): Promise<boolean>;
|
|
66
|
-
export declare function isFailedState(): Promise<boolean>;
|
|
67
|
-
export declare function getOrCreateTimestamp(): Promise<string>;
|
package/dist/index.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { AppEnvType } from '@stacksjs/types';
|
|
2
|
-
import type { StackProps } from 'aws-cdk-lib';
|
|
3
|
-
export interface CloudOptions extends StackProps {
|
|
4
|
-
name: string;
|
|
5
|
-
env: {
|
|
6
|
-
account: string;
|
|
7
|
-
region: string;
|
|
8
|
-
};
|
|
9
|
-
slug: string;
|
|
10
|
-
appEnv: AppEnvType;
|
|
11
|
-
appName: string;
|
|
12
|
-
domain: string;
|
|
13
|
-
timestamp: string;
|
|
14
|
-
}
|
|
15
|
-
export interface NestedCloudProps {
|
|
16
|
-
name: string;
|
|
17
|
-
env: {
|
|
18
|
-
account: string;
|
|
19
|
-
region: string;
|
|
20
|
-
};
|
|
21
|
-
slug: string;
|
|
22
|
-
appEnv: AppEnvType;
|
|
23
|
-
appName: string;
|
|
24
|
-
domain: string;
|
|
25
|
-
timestamp: string;
|
|
26
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const AWS = require('aws-sdk')
|
|
2
|
-
|
|
3
|
-
async function handler(event) {
|
|
4
|
-
const requestBody = JSON.parse(event.body)
|
|
5
|
-
|
|
6
|
-
// Extract the 'question' property from the request body
|
|
7
|
-
const text = requestBody.text
|
|
8
|
-
// eslint-disable-next-line no-console
|
|
9
|
-
console.log(`Text received: ${text}`)
|
|
10
|
-
|
|
11
|
-
const bedrockRuntime = new AWS.BedrockRuntime({ apiVersion: '2023-09-30' })
|
|
12
|
-
const res = await bedrockRuntime.invokeModel({
|
|
13
|
-
modelId: 'amazon.titan-text-express-v1',
|
|
14
|
-
contentType: 'application/json',
|
|
15
|
-
accept: '*/*',
|
|
16
|
-
body: JSON.stringify({
|
|
17
|
-
inputText: `Summarize the following text: ${text}`,
|
|
18
|
-
textGenerationConfig: {
|
|
19
|
-
maxTokenCount: 512,
|
|
20
|
-
stopSequences: [],
|
|
21
|
-
temperature: 0,
|
|
22
|
-
topP: 0.9,
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
}).promise()
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
statusCode: 200,
|
|
29
|
-
body: res.body.toString(),
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = {
|
|
34
|
-
handler,
|
|
35
|
-
}
|
|
File without changes
|