Skip to content

Commit

Permalink
Merge pull request #8552 from amplication/next
Browse files Browse the repository at this point in the history
Release v2.0.4
  • Loading branch information
mulygottlieb committed May 29, 2024
2 parents 4594e9d + 8af9acf commit d4c0b72
Show file tree
Hide file tree
Showing 47 changed files with 1,399 additions and 455 deletions.
4 changes: 2 additions & 2 deletions libs/util/code-gen-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ In order to publish to npm `@amplication/code-gen-types` run the following:
# From the monorepo root folder
npm i

npx nx build amplication-code-gen-types
npx nx build code-gen-types

cd ./dist/packages/amplication-code-gen-types
cd ./dist/libs/util/code-gen-types

npm publish --access public ....
```
5 changes: 3 additions & 2 deletions libs/util/code-gen-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplication/code-gen-types",
"version": "2.0.27",
"version": "2.0.33-beta.12",
"description": "This library supplies all the contracts for Amplication Code Generation. The purpose is to make the contracts available for inclusion in plugins.",
"main": "src/index.js",
"author": {
Expand All @@ -13,6 +13,7 @@
"json-schema": "^0.4.0",
"prisma-schema-dsl-types": "^1.1.2",
"tslib": "^2.6.2",
"type-fest": "^3.11.0"
"type-fest": "^3.11.0",
"@amplication/csharp-ast": "^0.0.2"
}
}
174 changes: 174 additions & 0 deletions libs/util/code-gen-types/src/dotnet-plugin-events-params.types.ts
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 libs/util/code-gen-types/src/dotnet-plugin-events.types.ts
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>;
};
Loading

0 comments on commit d4c0b72

Please sign in to comment.