-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8552 from amplication/next
Release v2.0.4
- Loading branch information
Showing
47 changed files
with
1,399 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 174 additions & 0 deletions
174
libs/util/code-gen-types/src/dotnet-plugin-events-params.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
import { CodeBlock } from "@amplication/csharp-ast"; | ||
import { | ||
Entity, | ||
EntityLookupField, | ||
ModuleContainer, | ||
ModuleAction, | ||
entityActions, | ||
} from "./code-gen-types"; | ||
import { EventParams } from "./plugins.types"; | ||
|
||
export interface CreateEntityServiceBaseParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
moduleActions: ModuleAction[]; | ||
entities: Entity[]; | ||
} | ||
|
||
export interface CreateEntityServiceParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
entityActions: entityActions; | ||
} | ||
|
||
// export interface CreateCustomModuleServiceParams extends EventParams { | ||
// customModuleName: string; | ||
// templateMapping: { [key: string]: any }; | ||
// serviceId: namedTypes.Identifier; | ||
// template: namedTypes.File; | ||
// moduleActions: ModuleAction[]; | ||
// dtoNameToPath: Record<string, string>; | ||
// } | ||
export interface CreateEntityControllerParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
entityActions: entityActions; | ||
} | ||
|
||
// export interface CreateCustomModuleControllerParams extends EventParams { | ||
// template: namedTypes.File; | ||
// customModuleName: string; | ||
// templateMapping: { [key: string]: any }; | ||
// controllerId: namedTypes.Identifier; | ||
// serviceId: namedTypes.Identifier; | ||
// moduleActions: ModuleAction[]; | ||
// customModuleServiceModule: string; | ||
// dtoNameToPath: Record<string, string>; | ||
// } | ||
export interface CreateEntityControllerBaseParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
moduleActions: ModuleAction[]; | ||
entities: Entity[]; | ||
} | ||
|
||
export interface CreateEntityGrpcControllerParams extends EventParams { | ||
entity: Entity; | ||
} | ||
export interface CreateEntityGrpcControllerBaseParams extends EventParams { | ||
entity: Entity; | ||
} | ||
|
||
export interface CreateEntityInterfaceParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
moduleContainers: ModuleContainer[]; | ||
moduleActions: ModuleAction[]; | ||
entities: Entity[]; | ||
} | ||
|
||
export interface CreateEntityControllerToManyRelationMethodsParams | ||
extends EventParams { | ||
field: EntityLookupField; | ||
entity: Entity; | ||
} | ||
|
||
export interface CreateServerAuthParams extends EventParams {} | ||
|
||
export interface CreateServerParams extends EventParams {} | ||
|
||
export type VariableDictionary = { | ||
[variable: string]: string; | ||
}[]; | ||
|
||
export interface CreateServerGitIgnoreParams extends EventParams { | ||
gitignorePaths: string[]; | ||
} | ||
|
||
export interface CreateServerDockerComposeParams extends EventParams { | ||
fileContent: string; | ||
updateProperties: { [key: string]: any }[]; | ||
outputFileName: string; | ||
} | ||
|
||
export interface CreateServerCsprojParams extends EventParams { | ||
packageReferences: { | ||
include: string; | ||
version: string; | ||
includeAssets?: string; | ||
privateAssets?: string; | ||
}[]; | ||
} | ||
export interface CreateServerAppsettingsParams extends EventParams { | ||
updateProperties: { [key: string]: any }; | ||
} | ||
|
||
export interface CreateMessageBrokerParams extends EventParams {} | ||
|
||
export interface CreateMessageBrokerTopicsEnumParams extends EventParams {} | ||
|
||
export interface CreateMessageBrokerClientOptionsFactoryParams | ||
extends EventParams {} | ||
|
||
export interface CreateMessageBrokerServiceParams extends EventParams {} | ||
export interface CreateMessageBrokerServiceBaseParams extends EventParams {} | ||
|
||
export interface CreateProgramFileParams extends EventParams { | ||
/** | ||
* List of code blocks that will be added to the program file. | ||
* The code blocks will be added to the `builder` object, before builder.Build() gets called. | ||
* i.e. `builder.services.AddControllers();` | ||
* @type {CodeBlock[]} | ||
*/ | ||
builderServicesBlocks: CodeBlock[]; | ||
/** | ||
* List of code blocks that will be added to the program file. | ||
* The code blocks will be added to the `app` object after builder.Build() gets called. | ||
* i.e. `app.UseCors();` | ||
* @type {CodeBlock[]} | ||
*/ | ||
appBlocks: CodeBlock[]; | ||
} | ||
|
||
export interface CreateSwaggerParams extends EventParams { | ||
fileDir: string; | ||
outputFileName: string; | ||
} | ||
|
||
export interface CreateSeedParams extends EventParams { | ||
fileDir: string; | ||
outputFileName: string; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
export interface CreateDTOsParams extends EventParams { | ||
entity: Entity; | ||
dtoName: string; | ||
dtoBasePath: string; | ||
} | ||
export interface LoadStaticFilesParams extends EventParams { | ||
source: string; | ||
basePath: string; | ||
} | ||
|
||
export interface CreateServerSecretsManagerParams extends EventParams { | ||
/** | ||
* Array of secretsName secrectKey pairs that will generate the SecretsNameKey enum. | ||
* SecrectKey is used by the Secrets Manager Service to retrieve the secret value | ||
*/ | ||
secretsNameKey: SecretsNameKey[]; | ||
} | ||
export interface CreateEntityExtensionsParams extends EventParams { | ||
entity: Entity; | ||
resourceName: string; | ||
apisDir: string; | ||
} | ||
|
||
export interface SecretsNameKey { | ||
name: string; | ||
key: string; | ||
} |
77 changes: 77 additions & 0 deletions
77
libs/util/code-gen-types/src/dotnet-plugin-events.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { | ||
CreateDTOsParams, | ||
CreateEntityControllerBaseParams, | ||
CreateEntityControllerParams, | ||
CreateEntityControllerToManyRelationMethodsParams, | ||
CreateEntityExtensionsParams, | ||
CreateEntityGrpcControllerBaseParams, | ||
CreateEntityGrpcControllerParams, | ||
CreateEntityInterfaceParams, | ||
CreateEntityServiceBaseParams, | ||
CreateEntityServiceParams, | ||
CreateMessageBrokerClientOptionsFactoryParams, | ||
CreateMessageBrokerParams, | ||
CreateMessageBrokerServiceBaseParams, | ||
CreateMessageBrokerServiceParams, | ||
CreateMessageBrokerTopicsEnumParams, | ||
CreateProgramFileParams, | ||
CreateSeedParams, | ||
CreateServerAppsettingsParams, | ||
CreateServerAuthParams, | ||
CreateServerCsprojParams, | ||
CreateServerDockerComposeParams, | ||
CreateServerGitIgnoreParams, | ||
CreateServerParams, | ||
CreateServerSecretsManagerParams, | ||
CreateSwaggerParams, | ||
LoadStaticFilesParams, | ||
} from "./dotnet-plugin-events-params.types"; | ||
import { DotnetEventNames, PluginEventType } from "./dotnet-plugins.types"; | ||
import { CodeBlock, Interface } from "@amplication/csharp-ast"; | ||
|
||
export type DotnetEvents = { | ||
[DotnetEventNames.CreateServerAuth]?: PluginEventType<CreateServerAuthParams>; | ||
[DotnetEventNames.CreateServer]?: PluginEventType<CreateServerParams>; | ||
[DotnetEventNames.CreateServerGitIgnore]?: PluginEventType< | ||
CreateServerGitIgnoreParams, | ||
CodeBlock | ||
>; | ||
[DotnetEventNames.CreateServerCsproj]?: PluginEventType< | ||
CreateServerCsprojParams, | ||
CodeBlock | ||
>; | ||
[DotnetEventNames.CreateServerAppsettings]?: PluginEventType< | ||
CreateServerAppsettingsParams, | ||
CodeBlock | ||
>; | ||
[DotnetEventNames.CreateEntityService]?: PluginEventType<CreateEntityServiceParams>; | ||
[DotnetEventNames.CreateEntityServiceBase]?: PluginEventType<CreateEntityServiceBaseParams>; | ||
[DotnetEventNames.CreateEntityController]?: PluginEventType<CreateEntityControllerParams>; | ||
[DotnetEventNames.CreateEntityControllerBase]?: PluginEventType<CreateEntityControllerBaseParams>; | ||
[DotnetEventNames.CreateEntityGrpcController]?: PluginEventType<CreateEntityGrpcControllerParams>; | ||
[DotnetEventNames.CreateEntityGrpcControllerBase]?: PluginEventType<CreateEntityGrpcControllerBaseParams>; | ||
[DotnetEventNames.CreateServerDockerCompose]?: PluginEventType< | ||
CreateServerDockerComposeParams, | ||
CodeBlock | ||
>; | ||
[DotnetEventNames.CreateMessageBroker]?: PluginEventType<CreateMessageBrokerParams>; | ||
[DotnetEventNames.CreateMessageBrokerTopicsEnum]?: PluginEventType<CreateMessageBrokerTopicsEnumParams>; | ||
[DotnetEventNames.CreateMessageBrokerClientOptionsFactory]?: PluginEventType<CreateMessageBrokerClientOptionsFactoryParams>; | ||
[DotnetEventNames.CreateMessageBrokerService]?: PluginEventType<CreateMessageBrokerServiceParams>; | ||
[DotnetEventNames.CreateMessageBrokerServiceBase]?: PluginEventType<CreateMessageBrokerServiceBaseParams>; | ||
[DotnetEventNames.CreateProgramFile]?: PluginEventType< | ||
CreateProgramFileParams, | ||
CodeBlock | ||
>; | ||
[DotnetEventNames.CreateSwagger]?: PluginEventType<CreateSwaggerParams>; | ||
[DotnetEventNames.CreateSeed]?: PluginEventType<CreateSeedParams>; | ||
[DotnetEventNames.CreateEntityControllerToManyRelationMethods]?: PluginEventType<CreateEntityControllerToManyRelationMethodsParams>; | ||
[DotnetEventNames.CreateDTOs]?: PluginEventType<CreateDTOsParams>; | ||
[DotnetEventNames.LoadStaticFiles]?: PluginEventType<LoadStaticFilesParams>; | ||
[DotnetEventNames.CreateServerSecretsManager]?: PluginEventType<CreateServerSecretsManagerParams>; | ||
[DotnetEventNames.CreateEntityInterface]?: PluginEventType< | ||
CreateEntityInterfaceParams, | ||
Interface | ||
>; | ||
[DotnetEventNames.CreateEntityExtensions]?: PluginEventType<CreateEntityExtensionsParams>; | ||
}; |
Oops, something went wrong.