@stacksjs/ts-cloud 0.7.105 → 0.7.109
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/alerts/delivery.d.ts +10 -0
- package/dist/alerts/model.d.ts +1 -1
- package/dist/api/client.d.ts +53 -0
- package/dist/api/handler.d.ts +10 -0
- package/dist/api/service.d.ts +1 -0
- package/dist/aws/index.js +10 -10
- package/dist/aws/lambda.d.ts +19 -0
- package/dist/bin/cli.js +1677 -1370
- package/dist/bin/dashboard-server.js +926 -620
- package/dist/{chunk-fmt40tpw.js → chunk-53jatzaw.js} +2 -2
- package/dist/{chunk-ef2dwfrg.js → chunk-8kh577qh.js} +5 -5
- package/dist/{chunk-s9c2x5jv.js → chunk-9v2pwxv9.js} +2 -2
- package/dist/chunk-aa2dkn7b.js +205 -0
- package/dist/{chunk-vkd2y0fs.js → chunk-cktwk9hy.js} +7169 -14800
- package/dist/{chunk-dmzez5f8.js → chunk-d3vx2ekv.js} +123 -28
- package/dist/chunk-grx1rp09.js +12163 -0
- package/dist/{chunk-c6db5m63.js → chunk-t2s3gdq6.js} +253 -8
- package/dist/chunk-va2yd85b.js +200 -0
- package/dist/{chunk-3g4r09dd.js → chunk-wmbep3b5.js} +1 -1
- package/dist/{chunk-ybcz6sxc.js → chunk-x6yzgv7y.js} +33 -0
- package/dist/chunk-xrtwv3v2.js +420 -0
- package/dist/control-plane/types.d.ts +1 -1
- package/dist/deploy/dashboard-bundle-encoding.test.d.ts +1 -0
- package/dist/deploy/dashboard-payload.d.ts +20 -0
- package/dist/deploy/dashboard-payload.test.d.ts +1 -0
- package/dist/deploy/dashboard-protection.test.d.ts +1 -0
- package/dist/deploy/dashboard-spend.test.d.ts +1 -0
- package/dist/deploy/dashboard-topology.d.ts +85 -0
- package/dist/deploy/dashboard-topology.test.d.ts +1 -0
- package/dist/deploy/egress-collection.d.ts +60 -0
- package/dist/deploy/index.d.ts +2 -0
- package/dist/deploy/index.js +23 -8
- package/dist/deploy/local-dashboard-server.d.ts +2 -0
- package/dist/drivers/index.js +4 -2
- package/dist/drivers/shared/protection.d.ts +43 -0
- package/dist/drivers/shared/protection.test.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +364 -102
- package/dist/protection/controls.d.ts +113 -0
- package/dist/protection/controls.test.d.ts +1 -0
- package/dist/protection/ddos.d.ts +130 -0
- package/dist/protection/ddos.test.d.ts +1 -0
- package/dist/protection/index.d.ts +11 -0
- package/dist/protection/index.js +87 -0
- package/dist/protection/ratelimit.d.ts +154 -0
- package/dist/protection/ratelimit.test.d.ts +1 -0
- package/dist/protection/waf.d.ts +143 -0
- package/dist/protection/waf.test.d.ts +1 -0
- package/dist/spend/anomaly-config.d.ts +130 -0
- package/dist/spend/anomaly-config.test.d.ts +1 -0
- package/dist/spend/anomaly.d.ts +114 -0
- package/dist/spend/anomaly.test.d.ts +1 -0
- package/dist/spend/api.d.ts +42 -0
- package/dist/spend/api.test.d.ts +1 -0
- package/dist/spend/appliers.d.ts +126 -0
- package/dist/spend/docs.test.d.ts +1 -0
- package/dist/spend/enforcement.d.ts +111 -0
- package/dist/spend/enforcement.integration.test.d.ts +1 -0
- package/dist/spend/evaluator.d.ts +70 -0
- package/dist/spend/evaluator.test.d.ts +1 -0
- package/dist/spend/focus.d.ts +93 -0
- package/dist/spend/focus.test.d.ts +1 -0
- package/dist/spend/gate.d.ts +96 -0
- package/dist/spend/index.d.ts +20 -0
- package/dist/spend/index.js +173 -0
- package/dist/spend/lease.d.ts +54 -0
- package/dist/spend/lease.test.d.ts +1 -0
- package/dist/spend/meter.d.ts +70 -0
- package/dist/spend/meter.test.d.ts +1 -0
- package/dist/spend/model.d.ts +228 -0
- package/dist/spend/notifications.d.ts +58 -0
- package/dist/spend/pricing.d.ts +109 -0
- package/dist/spend/pricing.test.d.ts +1 -0
- package/dist/spend/projection.d.ts +36 -0
- package/dist/spend/runner.d.ts +130 -0
- package/dist/spend/service.d.ts +129 -0
- package/dist/spend/signals.d.ts +110 -0
- package/dist/spend/signals.test.d.ts +1 -0
- package/dist/spend/sms-sdk.test.d.ts +1 -0
- package/dist/spend/spend.integration.test.d.ts +1 -0
- package/dist/spend/store.d.ts +166 -0
- package/dist/spend/transports.d.ts +169 -0
- package/dist/spend/transports.test.d.ts +1 -0
- package/dist/spend/window.d.ts +52 -0
- package/dist/spend/window.test.d.ts +1 -0
- package/dist/ui/404.html +2 -0
- package/dist/ui/access-denied.html +2 -2
- package/dist/ui/account/automation.html +4 -4
- package/dist/ui/account/security.html +2 -2
- package/dist/ui/applications/compose.html +4 -4
- package/dist/ui/applications/new.html +2 -2
- package/dist/ui/data/backups.html +22 -9
- package/dist/ui/data/services.html +22 -9
- package/dist/ui/data/volumes.html +22 -9
- package/dist/ui/index.html +22 -9
- package/dist/ui/infrastructure/topology.html +2223 -0
- package/dist/ui/integrations.html +2 -2
- package/dist/ui/operations/alerts.html +22 -9
- package/dist/ui/operations/configuration.html +4 -4
- package/dist/ui/operations/jobs.html +22 -9
- package/dist/ui/operations/maintenance.html +4 -4
- package/dist/ui/operations/observability.html +22 -9
- package/dist/ui/operations/previews.html +4 -4
- package/dist/ui/operations/queue.html +4 -4
- package/dist/ui/operations/regions.html +3 -3
- package/dist/ui/operations/releases.html +3 -3
- package/dist/ui/operations/spend.html +1634 -0
- package/dist/ui/operations/workloads.html +22 -9
- package/dist/ui/security.html +2 -2
- package/dist/ui/server/actions.html +4 -4
- package/dist/ui/server/activity.html +2 -2
- package/dist/ui/server/capacity.html +4 -4
- package/dist/ui/server/database.html +4 -4
- package/dist/ui/server/deployments.html +4 -4
- package/dist/ui/server/diagnostics.html +2 -2
- package/dist/ui/server/firewall.html +100 -161
- package/dist/ui/server/fleet.html +22 -9
- package/dist/ui/server/logs.html +22 -9
- package/dist/ui/server/metrics.html +130 -14
- package/dist/ui/server/security.html +2 -2
- package/dist/ui/server/services.html +1 -1
- package/dist/ui/server/sites.html +22 -9
- package/dist/ui/server/ssh-keys.html +3 -3
- package/dist/ui/server/team.html +4 -4
- package/dist/ui/server/terminal.html +2 -2
- package/dist/ui/serverless/alarms.html +4 -4
- package/dist/ui/serverless/assets.html +2 -2
- package/dist/ui/serverless/cost.html +2 -2
- package/dist/ui/serverless/data.html +4 -4
- package/dist/ui/serverless/deployments.html +2 -2
- package/dist/ui/serverless/firewall.html +2 -2
- package/dist/ui/serverless/functions.html +4 -4
- package/dist/ui/serverless/logs.html +22 -9
- package/dist/ui/serverless/metrics.html +2 -2
- package/dist/ui/serverless/queues.html +4 -4
- package/dist/ui/serverless/secrets.html +4 -4
- package/dist/ui/serverless/traces.html +4 -4
- package/dist/ui/serverless.html +4 -4
- package/dist/ui-src/functions/requestJson.ts +41 -0
- package/dist/ui-src/functions/useOpConfirm.ts +132 -0
- package/dist/ui-src/functions/usePolling.ts +98 -0
- package/dist/ui-src/functions/useTerminal.ts +79 -0
- package/dist/ui-src/pages/infrastructure/topology.stx +517 -0
- package/dist/ui-src/pages/operations/spend.stx +225 -0
- package/dist/ui-src/pages/partials/nav.stx +4 -0
- package/dist/ui-src/pages/server/firewall.stx +89 -0
- package/dist/ui-src/pages/server/metrics.stx +140 -6
- package/dist/ui-src/src/topology.ts +485 -0
- package/package.json +11 -3
|
@@ -15,6 +15,15 @@ export type NotificationEmail = (input: {
|
|
|
15
15
|
subject: string;
|
|
16
16
|
text: string;
|
|
17
17
|
}) => Promise<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Send one SMS. Injected rather than imported so the router stays testable and
|
|
20
|
+
* so a deployment that does not use SMS pays nothing for it.
|
|
21
|
+
*/
|
|
22
|
+
export type NotificationSms = (input: {
|
|
23
|
+
to: string;
|
|
24
|
+
from?: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}) => Promise<unknown>;
|
|
18
27
|
export declare function isQuietHours(route: NotificationRoute, at: Date): boolean;
|
|
19
28
|
export declare class NotificationRouter {
|
|
20
29
|
private readonly store;
|
|
@@ -23,6 +32,7 @@ export declare class NotificationRouter {
|
|
|
23
32
|
constructor(store: AlertStore, options?: {
|
|
24
33
|
fetchImpl?: NotificationFetch;
|
|
25
34
|
emailImpl?: NotificationEmail;
|
|
35
|
+
smsImpl?: NotificationSms;
|
|
26
36
|
now?: () => Date;
|
|
27
37
|
});
|
|
28
38
|
private now;
|
package/dist/alerts/model.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type HealthCheckKind = 'http' | 'tcp' | 'command';
|
|
|
3
3
|
export type HealthStatus = 'healthy' | 'unhealthy' | 'no_data';
|
|
4
4
|
export type AlertState = 'pending' | 'firing' | 'resolved' | 'silenced';
|
|
5
5
|
export type AlertSeverity = 'info' | 'warning' | 'critical';
|
|
6
|
-
export type NotificationChannelKind = 'slack' | 'discord' | 'teams' | 'telegram' | 'email' | 'webhook';
|
|
6
|
+
export type NotificationChannelKind = 'slack' | 'discord' | 'teams' | 'telegram' | 'email' | 'webhook' | 'sms';
|
|
7
7
|
export interface HealthCheck {
|
|
8
8
|
id: string;
|
|
9
9
|
projectId: string;
|
package/dist/api/client.d.ts
CHANGED
|
@@ -194,4 +194,57 @@ export declare class TsCloudClient {
|
|
|
194
194
|
operation: ApiOperationResponse['operation'];
|
|
195
195
|
requestId: string;
|
|
196
196
|
}>;
|
|
197
|
+
/**
|
|
198
|
+
* Current usage, cost, and budget headroom.
|
|
199
|
+
*
|
|
200
|
+
* The call a pipeline makes before doing something expensive. Every budget
|
|
201
|
+
* carries `remainingCents`, `projectedCents`, and `projectionConfidence`, so
|
|
202
|
+
* the caller can decide rather than guess.
|
|
203
|
+
*/
|
|
204
|
+
usage(options?: {
|
|
205
|
+
projectId?: string;
|
|
206
|
+
environmentId?: string;
|
|
207
|
+
period?: 'daily' | 'weekly' | 'monthly';
|
|
208
|
+
timezone?: string;
|
|
209
|
+
}): Promise<Record<string, unknown>>;
|
|
210
|
+
/** Itemized hourly usage rollups for a window. */
|
|
211
|
+
usageRollups(options: {
|
|
212
|
+
from: string;
|
|
213
|
+
to: string;
|
|
214
|
+
projectId?: string;
|
|
215
|
+
environmentId?: string;
|
|
216
|
+
meters?: string[];
|
|
217
|
+
limit?: number;
|
|
218
|
+
}): Promise<{
|
|
219
|
+
data: Array<Record<string, unknown>>;
|
|
220
|
+
}>;
|
|
221
|
+
/**
|
|
222
|
+
* Whether an operation is allowed under current spend enforcement.
|
|
223
|
+
*
|
|
224
|
+
* One boolean and a reason, deliberately - the caller is a script deciding
|
|
225
|
+
* whether to continue, not a dashboard rendering a page.
|
|
226
|
+
*/
|
|
227
|
+
allowance(operation?: 'build' | 'deploy' | 'function_invoke' | 'request', options?: {
|
|
228
|
+
projectId?: string;
|
|
229
|
+
environmentId?: string;
|
|
230
|
+
}): Promise<{
|
|
231
|
+
allowed: boolean;
|
|
232
|
+
blockedBy: string | null;
|
|
233
|
+
reason: string | null;
|
|
234
|
+
}>;
|
|
235
|
+
/** Budgets governing a scope. */
|
|
236
|
+
budgets(options?: {
|
|
237
|
+
projectId?: string;
|
|
238
|
+
environmentId?: string;
|
|
239
|
+
}): Promise<{
|
|
240
|
+
data: Array<Record<string, unknown>>;
|
|
241
|
+
}>;
|
|
242
|
+
/** Detected spend anomalies. */
|
|
243
|
+
anomalies(options?: {
|
|
244
|
+
projectId?: string;
|
|
245
|
+
since?: string;
|
|
246
|
+
unacknowledged?: boolean;
|
|
247
|
+
}): Promise<{
|
|
248
|
+
data: Array<Record<string, unknown>>;
|
|
249
|
+
}>;
|
|
197
250
|
}
|
package/dist/api/handler.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AutomationIdentityStore } from '../automation';
|
|
|
2
2
|
import type { ControlPlaneStore } from '../control-plane';
|
|
3
3
|
import type { ApplicationArtifactStore, ApplicationDraftStore, RegistryConnectionStore } from '../onboarding';
|
|
4
4
|
import type { SourceConnectionStore } from '../source';
|
|
5
|
+
import { SpendService, SpendStore } from '../spend';
|
|
5
6
|
interface ApiV1HandlerOptions {
|
|
6
7
|
controlPlane: ControlPlaneStore;
|
|
7
8
|
identities: AutomationIdentityStore;
|
|
@@ -13,6 +14,15 @@ interface ApiV1HandlerOptions {
|
|
|
13
14
|
};
|
|
14
15
|
now?: () => Date;
|
|
15
16
|
rateLimit?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Spend management. Supplied by default from the control plane, so the
|
|
19
|
+
* billing endpoints work without extra wiring; pass one to share a store
|
|
20
|
+
* (and therefore a counter tracker) with a running evaluation loop.
|
|
21
|
+
*/
|
|
22
|
+
spend?: {
|
|
23
|
+
store: SpendStore;
|
|
24
|
+
service: SpendService;
|
|
25
|
+
};
|
|
16
26
|
}
|
|
17
27
|
export declare function createApiV1Handler(options: ApiV1HandlerOptions): (request: Request, networkHint?: string) => Promise<Response | undefined>;
|
|
18
28
|
export {};
|
package/dist/api/service.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare class AutomationApiService {
|
|
|
12
12
|
private readonly controlPlane;
|
|
13
13
|
private readonly identities;
|
|
14
14
|
private readonly queue;
|
|
15
|
+
private readonly spendGate;
|
|
15
16
|
constructor(controlPlane: ControlPlaneStore, identities: AutomationIdentityStore);
|
|
16
17
|
target(principal: ApiTokenPrincipal, requested: AuthorizationScope): AuthorizationTarget;
|
|
17
18
|
authorize(principal: ApiTokenPrincipal, capability: AuthorizationCapability, requested: AuthorizationScope): AuthorizationTarget;
|
package/dist/aws/index.js
CHANGED
|
@@ -86,7 +86,13 @@ import {
|
|
|
86
86
|
trackEvent,
|
|
87
87
|
translate,
|
|
88
88
|
translateToMultiple
|
|
89
|
-
} from "../chunk-
|
|
89
|
+
} from "../chunk-x6yzgv7y.js";
|
|
90
|
+
import {
|
|
91
|
+
EmailClient,
|
|
92
|
+
IAMClient,
|
|
93
|
+
SESClient,
|
|
94
|
+
email
|
|
95
|
+
} from "../chunk-hpv68b4a.js";
|
|
90
96
|
import {
|
|
91
97
|
CloudFrontClient
|
|
92
98
|
} from "../chunk-01d86gt1.js";
|
|
@@ -112,6 +118,9 @@ import {
|
|
|
112
118
|
detectDnsProvider,
|
|
113
119
|
dnsProviders
|
|
114
120
|
} from "../chunk-gttvakpv.js";
|
|
121
|
+
import {
|
|
122
|
+
Route53Client
|
|
123
|
+
} from "../chunk-32e7ya18.js";
|
|
115
124
|
import {
|
|
116
125
|
EC2Client,
|
|
117
126
|
SSMClient
|
|
@@ -119,15 +128,6 @@ import {
|
|
|
119
128
|
import {
|
|
120
129
|
CloudFormationClient
|
|
121
130
|
} from "../chunk-4cjrg98a.js";
|
|
122
|
-
import {
|
|
123
|
-
EmailClient,
|
|
124
|
-
IAMClient,
|
|
125
|
-
SESClient,
|
|
126
|
-
email
|
|
127
|
-
} from "../chunk-hpv68b4a.js";
|
|
128
|
-
import {
|
|
129
|
-
Route53Client
|
|
130
|
-
} from "../chunk-32e7ya18.js";
|
|
131
131
|
import {
|
|
132
132
|
S3Client
|
|
133
133
|
} from "../chunk-wj3s95p9.js";
|
package/dist/aws/lambda.d.ts
CHANGED
|
@@ -217,6 +217,25 @@ export declare class LambdaClient {
|
|
|
217
217
|
Status?: string;
|
|
218
218
|
RequestedProvisionedConcurrentExecutions?: number;
|
|
219
219
|
}>;
|
|
220
|
+
/**
|
|
221
|
+
* Read the reserved-concurrency limit. Returns null when none is set.
|
|
222
|
+
*
|
|
223
|
+
* Reserved concurrency is not the same as provisioned concurrency above: it
|
|
224
|
+
* is a ceiling on how many executions may run at once, and setting it to 0 is
|
|
225
|
+
* the supported way to stop a function being invoked at all without deleting
|
|
226
|
+
* it or breaking its triggers.
|
|
227
|
+
*/
|
|
228
|
+
getFunctionConcurrency(functionName: string): Promise<number | null>;
|
|
229
|
+
/**
|
|
230
|
+
* Set the reserved-concurrency ceiling.
|
|
231
|
+
*
|
|
232
|
+
* Zero throttles every invocation: the trigger still fires, Lambda rejects it,
|
|
233
|
+
* and nothing runs. That is reversible in one call, which is what makes it
|
|
234
|
+
* usable as a spend cap rather than a deletion.
|
|
235
|
+
*/
|
|
236
|
+
putFunctionConcurrency(functionName: string, reservedConcurrentExecutions: number): Promise<void>;
|
|
237
|
+
/** Remove the reserved-concurrency ceiling, returning the function to the account pool. */
|
|
238
|
+
deleteFunctionConcurrency(functionName: string): Promise<void>;
|
|
220
239
|
/** Remove a provisioned-concurrency config from a function version/alias. */
|
|
221
240
|
deleteProvisionedConcurrencyConfig(functionName: string, qualifier: string): Promise<void>;
|
|
222
241
|
/**
|