Browse Source

Tighten API model types and add multi-tenancy export

Strengthen TypeScript model typings across several ABP proxy models: make many previously-optional fields required, replace nullable union types with stricter types (remove | null in many places), convert nullable arrays/objects to concrete arrays/records, and normalize a few property types (e.g. LocalizableString.resource). Updated files: application-configurations/object-extending/models.ts, asp-net-core/mvc/multi-tenancy/models.ts, http/modeling/models.ts. Also added an export for './lib/proxy/volo/abp/multi-tenancy' to public-api.ts so the multi-tenancy proxies are publicly available.
pull/25051/head
Fahri Gedik 7 months ago
parent
commit
a82f55a91d
  1. 196
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts
  2. 40
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts
  3. 207
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
  4. 1
      npm/ng-packs/packages/core/src/public-api.ts

196
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts

@ -1,109 +1,87 @@
export interface EntityExtensionDto { export interface EntityExtensionDto {
properties?: Record<string, ExtensionPropertyDto>; properties: Record<string, ExtensionPropertyDto>;
configuration?: Record<string, object>; configuration: Record<string, object>;
} }
export interface ExtensionEnumDto { export interface ExtensionEnumDto {
fields?: ExtensionEnumFieldDto[]; fields: ExtensionEnumFieldDto[];
localizationResource?: string | null; localizationResource?: string;
} }
export interface ExtensionEnumFieldDto { export interface ExtensionEnumFieldDto {
name?: string | null; name?: string;
value?: object | null; value: object;
} }
export interface ExtensionPropertyApiCreateDto { export interface ExtensionPropertyApiCreateDto {
isAvailable?: boolean; isAvailable: boolean;
} }
export interface ExtensionPropertyApiDto { export interface ExtensionPropertyApiDto {
onGet?: ExtensionPropertyApiGetDto; onGet: ExtensionPropertyApiGetDto;
onCreate?: ExtensionPropertyApiCreateDto; onCreate: ExtensionPropertyApiCreateDto;
onUpdate?: ExtensionPropertyApiUpdateDto; onUpdate: ExtensionPropertyApiUpdateDto;
} }
export interface ExtensionPropertyApiGetDto { export interface ExtensionPropertyApiGetDto {
isAvailable?: boolean; isAvailable: boolean;
} }
export interface ExtensionPropertyApiUpdateDto { export interface ExtensionPropertyApiUpdateDto {
isAvailable?: boolean; isAvailable: boolean;
} }
export interface ExtensionPropertyAttributeDto { export interface ExtensionPropertyAttributeDto {
typeSimple?: string; typeSimple?: string;
config?: Record<string, object>; config: Record<string, object>;
} }
export interface ExtensionPropertyDto { export interface ExtensionPropertyDto {
type?: string; type?: string;
typeSimple?: string; typeSimple?: string;
displayName?: LocalizableStringDto | null; displayName: LocalizableStringDto;
api?: ExtensionPropertyApiDto; api: ExtensionPropertyApiDto;
ui?: ExtensionPropertyUiDto; ui: ExtensionPropertyUiDto;
policy?: ExtensionPropertyPolicyDto; attributes: ExtensionPropertyAttributeDto[];
attributes?: ExtensionPropertyAttributeDto[]; configuration: Record<string, object>;
configuration?: Record<string, object>; defaultValue: object;
defaultValue?: object | null; }
}
export interface ExtensionPropertyUiDto {
export interface ExtensionPropertyFeaturePolicyDto { onTable: ExtensionPropertyUiTableDto;
features?: string[]; onCreateForm: ExtensionPropertyUiFormDto;
requiresAll?: boolean; onEditForm: ExtensionPropertyUiFormDto;
} lookup: ExtensionPropertyUiLookupDto;
}
export interface ExtensionPropertyGlobalFeaturePolicyDto {
features?: string[]; export interface ExtensionPropertyUiFormDto {
requiresAll?: boolean; isVisible: boolean;
} }
export interface ExtensionPropertyPermissionPolicyDto { export interface ExtensionPropertyUiLookupDto {
permissionNames?: string[]; url?: string;
requiresAll?: boolean; resultListPropertyName?: string;
} displayPropertyName?: string;
valuePropertyName?: string;
export interface ExtensionPropertyPolicyDto { filterParamName?: string;
globalFeatures?: ExtensionPropertyGlobalFeaturePolicyDto; }
features?: ExtensionPropertyFeaturePolicyDto;
permissions?: ExtensionPropertyPermissionPolicyDto; export interface ExtensionPropertyUiTableDto {
} isVisible: boolean;
}
export interface ExtensionPropertyUiDto {
onTable?: ExtensionPropertyUiTableDto; export interface LocalizableStringDto {
onCreateForm?: ExtensionPropertyUiFormDto; name?: string;
onEditForm?: ExtensionPropertyUiFormDto; resource?: string;
lookup?: ExtensionPropertyUiLookupDto; }
}
export interface ModuleExtensionDto {
export interface ExtensionPropertyUiFormDto { entities: Record<string, EntityExtensionDto>;
isVisible?: boolean; configuration: Record<string, object>;
} }
export interface ExtensionPropertyUiLookupDto { export interface ObjectExtensionsDto {
url?: string; modules: Record<string, ModuleExtensionDto>;
resultListPropertyName?: string; enums: Record<string, ExtensionEnumDto>;
displayPropertyName?: string; }
valuePropertyName?: string;
filterParamName?: string;
}
export interface ExtensionPropertyUiTableDto {
isVisible?: boolean;
}
export interface LocalizableStringDto {
name?: string;
resource?: string | null;
}
export interface ModuleExtensionDto {
entities?: Record<string, EntityExtensionDto>;
configuration?: Record<string, object>;
}
export interface ObjectExtensionsDto {
modules?: Record<string, ModuleExtensionDto>;
enums?: Record<string, ExtensionEnumDto>;
}

