@amplication/code-gen-types
Advanced tools
Comparing version 2.0.22 to 2.0.23
{ | ||
"name": "@amplication/code-gen-types", | ||
"version": "2.0.22", | ||
"version": "2.0.23", | ||
"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", |
@@ -6,3 +6,3 @@ import type { namedTypes } from "ast-types"; | ||
import { BuildLogger } from "./build-logger"; | ||
export { EnumDataType, EnumEntityAction, EnumEntityPermissionType, EnumMessagePatternConnectionOptions, EnumModuleActionType, EnumModuleActionGqlOperation, EnumModuleActionRestVerb, } from "./models"; | ||
export { EnumDataType, EnumEntityAction, EnumEntityPermissionType, EnumMessagePatternConnectionOptions, EnumModuleActionType, EnumModuleDtoType, EnumModuleActionGqlOperation, EnumModuleActionRestVerb, EnumModuleDtoPropertyType, EnumModuleActionRestInputSource, } from "./models"; | ||
export type ServiceSettings = Omit<BlockOmittedFields<models.ServiceSettings>, "id">; | ||
@@ -148,5 +148,9 @@ export type AppInfo = { | ||
}; | ||
export type PropertyTypeDef = Omit<models.PropertyTypeDef, "type"> & { | ||
type: keyof typeof models.EnumModuleDtoPropertyType; | ||
dto?: ModuleDto; | ||
}; | ||
export type PluginInstallation = BlockOmittedFields<models.PluginInstallation>; | ||
export type ModuleContainer = BlockOmittedFields<models.Module>; | ||
export type ModuleAction = Omit<BlockOmittedFields<models.ModuleAction>, "id" | "actionType" | "restVerb" | "gqlOperation"> & { | ||
export type ModuleAction = Omit<BlockOmittedFields<models.ModuleAction>, "id" | "actionType" | "restVerb" | "gqlOperation" | "inputType" | "outputType" | "restInputSource"> & { | ||
id?: string; | ||
@@ -158,18 +162,31 @@ displayName: string; | ||
gqlOperation: keyof typeof models.EnumModuleActionGqlOperation; | ||
inputType?: PropertyTypeDef; | ||
outputType?: PropertyTypeDef; | ||
restInputSource?: keyof typeof models.EnumModuleActionRestInputSource; | ||
}; | ||
export type entityDefaultActions = { | ||
[models.EnumModuleActionType.Create]: ModuleAction | undefined; | ||
[models.EnumModuleActionType.Delete]: ModuleAction | undefined; | ||
[models.EnumModuleActionType.Find]: ModuleAction | undefined; | ||
[models.EnumModuleActionType.Meta]: ModuleAction | undefined; | ||
[models.EnumModuleActionType.Read]: ModuleAction | undefined; | ||
[models.EnumModuleActionType.Update]: ModuleAction | undefined; | ||
export type ModuleDtoProperty = Omit<models.ModuleDtoProperty, "propertyTypes"> & { | ||
propertyTypes: PropertyTypeDef[]; | ||
}; | ||
export type ModuleDto = Omit<BlockOmittedFields<models.ModuleDto>, "id" | "dtoType" | "properties"> & { | ||
id?: string; | ||
description: string; | ||
dtoType: keyof typeof models.EnumModuleDtoType; | ||
properties?: ModuleDtoProperty[]; | ||
}; | ||
export type ModuleActionDefaultTypesNestedOnly = Extract<models.EnumModuleActionType, models.EnumModuleActionType.ChildrenConnect | models.EnumModuleActionType.ChildrenDisconnect | models.EnumModuleActionType.ChildrenFind | models.EnumModuleActionType.ChildrenUpdate | models.EnumModuleActionType.ParentGet>; | ||
export type ModuleActionDefaultTypesWithoutNested = Exclude<models.EnumModuleActionType, ModuleActionDefaultTypesNestedOnly | models.EnumModuleActionType.Custom>; | ||
export type entityRelatedFieldDefaultActions = { | ||
[models.EnumModuleActionType.ChildrenConnect]?: ModuleAction | undefined; | ||
[models.EnumModuleActionType.ChildrenDisconnect]?: ModuleAction | undefined; | ||
[models.EnumModuleActionType.ChildrenFind]?: ModuleAction | undefined; | ||
[models.EnumModuleActionType.ChildrenUpdate]?: ModuleAction | undefined; | ||
[models.EnumModuleActionType.ParentGet]?: ModuleAction | undefined; | ||
[key in ModuleActionDefaultTypesNestedOnly]?: ModuleAction | undefined; | ||
}; | ||
export type entityDefaultActions = { | ||
[key in ModuleActionDefaultTypesWithoutNested]?: ModuleAction | undefined; | ||
}; | ||
type defaultDtoTypes = Exclude<models.EnumModuleDtoType, models.EnumModuleDtoType.Custom | models.EnumModuleDtoType.CustomEnum | models.EnumModuleDtoType.Enum | models.EnumModuleDtoType.CreateNestedManyInput | models.EnumModuleDtoType.UpdateNestedManyInput>; | ||
type defaultDtoNestedTypes = Extract<models.EnumModuleDtoType, models.EnumModuleDtoType.CreateNestedManyInput | models.EnumModuleDtoType.UpdateNestedManyInput>; | ||
export type entityDefaultDtos = { | ||
[key in defaultDtoTypes]: ModuleDto | undefined; | ||
}; | ||
export type entityDefaultNestedDtos = { | ||
[key in defaultDtoNestedTypes]: ModuleDto | undefined; | ||
}; | ||
export type entityActions = { | ||
@@ -183,2 +200,9 @@ entityDefaultActions: entityDefaultActions; | ||
entityActions>; | ||
export type ModuleActionsAndDtos = { | ||
moduleContainer: ModuleContainer; | ||
actions: ModuleAction[]; | ||
dtos: ModuleDto[]; | ||
}; | ||
export type ModuleActionsAndDtosMap = Record<string, //module name | ||
ModuleActionsAndDtos>; | ||
type BlockOmittedFields<T> = Omit<T, "__typename" | "createdAt" | "updatedAt" | "parentBlock" | "displayName" | "description" | "blockType" | "versionNumber" | "inputParameters" | "outputParameters" | "lockedByUserId" | "lockedAt" | "lockedByUser">; | ||
@@ -185,0 +209,0 @@ export type clientDirectories = { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ModuleMap = exports.EnumModuleActionRestVerb = exports.EnumModuleActionGqlOperation = exports.EnumModuleActionType = exports.EnumMessagePatternConnectionOptions = exports.EnumEntityPermissionType = exports.EnumEntityAction = exports.EnumDataType = void 0; | ||
const tslib_1 = require("tslib"); | ||
const models = tslib_1.__importStar(require("./models")); | ||
exports.ModuleMap = exports.EnumModuleActionRestInputSource = exports.EnumModuleDtoPropertyType = exports.EnumModuleActionRestVerb = exports.EnumModuleActionGqlOperation = exports.EnumModuleDtoType = exports.EnumModuleActionType = exports.EnumMessagePatternConnectionOptions = exports.EnumEntityPermissionType = exports.EnumEntityAction = exports.EnumDataType = void 0; | ||
var models_1 = require("./models"); | ||
@@ -12,4 +10,7 @@ Object.defineProperty(exports, "EnumDataType", { enumerable: true, get: function () { return models_1.EnumDataType; } }); | ||
Object.defineProperty(exports, "EnumModuleActionType", { enumerable: true, get: function () { return models_1.EnumModuleActionType; } }); | ||
Object.defineProperty(exports, "EnumModuleDtoType", { enumerable: true, get: function () { return models_1.EnumModuleDtoType; } }); | ||
Object.defineProperty(exports, "EnumModuleActionGqlOperation", { enumerable: true, get: function () { return models_1.EnumModuleActionGqlOperation; } }); | ||
Object.defineProperty(exports, "EnumModuleActionRestVerb", { enumerable: true, get: function () { return models_1.EnumModuleActionRestVerb; } }); | ||
Object.defineProperty(exports, "EnumModuleDtoPropertyType", { enumerable: true, get: function () { return models_1.EnumModuleDtoPropertyType; } }); | ||
Object.defineProperty(exports, "EnumModuleActionRestInputSource", { enumerable: true, get: function () { return models_1.EnumModuleActionRestInputSource; } }); | ||
/** | ||
@@ -16,0 +17,0 @@ * ModuleMap is a map of module paths to modules |
@@ -1,2 +0,2 @@ | ||
import { AppInfo, Entity, ModuleAction, ModuleContainer, PluginInstallation, Role, ServiceTopics, Topic } from "./code-gen-types"; | ||
import { AppInfo, Entity, ModuleAction, ModuleDto, ModuleContainer, PluginInstallation, Role, ServiceTopics, Topic } from "./code-gen-types"; | ||
import { EnumResourceType } from "./models"; | ||
@@ -12,2 +12,3 @@ export declare class DSGResourceData { | ||
moduleActions?: ModuleAction[]; | ||
moduleDtos?: ModuleDto[]; | ||
serviceTopics?: ServiceTopics[]; | ||
@@ -14,0 +15,0 @@ topics?: Topic[]; |
@@ -13,2 +13,3 @@ "use strict"; | ||
moduleActions; | ||
moduleDtos; | ||
//#region Blocks | ||
@@ -15,0 +16,0 @@ serviceTopics; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SortOrder = exports.Role = exports.QueryMode = exports.PreviewAccountType = exports.EnumWorkspaceMemberType = exports.EnumUserActionType = exports.EnumUserActionStatus = exports.EnumSubscriptionStatus = exports.EnumSubscriptionPlan = exports.EnumResourceType = exports.EnumPendingChangeOriginType = exports.EnumPendingChangeAction = exports.EnumModuleActionType = exports.EnumModuleActionRestVerb = exports.EnumModuleActionGqlOperation = exports.EnumMessagePatternConnectionOptions = exports.EnumGitProvider = exports.EnumGitOrganizationType = exports.EnumEntityPermissionType = exports.EnumEntityAction = exports.EnumDataType = exports.EnumBuildStatus = exports.EnumBlockType = exports.EnumAuthProviderType = exports.EnumActionStepStatus = exports.EnumActionLogLevel = exports.CodeGeneratorVersionStrategy = void 0; | ||
exports.SortOrder = exports.Role = exports.QueryMode = exports.EnumWorkspaceMemberType = exports.EnumUserActionType = exports.EnumUserActionStatus = exports.EnumSubscriptionStatus = exports.EnumSubscriptionPlan = exports.EnumSchemaNames = exports.EnumResourceType = exports.EnumPreviewAccountType = exports.EnumPendingChangeOriginType = exports.EnumPendingChangeAction = exports.EnumModuleDtoType = exports.EnumModuleDtoPropertyType = exports.EnumModuleActionType = exports.EnumModuleActionRestVerb = exports.EnumModuleActionRestInputSource = exports.EnumModuleActionGqlOperation = exports.EnumMessagePatternConnectionOptions = exports.EnumGitProvider = exports.EnumGitOrganizationType = exports.EnumEntityPermissionType = exports.EnumEntityAction = exports.EnumDataType = exports.EnumBuildStatus = exports.EnumBlockType = exports.EnumAuthProviderType = exports.EnumActionStepStatus = exports.EnumActionLogLevel = exports.CodeGeneratorVersionStrategy = void 0; | ||
var CodeGeneratorVersionStrategy; | ||
@@ -34,2 +34,3 @@ (function (CodeGeneratorVersionStrategy) { | ||
EnumBlockType["ModuleAction"] = "ModuleAction"; | ||
EnumBlockType["ModuleDto"] = "ModuleDto"; | ||
EnumBlockType["PluginInstallation"] = "PluginInstallation"; | ||
@@ -108,2 +109,9 @@ EnumBlockType["PluginOrder"] = "PluginOrder"; | ||
})(EnumModuleActionGqlOperation || (exports.EnumModuleActionGqlOperation = EnumModuleActionGqlOperation = {})); | ||
var EnumModuleActionRestInputSource; | ||
(function (EnumModuleActionRestInputSource) { | ||
EnumModuleActionRestInputSource["Body"] = "Body"; | ||
EnumModuleActionRestInputSource["Params"] = "Params"; | ||
EnumModuleActionRestInputSource["Query"] = "Query"; | ||
EnumModuleActionRestInputSource["Split"] = "Split"; | ||
})(EnumModuleActionRestInputSource || (exports.EnumModuleActionRestInputSource = EnumModuleActionRestInputSource = {})); | ||
var EnumModuleActionRestVerb; | ||
@@ -135,2 +143,36 @@ (function (EnumModuleActionRestVerb) { | ||
})(EnumModuleActionType || (exports.EnumModuleActionType = EnumModuleActionType = {})); | ||
var EnumModuleDtoPropertyType; | ||
(function (EnumModuleDtoPropertyType) { | ||
EnumModuleDtoPropertyType["Boolean"] = "Boolean"; | ||
EnumModuleDtoPropertyType["DateTime"] = "DateTime"; | ||
EnumModuleDtoPropertyType["Dto"] = "Dto"; | ||
EnumModuleDtoPropertyType["Enum"] = "Enum"; | ||
EnumModuleDtoPropertyType["Float"] = "Float"; | ||
EnumModuleDtoPropertyType["Integer"] = "Integer"; | ||
EnumModuleDtoPropertyType["Json"] = "Json"; | ||
EnumModuleDtoPropertyType["Null"] = "Null"; | ||
EnumModuleDtoPropertyType["String"] = "String"; | ||
EnumModuleDtoPropertyType["Undefined"] = "Undefined"; | ||
})(EnumModuleDtoPropertyType || (exports.EnumModuleDtoPropertyType = EnumModuleDtoPropertyType = {})); | ||
var EnumModuleDtoType; | ||
(function (EnumModuleDtoType) { | ||
EnumModuleDtoType["CountArgs"] = "CountArgs"; | ||
EnumModuleDtoType["CreateArgs"] = "CreateArgs"; | ||
EnumModuleDtoType["CreateInput"] = "CreateInput"; | ||
EnumModuleDtoType["CreateNestedManyInput"] = "CreateNestedManyInput"; | ||
EnumModuleDtoType["Custom"] = "Custom"; | ||
EnumModuleDtoType["CustomEnum"] = "CustomEnum"; | ||
EnumModuleDtoType["DeleteArgs"] = "DeleteArgs"; | ||
EnumModuleDtoType["Entity"] = "Entity"; | ||
EnumModuleDtoType["Enum"] = "Enum"; | ||
EnumModuleDtoType["FindManyArgs"] = "FindManyArgs"; | ||
EnumModuleDtoType["FindOneArgs"] = "FindOneArgs"; | ||
EnumModuleDtoType["ListRelationFilter"] = "ListRelationFilter"; | ||
EnumModuleDtoType["OrderByInput"] = "OrderByInput"; | ||
EnumModuleDtoType["UpdateArgs"] = "UpdateArgs"; | ||
EnumModuleDtoType["UpdateInput"] = "UpdateInput"; | ||
EnumModuleDtoType["UpdateNestedManyInput"] = "UpdateNestedManyInput"; | ||
EnumModuleDtoType["WhereInput"] = "WhereInput"; | ||
EnumModuleDtoType["WhereUniqueInput"] = "WhereUniqueInput"; | ||
})(EnumModuleDtoType || (exports.EnumModuleDtoType = EnumModuleDtoType = {})); | ||
var EnumPendingChangeAction; | ||
@@ -147,2 +189,7 @@ (function (EnumPendingChangeAction) { | ||
})(EnumPendingChangeOriginType || (exports.EnumPendingChangeOriginType = EnumPendingChangeOriginType = {})); | ||
var EnumPreviewAccountType; | ||
(function (EnumPreviewAccountType) { | ||
EnumPreviewAccountType["BreakingTheMonolith"] = "BreakingTheMonolith"; | ||
EnumPreviewAccountType["None"] = "None"; | ||
})(EnumPreviewAccountType || (exports.EnumPreviewAccountType = EnumPreviewAccountType = {})); | ||
var EnumResourceType; | ||
@@ -154,2 +201,9 @@ (function (EnumResourceType) { | ||
})(EnumResourceType || (exports.EnumResourceType = EnumResourceType = {})); | ||
var EnumSchemaNames; | ||
(function (EnumSchemaNames) { | ||
EnumSchemaNames["Abby"] = "Abby"; | ||
EnumSchemaNames["CalDotCom"] = "CalDotCom"; | ||
EnumSchemaNames["Formbricks"] = "Formbricks"; | ||
EnumSchemaNames["Papermark"] = "Papermark"; | ||
})(EnumSchemaNames || (exports.EnumSchemaNames = EnumSchemaNames = {})); | ||
var EnumSubscriptionPlan; | ||
@@ -180,2 +234,4 @@ (function (EnumSubscriptionPlan) { | ||
EnumUserActionType["DbSchemaImport"] = "DBSchemaImport"; | ||
EnumUserActionType["GptConversation"] = "GptConversation"; | ||
EnumUserActionType["ProjectRedesign"] = "ProjectRedesign"; | ||
})(EnumUserActionType || (exports.EnumUserActionType = EnumUserActionType = {})); | ||
@@ -187,7 +243,2 @@ var EnumWorkspaceMemberType; | ||
})(EnumWorkspaceMemberType || (exports.EnumWorkspaceMemberType = EnumWorkspaceMemberType = {})); | ||
var PreviewAccountType; | ||
(function (PreviewAccountType) { | ||
PreviewAccountType["BreakingTheMonolith"] = "BreakingTheMonolith"; | ||
PreviewAccountType["None"] = "None"; | ||
})(PreviewAccountType || (exports.PreviewAccountType = PreviewAccountType = {})); | ||
var QueryMode; | ||
@@ -194,0 +245,0 @@ (function (QueryMode) { |
@@ -18,2 +18,3 @@ import type { namedTypes } from "ast-types"; | ||
entityActions: entityActions; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -30,2 +31,3 @@ export interface CreateEntityServiceParams extends EventParams { | ||
entityActions: entityActions; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -56,2 +58,3 @@ export interface CreateEntityControllerParams extends EventParams { | ||
entityActions: entityActions; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -79,2 +82,3 @@ export interface CreateEntityGrpcControllerParams extends EventParams { | ||
serviceId: namedTypes.Identifier; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -266,2 +270,3 @@ export interface CreateEntityControllerToManyRelationMethodsParams extends EventParams { | ||
entityActions: entityActions; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -285,2 +290,3 @@ export interface CreateEntityResolverBaseParams extends EventParams { | ||
entityActions: entityActions; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -302,5 +308,7 @@ export interface CreateSwaggerParams extends EventParams { | ||
outputFileName: string; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
export interface CreateDTOsParams extends EventParams { | ||
dtos: DTOs; | ||
dtoNameToPath: Record<string, string>; | ||
} | ||
@@ -307,0 +315,0 @@ export interface LoadStaticFilesParams extends EventParams { |
import type { Promisable } from "type-fest"; | ||
import { BuildLogger } from "./build-logger"; | ||
import { clientDirectories, DTOs, EntityActionsMap, ModuleMap, serverDirectories } from "./code-gen-types"; | ||
import { clientDirectories, DTOs, EntityActionsMap, ModuleActionsAndDtosMap, ModuleMap, serverDirectories } from "./code-gen-types"; | ||
import { DSGResourceData } from "./dsg-resource-data"; | ||
@@ -45,2 +45,3 @@ import { Events } from "./plugin-events.types"; | ||
entityActionsMap: EntityActionsMap; | ||
moduleActionsAndDtoMap: ModuleActionsAndDtosMap; | ||
} | ||
@@ -47,0 +48,0 @@ export type PluginWrapper = (args: EventParams, func: () => void) => any; |
@@ -7,3 +7,10 @@ { | ||
"additionalProperties": false, | ||
"properties": {} | ||
"properties": { | ||
"maxLength": { | ||
"type": "integer", | ||
"description": "The maximum length of the field", | ||
"minimum": 1, | ||
"default": 256 | ||
} | ||
} | ||
} |
@@ -7,3 +7,10 @@ { | ||
"additionalProperties": false, | ||
"properties": {} | ||
"properties": { | ||
"maxLength": { | ||
"type": "integer", | ||
"description": "The maximum length of the field", | ||
"minimum": 1, | ||
"default": 256 | ||
} | ||
} | ||
} |
@@ -7,2 +7,6 @@ /** | ||
export interface Password { | ||
/** | ||
* The maximum length of the field | ||
*/ | ||
maxLength?: number; | ||
} |
@@ -7,2 +7,6 @@ /** | ||
export interface Username { | ||
/** | ||
* The maximum length of the field | ||
*/ | ||
maxLength?: number; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
192958
4497