Skip to content

fix(typescript): update for v4 #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Definitions Builder
name: Update and Release Serverless Definitions
on:
workflow_dispatch:
repository_dispatch:
Expand Down Expand Up @@ -28,7 +28,7 @@ jobs:
name: Set Serverless latest version
run: echo "::set-output name=version::$(npm list serverless | grep serverless@ | sed 's/.*serverless@/v/g' | tr -d '[[:space:]]')"

- name: Generate definitions
- name: Generate TypeScript Definitions
run: npx sls schema

- name: Update package.json version
Expand All @@ -37,8 +37,8 @@ jobs:
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
author_name: Frédéric Barthelet
author_email: [email protected]
author_name: Eslam λ Hefnawy
author_email: [email protected]
branch: master
message: Add Serverless definitions for ${{ steps.serverless-version.outputs.version }}
add: index.d.ts package.json
Expand Down
115 changes: 89 additions & 26 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* and run json-schema-to-typescript to regenerate this file.
*/

export type AwsArnString = string;
export type ErrorCode = string;
export type AwsCfFunction =
| AwsCfImport
Expand All @@ -17,6 +16,7 @@ export type AwsCfFunction =
| AwsCfToJsonString;
export type AwsCfInstruction = string | AwsCfFunction;
export type AwsArn = AwsArnString | AwsCfFunction;
export type AwsArnString = string;
export type FunctionName = string;
export type AwsSecretsManagerArnString = string;
export type FilterPatterns = {
Expand Down Expand Up @@ -57,7 +57,9 @@ export type AwsLambdaMemorySize = number;
export type AwsLambdaRole = string | AwsCfSub | AwsCfImport | AwsCfGetAtt;
export type AwsLambdaRuntime =
| "dotnet6"
| "dotnet8"
| "go1.x"
| "java21"
| "java17"
| "java11"
| "java8"
Expand All @@ -66,6 +68,7 @@ export type AwsLambdaRuntime =
| "nodejs16.x"
| "nodejs18.x"
| "nodejs20.x"
| "nodejs22.x"
| "provided"
| "provided.al2"
| "provided.al2023"
Expand All @@ -74,8 +77,11 @@ export type AwsLambdaRuntime =
| "python3.9"
| "python3.10"
| "python3.11"
| "python3.12"
| "python3.13"
| "ruby2.7"
| "ruby3.2";
| "ruby3.2"
| "ruby3.3";
export type AwsLambdaRuntimeManagement =
| ("auto" | "onFunctionUpdate")
| {
Expand Down Expand Up @@ -135,31 +141,55 @@ export type AwsCfArrayInstruction = AwsCfInstruction[] | AwsCfSplit;
export type ServiceName = string;

export interface AWS {
org?: string;
app?: string;
outputs?: {
[k: string]:
| string
| number
| boolean
| unknown[]
| {
[k: string]: unknown;
};
};
configValidationMode?: "error" | "warn" | "off";
console?:
| boolean
| {
[k: string]: unknown;
};
custom?: {
enterprise?: {
collectApiGatewayLogs?: boolean;
collectLambdaLogs?: boolean;
compressLogs?: boolean;
disableAwsSpans?: boolean;
disableFrameworksInstrumentation?: boolean;
disableHttpSpans?: boolean;
logAccessIamRole?: AwsArnString;
logIngestMode?: "push" | "pull";
disableWrapping?: boolean;
};
[k: string]: unknown;
};
dashboard?: {
disableMonitoring?: boolean;
};
deprecationNotificationMode?: "error" | "warn" | "warn:summary";
disabledDeprecations?: "*" | ErrorCode[];
build?:
| string
| {
esbuild?:
| {
external?: string[];
exclude?: string[];
packages?: "external";
buildConcurrency?: number;
bundle?: boolean;
minify?: boolean;
sourcemap?:
| boolean
| {
type?: "inline" | "linked" | "external";
setNodeOptions?: boolean;
[k: string]: unknown;
};
[k: string]: unknown;
}
| boolean;
[k: string]: unknown;
};
frameworkVersion?: string;
functions?: {
/**
Expand Down Expand Up @@ -314,6 +344,7 @@ export interface AWS {
};
};
};
timeoutInMillis?: number;
};
}
| {
Expand Down Expand Up @@ -688,6 +719,7 @@ export interface AWS {
layers?: AwsLambdaLayers;
logRetentionInDays?: AwsLogRetentionInDays;
logDataProtectionPolicy?: AwsLogDataProtectionPolicy;
logs?: AwsLambdaLoggingConfiguration;
maximumEventAge?: number;
maximumRetryAttempts?: number;
memorySize?: AwsLambdaMemorySize;
Expand All @@ -703,6 +735,7 @@ export interface AWS {
reservedConcurrency?: number | AwsCfFunction | AwsCfIf;
role?: AwsLambdaRole;
runtime?: AwsLambdaRuntime;
build?: string;
runtimeManagement?: AwsLambdaRuntimeManagement;
tags?: AwsResourceTags;
timeout?: AwsLambdaTimeout;
Expand Down Expand Up @@ -730,6 +763,7 @@ export interface AWS {
};
};
};
licenseKey?: string;
package?: {
artifact?: string;
exclude?: string[];
Expand All @@ -748,6 +782,25 @@ export interface AWS {
[k: string]: unknown;
};
};
stages?: {
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[a-zA-Z0-9-]+$".
*/
[k: string]: {
observability?:
| boolean
| ("axiom" | "dashboard")
| {
provider: "axiom" | "dashboard";
dataset?: string;
};
resolvers?: {
[k: string]: unknown;
};
[k: string]: unknown;
};
};
plugins?:
| {
localPath?: string;
Expand Down Expand Up @@ -824,6 +877,7 @@ export interface AWS {
};
shouldStartNameWithService?: boolean;
stage?: string;
timeoutInMillis?: number;
usagePlan?:
| {
quota?: {
Expand Down Expand Up @@ -974,8 +1028,10 @@ export interface AWS {
buildArgs?: {
[k: string]: string;
};
buildOptions?: string[];
cacheFrom?: string[];
platform?: string;
provenance?: string;
}
| string;
};
Expand All @@ -987,6 +1043,7 @@ export interface AWS {
logDataProtectionPolicy?: AwsLogDataProtectionPolicy;
logs?: {
frameworkLambda?: boolean;
lambda?: AwsLambdaLoggingConfiguration;
httpApi?:
| boolean
| {
Expand Down Expand Up @@ -1038,7 +1095,10 @@ export interface AWS {
| "ap-southeast-2"
| "ap-southeast-3"
| "ap-southeast-4"
| "ap-southeast-5"
| "ap-southeast-7"
| "ca-central-1"
| "ca-west-1"
| "cn-north-1"
| "cn-northwest-1"
| "eu-central-1"
Expand All @@ -1052,7 +1112,9 @@ export interface AWS {
| "il-central-1"
| "me-central-1"
| "me-south-1"
| "sa-east-1";
| "sa-east-1"
| "mx-central-1";
resolver?: string;
role?: AwsLambdaRole;
rolePermissionsBoundary?: AwsArnString;
rollbackConfiguration?: {
Expand All @@ -1064,7 +1126,9 @@ export interface AWS {
};
runtime?: AwsLambdaRuntime;
runtimeManagement?: AwsLambdaRuntimeManagement;
build?: string;
deploymentMethod?: "changesets" | "direct";
enableLegacyDeploymentBucket?: boolean;
s3?: {
[k: string]: {
accelerateConfiguration?: {
Expand Down Expand Up @@ -1342,6 +1406,11 @@ export interface AWS {
websocketsDescription?: string;
};
service: ServiceName;
state?:
| {
resolver: string;
}
| string;
useDotenv?: true;
variablesResolutionMode?: "20210219" | "20210326";
resources?: {
Expand Down Expand Up @@ -1437,18 +1506,6 @@ export interface AWS {
retain?: boolean;
};
};
org?: string;
app?: string;
outputs?: {
[k: string]:
| string
| number
| boolean
| unknown[]
| {
[k: string]: unknown;
};
};
}
export interface AwsCfImport {
"Fn::ImportValue": unknown;
Expand Down Expand Up @@ -1514,6 +1571,12 @@ export interface AwsLogDataProtectionPolicy {
Version: string;
Statement: unknown[];
}
export interface AwsLambdaLoggingConfiguration {
applicationLogLevel?: "DEBUG" | "ERROR" | "FATAL" | "INFO" | "TRACE" | "WARN";
logFormat?: "JSON" | "Text";
logGroup?: string;
systemLogLevel?: "DEBUG" | "INFO" | "WARN";
}
export interface AwsResourceTags {
/**
* This interface was referenced by `AwsResourceTags`'s JSON-Schema definition
Expand Down