40
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts

@ -1,20 +1,20 @@
import type { TenantUserSharingStrategy } from '../../../multi-tenancy/tenant-user-sharing-strategy.enum'; import type { TenantUserSharingStrategy } from '../../../multi-tenancy/tenant-user-sharing-strategy.enum';
export interface FindTenantResultDto { export interface FindTenantResultDto {
success?: boolean; success: boolean;
tenantId?: string | null; tenantId?: string;
name?: string | null; name?: string;
normalizedName?: string | null; normalizedName?: string;
isActive?: boolean; isActive: boolean;
} }
export interface CurrentTenantDto { export interface CurrentTenantDto {
id?: string | null; id?: string;
name?: string | null; name?: string;
isAvailable?: boolean; isAvailable: boolean;
} }
export interface MultiTenancyInfoDto { export interface MultiTenancyInfoDto {
isEnabled?: boolean; isEnabled: boolean;
userSharingStrategy?: TenantUserSharingStrategy; userSharingStrategy?: TenantUserSharingStrategy;
} }

207
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts

@ -1,107 +1,100 @@
export interface ActionApiDescriptionModel { export interface ActionApiDescriptionModel {
uniqueName?: string; uniqueName?: string;
name?: string; name?: string;
httpMethod?: string | null; httpMethod?: string;
url?: string; url?: string;
supportedVersions?: string[] | null; supportedVersions: string[];
parametersOnMethod?: MethodParameterApiDescriptionModel[]; parametersOnMethod: MethodParameterApiDescriptionModel[];
parameters?: ParameterApiDescriptionModel[]; parameters: ParameterApiDescriptionModel[];
returnValue?: ReturnValueApiDescriptionModel; returnValue: ReturnValueApiDescriptionModel;
allowAnonymous?: boolean | null; allowAnonymous?: boolean;
authorizeDatas?: AuthorizeDataApiDescriptionModel[]; implementFrom?: string;
implementFrom?: string | null; }
}
export interface ApplicationApiDescriptionModel {
export interface ApplicationApiDescriptionModel { modules: Record<string, ModuleApiDescriptionModel>;
modules?: Record<string, ModuleApiDescriptionModel>; types: Record<string, TypeApiDescriptionModel>;
types?: Record<string, TypeApiDescriptionModel>; }
}
export interface ApplicationApiDescriptionModelRequestDto {
export interface ApplicationApiDescriptionModelRequestDto { includeTypes: boolean;
includeTypes?: boolean; }
}
export interface ControllerApiDescriptionModel {
export interface AuthorizeDataApiDescriptionModel { controllerName?: string;
policy?: string | null; controllerGroupName?: string;
roles?: string | null; isRemoteService: boolean;
} isIntegrationService: boolean;
apiVersion?: string;
export interface ControllerApiDescriptionModel { type?: string;
controllerName?: string; interfaces: ControllerInterfaceApiDescriptionModel[];
controllerGroupName?: string | null; actions: Record<string, ActionApiDescriptionModel>;
isRemoteService?: boolean; }
isIntegrationService?: boolean;
apiVersion?: string | null; export interface ControllerInterfaceApiDescriptionModel {
type?: string; type?: string;
interfaces?: ControllerInterfaceApiDescriptionModel[]; name?: string;
actions?: Record<string, ActionApiDescriptionModel>; methods: InterfaceMethodApiDescriptionModel[];
} }
export interface ControllerInterfaceApiDescriptionModel { export interface InterfaceMethodApiDescriptionModel {
type?: string; name?: string;
name?: string; parametersOnMethod: MethodParameterApiDescriptionModel[];
methods?: InterfaceMethodApiDescriptionModel[]; returnValue: ReturnValueApiDescriptionModel;
} }
export interface InterfaceMethodApiDescriptionModel { export interface MethodParameterApiDescriptionModel {
name?: string; name?: string;
parametersOnMethod?: MethodParameterApiDescriptionModel[]; typeAsString?: string;
returnValue?: ReturnValueApiDescriptionModel; type?: string;
} typeSimple?: string;
isOptional: boolean;
export interface MethodParameterApiDescriptionModel { defaultValue: object;
name?: string; }
typeAsString?: string;
type?: string; export interface ModuleApiDescriptionModel {
typeSimple?: string; rootPath?: string;
isOptional?: boolean; remoteServiceName?: string;
defaultValue?: object | null; controllers: Record<string, ControllerApiDescriptionModel>;
} }
export interface ModuleApiDescriptionModel { export interface ParameterApiDescriptionModel {
rootPath?: string; nameOnMethod?: string;
remoteServiceName?: string; name?: string;
controllers?: Record<string, ControllerApiDescriptionModel>; jsonName?: string;
} type?: string;
typeSimple?: string;
export interface ParameterApiDescriptionModel { isOptional: boolean;
nameOnMethod?: string; defaultValue: object;
name?: string; constraintTypes: string[];
jsonName?: string | null; bindingSourceId?: string;
type?: string | null; descriptorName?: string;
typeSimple?: string | null; }
isOptional?: boolean;
defaultValue?: object | null; export interface PropertyApiDescriptionModel {
constraintTypes?: string[] | null; name?: string;
bindingSourceId?: string | null; jsonName?: string;
descriptorName?: string | null; type?: string;
} typeSimple?: string;
isRequired: boolean;
export interface PropertyApiDescriptionModel { minLength?: number;
name?: string; maxLength?: number;
jsonName?: string | null; minimum?: string;
type?: string; maximum?: string;
typeSimple?: string; regex?: string;
isRequired?: boolean; }
minLength?: number | null;
maxLength?: number | null; export interface ReturnValueApiDescriptionModel {
minimum?: string | null; type?: string;
maximum?: string | null; typeSimple?: string;
regex?: string | null; }
isNullable?: boolean;
} export interface TypeApiDescriptionModel {
baseType?: string;
export interface ReturnValueApiDescriptionModel { isEnum: boolean;
type?: string; enumNames: string[];
typeSimple?: string; enumValues: object[];
} genericArguments: string[];
properties: PropertyApiDescriptionModel[];
export interface TypeApiDescriptionModel { }
baseType?: string | null;
isEnum?: boolean;
enumNames?: string[] | null;
enumValues?: object[] | null;
genericArguments?: string[] | null;
properties?: PropertyApiDescriptionModel[] | null;
}

1
npm/ng-packs/packages/core/src/public-api.ts

@ -15,6 +15,7 @@ export * from './lib/proxy/volo/abp/asp-net-core/mvc/api-exploring';
export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations'; export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations';
export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending'; export * from './lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending';
export * from './lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy'; export * from './lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy';
export * from './lib/proxy/volo/abp/multi-tenancy';
export * from './lib/proxy/volo/abp/http/modeling'; export * from './lib/proxy/volo/abp/http/modeling';
export * from './lib/proxy/volo/abp/localization'; export * from './lib/proxy/volo/abp/localization';
export * from './lib/proxy/volo/abp/models'; export * from './lib/proxy/volo/abp/models';

Loading…
Cancel
Save