@amplication/code-gen-types
Advanced tools
Comparing version 1.1.21 to 1.1.22-beta.0
{ | ||
"name": "@amplication/code-gen-types", | ||
"version": "1.1.21", | ||
"version": "1.1.22-beta.0", | ||
"description": "This library supplies all the contracts for Amplication Code Generation. The purpose is to make the contracts available for inclusion in plugins.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
import { namedTypes } from "ast-types"; | ||
import { Entity, EntityField, EnumDataType, Module, NamedClassDeclaration } from "./code-gen-types"; | ||
import { Entity, EntityField, EntityLookupField, EnumDataType, Module, NamedClassDeclaration } from "./code-gen-types"; | ||
import { EventParams } from "./plugins-types"; | ||
@@ -49,2 +49,34 @@ import { Generator, DataSource, ScalarField, ObjectField } from "prisma-schema-dsl-types"; | ||
} | ||
export interface CreateEntityControllerToManyRelationMethodsParams extends EventParams { | ||
field: EntityLookupField; | ||
entity: Entity; | ||
entityType: string; | ||
whereUniqueInput: NamedClassDeclaration; | ||
serviceId: namedTypes.Identifier; | ||
methods: namedTypes.ClassMethod[]; | ||
toManyFile: namedTypes.File; | ||
toManyMapping: { | ||
[key: string]: any; | ||
}; | ||
} | ||
export interface CreateEntityResolverToManyRelationMethodsParams extends EventParams { | ||
field: EntityLookupField; | ||
entityType: string; | ||
serviceId: namedTypes.Identifier; | ||
methods: namedTypes.ClassMethod[]; | ||
toManyFile: namedTypes.File; | ||
toManyMapping: { | ||
[key: string]: any; | ||
}; | ||
} | ||
export interface CreateEntityResolverToOneRelationMethodsParams extends EventParams { | ||
field: EntityLookupField; | ||
entityType: string; | ||
serviceId: namedTypes.Identifier; | ||
methods: namedTypes.ClassMethod[]; | ||
toOneFile: namedTypes.File; | ||
toOneMapping: { | ||
[key: string]: any; | ||
}; | ||
} | ||
export interface CreateEntityControllerSpecParams extends EventParams { | ||
@@ -78,3 +110,2 @@ entity: Entity; | ||
export interface CreateServerAuthParams extends EventParams { | ||
srcDir: string; | ||
} | ||
@@ -148,2 +179,3 @@ export interface CreateAdminUIParams extends EventParams { | ||
modulesFiles: Module[]; | ||
template: namedTypes.File; | ||
} | ||
@@ -150,0 +182,0 @@ export interface CreateEntityModuleParams extends EventParams { |
@@ -1,2 +0,2 @@ | ||
import { CreateAdminUIParams, CreateServerAuthParams, CreateEntityControllerBaseParams, CreateEntityControllerParams, CreateEntityServiceBaseParams, CreateEntityServiceParams, CreateEntityResolverBaseParams, CreateEntityResolverParams, CreateMessageBrokerClientOptionsFactoryParams, CreateMessageBrokerNestJSModuleParams, CreateMessageBrokerParams, CreateMessageBrokerServiceBaseParams, CreateMessageBrokerServiceParams, CreateMessageBrokerTopicsEnumParams, CreatePrismaSchemaParams, CreateServerAppModuleParams, CreateServerDockerComposeDBParams, CreateServerDockerComposeParams, CreateServerDotEnvParams, CreateServerPackageJsonParams, CreateServerParams, CreateEntityModuleParams, CreateEntityModuleBaseParams, CreateSwaggerParams, CreateSeedParams, CreateEntityControllerSpecParams, CreateUserInfoParams, CreateTokenPayloadInterfaceParams, CreateAdminUIPackageJsonParams, CreateServerGitIgnoreParams, CreateAdminGitIgnoreParams } from "./plugin-events-params"; | ||
import { CreateAdminUIParams, CreateServerAuthParams, CreateEntityControllerBaseParams, CreateEntityControllerParams, CreateEntityServiceBaseParams, CreateEntityServiceParams, CreateEntityResolverBaseParams, CreateEntityResolverParams, CreateMessageBrokerClientOptionsFactoryParams, CreateMessageBrokerNestJSModuleParams, CreateMessageBrokerParams, CreateMessageBrokerServiceBaseParams, CreateMessageBrokerServiceParams, CreateMessageBrokerTopicsEnumParams, CreatePrismaSchemaParams, CreateServerAppModuleParams, CreateServerDockerComposeDBParams, CreateServerDockerComposeParams, CreateServerDotEnvParams, CreateServerPackageJsonParams, CreateServerParams, CreateEntityModuleParams, CreateEntityModuleBaseParams, CreateSwaggerParams, CreateSeedParams, CreateEntityControllerSpecParams, CreateUserInfoParams, CreateTokenPayloadInterfaceParams, CreateAdminUIPackageJsonParams, CreateEntityControllerToManyRelationMethodsParams, CreateEntityResolverToManyRelationMethodsParams, CreateEntityResolverToOneRelationMethodsParams, CreateServerGitIgnoreParams, CreateAdminGitIgnoreParams } from "./plugin-events-params"; | ||
import { EventNames, PluginEventType } from "./plugins-types"; | ||
@@ -35,2 +35,5 @@ export type Events = { | ||
[EventNames.CreateEntityControllerSpec]?: PluginEventType<CreateEntityControllerSpecParams>; | ||
[EventNames.CreateEntityControllerToManyRelationMethods]?: PluginEventType<CreateEntityControllerToManyRelationMethodsParams>; | ||
[EventNames.CreateEntityResolverToManyRelationMethods]?: PluginEventType<CreateEntityResolverToManyRelationMethodsParams>; | ||
[EventNames.CreateEntityResolverToOneRelationMethods]?: PluginEventType<CreateEntityResolverToOneRelationMethodsParams>; | ||
}; |
@@ -77,3 +77,6 @@ import type { Promisable } from "type-fest"; | ||
CreateSwagger = "CreateSwagger", | ||
CreateSeed = "CreateSeed" | ||
CreateSeed = "CreateSeed", | ||
CreateEntityControllerToManyRelationMethods = "CreateEntityControllerToManyRelationMethods", | ||
CreateEntityResolverToManyRelationMethods = "CreateEntityResolverToManyRelationMethods", | ||
CreateEntityResolverToOneRelationMethods = "CreateEntityResolverToOneRelationMethods" | ||
} | ||
@@ -80,0 +83,0 @@ export interface AmplicationPlugin { |
@@ -37,3 +37,6 @@ "use strict"; | ||
EventNames["CreateSeed"] = "CreateSeed"; | ||
EventNames["CreateEntityControllerToManyRelationMethods"] = "CreateEntityControllerToManyRelationMethods"; | ||
EventNames["CreateEntityResolverToManyRelationMethods"] = "CreateEntityResolverToManyRelationMethods"; | ||
EventNames["CreateEntityResolverToOneRelationMethods"] = "CreateEntityResolverToOneRelationMethods"; | ||
})(EventNames = exports.EventNames || (exports.EventNames = {})); | ||
//# sourceMappingURL=plugins-types.js.map |
@@ -18,2 +18,7 @@ { | ||
}, | ||
"fkHolder": { | ||
"title": "Foreign Key Holder", | ||
"$ref": "#/definitions/RelationFkHolder", | ||
"default": null | ||
}, | ||
"relatedFieldId": { | ||
@@ -34,4 +39,7 @@ "title": "Related Field", | ||
"type": "boolean" | ||
}, | ||
"RelationFkHolder": { | ||
"type": ["string", "null"] | ||
} | ||
} | ||
} |
@@ -7,2 +7,3 @@ /** | ||
export type RelatedEntity = string; | ||
export type ForeignKeyHolder = string | null; | ||
export type RelatedField = string; | ||
@@ -12,3 +13,4 @@ export interface Lookup { | ||
allowMultipleSelection: boolean; | ||
fkHolder?: ForeignKeyHolder; | ||
relatedFieldId: RelatedField; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132698
3234
2