@stacksjs/ts-cloud 0.5.9 → 0.5.10

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.
@@ -99,6 +99,35 @@ export declare function getCommandRecord(config: CloudConfig, environment: Envir
99
99
  * whitespace argument parsing.
100
100
  */
101
101
  export declare function runDbQuery(config: CloudConfig, environment: EnvironmentType, sql: string): Promise<string>;
102
+ export interface ServerlessFunctionInfo {
103
+ mode: 'http' | 'queue' | 'cli';
104
+ name: string;
105
+ /** `live` alias version when provisioned concurrency is on, else '$LATEST'. */
106
+ version: string;
107
+ provisioned?: {
108
+ status: string;
109
+ allocated: number;
110
+ requested: number;
111
+ };
112
+ }
113
+ export interface ServerlessInfo {
114
+ slug: string;
115
+ environment: string;
116
+ region: string;
117
+ stackStatus: string;
118
+ endpoint?: string;
119
+ assetUrl?: string;
120
+ scheduler: 'on' | 'off' | 'sub-minute';
121
+ queues: string[];
122
+ provisionedConcurrency: number;
123
+ functions: ServerlessFunctionInfo[];
124
+ lastRelease?: {
125
+ sha: string;
126
+ timestamp: string;
127
+ };
128
+ }
129
+ /** Gather an operational summary of a deployed serverless app. */
130
+ export declare function serverlessInfo(config: CloudConfig, environment: EnvironmentType): Promise<ServerlessInfo>;
102
131
  /** Rescale the serverless Aurora cluster's min/max ACU capacity. */
103
132
  export declare function scaleServerlessDatabase(config: CloudConfig, environment: EnvironmentType, minCapacity: number, maxCapacity: number): Promise<void>;
104
133
  /**
package/dist/index.js CHANGED
@@ -74264,6 +74264,35 @@ class LambdaClient {
74264
74264
  body: JSON.stringify(rest)
74265
74265
  });
74266
74266
  }
74267
+ async getAlias(functionName, name) {
74268
+ try {
74269
+ return await this.client.request({
74270
+ service: "lambda",
74271
+ region: this.region,
74272
+ method: "GET",
74273
+ path: `/2015-03-31/functions/${encodeURIComponent(functionName)}/aliases/${encodeURIComponent(name)}`
74274
+ });
74275
+ } catch (err) {
74276
+ if (/ResourceNotFound/i.test(String(err?.message)))
74277
+ return null;
74278
+ throw err;
74279
+ }
74280
+ }
74281
+ async getProvisionedConcurrencyConfig(functionName, qualifier) {
74282
+ try {
74283
+ return await this.client.request({
74284
+ service: "lambda",
74285
+ region: this.region,
74286
+ method: "GET",
74287
+ path: `/2019-09-30/functions/${encodeURIComponent(functionName)}/provisioned-concurrency`,
74288
+ queryParams: { Qualifier: qualifier }
74289
+ });
74290
+ } catch (err) {
74291
+ if (/ProvisionedConcurrencyConfigNotFound|ResourceNotFound/i.test(String(err?.message)))
74292
+ return null;
74293
+ throw err;
74294
+ }
74295
+ }
74267
74296
  async putProvisionedConcurrencyConfig(params) {
74268
74297
  const { FunctionName, Qualifier, ProvisionedConcurrentExecutions } = params;
74269
74298
  return this.client.request({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ts-cloud",
3
3
  "type": "module",
4
- "version": "0.5.9",
4
+ "version": "0.5.10",
5
5
  "description": "A lightweight, performant infrastructure-as-code library and CLI for deploying both server-based (EC2) and serverless applications.",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -89,8 +89,8 @@
89
89
  "test": "bun test"
90
90
  },
91
91
  "dependencies": {
92
- "@ts-cloud/aws-types": "0.5.9",
93
- "@ts-cloud/core": "0.5.9",
92
+ "@ts-cloud/aws-types": "0.5.10",
93
+ "@ts-cloud/core": "0.5.10",
94
94
  "@stacksjs/ts-xml": "^0.1.0"
95
95
  },
96
96
  "devDependencies": {