From 9dbae3afe3dd9314a21a5c53c78e7f63dd597f98 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 11:55:24 +0300 Subject: [PATCH 01/95] build: add dependencies for schematics --- npm/ng-packs/package.json | 4 ++++ npm/ng-packs/yarn.lock | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 0951ad2d1c8..082cfce422e 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -13,6 +13,8 @@ "test": "ng test --watchAll --runInBand", "commit": "git-cz", "lint": "ng lint", + "build:schematics": "cd scripts && yarn && yarn build:schematics && cd ..", + "dev:schematics": "tsc -p packages/schematics/tsconfig.json -w", "scripts:build": "cd scripts && yarn && yarn build", "prepare:workspace": "yarn scripts:build --noInstall", "ci": "yarn ng lint && yarn prepare:workspace && yarn ci:test && yarn ci:build", @@ -57,6 +59,7 @@ "@ngxs/router-plugin": "^3.6.2", "@ngxs/storage-plugin": "^3.6.2", "@ngxs/store": "^3.6.2", + "@schematics/angular": "~10.0.5", "@swimlane/ngx-datatable": "^17.0.0", "@types/jest": "^25.2.3", "@types/node": "^12.11.1", @@ -70,6 +73,7 @@ "jest": "^25.0.0", "jest-canvas-mock": "^2.2.0", "jest-preset-angular": "^8.2.0", + "jsonc-parser": "^2.3.0", "just-clone": "^3.1.0", "just-compare": "^1.3.0", "lerna": "^3.19.0", diff --git a/npm/ng-packs/yarn.lock b/npm/ng-packs/yarn.lock index e9caca6facc..af7083c75f9 100644 --- a/npm/ng-packs/yarn.lock +++ b/npm/ng-packs/yarn.lock @@ -2562,7 +2562,7 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@schematics/angular@10.0.5": +"@schematics/angular@10.0.5", "@schematics/angular@~10.0.5": version "10.0.5" resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-10.0.5.tgz#905f7c58547fdf9847fb004c1689bc0af7a09a7a" integrity sha512-zg8QxgW3uLva/MSKMRYfV7dzj00SUki4nxYN4j1rw42VlwNPnFrPtzFVEilL6N7wFgoHP/6cZRgm4bfXYvLBvg== @@ -8432,6 +8432,11 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +jsonc-parser@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.3.0.tgz#7c7fc988ee1486d35734faaaa866fadb00fa91ee" + integrity sha512-b0EBt8SWFNnixVdvoR2ZtEGa9ZqLhbJnOjezn+WP+8kspFm+PFYDN8Z4Bc7pRlDjvuVcADSUkroIuTWWn/YiIA== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" From 9641e4c1f5f4d23368f3c526d8de3c93369c5d1c Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 11:56:25 +0300 Subject: [PATCH 02/95] chore: make VS Code ignore template files --- npm/ng-packs/.vscode/settings.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/npm/ng-packs/.vscode/settings.json b/npm/ng-packs/.vscode/settings.json index a04bf7ca0cb..cee01836fcf 100644 --- a/npm/ng-packs/.vscode/settings.json +++ b/npm/ng-packs/.vscode/settings.json @@ -1,4 +1,22 @@ { + "[typescriptreact]": { + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll": false, + "source.organizeImports": false + } + }, + "[xml]": { + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll": false, + "source.organizeImports": false + } + }, + "files.associations": { + "*.ts.template": "typescriptreact", + "*.html.template": "xml" + }, "search.exclude": { "**/dist": true }, From 50407d19a113564d51792c824e52f666d4389f6f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 11:57:50 +0300 Subject: [PATCH 03/95] build: add build scripts for schematics --- npm/ng-packs/scripts/build-schematics.ts | 59 ++++++++++++++++++++++++ npm/ng-packs/scripts/package.json | 1 + 2 files changed, 60 insertions(+) create mode 100644 npm/ng-packs/scripts/build-schematics.ts diff --git a/npm/ng-packs/scripts/build-schematics.ts b/npm/ng-packs/scripts/build-schematics.ts new file mode 100644 index 00000000000..9b4f32cd305 --- /dev/null +++ b/npm/ng-packs/scripts/build-schematics.ts @@ -0,0 +1,59 @@ +import execa from 'execa'; +import fse from 'fs-extra'; + +class FileCopy { + src: string; + dest: string; + options?: fse.CopyOptions; + + constructor(filecopyOrSrc: FileCopy | string) { + if (typeof filecopyOrSrc === 'string') { + this.src = filecopyOrSrc; + this.dest = filecopyOrSrc; + } else { + this.src = filecopyOrSrc.src; + this.dest = filecopyOrSrc.dest; + this.options = filecopyOrSrc.options; + } + } +} + +const PACKAGE_TO_BUILD = 'schematics'; +const FILES_TO_COPY_AFTER_BUILD: (FileCopy | string)[] = [ + { src: 'src/commands/proxy/files-enum', dest: 'commands/proxy/files-enum' }, + { src: 'src/commands/proxy/files-model', dest: 'commands/proxy/files-model' }, + { src: 'src/commands/proxy/files-service', dest: 'commands/proxy/files-service' }, + { src: 'src/collection.json', dest: 'collection.json' }, + 'package.json', + 'README.md', +]; + +async function* copyPackageFile(packageName: string, filecopy: FileCopy | string) { + filecopy = new FileCopy(filecopy); + const { src, dest, options = { overwrite: true } } = filecopy; + + await fse.copy(`../packages/${packageName}/${src}`, `../dist/${packageName}/${dest}`, options); + + yield filecopy; +} + +async function* copyPackageFiles(packageName: string) { + for (const filecopy of FILES_TO_COPY_AFTER_BUILD) { + yield* copyPackageFile(packageName, filecopy); + } +} + +(async () => { + await execa( + 'tsc', + ['-p', `packages/${PACKAGE_TO_BUILD}/tsconfig.json`, '--outDir', `dist/${PACKAGE_TO_BUILD}`], + { + stdout: 'inherit', + cwd: '../', + }, + ); + + for await (const filecopy of copyPackageFiles(PACKAGE_TO_BUILD)) { + // do nothing + } +})(); diff --git a/npm/ng-packs/scripts/package.json b/npm/ng-packs/scripts/package.json index 932abe4f641..3984a00b148 100644 --- a/npm/ng-packs/scripts/package.json +++ b/npm/ng-packs/scripts/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "ts-node -r tsconfig-paths/register build.ts", "build:prod": "ts-node -r tsconfig-paths/register prod-build.ts", + "build:schematics": "ts-node -r tsconfig-paths/register build-schematics.ts", "publish-packages": "ts-node -r tsconfig-paths/register publish.ts", "replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts" }, From bdb82177c2a08cc6c4403e0f377771a558e1764d Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 11:58:53 +0300 Subject: [PATCH 04/95] feat: add an empty schematics project --- npm/ng-packs/packages/schematics/.gitignore | 18 +++++++++++ npm/ng-packs/packages/schematics/.npmignore | 3 ++ npm/ng-packs/packages/schematics/README.md | 3 ++ .../packages/schematics/jest.config.js | 7 ++++ npm/ng-packs/packages/schematics/package.json | 23 +++++++++++++ .../packages/schematics/src/collection.json | 9 ++++++ .../enums/__name@kebab__.ts.template | 0 .../enums/__name@kebab__.ts.template | 0 .../enums/__name@kebab__.service.ts.template | 0 .../schematics/src/commands/proxy/index.ts | 10 ++++++ .../schematics/src/commands/proxy/schema.json | 32 +++++++++++++++++++ .../schematics/src/commands/proxy/schema.ts | 16 ++++++++++ .../packages/schematics/tsconfig.json | 24 ++++++++++++++ npm/ng-packs/packages/schematics/tslint.json | 8 +++++ 14 files changed, 153 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/.gitignore create mode 100644 npm/ng-packs/packages/schematics/.npmignore create mode 100644 npm/ng-packs/packages/schematics/README.md create mode 100644 npm/ng-packs/packages/schematics/jest.config.js create mode 100644 npm/ng-packs/packages/schematics/package.json create mode 100644 npm/ng-packs/packages/schematics/src/collection.json create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/files-enum/__namespacePath__/enums/__name@kebab__.ts.template create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/enums/__name@kebab__.ts.template create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/enums/__name@kebab__.service.ts.template create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/index.ts create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/schema.json create mode 100644 npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts create mode 100644 npm/ng-packs/packages/schematics/tsconfig.json create mode 100644 npm/ng-packs/packages/schematics/tslint.json diff --git a/npm/ng-packs/packages/schematics/.gitignore b/npm/ng-packs/packages/schematics/.gitignore new file mode 100644 index 00000000000..82677b58841 --- /dev/null +++ b/npm/ng-packs/packages/schematics/.gitignore @@ -0,0 +1,18 @@ +# Outputs +src/**/*.js +src/**/*.js.map +src/**/*.d.ts + +# IDEs +.idea/ +jsconfig.json +.vscode/ + +# Misc +node_modules/ +npm-debug.log* +yarn-error.log* + +# Mac OSX Finder files. +**/.DS_Store +.DS_Store diff --git a/npm/ng-packs/packages/schematics/.npmignore b/npm/ng-packs/packages/schematics/.npmignore new file mode 100644 index 00000000000..c55ccfc3f5f --- /dev/null +++ b/npm/ng-packs/packages/schematics/.npmignore @@ -0,0 +1,3 @@ +# Ignores TypeScript files, but keeps definitions. +*.ts +!*.d.ts diff --git a/npm/ng-packs/packages/schematics/README.md b/npm/ng-packs/packages/schematics/README.md new file mode 100644 index 00000000000..19e68b67963 --- /dev/null +++ b/npm/ng-packs/packages/schematics/README.md @@ -0,0 +1,3 @@ +# ABP Suite Schematics + +TODO: Add usage and development information diff --git a/npm/ng-packs/packages/schematics/jest.config.js b/npm/ng-packs/packages/schematics/jest.config.js new file mode 100644 index 00000000000..351bc0355b5 --- /dev/null +++ b/npm/ng-packs/packages/schematics/jest.config.js @@ -0,0 +1,7 @@ +const jestConfig = require('../../jest.config'); + +module.exports = { + ...jestConfig, + name: 'schematics', + testMatch: ['/packages/schematics/**/+(*.)+(spec).+(ts)'], +}; diff --git a/npm/ng-packs/packages/schematics/package.json b/npm/ng-packs/packages/schematics/package.json new file mode 100644 index 00000000000..adde31639eb --- /dev/null +++ b/npm/ng-packs/packages/schematics/package.json @@ -0,0 +1,23 @@ +{ + "name": "@abp/ng.schematics", + "version": "3.0.5", + "description": "Schematics that works with ABP Suite", + "keywords": [ + "schematics" + ], + "author": "", + "license": "MIT", + "schematics": "./src/collection.json", + "dependencies": { + "@angular-devkit/core": "~10.0.3", + "@angular-devkit/schematics": "~10.0.3", + "typescript": "~3.9.2" + }, + "devDependencies": { + "@types/node": "^12.11.1", + "@types/jest": "^26.0.0", + "jest": "^26.0.0", + "jest-preset-angular": "^8.2.0", + "@schematics/angular": "~10.0.3" + } +} diff --git a/npm/ng-packs/packages/schematics/src/collection.json b/npm/ng-packs/packages/schematics/src/collection.json new file mode 100644 index 00000000000..6cfecd4d4a8 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/collection.json @@ -0,0 +1,9 @@ +{ + "schematics": { + "proxy": { + "description": "ABP Proxy Generator Schematics", + "factory": "./commands/proxy", + "schema": "./commands/proxy/schema.json" + } + } +} diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-enum/__namespacePath__/enums/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/proxy/files-enum/__namespacePath__/enums/__name@kebab__.ts.template new file mode 100644 index 00000000000..e69de29bb2d diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/enums/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/enums/__name@kebab__.ts.template new file mode 100644 index 00000000000..e69de29bb2d diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/enums/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/enums/__name@kebab__.service.ts.template new file mode 100644 index 00000000000..e69de29bb2d diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts new file mode 100644 index 00000000000..6c232805c3b --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -0,0 +1,10 @@ +import { chain, SchematicContext, Tree } from '@angular-devkit/schematics'; +import { Schema as GenerateProxySchema } from './schema'; + +export default function(_params: GenerateProxySchema) { + return chain([ + async (_tree: Tree, _context: SchematicContext) => { + return chain([]); + }, + ]); +} diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json new file mode 100644 index 00000000000..e61ee255673 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/schema", + "id": "SchematicsAbpEntityModule", + "title": "ABP Entity Module Schema", + "type": "object", + "properties": { + "module": { + "alias": "m", + "description": "The name of the module to generate code for", + "type": "string", + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Please enter name of the module you wish to generate proxies for. (default: app)" + }, + "apiUrl": { + "alias": "a", + "description": "The URL to get API configuration from", + "type": "string", + "x-prompt": "Plese enter URL to get API config from. Leave blank to use environment variables." + }, + "out": { + "alias": "o", + "description": "The path to place the generated code at", + "type": "string", + "format": "path", + "x-prompt": "Plese enter a custom output path. Leave blank if you do not need one." + } + }, + "required": [] +} diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts new file mode 100644 index 00000000000..1acf9328866 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts @@ -0,0 +1,16 @@ +export interface Schema { + /** + * The URL to get API configuration from + */ + apiUrl?: string; + + /** + * The name of the module to generate code for + */ + module?: string; + + /** + * The path to place the generated code at + */ + out?: string; +} diff --git a/npm/ng-packs/packages/schematics/tsconfig.json b/npm/ng-packs/packages/schematics/tsconfig.json new file mode 100644 index 00000000000..dd80972b489 --- /dev/null +++ b/npm/ng-packs/packages/schematics/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "baseUrl": "tsconfig", + "lib": ["es2018", "dom"], + "declaration": true, + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedParameters": true, + "noUnusedLocals": true, + "rootDir": "src/", + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "sourceMap": true, + "strictNullChecks": true, + "target": "es2017", + "types": ["jest", "node"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "src/*/files/**/*", "**/*.spec.ts"] +} diff --git a/npm/ng-packs/packages/schematics/tslint.json b/npm/ng-packs/packages/schematics/tslint.json new file mode 100644 index 00000000000..7380ad5e401 --- /dev/null +++ b/npm/ng-packs/packages/schematics/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tslint.json", + "rules": { + "variable-name": { + "options": ["allow-leading-underscore", "ban-keywords", "check-format", "allow-pascal-case"] + } + } +} From 0b4c7e3dea302788f0d42e0bad1bff887692a2a3 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:00:19 +0300 Subject: [PATCH 05/95] build: add schematics library to angular.json --- npm/ng-packs/angular.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/npm/ng-packs/angular.json b/npm/ng-packs/angular.json index d7d267dc069..916dea84575 100644 --- a/npm/ng-packs/angular.json +++ b/npm/ng-packs/angular.json @@ -366,6 +366,29 @@ } } }, + "schematics": { + "projectType": "library", + "root": "packages/schematics", + "sourceRoot": "packages/schematics/src", + "prefix": "abp", + "architect": { + "test": { + "builder": "@angular-builders/jest:run", + "options": { + "tsConfig": "tsconfig.json", + "coverage": true, + "passWithNoTests": true + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": ["packages/schematics/tsconfig.json"], + "exclude": ["**/node_modules/**"] + } + } + } + }, "dev-app": { "projectType": "application", "schematics": { From 863d66e34c32ce4b09135b612ce804adceee2550 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:00:47 +0300 Subject: [PATCH 06/95] chore: add mock api-definition.json to schematics --- .../schematics/src/mocks/api-definition.json | 11519 ++++++++++++++++ 1 file changed, 11519 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/mocks/api-definition.json diff --git a/npm/ng-packs/packages/schematics/src/mocks/api-definition.json b/npm/ng-packs/packages/schematics/src/mocks/api-definition.json new file mode 100644 index 00000000000..b7544097566 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/mocks/api-definition.json @@ -0,0 +1,11519 @@ +{ + "modules": { + "leptonThemeManagement": { + "rootPath": "leptonThemeManagement", + "remoteServiceName": "LeptonThemeManagement", + "controllers": { + "Volo.Abp.LeptonTheme.LeptonThemeSettingsController": { + "controllerName": "LeptonThemeSettings", + "type": "Volo.Abp.LeptonTheme.LeptonThemeSettingsController", + "interfaces": [ + { + "type": "Volo.Abp.LeptonTheme.Management.ILeptonThemeSettingsAppService" + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/lepton-theme-management/settings", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.LeptonTheme.Management.LeptonThemeSettingsDto", + "typeSimple": "Volo.Abp.LeptonTheme.Management.LeptonThemeSettingsDto" + } + }, + "UpdateAsyncByInput": { + "uniqueName": "UpdateAsyncByInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/lepton-theme-management/settings", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto, Volo.Abp.LeptonTheme.Management.Application.Contracts", + "type": "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto", + "typeSimple": "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto", + "typeSimple": "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "auditLogging": { + "rootPath": "auditLogging", + "remoteServiceName": "AbpAuditLogging", + "controllers": { + "Volo.Abp.AuditLogging.AuditLogsController": { + "controllerName": "AuditLogs", + "type": "Volo.Abp.AuditLogging.AuditLogsController", + "interfaces": [ + { + "type": "Volo.Abp.AuditLogging.IAuditLogsAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.AuditLogging.GetAuditLogListDto, Volo.Abp.AuditLogging.Application.Contracts", + "type": "Volo.Abp.AuditLogging.GetAuditLogListDto", + "typeSimple": "Volo.Abp.AuditLogging.GetAuditLogListDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Url", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "UserName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "HttpMethod", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "HttpStatusCode", + "type": "System.Net.HttpStatusCode?", + "typeSimple": "System.Net.HttpStatusCode?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxExecutionDuration", + "type": "System.Int32?", + "typeSimple": "number?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MinExecutionDuration", + "type": "System.Int32?", + "typeSimple": "number?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "HasException", + "type": "System.Boolean?", + "typeSimple": "boolean?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.AuditLogging.AuditLogDto", + "typeSimple": "Volo.Abp.AuditLogging.AuditLogDto" + } + }, + "GetErrorRateAsyncByFilter": { + "uniqueName": "GetErrorRateAsyncByFilter", + "name": "GetErrorRateAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/statistics/error-rate", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "filter", + "typeAsString": "Volo.Abp.AuditLogging.GetErrorRateFilter, Volo.Abp.AuditLogging.Application.Contracts", + "type": "Volo.Abp.AuditLogging.GetErrorRateFilter", + "typeSimple": "Volo.Abp.AuditLogging.GetErrorRateFilter", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "filter", + "name": "StartDate", + "type": "System.DateTime", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "filter" + }, + { + "nameOnMethod": "filter", + "name": "EndDate", + "type": "System.DateTime", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "filter" + } + ], + "returnValue": { + "type": "Volo.Abp.AuditLogging.GetErrorRateOutput", + "typeSimple": "Volo.Abp.AuditLogging.GetErrorRateOutput" + } + }, + "GetAverageExecutionDurationPerDayAsyncByFilter": { + "uniqueName": "GetAverageExecutionDurationPerDayAsyncByFilter", + "name": "GetAverageExecutionDurationPerDayAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/statistics/average-execution-duration-per-day", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "filter", + "typeAsString": "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayInput, Volo.Abp.AuditLogging.Application.Contracts", + "type": "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayInput", + "typeSimple": "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "filter", + "name": "StartDate", + "type": "System.DateTime", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "filter" + }, + { + "nameOnMethod": "filter", + "name": "EndDate", + "type": "System.DateTime", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "filter" + } + ], + "returnValue": { + "type": "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayOutput", + "typeSimple": "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayOutput" + } + }, + "GetEntityChangesAsyncByInput": { + "uniqueName": "GetEntityChangesAsyncByInput", + "name": "GetEntityChangesAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/entity-changes", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.AuditLogging.GetEntityChangesDto, Volo.Abp.AuditLogging.Application.Contracts", + "type": "Volo.Abp.AuditLogging.GetEntityChangesDto", + "typeSimple": "Volo.Abp.AuditLogging.GetEntityChangesDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "AuditLogId", + "type": "System.Guid?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EntityChangeType", + "type": "Volo.Abp.Auditing.EntityChangeType?", + "typeSimple": "Volo.Abp.Auditing.EntityChangeType?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EntityId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EntityTypeFullName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "StartDate", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EndDate", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetEntityChangesWithUsernameAsyncByInput": { + "uniqueName": "GetEntityChangesWithUsernameAsyncByInput", + "name": "GetEntityChangesWithUsernameAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/entity-changes-with-username", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.AuditLogging.EntityChangeFilter, Volo.Abp.AuditLogging.Application.Contracts", + "type": "Volo.Abp.AuditLogging.EntityChangeFilter", + "typeSimple": "Volo.Abp.AuditLogging.EntityChangeFilter", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "EntityId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EntityTypeFullName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.AuditLogging.EntityChangeWithUsernameDto]" + } + }, + "GetEntityChangeWithUsernameAsyncByEntityChangeId": { + "uniqueName": "GetEntityChangeWithUsernameAsyncByEntityChangeId", + "name": "GetEntityChangeWithUsernameAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/entity-change-with-username/{entityChangeId}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "entityChangeId", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "entityChangeId", + "name": "entityChangeId", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.AuditLogging.EntityChangeWithUsernameDto", + "typeSimple": "Volo.Abp.AuditLogging.EntityChangeWithUsernameDto" + } + }, + "GetEntityChangeAsyncByEntityChangeId": { + "uniqueName": "GetEntityChangeAsyncByEntityChangeId", + "name": "GetEntityChangeAsync", + "httpMethod": "GET", + "url": "api/audit-logging/audit-logs/entity-changes/{entityChangeId}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "entityChangeId", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "entityChangeId", + "name": "entityChangeId", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.AuditLogging.EntityChangeDto", + "typeSimple": "Volo.Abp.AuditLogging.EntityChangeDto" + } + } + } + } + } + }, + "identity": { + "rootPath": "identity", + "remoteServiceName": "AbpIdentity", + "controllers": { + "Volo.Abp.Identity.IdentityClaimTypeController": { + "controllerName": "IdentityClaimType", + "type": "Volo.Abp.Identity.IdentityClaimTypeController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentityClaimTypeAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity/claim-types", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityClaimTypesInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityClaimTypesInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityClaimTypesInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/claim-types/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.ClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.ClaimTypeDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity/claim-types", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.CreateClaimTypeDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.CreateClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.CreateClaimTypeDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.CreateClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.CreateClaimTypeDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.ClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.ClaimTypeDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/claim-types/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UpdateClaimTypeDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.UpdateClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.UpdateClaimTypeDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.UpdateClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.UpdateClaimTypeDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.ClaimTypeDto", + "typeSimple": "Volo.Abp.Identity.ClaimTypeDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity/claim-types/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.Identity.IdentityRoleController": { + "controllerName": "IdentityRole", + "type": "Volo.Abp.Identity.IdentityRoleController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentityRoleAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/roles/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityRoleCreateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityRoleCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityRoleCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/roles/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityRoleUpdateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity/roles/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetAllListAsync": { + "uniqueName": "GetAllListAsync", + "name": "GetAllListAsync", + "httpMethod": "GET", + "url": "api/identity/roles/all", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityRoleListInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityRoleListInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityRoleListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "UpdateClaimsAsyncByIdAndInput": { + "uniqueName": "UpdateClaimsAsyncByIdAndInput", + "name": "UpdateClaimsAsync", + "httpMethod": "PUT", + "url": "api/identity/roles/{id}/claims", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityRoleClaimDto, Volo.Abp.Identity.Pro.Application.Contracts, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib", + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityRoleClaimDto]", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityRoleClaimDto]", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetClaimsAsyncById": { + "uniqueName": "GetClaimsAsyncById", + "name": "GetClaimsAsync", + "httpMethod": "GET", + "url": "api/identity/roles/{id}/claims", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityRoleClaimDto]" + } + }, + "GetAllClaimTypesAsync": { + "uniqueName": "GetAllClaimTypesAsync", + "name": "GetAllClaimTypesAsync", + "httpMethod": "GET", + "url": "api/identity/roles/all-claim-types", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.ClaimTypeDto]" + } + } + } + }, + "Volo.Abp.Identity.IdentitySecurityLogController": { + "controllerName": "IdentitySecurityLog", + "type": "Volo.Abp.Identity.IdentitySecurityLogController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentitySecurityLogAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity/security-logs", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentitySecurityLogListInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentitySecurityLogListInput", + "typeSimple": "Volo.Abp.Identity.GetIdentitySecurityLogListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "StartTime", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EndTime", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Identity", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Action", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "UserName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ClientId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/security-logs/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentitySecurityLogDto", + "typeSimple": "Volo.Abp.Identity.IdentitySecurityLogDto" + } + }, + "GetMyListAsyncByInput": { + "uniqueName": "GetMyListAsyncByInput", + "name": "GetMyListAsync", + "httpMethod": "GET", + "url": "api/identity/security-logs/my", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentitySecurityLogListInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentitySecurityLogListInput", + "typeSimple": "Volo.Abp.Identity.GetIdentitySecurityLogListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "StartTime", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "EndTime", + "type": "System.DateTime?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Identity", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Action", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "UserName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ClientId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetMyAsyncById": { + "uniqueName": "GetMyAsyncById", + "name": "GetMyAsync", + "httpMethod": "GET", + "url": "api/identity/security-logs/my/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentitySecurityLogDto", + "typeSimple": "Volo.Abp.Identity.IdentitySecurityLogDto" + } + } + } + }, + "Volo.Abp.Identity.IdentitySettingsController": { + "controllerName": "IdentitySettings", + "type": "Volo.Abp.Identity.IdentitySettingsController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentitySettingsAppService" + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/settings", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Identity.IdentitySettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentitySettingsDto" + } + }, + "UpdateAsyncByInput": { + "uniqueName": "UpdateAsyncByInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/settings", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentitySettingsDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentitySettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentitySettingsDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentitySettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentitySettingsDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.Identity.IdentityUserController": { + "controllerName": "IdentityUser", + "type": "Volo.Abp.Identity.IdentityUserController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentityUserAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/users/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity/users", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityUsersInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityUsersInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityUsersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity/users", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserCreateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityUserCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/users/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserUpdateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityUserUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity/users/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetRolesAsyncById": { + "uniqueName": "GetRolesAsyncById", + "name": "GetRolesAsync", + "httpMethod": "GET", + "url": "api/identity/users/{id}/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetAssignableRolesAsync": { + "uniqueName": "GetAssignableRolesAsync", + "name": "GetAssignableRolesAsync", + "httpMethod": "GET", + "url": "api/identity/users/assignable-roles", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetAvailableOrganizationUnitsAsync": { + "uniqueName": "GetAvailableOrganizationUnitsAsync", + "name": "GetAvailableOrganizationUnitsAsync", + "httpMethod": "GET", + "url": "api/identity/users/available-organization-units", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetAllClaimTypesAsync": { + "uniqueName": "GetAllClaimTypesAsync", + "name": "GetAllClaimTypesAsync", + "httpMethod": "GET", + "url": "api/identity/users/all-claim-types", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.ClaimTypeDto]" + } + }, + "GetClaimsAsyncById": { + "uniqueName": "GetClaimsAsyncById", + "name": "GetClaimsAsync", + "httpMethod": "GET", + "url": "api/identity/users/{id}/claims", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityUserClaimDto]" + } + }, + "GetOrganizationUnitsAsyncById": { + "uniqueName": "GetOrganizationUnitsAsyncById", + "name": "GetOrganizationUnitsAsync", + "httpMethod": "GET", + "url": "api/identity/users/{id}/organization-units", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.OrganizationUnitDto]" + } + }, + "UpdateRolesAsyncByIdAndInput": { + "uniqueName": "UpdateRolesAsyncByIdAndInput", + "name": "UpdateRolesAsync", + "httpMethod": "PUT", + "url": "api/identity/users/{id}/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserUpdateRolesDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "UpdateClaimsAsyncByIdAndInput": { + "uniqueName": "UpdateClaimsAsyncByIdAndInput", + "name": "UpdateClaimsAsync", + "httpMethod": "PUT", + "url": "api/identity/users/{id}/claims", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityUserClaimDto, Volo.Abp.Identity.Pro.Application.Contracts, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib", + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityUserClaimDto]", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.Identity.IdentityUserClaimDto]", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "UnlockAsyncById": { + "uniqueName": "UnlockAsyncById", + "name": "UnlockAsync", + "httpMethod": "PUT", + "url": "api/identity/users/{id}/unlock", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "FindByUsernameAsyncByUsername": { + "uniqueName": "FindByUsernameAsyncByUsername", + "name": "FindByUsernameAsync", + "httpMethod": "GET", + "url": "api/identity/users/by-username/{username}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "username", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "username", + "name": "username", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "FindByEmailAsyncByEmail": { + "uniqueName": "FindByEmailAsyncByEmail", + "name": "FindByEmailAsync", + "httpMethod": "GET", + "url": "api/identity/users/by-email/{email}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "email", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "email", + "name": "email", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "UpdatePasswordAsyncByIdAndInput": { + "uniqueName": "UpdatePasswordAsyncByIdAndInput", + "name": "UpdatePasswordAsync", + "httpMethod": "PUT", + "url": "api/identity/users/{id}/change-password", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserUpdatePasswordInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserUpdatePasswordInput", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdatePasswordInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.IdentityUserUpdatePasswordInput", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdatePasswordInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.Identity.IdentityUserLookupController": { + "controllerName": "IdentityUserLookup", + "type": "Volo.Abp.Identity.IdentityUserLookupController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IIdentityUserLookupAppService" + } + ], + "actions": { + "FindByIdAsyncById": { + "uniqueName": "FindByIdAsyncById", + "name": "FindByIdAsync", + "httpMethod": "GET", + "url": "api/identity/users/lookup/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Users.UserData", + "typeSimple": "Volo.Abp.Users.UserData" + } + }, + "FindByUserNameAsyncByUserName": { + "uniqueName": "FindByUserNameAsyncByUserName", + "name": "FindByUserNameAsync", + "httpMethod": "GET", + "url": "api/identity/users/lookup/by-username/{userName}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "userName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "userName", + "name": "userName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Users.UserData", + "typeSimple": "Volo.Abp.Users.UserData" + } + }, + "SearchAsyncByInput": { + "uniqueName": "SearchAsyncByInput", + "name": "SearchAsync", + "httpMethod": "GET", + "url": "api/identity/users/lookup/search", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UserLookupSearchInputDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.UserLookupSearchInputDto", + "typeSimple": "Volo.Abp.Identity.UserLookupSearchInputDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetCountAsyncByInput": { + "uniqueName": "GetCountAsyncByInput", + "name": "GetCountAsync", + "httpMethod": "GET", + "url": "api/identity/users/lookup/count", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UserLookupCountInputDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.UserLookupCountInputDto", + "typeSimple": "Volo.Abp.Identity.UserLookupCountInputDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Int64", + "typeSimple": "number" + } + } + } + }, + "Volo.Abp.Identity.OrganizationUnitController": { + "controllerName": "OrganizationUnit", + "type": "Volo.Abp.Identity.OrganizationUnitController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IOrganizationUnitAppService" + } + ], + "actions": { + "AddRolesAsyncByIdAndInput": { + "uniqueName": "AddRolesAsyncByIdAndInput", + "name": "AddRolesAsync", + "httpMethod": "PUT", + "url": "api/identity/organization-units/{id}/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.OrganizationUnitRoleInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.OrganizationUnitRoleInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitRoleInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.OrganizationUnitRoleInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitRoleInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "AddMembersAsyncByIdAndInput": { + "uniqueName": "AddMembersAsyncByIdAndInput", + "name": "AddMembersAsync", + "httpMethod": "PUT", + "url": "api/identity/organization-units/{id}/members", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.OrganizationUnitUserInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.OrganizationUnitUserInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitUserInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.OrganizationUnitUserInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitUserInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity/organization-units", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.OrganizationUnitCreateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.OrganizationUnitCreateDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.OrganizationUnitCreateDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity/organization-units", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/organization-units/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity/organization-units", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetOrganizationUnitInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetOrganizationUnitInput", + "typeSimple": "Volo.Abp.Identity.GetOrganizationUnitInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetListAllAsync": { + "uniqueName": "GetListAllAsync", + "name": "GetListAllAsync", + "httpMethod": "GET", + "url": "api/identity/organization-units/all", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetRolesAsyncByIdAndInput": { + "uniqueName": "GetRolesAsyncByIdAndInput", + "name": "GetRolesAsync", + "httpMethod": "GET", + "url": "api/identity/organization-units/{id}/roles", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto, Volo.Abp.Ddd.Application.Contracts", + "type": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetMembersAsyncByIdAndInput": { + "uniqueName": "GetMembersAsyncByIdAndInput", + "name": "GetMembersAsync", + "httpMethod": "GET", + "url": "api/identity/organization-units/{id}/members", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityUsersInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityUsersInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityUsersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "MoveAsyncByIdAndInput": { + "uniqueName": "MoveAsyncByIdAndInput", + "name": "MoveAsync", + "httpMethod": "PUT", + "url": "api/identity/organization-units/{id}/move", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.OrganizationUnitMoveInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.OrganizationUnitMoveInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitMoveInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.OrganizationUnitMoveInput", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitMoveInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/organization-units/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.OrganizationUnitUpdateDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.OrganizationUnitUpdateDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.OrganizationUnitUpdateDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitUpdateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto", + "typeSimple": "Volo.Abp.Identity.OrganizationUnitWithDetailsDto" + } + }, + "RemoveMemberAsyncByIdAndMemberId": { + "uniqueName": "RemoveMemberAsyncByIdAndMemberId", + "name": "RemoveMemberAsync", + "httpMethod": "DELETE", + "url": "api/identity/organization-units/{id}/members/{memberId}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "memberId", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "memberId", + "name": "memberId", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "RemoveRoleAsyncByIdAndRoleId": { + "uniqueName": "RemoveRoleAsyncByIdAndRoleId", + "name": "RemoveRoleAsync", + "httpMethod": "DELETE", + "url": "api/identity/organization-units/{id}/roles/{roleId}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "roleId", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "roleId", + "name": "roleId", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.Identity.ProfileController": { + "controllerName": "Profile", + "type": "Volo.Abp.Identity.ProfileController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.IProfileAppService" + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity/my-profile", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Identity.ProfileDto", + "typeSimple": "Volo.Abp.Identity.ProfileDto" + } + }, + "UpdateAsyncByInput": { + "uniqueName": "UpdateAsyncByInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity/my-profile", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UpdateProfileDto, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.UpdateProfileDto", + "typeSimple": "Volo.Abp.Identity.UpdateProfileDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.UpdateProfileDto", + "typeSimple": "Volo.Abp.Identity.UpdateProfileDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.ProfileDto", + "typeSimple": "Volo.Abp.Identity.ProfileDto" + } + }, + "ChangePasswordAsyncByInput": { + "uniqueName": "ChangePasswordAsyncByInput", + "name": "ChangePasswordAsync", + "httpMethod": "POST", + "url": "api/identity/my-profile/change-password", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.ChangePasswordInput, Volo.Abp.Identity.Pro.Application.Contracts", + "type": "Volo.Abp.Identity.ChangePasswordInput", + "typeSimple": "Volo.Abp.Identity.ChangePasswordInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Identity.ChangePasswordInput", + "typeSimple": "Volo.Abp.Identity.ChangePasswordInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "account": { + "rootPath": "account", + "remoteServiceName": "AbpAccountPublic", + "controllers": { + "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.AccountController": { + "controllerName": "Account", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.AccountController", + "interfaces": [], + "actions": { + "LoginByLogin": { + "uniqueName": "LoginByLogin", + "name": "Login", + "httpMethod": "POST", + "url": "api/account/login", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "login", + "typeAsString": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo, Volo.Abp.Account.Pro.Public.Web", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "login", + "name": "login", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.AbpLoginResult", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.AbpLoginResult" + } + }, + "Logout": { + "uniqueName": "Logout", + "name": "Logout", + "httpMethod": "GET", + "url": "api/account/logout", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "CheckPasswordByLogin": { + "uniqueName": "CheckPasswordByLogin", + "name": "CheckPassword", + "httpMethod": "POST", + "url": "api/account/checkPassword", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "login", + "typeAsString": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo, Volo.Abp.Account.Pro.Public.Web", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "login", + "name": "login", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.AbpLoginResult", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.AbpLoginResult" + } + } + } + }, + "Volo.Abp.Account.AccountController": { + "controllerName": "Account", + "type": "Volo.Abp.Account.AccountController", + "interfaces": [ + { + "type": "Volo.Abp.Account.IAccountAppService" + } + ], + "actions": { + "RegisterAsyncByInput": { + "uniqueName": "RegisterAsyncByInput", + "name": "RegisterAsync", + "httpMethod": "POST", + "url": "api/account/register", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.RegisterDto, Volo.Abp.Account.Pro.Public.Application.Contracts", + "type": "Volo.Abp.Account.RegisterDto", + "typeSimple": "Volo.Abp.Account.RegisterDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.RegisterDto", + "typeSimple": "Volo.Abp.Account.RegisterDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + "SendPasswordResetCodeAsyncByInput": { + "uniqueName": "SendPasswordResetCodeAsyncByInput", + "name": "SendPasswordResetCodeAsync", + "httpMethod": "POST", + "url": "api/account/send-password-reset-code", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.SendPasswordResetCodeDto, Volo.Abp.Account.Pro.Public.Application.Contracts", + "type": "Volo.Abp.Account.SendPasswordResetCodeDto", + "typeSimple": "Volo.Abp.Account.SendPasswordResetCodeDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.SendPasswordResetCodeDto", + "typeSimple": "Volo.Abp.Account.SendPasswordResetCodeDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "ResetPasswordAsyncByInput": { + "uniqueName": "ResetPasswordAsyncByInput", + "name": "ResetPasswordAsync", + "httpMethod": "POST", + "url": "api/account/reset-password", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.ResetPasswordDto, Volo.Abp.Account.Pro.Public.Application.Contracts", + "type": "Volo.Abp.Account.ResetPasswordDto", + "typeSimple": "Volo.Abp.Account.ResetPasswordDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.ResetPasswordDto", + "typeSimple": "Volo.Abp.Account.ResetPasswordDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "SendPhoneNumberConfirmationTokenAsync": { + "uniqueName": "SendPhoneNumberConfirmationTokenAsync", + "name": "SendPhoneNumberConfirmationTokenAsync", + "httpMethod": "POST", + "url": "api/account/send-phone-number-confirmation-token", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "ConfirmPhoneNumberAsyncByInput": { + "uniqueName": "ConfirmPhoneNumberAsyncByInput", + "name": "ConfirmPhoneNumberAsync", + "httpMethod": "POST", + "url": "api/account/confirm-phone-number", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.ConfirmPhoneNumberInput, Volo.Abp.Account.Pro.Public.Application.Contracts", + "type": "Volo.Abp.Account.ConfirmPhoneNumberInput", + "typeSimple": "Volo.Abp.Account.ConfirmPhoneNumberInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.ConfirmPhoneNumberInput", + "typeSimple": "Volo.Abp.Account.ConfirmPhoneNumberInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "ConfirmEmailAsyncByInput": { + "uniqueName": "ConfirmEmailAsyncByInput", + "name": "ConfirmEmailAsync", + "httpMethod": "POST", + "url": "api/account/confirm-email", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.ConfirmEmailInput, Volo.Abp.Account.Pro.Public.Application.Contracts", + "type": "Volo.Abp.Account.ConfirmEmailInput", + "typeSimple": "Volo.Abp.Account.ConfirmEmailInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.ConfirmEmailInput", + "typeSimple": "Volo.Abp.Account.ConfirmEmailInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "featureManagement": { + "rootPath": "featureManagement", + "remoteServiceName": "AbpFeatureManagement", + "controllers": { + "Volo.Abp.FeatureManagement.FeaturesController": { + "controllerName": "Features", + "type": "Volo.Abp.FeatureManagement.FeaturesController", + "interfaces": [ + { + "type": "Volo.Abp.FeatureManagement.IFeatureAppService" + } + ], + "actions": { + "GetAsyncByProviderNameAndProviderKey": { + "uniqueName": "GetAsyncByProviderNameAndProviderKey", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/feature-management/features", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "providerName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "providerKey", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "providerName", + "name": "providerName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "providerKey", + "name": "providerKey", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.FeatureManagement.FeatureListDto", + "typeSimple": "Volo.Abp.FeatureManagement.FeatureListDto" + } + }, + "UpdateAsyncByProviderNameAndProviderKeyAndInput": { + "uniqueName": "UpdateAsyncByProviderNameAndProviderKeyAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/feature-management/features", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "providerName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "providerKey", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.FeatureManagement.UpdateFeaturesDto, Volo.Abp.FeatureManagement.Application.Contracts", + "type": "Volo.Abp.FeatureManagement.UpdateFeaturesDto", + "typeSimple": "Volo.Abp.FeatureManagement.UpdateFeaturesDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "providerName", + "name": "providerName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "providerKey", + "name": "providerKey", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.FeatureManagement.UpdateFeaturesDto", + "typeSimple": "Volo.Abp.FeatureManagement.UpdateFeaturesDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "textTemplateManagement": { + "rootPath": "textTemplateManagement", + "remoteServiceName": "TextTemplateManagement", + "controllers": { + "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateContentController": { + "controllerName": "TemplateContent", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateContentController", + "interfaces": [ + { + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.ITemplateContentAppService" + } + ], + "actions": { + "GetAsyncByInput": { + "uniqueName": "GetAsyncByInput", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/text-template-management/template-contents", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateContentInput, Volo.Abp.TextTemplateManagement.Application.Contracts", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateContentInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateContentInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "TemplateName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "CultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.TextTemplateContentDto", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.TextTemplateContentDto" + } + }, + "RestoreToDefaultAsyncByInput": { + "uniqueName": "RestoreToDefaultAsyncByInput", + "name": "RestoreToDefaultAsync", + "httpMethod": "PUT", + "url": "api/text-template-management/template-contents/restore-to-default", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput, Volo.Abp.TextTemplateManagement.Application.Contracts", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "UpdateAsyncByInput": { + "uniqueName": "UpdateAsyncByInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/text-template-management/template-contents", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput, Volo.Abp.TextTemplateManagement.Application.Contracts", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.TextTemplateContentDto", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.TextTemplateContentDto" + } + } + } + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateDefinitionController": { + "controllerName": "TemplateDefinition", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateDefinitionController", + "interfaces": [ + { + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.ITemplateDefinitionAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/text-template-management/template-definitions", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateDefinitionListInput, Volo.Abp.TextTemplateManagement.Application.Contracts", + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateDefinitionListInput", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateDefinitionListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "FilterText", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncByName": { + "uniqueName": "GetAsyncByName", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/text-template-management/template-definitions/{name}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "name", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "name", + "name": "name", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateDefinitionDto", + "typeSimple": "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateDefinitionDto" + } + } + } + } + } + }, + "languageManagement": { + "rootPath": "languageManagement", + "remoteServiceName": "LanguageManagement", + "controllers": { + "Volo.Abp.LanguageManagement.LanguageController": { + "controllerName": "Language", + "type": "Volo.Abp.LanguageManagement.LanguageController", + "interfaces": [ + { + "type": "Volo.Abp.LanguageManagement.ILanguageAppService" + } + ], + "actions": { + "GetAllListAsync": { + "uniqueName": "GetAllListAsync", + "name": "GetAllListAsync", + "httpMethod": "GET", + "url": "api/language-management/languages/all", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/language-management/languages", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput, Volo.Abp.LanguageManagement.Application.Contracts", + "type": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ResourceName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "BaseCultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "TargetCultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "GetOnlyEmptyValues", + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/language-management/languages/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.LanguageManagement.Dto.LanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.LanguageDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/language-management/languages", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto, Volo.Abp.LanguageManagement.Application.Contracts", + "type": "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.LanguageManagement.Dto.LanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.LanguageDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/language-management/languages/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto, Volo.Abp.LanguageManagement.Application.Contracts", + "type": "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.LanguageManagement.Dto.LanguageDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.LanguageDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/language-management/languages/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "SetAsDefaultAsyncById": { + "uniqueName": "SetAsDefaultAsyncById", + "name": "SetAsDefaultAsync", + "httpMethod": "PUT", + "url": "api/language-management/languages/{id}/set-as-default", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetResourcesAsync": { + "uniqueName": "GetResourcesAsync", + "name": "GetResourcesAsync", + "httpMethod": "GET", + "url": "api/language-management/languages/resources", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.LanguageManagement.Dto.LanguageResourceDto]" + } + }, + "GetCulturelistAsync": { + "uniqueName": "GetCulturelistAsync", + "name": "GetCulturelistAsync", + "httpMethod": "GET", + "url": "api/language-management/languages/culture-list", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.LanguageManagement.Dto.CultureInfoDto]" + } + } + } + }, + "Volo.Abp.LanguageManagement.LanguageTextController": { + "controllerName": "LanguageText", + "type": "Volo.Abp.LanguageManagement.LanguageTextController", + "interfaces": [ + { + "type": "Volo.Abp.LanguageManagement.ILanguageTextAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/language-management/language-texts", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput, Volo.Abp.LanguageManagement.Application.Contracts", + "type": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "ResourceName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "BaseCultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "TargetCultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "GetOnlyEmptyValues", + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncByResourceNameAndCultureNameAndNameAndBaseCultureName": { + "uniqueName": "GetAsyncByResourceNameAndCultureNameAndNameAndBaseCultureName", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/language-management/language-texts/{resourceName}/{cultureName}/{name}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "resourceName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "cultureName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "name", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "baseCultureName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "resourceName", + "name": "resourceName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "cultureName", + "name": "cultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "name", + "name": "name", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "baseCultureName", + "name": "baseCultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.LanguageManagement.Dto.LanguageTextDto", + "typeSimple": "Volo.Abp.LanguageManagement.Dto.LanguageTextDto" + } + }, + "UpdateAsyncByResourceNameAndCultureNameAndNameAndValue": { + "uniqueName": "UpdateAsyncByResourceNameAndCultureNameAndNameAndValue", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/language-management/language-texts/{resourceName}/{cultureName}/{name}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "resourceName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "cultureName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "name", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "value", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "resourceName", + "name": "resourceName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "cultureName", + "name": "cultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "name", + "name": "name", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "value", + "name": "value", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "RestoreToDefaultAsyncByResourceNameAndCultureNameAndName": { + "uniqueName": "RestoreToDefaultAsyncByResourceNameAndCultureNameAndName", + "name": "RestoreToDefaultAsync", + "httpMethod": "PUT", + "url": "api/language-management/language-texts/{resourceName}/{cultureName}/{name}/restore", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "resourceName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "cultureName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "name", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "resourceName", + "name": "resourceName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "cultureName", + "name": "cultureName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "name", + "name": "name", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "saas": { + "rootPath": "saas", + "remoteServiceName": "SaasHost", + "controllers": { + "Volo.Saas.Host.EditionController": { + "controllerName": "Edition", + "type": "Volo.Saas.Host.EditionController", + "interfaces": [ + { + "type": "Volo.Saas.Host.IEditionAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/saas/editions/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.EditionDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/saas/editions", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.GetEditionsInput, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.GetEditionsInput", + "typeSimple": "Volo.Saas.Host.Dtos.GetEditionsInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/saas/editions", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.EditionCreateDto, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.EditionCreateDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Saas.Host.Dtos.EditionCreateDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.EditionDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/saas/editions/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.EditionUpdateDto, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.EditionUpdateDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Saas.Host.Dtos.EditionUpdateDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionUpdateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.EditionDto", + "typeSimple": "Volo.Saas.Host.Dtos.EditionDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/saas/editions/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetUsageStatistics": { + "uniqueName": "GetUsageStatistics", + "name": "GetUsageStatistics", + "httpMethod": "GET", + "url": "api/saas/editions/statistics/usage-statistic", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Saas.Host.GetEditionUsageStatisticsResult", + "typeSimple": "Volo.Saas.Host.GetEditionUsageStatisticsResult" + } + } + } + }, + "Volo.Saas.Host.TenantController": { + "controllerName": "Tenant", + "type": "Volo.Saas.Host.TenantController", + "interfaces": [ + { + "type": "Volo.Saas.Host.ITenantAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/saas/tenants/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.SaasTenantDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantDto" + } + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/saas/tenants", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.GetTenantsInput, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.GetTenantsInput", + "typeSimple": "Volo.Saas.Host.Dtos.GetTenantsInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "GetEditionNames", + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/saas/tenants", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.SaasTenantCreateDto, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.SaasTenantCreateDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Saas.Host.Dtos.SaasTenantCreateDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.SaasTenantDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/saas/tenants/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Saas.Host.Dtos.SaasTenantUpdateDto, Volo.Saas.Host.Application.Contracts", + "type": "Volo.Saas.Host.Dtos.SaasTenantUpdateDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Saas.Host.Dtos.SaasTenantUpdateDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantUpdateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Saas.Host.Dtos.SaasTenantDto", + "typeSimple": "Volo.Saas.Host.Dtos.SaasTenantDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/saas/tenants/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "GetDefaultConnectionStringAsyncById": { + "uniqueName": "GetDefaultConnectionStringAsyncById", + "name": "GetDefaultConnectionStringAsync", + "httpMethod": "GET", + "url": "api/saas/tenants/{id}/default-connection-string", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + } + }, + "UpdateDefaultConnectionStringAsyncByIdAndDefaultConnectionString": { + "uniqueName": "UpdateDefaultConnectionStringAsyncByIdAndDefaultConnectionString", + "name": "UpdateDefaultConnectionStringAsync", + "httpMethod": "PUT", + "url": "api/saas/tenants/{id}/default-connection-string", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "defaultConnectionString", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "defaultConnectionString", + "name": "defaultConnectionString", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "DeleteDefaultConnectionStringAsyncById": { + "uniqueName": "DeleteDefaultConnectionStringAsyncById", + "name": "DeleteDefaultConnectionStringAsync", + "httpMethod": "DELETE", + "url": "api/saas/tenants/{id}/default-connection-string", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "abp": { + "rootPath": "abp", + "remoteServiceName": "abp", + "controllers": { + "Pages.Abp.MultiTenancy.AbpTenantController": { + "controllerName": "AbpTenant", + "type": "Pages.Abp.MultiTenancy.AbpTenantController", + "interfaces": [ + { + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.IAbpTenantAppService" + } + ], + "actions": { + "FindTenantByNameAsyncByName": { + "uniqueName": "FindTenantByNameAsyncByName", + "name": "FindTenantByNameAsync", + "httpMethod": "GET", + "url": "api/abp/multi-tenancy/tenants/by-name/{name}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "name", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "name", + "name": "name", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto" + } + }, + "FindTenantByIdAsyncById": { + "uniqueName": "FindTenantByIdAsyncById", + "name": "FindTenantByIdAsync", + "httpMethod": "GET", + "url": "api/abp/multi-tenancy/tenants/by-id/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto" + } + } + } + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController": { + "controllerName": "AbpApplicationConfiguration", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController", + "interfaces": [ + { + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService" + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/abp/application-configuration", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto" + } + } + } + }, + "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController": { + "controllerName": "AbpApiDefinition", + "type": "Volo.Abp.AspNetCore.Mvc.ApiExploring.AbpApiDefinitionController", + "interfaces": [], + "actions": { + "GetByModel": { + "uniqueName": "GetByModel", + "name": "Get", + "httpMethod": "GET", + "url": "api/abp/api-definition", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "model", + "typeAsString": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto, Volo.Abp.Http", + "type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto", + "typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "model", + "name": "IncludeTypes", + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "model" + } + ], + "returnValue": { + "type": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel", + "typeSimple": "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel" + } + } + } + } + } + }, + "identityServer": { + "rootPath": "identityServer", + "remoteServiceName": "AbpIdentityServer", + "controllers": { + "Volo.Abp.IdentityServer.ApiResourcesController": { + "controllerName": "ApiResources", + "type": "Volo.Abp.IdentityServer.ApiResourcesController", + "interfaces": [ + { + "type": "Volo.Abp.IdentityServer.ApiResource.IApiResourceAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity-server/api-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.ApiResource.Dtos.GetApiResourceListInput, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.GetApiResourceListInput", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.GetApiResourceListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAllListAsync": { + "uniqueName": "GetAllListAsync", + "name": "GetAllListAsync", + "httpMethod": "GET", + "url": "api/identity-server/api-resources/all", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto]" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity-server/api-resources/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity-server/api-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity-server/api-resources/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity-server/api-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.IdentityServer.ClientsController": { + "controllerName": "Clients", + "type": "Volo.Abp.IdentityServer.ClientsController", + "interfaces": [ + { + "type": "Volo.Abp.IdentityServer.Client.IClientAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity-server/clients", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.Client.Dtos.GetClientListInput, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.Client.Dtos.GetClientListInput", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.GetClientListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity-server/clients/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity-server/clients", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity-server/clients/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity-server/clients", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.IdentityServer.IdentityResourcesController": { + "controllerName": "IdentityResources", + "type": "Volo.Abp.IdentityServer.IdentityResourcesController", + "interfaces": [ + { + "type": "Volo.Abp.IdentityServer.IdentityResource.IIdentityResourceAppService" + } + ], + "actions": { + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity-server/identity-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.IdentityResource.Dtos.GetIdentityResourceListInput, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.GetIdentityResourceListInput", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.GetIdentityResourceListInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + "GetAllListAsync": { + "uniqueName": "GetAllListAsync", + "name": "GetAllListAsync", + "httpMethod": "GET", + "url": "api/identity-server/identity-resources/all", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto]" + } + }, + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/identity-server/identity-resources/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto" + } + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/identity-server/identity-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto" + } + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/identity-server/identity-resources/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto, Volo.Abp.IdentityServer.Application.Contracts", + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto", + "typeSimple": "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto" + } + }, + "DeleteAsyncById": { + "uniqueName": "DeleteAsyncById", + "name": "DeleteAsync", + "httpMethod": "DELETE", + "url": "api/identity-server/identity-resources", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + "CreateStandardResourcesAsync": { + "uniqueName": "CreateStandardResourcesAsync", + "name": "CreateStandardResourcesAsync", + "httpMethod": "POST", + "url": "api/identity-server/identity-resources/create-standard-resources", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + }, + "Volo.Abp.IdentityServer.IdentityServerClaimTypesController": { + "controllerName": "IdentityServerClaimTypes", + "type": "Volo.Abp.IdentityServer.IdentityServerClaimTypesController", + "interfaces": [ + { + "type": "Volo.Abp.IdentityServer.ClaimType.IIdentityServerClaimTypeAppService" + } + ], + "actions": { + "GetListAsync": { + "uniqueName": "GetListAsync", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/identity-server/claim-types", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[Volo.Abp.IdentityServer.ClaimType.Dtos.IdentityClaimTypeDto]" + } + } + } + } + } + }, + "accountAdmin": { + "rootPath": "accountAdmin", + "remoteServiceName": "AbpAccountAdmin", + "controllers": { + "Volo.Abp.Account.AccountSettingsController": { + "controllerName": "AccountSettings", + "type": "Volo.Abp.Account.AccountSettingsController", + "interfaces": [ + { + "type": "Volo.Abp.Account.IAccountSettingsAppService" + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/account-admin/settings", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "Volo.Abp.Account.AccountSettingsDto", + "typeSimple": "Volo.Abp.Account.AccountSettingsDto" + } + }, + "UpdateAsyncByInput": { + "uniqueName": "UpdateAsyncByInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/account-admin/settings", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Account.AccountSettingsDto, Volo.Abp.Account.Pro.Admin.Application.Contracts", + "type": "Volo.Abp.Account.AccountSettingsDto", + "typeSimple": "Volo.Abp.Account.AccountSettingsDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.Account.AccountSettingsDto", + "typeSimple": "Volo.Abp.Account.AccountSettingsDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + }, + "permissionManagement": { + "rootPath": "permissionManagement", + "remoteServiceName": "AbpPermissionManagement", + "controllers": { + "Volo.Abp.PermissionManagement.PermissionsController": { + "controllerName": "Permissions", + "type": "Volo.Abp.PermissionManagement.PermissionsController", + "interfaces": [ + { + "type": "Volo.Abp.PermissionManagement.IPermissionAppService" + } + ], + "actions": { + "GetAsyncByProviderNameAndProviderKey": { + "uniqueName": "GetAsyncByProviderNameAndProviderKey", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/permission-management/permissions", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "providerName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "providerKey", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "providerName", + "name": "providerName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "providerKey", + "name": "providerKey", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "Volo.Abp.PermissionManagement.GetPermissionListResultDto", + "typeSimple": "Volo.Abp.PermissionManagement.GetPermissionListResultDto" + } + }, + "UpdateAsyncByProviderNameAndProviderKeyAndInput": { + "uniqueName": "UpdateAsyncByProviderNameAndProviderKeyAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/permission-management/permissions", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "providerName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "providerKey", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.PermissionManagement.UpdatePermissionsDto, Volo.Abp.PermissionManagement.Application.Contracts", + "type": "Volo.Abp.PermissionManagement.UpdatePermissionsDto", + "typeSimple": "Volo.Abp.PermissionManagement.UpdatePermissionsDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "providerName", + "name": "providerName", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "providerKey", + "name": "providerKey", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "type": "Volo.Abp.PermissionManagement.UpdatePermissionsDto", + "typeSimple": "Volo.Abp.PermissionManagement.UpdatePermissionsDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + } + } + } + } + }, + "types": { + "Volo.Abp.Account.AccountSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsSelfRegistrationEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "EnableLocalLogin", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsRememberBrowserEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.UserLoginInfo": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserNameOrEmailAddress", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Password", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RememberMe", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "TenanId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.AbpLoginResult": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Result", + "type": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.LoginResultType", + "typeSimple": "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.LoginResultType" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Account.Public.Web.Areas.Account.Controllers.Models.LoginResultType": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": [ + "Success", + "InvalidUserNameOrPassword", + "NotAllowed", + "LockedOut", + "RequiresTwoFactor" + ], + "enumValues": [1, 2, 3, 4, 5], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.Account.RegisterDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EmailAddress", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Password", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "AppName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityUserDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Surname", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EmailConfirmed", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "PhoneNumber", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumberConfirmed", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "TwoFactorEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "LockoutEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsLockedOut", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ConcurrencyStamp", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Application.Dtos.ExtensibleEntityDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["TKey"], + "properties": [ + { + "name": "Id", + "type": "TKey", + "typeSimple": "TKey" + } + ] + }, + "Volo.Abp.ObjectExtending.ExtensibleObject": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ExtraProperties", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.Account.SendPasswordResetCodeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "AppName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Account.ResetPasswordDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "ResetToken", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Password", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Account.ConfirmPhoneNumberInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Token", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Account.ConfirmEmailInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Token", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Success", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AuditLogging.GetAuditLogListDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Url", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "HttpMethod", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "HttpStatusCode", + "type": "System.Net.HttpStatusCode?", + "typeSimple": "System.Net.HttpStatusCode?" + }, + { + "name": "MaxExecutionDuration", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "MinExecutionDuration", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "HasException", + "type": "System.Boolean?", + "typeSimple": "boolean?" + } + ] + }, + "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Sorting", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Application.Dtos.PagedResultRequestDto": { + "baseType": "Volo.Abp.Application.Dtos.LimitedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "SkipCount", + "type": "System.Int32", + "typeSimple": "number" + } + ] + }, + "Volo.Abp.Application.Dtos.LimitedResultRequestDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DefaultMaxResultCount", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "MaxMaxResultCount", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "MaxResultCount", + "type": "System.Int32", + "typeSimple": "number" + } + ] + }, + "System.Nullable": { + "baseType": "System.ValueType", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["T"], + "properties": [ + { + "name": "HasValue", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Value", + "type": "T", + "typeSimple": "T" + } + ] + }, + "System.Net.HttpStatusCode": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": [ + "Continue", + "SwitchingProtocols", + "Processing", + "EarlyHints", + "OK", + "Created", + "Accepted", + "NonAuthoritativeInformation", + "NoContent", + "ResetContent", + "PartialContent", + "MultiStatus", + "AlreadyReported", + "IMUsed", + "MultipleChoices", + "Ambiguous", + "MovedPermanently", + "Moved", + "Found", + "Redirect", + "SeeOther", + "RedirectMethod", + "NotModified", + "UseProxy", + "Unused", + "TemporaryRedirect", + "RedirectKeepVerb", + "PermanentRedirect", + "BadRequest", + "Unauthorized", + "PaymentRequired", + "Forbidden", + "NotFound", + "MethodNotAllowed", + "NotAcceptable", + "ProxyAuthenticationRequired", + "RequestTimeout", + "Conflict", + "Gone", + "LengthRequired", + "PreconditionFailed", + "RequestEntityTooLarge", + "RequestUriTooLong", + "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", + "ExpectationFailed", + "MisdirectedRequest", + "UnprocessableEntity", + "Locked", + "FailedDependency", + "UpgradeRequired", + "PreconditionRequired", + "TooManyRequests", + "RequestHeaderFieldsTooLarge", + "UnavailableForLegalReasons", + "InternalServerError", + "NotImplemented", + "BadGateway", + "ServiceUnavailable", + "GatewayTimeout", + "HttpVersionNotSupported", + "VariantAlsoNegotiates", + "InsufficientStorage", + "LoopDetected", + "NotExtended", + "NetworkAuthenticationRequired" + ], + "enumValues": [ + 100, + 101, + 102, + 103, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 226, + 300, + 300, + 301, + 301, + 302, + 302, + 303, + 303, + 304, + 305, + 306, + 307, + 307, + 308, + 400, + 401, + 402, + 403, + 404, + 405, + 406, + 407, + 408, + 409, + 410, + 411, + 412, + 413, + 414, + 415, + 416, + 417, + 421, + 422, + 423, + 424, + 426, + 428, + 429, + 431, + 451, + 500, + 501, + 502, + 503, + 504, + 505, + 506, + 507, + 508, + 510, + 511 + ], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.Application.Dtos.PagedResultDto": { + "baseType": "Volo.Abp.Application.Dtos.ListResultDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["T"], + "properties": [ + { + "name": "TotalCount", + "type": "System.Int64", + "typeSimple": "number" + } + ] + }, + "Volo.Abp.Application.Dtos.ListResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["T"], + "properties": [ + { + "name": "Items", + "type": "[T]", + "typeSimple": "[T]" + } + ] + }, + "Volo.Abp.AuditLogging.AuditLogDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "ImpersonatorUserId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "ImpersonatorTenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "ExecutionTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "ExecutionDuration", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ClientIpAddress", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BrowserInfo", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "HttpMethod", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Url", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Exceptions", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Comments", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "HttpStatusCode", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EntityChanges", + "type": "[Volo.Abp.AuditLogging.EntityChangeDto]", + "typeSimple": "[Volo.Abp.AuditLogging.EntityChangeDto]" + }, + { + "name": "Actions", + "type": "[Volo.Abp.AuditLogging.AuditLogActionDto]", + "typeSimple": "[Volo.Abp.AuditLogging.AuditLogActionDto]" + } + ] + }, + "Volo.Abp.AuditLogging.EntityChangeDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "AuditLogId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "ChangeTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "ChangeType", + "type": "Volo.Abp.Auditing.EntityChangeType", + "typeSimple": "Volo.Abp.Auditing.EntityChangeType" + }, + { + "name": "EntityId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EntityTypeFullName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PropertyChanges", + "type": "[Volo.Abp.AuditLogging.EntityPropertyChangeDto]", + "typeSimple": "[Volo.Abp.AuditLogging.EntityPropertyChangeDto]" + } + ] + }, + "Volo.Abp.Auditing.EntityChangeType": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": ["Created", "Updated", "Deleted"], + "enumValues": [0, 1, 2], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.AuditLogging.EntityPropertyChangeDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "EntityChangeId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "NewValue", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "OriginalValue", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PropertyName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PropertyTypeFullName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Application.Dtos.EntityDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["TKey"], + "properties": [ + { + "name": "Id", + "type": "TKey", + "typeSimple": "TKey" + } + ] + }, + "Volo.Abp.Application.Dtos.EntityDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.AuditLogging.AuditLogActionDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "AuditLogId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "ServiceName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "MethodName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Parameters", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ExecutionTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "ExecutionDuration", + "type": "System.Int32", + "typeSimple": "number" + } + ] + }, + "Volo.Abp.AuditLogging.GetErrorRateFilter": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "StartDate", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "EndDate", + "type": "System.DateTime", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AuditLogging.GetErrorRateOutput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Data", + "type": "{System.String:System.Int64}", + "typeSimple": "{string:number}" + } + ] + }, + "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "StartDate", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "EndDate", + "type": "System.DateTime", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AuditLogging.GetAverageExecutionDurationPerDayOutput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Data", + "type": "{System.String:System.Double}", + "typeSimple": "{string:number}" + } + ] + }, + "Volo.Abp.AuditLogging.GetEntityChangesDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "AuditLogId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "EntityChangeType", + "type": "Volo.Abp.Auditing.EntityChangeType?", + "typeSimple": "Volo.Abp.Auditing.EntityChangeType?" + }, + { + "name": "EntityId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EntityTypeFullName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "StartDate", + "type": "System.DateTime?", + "typeSimple": "string?" + }, + { + "name": "EndDate", + "type": "System.DateTime?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.AuditLogging.EntityChangeFilter": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "EntityId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EntityTypeFullName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AuditLogging.EntityChangeWithUsernameDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "EntityChange", + "type": "Volo.Abp.AuditLogging.EntityChangeDto", + "typeSimple": "Volo.Abp.AuditLogging.EntityChangeDto" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.GetIdentityClaimTypesInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.ClaimTypeDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsStatic", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Regex", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RegexDescription", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ValueType", + "type": "Volo.Abp.Identity.IdentityClaimValueType", + "typeSimple": "Volo.Abp.Identity.IdentityClaimValueType" + }, + { + "name": "ValueTypeAsString", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityClaimValueType": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": ["String", "Int", "Boolean", "DateTime"], + "enumValues": [0, 1, 2, 3], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.Identity.CreateClaimTypeDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Regex", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RegexDescription", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ValueType", + "type": "Volo.Abp.Identity.IdentityClaimValueType", + "typeSimple": "Volo.Abp.Identity.IdentityClaimValueType" + } + ] + }, + "Volo.Abp.Identity.UpdateClaimTypeDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Regex", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RegexDescription", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ValueType", + "type": "Volo.Abp.Identity.IdentityClaimValueType", + "typeSimple": "Volo.Abp.Identity.IdentityClaimValueType" + } + ] + }, + "Volo.Abp.Identity.IdentityRoleDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsDefault", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsStatic", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsPublic", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ConcurrencyStamp", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityRoleCreateDto": { + "baseType": "Volo.Abp.Identity.IdentityRoleCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.Identity.IdentityRoleCreateOrUpdateDtoBase": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsDefault", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsPublic", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.IdentityRoleUpdateDto": { + "baseType": "Volo.Abp.Identity.IdentityRoleCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ConcurrencyStamp", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.GetIdentityRoleListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityRoleClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RoleId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "ClaimType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClaimValue", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.GetIdentitySecurityLogListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "StartTime", + "type": "System.DateTime?", + "typeSimple": "string?" + }, + { + "name": "EndTime", + "type": "System.DateTime?", + "typeSimple": "string?" + }, + { + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Identity", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Action", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentitySecurityLogDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "ApplicationName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Identity", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Action", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UserId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TenantName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CorrelationId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientIpAddress", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BrowserInfo", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CreationTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "ExtraProperties", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.Identity.IdentitySettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Password", + "type": "Volo.Abp.Identity.IdentityPasswordSettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentityPasswordSettingsDto" + }, + { + "name": "Lockout", + "type": "Volo.Abp.Identity.IdentityLockoutSettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentityLockoutSettingsDto" + }, + { + "name": "SignIn", + "type": "Volo.Abp.Identity.IdentitySignInSettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentitySignInSettingsDto" + }, + { + "name": "User", + "type": "Volo.Abp.Identity.IdentityUserSettingsDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserSettingsDto" + } + ] + }, + "Volo.Abp.Identity.IdentityPasswordSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RequiredLength", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "RequiredUniqueChars", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "RequireNonAlphanumeric", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireLowercase", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireUppercase", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireDigit", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.IdentityLockoutSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "AllowedForNewUsers", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "LockoutDuration", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "MaxFailedAccessAttempts", + "type": "System.Int32", + "typeSimple": "number" + } + ] + }, + "Volo.Abp.Identity.IdentitySignInSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RequireConfirmedEmail", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "EnablePhoneNumberConfirmation", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireConfirmedPhoneNumber", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.IdentityUserSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsUserNameUpdateEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsEmailUpdateEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.GetIdentityUsersInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityUserCreateDto": { + "baseType": "Volo.Abp.Identity.IdentityUserCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Password", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.IdentityUserCreateOrUpdateDtoBase": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Surname", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumber", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TwoFactorEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "LockoutEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RoleNames", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "OrganizationUnitIds", + "type": "[System.Guid]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.Identity.IdentityUserUpdateDto": { + "baseType": "Volo.Abp.Identity.IdentityUserCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ConcurrencyStamp", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitWithDetailsDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleFullAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ParentId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "Code", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Roles", + "type": "[Volo.Abp.Identity.IdentityRoleDto]", + "typeSimple": "[Volo.Abp.Identity.IdentityRoleDto]" + } + ] + }, + "Volo.Abp.Application.Dtos.ExtensibleFullAuditedEntityDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["TPrimaryKey"], + "properties": [ + { + "name": "IsDeleted", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "DeleterId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "DeletionTime", + "type": "System.DateTime?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Application.Dtos.ExtensibleAuditedEntityDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleCreationAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["TPrimaryKey"], + "properties": [ + { + "name": "LastModificationTime", + "type": "System.DateTime?", + "typeSimple": "string?" + }, + { + "name": "LastModifierId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Application.Dtos.ExtensibleCreationAuditedEntityDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["TPrimaryKey"], + "properties": [ + { + "name": "CreationTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "CreatorId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Identity.IdentityUserClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "ClaimType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClaimValue", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleFullAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ParentId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "Code", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Roles", + "type": "[Volo.Abp.Identity.OrganizationUnitRoleDto]", + "typeSimple": "[Volo.Abp.Identity.OrganizationUnitRoleDto]" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitRoleDto": { + "baseType": "Volo.Abp.Application.Dtos.CreationAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OrganizationUnitId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "RoleId", + "type": "System.Guid", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Application.Dtos.CreationAuditedEntityDto": { + "baseType": "Volo.Abp.Application.Dtos.EntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CreationTime", + "type": "System.DateTime", + "typeSimple": "string" + }, + { + "name": "CreatorId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Identity.IdentityUserUpdateRolesDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RoleNames", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.Identity.IdentityUserUpdatePasswordInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "NewPassword", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Users.UserData": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Id", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Surname", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EmailConfirmed", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "PhoneNumber", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumberConfirmed", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.UserLookupSearchInputDto": { + "baseType": "Volo.Abp.Application.Dtos.PagedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Sorting", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.UserLookupCountInputDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitRoleInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RoleIds", + "type": "[System.Guid]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitUserInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserIds", + "type": "[System.Guid]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitCreateDto": { + "baseType": "Volo.Abp.Identity.OrganizationUnitCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ParentId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitCreateOrUpdateDtoBase": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.GetOrganizationUnitInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitMoveInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "NewParentId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.Identity.OrganizationUnitUpdateDto": { + "baseType": "Volo.Abp.Identity.OrganizationUnitCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.Identity.ProfileDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Surname", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumber", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumberConfirmed", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Identity.UpdateProfileDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Surname", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PhoneNumber", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Identity.ChangePasswordInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CurrentPassword", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "NewPassword", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.GetApiResourceListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceWithDetailsDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "UserClaims", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceClaimClaimDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceClaimClaimDto]" + }, + { + "name": "Properties", + "type": "{System.String:System.String}", + "typeSimple": "{string:string}" + }, + { + "name": "Scopes", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeDto]" + }, + { + "name": "Secrets", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiSecretDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiSecretDto]" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiResourceClaimClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ApiResourceId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ApiResourceId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Emphasize", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ShowInDiscoveryDocument", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "UserClaims", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeClaimDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeClaimDto]" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ApiResourceId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.ApiSecretDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ApiResourceId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Expiration", + "type": "System.DateTime?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.CreateApiResourceDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Claims", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.IdentityServer.ApiResource.Dtos.UpdateApiResourceDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Claims", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "Scopes", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiScopeDto]" + }, + { + "name": "Secrets", + "type": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiSecretDto]", + "typeSimple": "[Volo.Abp.IdentityServer.ApiResource.Dtos.ApiSecretDto]" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.GetClientListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LogoUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ProtocolType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RequireClientSecret", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireConsent", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowRememberConsent", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AlwaysIncludeUserClaimsInIdToken", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequirePkce", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowPlainTextPkce", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowAccessTokensViaBrowser", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "FrontChannelLogoutUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FrontChannelLogoutSessionRequired", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "BackChannelLogoutUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BackChannelLogoutSessionRequired", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowOfflineAccess", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IdentityTokenLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "AccessTokenLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "AuthorizationCodeLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ConsentLifetime", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "AbsoluteRefreshTokenLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "SlidingRefreshTokenLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "RefreshTokenUsage", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "UpdateAccessTokenClaimsOnRefresh", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RefreshTokenExpiration", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "AccessTokenType", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "EnableLocalLogin", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IncludeJwtId", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AlwaysSendClientClaims", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ClientClaimsPrefix", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "PairWiseSubjectSalt", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UserSsoLifetime", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "UserCodeType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DeviceCodeLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ClientSecrets", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]" + }, + { + "name": "AllowedScopes", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientScopeDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientScopeDto]" + }, + { + "name": "Claims", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientClaimDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientClaimDto]" + }, + { + "name": "AllowedGrantTypes", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientGrantTypeDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientGrantTypeDto]" + }, + { + "name": "IdentityProviderRestrictions", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientIdentityProviderRestrictionDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientIdentityProviderRestrictionDto]" + }, + { + "name": "Properties", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPropertyDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPropertyDto]" + }, + { + "name": "AllowedCorsOrigins", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientCorsOriginDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientCorsOriginDto]" + }, + { + "name": "RedirectUris", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientRedirectUriDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientRedirectUriDto]" + }, + { + "name": "PostLogoutRedirectUris", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPostLogoutRedirectUriDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPostLogoutRedirectUriDto]" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Expiration", + "type": "System.DateTime?", + "typeSimple": "string?" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientScopeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Scope", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientGrantTypeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "GrantType", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientIdentityProviderRestrictionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Provider", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientPropertyDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Key", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientCorsOriginDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Origin", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientRedirectUriDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "RedirectUri", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.ClientPostLogoutRedirectUriDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "PostLogoutRedirectUri", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.CreateClientDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LogoUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RequireConsent", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "CallbackUrl", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LogoutUrl", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Secrets", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]" + }, + { + "name": "Scopes", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.IdentityServer.Client.Dtos.UpdateClientDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ClientName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ClientUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LogoUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireConsent", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowOfflineAccess", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowRememberConsent", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequirePkce", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "RequireClientSecret", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AccessTokenLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ConsentLifetime", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "AccessTokenType", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "EnableLocalLogin", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "FrontChannelLogoutUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FrontChannelLogoutSessionRequired", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "BackChannelLogoutUri", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BackChannelLogoutSessionRequired", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IncludeJwtId", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AlwaysSendClientClaims", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "PairWiseSubjectSalt", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UserSsoLifetime", + "type": "System.Int32?", + "typeSimple": "number?" + }, + { + "name": "UserCodeType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DeviceCodeLifetime", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ClientSecrets", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientSecretDto]" + }, + { + "name": "Claims", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientClaimDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientClaimDto]" + }, + { + "name": "Properties", + "type": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPropertyDto]", + "typeSimple": "[Volo.Abp.IdentityServer.Client.Dtos.ClientPropertyDto]" + }, + { + "name": "AllowedGrantTypes", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "IdentityProviderRestrictions", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "Scopes", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "AllowedCorsOrigins", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "RedirectUris", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "PostLogoutRedirectUris", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.IdentityServer.IdentityResource.Dtos.GetIdentityResourceListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityResourceWithDetailsDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Emphasize", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ShowInDiscoveryDocument", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "UserClaims", + "type": "[Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityClaimDto]", + "typeSimple": "[Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityClaimDto]" + }, + { + "name": "Properties", + "type": "{System.String:System.String}", + "typeSimple": "{string:string}" + } + ] + }, + "Volo.Abp.IdentityServer.IdentityResource.Dtos.IdentityClaimDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IdentityResourceId", + "type": "System.Guid", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.IdentityServer.IdentityResource.Dtos.CreateIdentityResourceDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Emphasize", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ShowInDiscoveryDocument", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Claims", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.IdentityServer.IdentityResource.Dtos.UpdateIdentityResourceDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Enabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Required", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Emphasize", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "ShowInDiscoveryDocument", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Claims", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.IdentityServer.ClaimType.Dtos.IdentityClaimTypeDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.LanguageDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleCreationAuditedEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UiCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FlagIcon", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "IsDefaultLanguage", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.GetLanguagesTextsInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ResourceName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BaseCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TargetCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "GetOnlyEmptyValues", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.CreateLanguageDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UiCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FlagIcon", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.UpdateLanguageDto": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FlagIcon", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.LanguageResourceDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.CultureInfoDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.LanguageManagement.Dto.LanguageTextDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ResourceName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BaseCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "BaseValue", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.LeptonTheme.Management.LeptonThemeSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "BoxedLayout", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "MenuPlacement", + "type": "Volo.Abp.LeptonTheme.Management.MenuPlacement", + "typeSimple": "Volo.Abp.LeptonTheme.Management.MenuPlacement" + }, + { + "name": "MenuStatus", + "type": "Volo.Abp.LeptonTheme.Management.MenuStatus", + "typeSimple": "Volo.Abp.LeptonTheme.Management.MenuStatus" + }, + { + "name": "Style", + "type": "Volo.Abp.LeptonTheme.Management.LeptonStyle", + "typeSimple": "Volo.Abp.LeptonTheme.Management.LeptonStyle" + } + ] + }, + "Volo.Abp.LeptonTheme.Management.MenuPlacement": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": ["Left", "Top"], + "enumValues": [0, 1], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.LeptonTheme.Management.MenuStatus": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": ["AlwaysOpened", "OpenOnHover"], + "enumValues": [0, 1], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.LeptonTheme.Management.LeptonStyle": { + "baseType": "System.Enum", + "isEnum": true, + "enumNames": ["Style1", "Style2", "Style3", "Style4", "Style5", "Style6"], + "enumValues": [0, 1, 2, 3, 4, 5], + "genericArguments": null, + "properties": null + }, + "Volo.Abp.LeptonTheme.Management.UpdateLeptonThemeSettingsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "BoxedLayout", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "MenuPlacement", + "type": "Volo.Abp.LeptonTheme.Management.MenuPlacement", + "typeSimple": "Volo.Abp.LeptonTheme.Management.MenuPlacement" + }, + { + "name": "MenuStatus", + "type": "Volo.Abp.LeptonTheme.Management.MenuStatus", + "typeSimple": "Volo.Abp.LeptonTheme.Management.MenuStatus" + }, + { + "name": "Style", + "type": "Volo.Abp.LeptonTheme.Management.LeptonStyle", + "typeSimple": "Volo.Abp.LeptonTheme.Management.LeptonStyle" + } + ] + }, + "Volo.Abp.PermissionManagement.GetPermissionListResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "EntityDisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Groups", + "type": "[Volo.Abp.PermissionManagement.PermissionGroupDto]", + "typeSimple": "[Volo.Abp.PermissionManagement.PermissionGroupDto]" + } + ] + }, + "Volo.Abp.PermissionManagement.PermissionGroupDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Permissions", + "type": "[Volo.Abp.PermissionManagement.PermissionGrantInfoDto]", + "typeSimple": "[Volo.Abp.PermissionManagement.PermissionGrantInfoDto]" + } + ] + }, + "Volo.Abp.PermissionManagement.PermissionGrantInfoDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ParentName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsGranted", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "AllowedProviders", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "GrantedProviders", + "type": "[Volo.Abp.PermissionManagement.ProviderInfoDto]", + "typeSimple": "[Volo.Abp.PermissionManagement.ProviderInfoDto]" + } + ] + }, + "Volo.Abp.PermissionManagement.ProviderInfoDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ProviderName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ProviderKey", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.PermissionManagement.UpdatePermissionsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Permissions", + "type": "[Volo.Abp.PermissionManagement.UpdatePermissionDto]", + "typeSimple": "[Volo.Abp.PermissionManagement.UpdatePermissionDto]" + } + ] + }, + "Volo.Abp.PermissionManagement.UpdatePermissionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsGranted", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateContentInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TemplateName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.TextTemplateContentDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Content", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.RestoreTemplateContentInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TemplateName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.UpdateTemplateContentInput": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TemplateName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Content", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.GetTemplateDefinitionListInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "FilterText", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.TextTemplateManagement.TextTemplates.TemplateDefinitionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsLayout", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Layout", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsInlineLocalized", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "DefaultCultureName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.EditionDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.GetEditionsInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.EditionCreateDto": { + "baseType": "Volo.Saas.Host.Dtos.EditionCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Saas.Host.Dtos.EditionCreateOrUpdateDtoBase": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.EditionUpdateDto": { + "baseType": "Volo.Saas.Host.Dtos.EditionCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Saas.Host.GetEditionUsageStatisticsResult": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Data", + "type": "{System.String:System.Int32}", + "typeSimple": "{string:number}" + } + ] + }, + "Volo.Saas.Host.Dtos.SaasTenantDto": { + "baseType": "Volo.Abp.Application.Dtos.ExtensibleEntityDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EditionId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "EditionName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.GetTenantsInput": { + "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Filter", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "GetEditionNames", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Saas.Host.Dtos.SaasTenantCreateDto": { + "baseType": "Volo.Saas.Host.Dtos.SaasTenantCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "AdminEmailAddress", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "AdminPassword", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Saas.Host.Dtos.SaasTenantCreateOrUpdateDtoBase": { + "baseType": "Volo.Abp.ObjectExtending.ExtensibleObject", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EditionId", + "type": "System.Guid?", + "typeSimple": "string?" + } + ] + }, + "Volo.Saas.Host.Dtos.SaasTenantUpdateDto": { + "baseType": "Volo.Saas.Host.Dtos.SaasTenantCreateOrUpdateDtoBase", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.FeatureManagement.FeatureListDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Features", + "type": "[Volo.Abp.FeatureManagement.FeatureDto]", + "typeSimple": "[Volo.Abp.FeatureManagement.FeatureDto]" + } + ] + }, + "Volo.Abp.FeatureManagement.FeatureDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Description", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ValueType", + "type": "Volo.Abp.Validation.StringValues.IStringValueType", + "typeSimple": "Volo.Abp.Validation.StringValues.IStringValueType" + }, + { + "name": "Depth", + "type": "System.Int32", + "typeSimple": "number" + }, + { + "name": "ParentName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Validation.StringValues.IStringValueType": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Item", + "type": "System.Object", + "typeSimple": "object" + }, + { + "name": "Properties", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + }, + { + "name": "Validator", + "type": "Volo.Abp.Validation.StringValues.IValueValidator", + "typeSimple": "Volo.Abp.Validation.StringValues.IValueValidator" + } + ] + }, + "Volo.Abp.Validation.StringValues.IValueValidator": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Item", + "type": "System.Object", + "typeSimple": "object" + }, + { + "name": "Properties", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.FeatureManagement.UpdateFeaturesDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Features", + "type": "[Volo.Abp.FeatureManagement.UpdateFeatureDto]", + "typeSimple": "[Volo.Abp.FeatureManagement.UpdateFeatureDto]" + } + ] + }, + "Volo.Abp.FeatureManagement.UpdateFeatureDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Localization", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto" + }, + { + "name": "Auth", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto" + }, + { + "name": "Setting", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto" + }, + { + "name": "CurrentUser", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto" + }, + { + "name": "Features", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto" + }, + { + "name": "MultiTenancy", + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto" + }, + { + "name": "CurrentTenant", + "type": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto" + }, + { + "name": "Timing", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto" + }, + { + "name": "Clock", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto" + }, + { + "name": "ObjectExtensions", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "type": "{System.String:{System.String:System.String}}", + "typeSimple": "{string:{string:string}}" + }, + { + "name": "Languages", + "type": "[Volo.Abp.Localization.LanguageInfo]", + "typeSimple": "[Volo.Abp.Localization.LanguageInfo]" + }, + { + "name": "CurrentCulture", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto" + }, + { + "name": "DefaultResourceName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LanguagesMap", + "type": "{System.String:[Volo.Abp.NameValue]}", + "typeSimple": "{string:[Volo.Abp.NameValue]}" + }, + { + "name": "LanguageFilesMap", + "type": "{System.String:[Volo.Abp.NameValue]}", + "typeSimple": "{string:[Volo.Abp.NameValue]}" + } + ] + }, + "Volo.Abp.Localization.LanguageInfo": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "UiCultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FlagIcon", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentCultureDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "DisplayName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "EnglishName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ThreeLetterIsoLanguageName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TwoLetterIsoLanguageName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsRightToLeft", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "CultureName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "NativeName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DateTimeFormat", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.DateTimeFormatDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "CalendarAlgorithmType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DateTimeFormatLong", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ShortDatePattern", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "FullDateTimePattern", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DateSeparator", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "ShortTimePattern", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "LongTimePattern", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.NameValue": { + "baseType": "Volo.Abp.NameValue", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [] + }, + "Volo.Abp.NameValue": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": ["T"], + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "T", + "typeSimple": "T" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationAuthConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Policies", + "type": "{System.String:System.Boolean}", + "typeSimple": "{string:boolean}" + }, + { + "name": "GrantedPolicies", + "type": "{System.String:System.Boolean}", + "typeSimple": "{string:boolean}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationSettingConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "type": "{System.String:System.String}", + "typeSimple": "{string:string}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.CurrentUserDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAuthenticated", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "Id", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "TenantId", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "UserName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Email", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Roles", + "type": "[System.String]", + "typeSimple": "[string]" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationFeatureConfigurationDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Values", + "type": "{System.String:System.String}", + "typeSimple": "{string:string}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.MultiTenancy.MultiTenancyInfoDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsEnabled", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.MultiTenancy.CurrentTenantDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Id", + "type": "System.Guid?", + "typeSimple": "string?" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsAvailable", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimingDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZone", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.TimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Iana", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone" + }, + { + "name": "Windows", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IanaTimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZoneName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.WindowsTimeZone": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TimeZoneId", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClockDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Kind", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ObjectExtensionsDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Modules", + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto}" + }, + { + "name": "Enums", + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ModuleExtensionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Entities", + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto}" + }, + { + "name": "Configuration", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.EntityExtensionDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Properties", + "type": "{System.String:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto}", + "typeSimple": "{string:Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto}" + }, + { + "name": "Configuration", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DisplayName", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto" + }, + { + "name": "Api", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto" + }, + { + "name": "Ui", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto" + }, + { + "name": "Attributes", + "type": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto]", + "typeSimple": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto]" + }, + { + "name": "Configuration", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + }, + { + "name": "DefaultValue", + "type": "System.Object", + "typeSimple": "object" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.LocalizableStringDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Resource", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OnGet", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto" + }, + { + "name": "OnCreate", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto" + }, + { + "name": "OnUpdate", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiGetDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiCreateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyApiUpdateDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsAvailable", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "OnTable", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto" + }, + { + "name": "OnCreateForm", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto" + }, + { + "name": "OnEditForm", + "type": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto", + "typeSimple": "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiTableDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsVisible", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyUiFormDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IsVisible", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionPropertyAttributeDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Config", + "type": "{System.String:System.Object}", + "typeSimple": "{string:object}" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Fields", + "type": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto]", + "typeSimple": "[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto]" + }, + { + "name": "LocalizationResource", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending.ExtensionEnumFieldDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Value", + "type": "System.Object", + "typeSimple": "object" + } + ] + }, + "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModelRequestDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "IncludeTypes", + "type": "System.Boolean", + "typeSimple": "boolean" + } + ] + }, + "Volo.Abp.Http.Modeling.ApplicationApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Modules", + "type": "{System.String:Volo.Abp.Http.Modeling.ModuleApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ModuleApiDescriptionModel}" + }, + { + "name": "Types", + "type": "{System.String:Volo.Abp.Http.Modeling.TypeApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.TypeApiDescriptionModel}" + } + ] + }, + "Volo.Abp.Http.Modeling.ModuleApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "RootPath", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "RemoteServiceName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Controllers", + "type": "{System.String:Volo.Abp.Http.Modeling.ControllerApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ControllerApiDescriptionModel}" + } + ] + }, + "Volo.Abp.Http.Modeling.ControllerApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "ControllerName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Interfaces", + "type": "[Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel]" + }, + { + "name": "Actions", + "type": "{System.String:Volo.Abp.Http.Modeling.ActionApiDescriptionModel}", + "typeSimple": "{string:Volo.Abp.Http.Modeling.ActionApiDescriptionModel}" + } + ] + }, + "Volo.Abp.Http.Modeling.ControllerInterfaceApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Http.Modeling.ActionApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "UniqueName", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "HttpMethod", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Url", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "SupportedVersions", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "ParametersOnMethod", + "type": "[Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel]" + }, + { + "name": "Parameters", + "type": "[Volo.Abp.Http.Modeling.ParameterApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.ParameterApiDescriptionModel]" + }, + { + "name": "ReturnValue", + "type": "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel", + "typeSimple": "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel" + } + ] + }, + "Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeAsString", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsOptional", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "DefaultValue", + "type": "System.Object", + "typeSimple": "object" + } + ] + }, + "Volo.Abp.Http.Modeling.ParameterApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "NameOnMethod", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsOptional", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "DefaultValue", + "type": "System.Object", + "typeSimple": "object" + }, + { + "name": "ConstraintTypes", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "BindingSourceId", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "DescriptorName", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Http.Modeling.ReturnValueApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + } + ] + }, + "Volo.Abp.Http.Modeling.TypeApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "BaseType", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "IsEnum", + "type": "System.Boolean", + "typeSimple": "boolean" + }, + { + "name": "EnumNames", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "EnumValues", + "type": "[System.Object]", + "typeSimple": "[object]" + }, + { + "name": "GenericArguments", + "type": "[System.String]", + "typeSimple": "[string]" + }, + { + "name": "Properties", + "type": "[Volo.Abp.Http.Modeling.PropertyApiDescriptionModel]", + "typeSimple": "[Volo.Abp.Http.Modeling.PropertyApiDescriptionModel]" + } + ] + }, + "Volo.Abp.Http.Modeling.PropertyApiDescriptionModel": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Name", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "Type", + "type": "System.String", + "typeSimple": "string" + }, + { + "name": "TypeSimple", + "type": "System.String", + "typeSimple": "string" + } + ] + } + } +} From aa38af0a5f5ce956f382b8e24ea1db939f02a370 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:01:37 +0300 Subject: [PATCH 07/95] chore: copy angular internal schematics to utils --- .../schematics/src/utils/angular/README.md | 5 + .../schematics/src/utils/angular/ast-utils.ts | 753 ++++++++++++++++++ .../schematics/src/utils/angular/change.ts | 127 +++ .../schematics/src/utils/angular/config.ts | 532 +++++++++++++ .../src/utils/angular/dependencies.ts | 76 ++ .../src/utils/angular/find-module.ts | 151 ++++ .../schematics/src/utils/angular/index.ts | 17 + .../schematics/src/utils/angular/json-file.ts | 82 ++ .../src/utils/angular/json-utils.ts | 231 ++++++ .../src/utils/angular/latest-versions.ts | 26 + .../schematics/src/utils/angular/lint-fix.ts | 51 ++ .../src/utils/angular/ng-ast-utils.ts | 87 ++ .../src/utils/angular/parse-name.ts | 25 + .../schematics/src/utils/angular/paths.ts | 19 + .../src/utils/angular/project-targets.ts | 13 + .../schematics/src/utils/angular/tsconfig.ts | 70 ++ .../src/utils/angular/validation.ts | 77 ++ .../src/utils/angular/workspace-models.ts | 171 ++++ .../schematics/src/utils/angular/workspace.ts | 91 +++ .../packages/schematics/src/utils/index.ts | 1 + 20 files changed, 2605 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/README.md create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/change.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/config.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/dependencies.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/find-module.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/index.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/json-file.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/json-utils.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/latest-versions.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/lint-fix.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/ng-ast-utils.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/parse-name.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/paths.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/project-targets.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/validation.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/angular/workspace.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/index.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/README.md b/npm/ng-packs/packages/schematics/src/utils/angular/README.md new file mode 100644 index 00000000000..8d98f50e2d1 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/README.md @@ -0,0 +1,5 @@ +**DISCLAIMER** + +This directory is a direct copy of https://github.com/angular/angular-cli/tree/master/packages/schematics/angular/utility and is used under terms and permissions by the MIT license granted by Google, Inc. + +All credits go to Angular team for building these utilities. diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts b/npm/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts new file mode 100644 index 00000000000..6883e73360c --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/ast-utils.ts @@ -0,0 +1,753 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import * as ts from 'typescript'; +import { Change, InsertChange, NoopChange } from './change'; + + +/** + * Add Import `import { symbolName } from fileName` if the import doesn't exit + * already. Assumes fileToEdit can be resolved and accessed. + * @param fileToEdit (file we want to add import to) + * @param symbolName (item to import) + * @param fileName (path to the file) + * @param isDefault (if true, import follows style for importing default exports) + * @return Change + */ +export function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, + fileName: string, isDefault = false): Change { + const rootNode = source; + const allImports = findNodes(rootNode, ts.SyntaxKind.ImportDeclaration); + + // get nodes that map to import statements from the file fileName + const relevantImports = allImports.filter(node => { + // StringLiteral of the ImportDeclaration is the import file (fileName in this case). + const importFiles = node.getChildren() + .filter(ts.isStringLiteral) + .map(n => n.text); + + return importFiles.filter(file => file === fileName).length === 1; + }); + + if (relevantImports.length > 0) { + let importsAsterisk = false; + // imports from import file + const imports: ts.Node[] = []; + relevantImports.forEach(n => { + Array.prototype.push.apply(imports, findNodes(n, ts.SyntaxKind.Identifier)); + if (findNodes(n, ts.SyntaxKind.AsteriskToken).length > 0) { + importsAsterisk = true; + } + }); + + // if imports * from fileName, don't add symbolName + if (importsAsterisk) { + return new NoopChange(); + } + + const importTextNodes = imports.filter(n => (n as ts.Identifier).text === symbolName); + + // insert import if it's not there + if (importTextNodes.length === 0) { + const fallbackPos = + findNodes(relevantImports[0], ts.SyntaxKind.CloseBraceToken)[0].getStart() || + findNodes(relevantImports[0], ts.SyntaxKind.FromKeyword)[0].getStart(); + + return insertAfterLastOccurrence(imports, `, ${symbolName}`, fileToEdit, fallbackPos); + } + + return new NoopChange(); + } + + // no such import declaration exists + const useStrict = findNodes(rootNode, ts.isStringLiteral) + .filter((n) => n.text === 'use strict'); + let fallbackPos = 0; + if (useStrict.length > 0) { + fallbackPos = useStrict[0].end; + } + const open = isDefault ? '' : '{ '; + const close = isDefault ? '' : ' }'; + // if there are no imports or 'use strict' statement, insert import at beginning of file + const insertAtBeginning = allImports.length === 0 && useStrict.length === 0; + const separator = insertAtBeginning ? '' : ';\n'; + const toInsert = `${separator}import ${open}${symbolName}${close}` + + ` from '${fileName}'${insertAtBeginning ? ';\n' : ''}`; + + return insertAfterLastOccurrence( + allImports, + toInsert, + fileToEdit, + fallbackPos, + ts.SyntaxKind.StringLiteral, + ); +} + + +/** + * Find all nodes from the AST in the subtree of node of SyntaxKind kind. + * @param node + * @param kind + * @param max The maximum number of items to return. + * @param recursive Continue looking for nodes of kind recursive until end + * the last child even when node of kind has been found. + * @return all nodes of kind, or [] if none is found + */ +export function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number, recursive?: boolean): ts.Node[]; + +/** + * Find all nodes from the AST in the subtree that satisfy a type guard. + * @param node + * @param guard + * @param max The maximum number of items to return. + * @param recursive Continue looking for nodes of kind recursive until end + * the last child even when node of kind has been found. + * @return all nodes that satisfy the type guard, or [] if none is found + */ +export function findNodes(node: ts.Node, guard: (node: ts.Node) => node is T, max?: number, recursive?: boolean): T[]; + +export function findNodes( + node: ts.Node, + kindOrGuard: ts.SyntaxKind | ((node: ts.Node) => node is T), + max = Infinity, + recursive = false, +): T[] { + if (!node || max == 0) { + return []; + } + + const test = + typeof kindOrGuard === 'function' + ? kindOrGuard + : (node: ts.Node): node is T => node.kind === kindOrGuard; + + const arr: T[] = []; + if (test(node)) { + arr.push(node); + max--; + } + if (max > 0 && (recursive || !test(node))) { + for (const child of node.getChildren()) { + findNodes(child, test, max).forEach((node) => { + if (max > 0) { + arr.push(node); + } + max--; + }); + + if (max <= 0) { + break; + } + } + } + + return arr; +} + + +/** + * Get all the nodes from a source. + * @param sourceFile The source file object. + * @returns {Array} An array of all the nodes in the source. + */ +export function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[] { + const nodes: ts.Node[] = [sourceFile]; + const result = []; + + while (nodes.length > 0) { + const node = nodes.shift(); + + if (node) { + result.push(node); + if (node.getChildCount(sourceFile) >= 0) { + nodes.unshift(...node.getChildren()); + } + } + } + + return result; +} + +export function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null { + if (node.kind === kind && node.getText() === text) { + // throw new Error(node.getText()); + return node; + } + + let foundNode: ts.Node | null = null; + ts.forEachChild(node, childNode => { + foundNode = foundNode || findNode(childNode, kind, text); + }); + + return foundNode; +} + + +/** + * Helper for sorting nodes. + * @return function to sort nodes in increasing order of position in sourceFile + */ +function nodesByPosition(first: ts.Node, second: ts.Node): number { + return first.getStart() - second.getStart(); +} + + +/** + * Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]` + * or after the last of occurence of `syntaxKind` if the last occurence is a sub child + * of ts.SyntaxKind[nodes[i].kind] and save the changes in file. + * + * @param nodes insert after the last occurence of nodes + * @param toInsert string to insert + * @param file file to insert changes into + * @param fallbackPos position to insert if toInsert happens to be the first occurence + * @param syntaxKind the ts.SyntaxKind of the subchildren to insert after + * @return Change instance + * @throw Error if toInsert is first occurence but fall back is not set + */ +export function insertAfterLastOccurrence(nodes: ts.Node[], + toInsert: string, + file: string, + fallbackPos: number, + syntaxKind?: ts.SyntaxKind): Change { + let lastItem: ts.Node | undefined; + for (const node of nodes) { + if (!lastItem || lastItem.getStart() < node.getStart()) { + lastItem = node; + } + } + if (syntaxKind && lastItem) { + lastItem = findNodes(lastItem, syntaxKind).sort(nodesByPosition).pop(); + } + if (!lastItem && fallbackPos == undefined) { + throw new Error(`tried to insert ${toInsert} as first occurence with no fallback position`); + } + const lastItemPosition: number = lastItem ? lastItem.getEnd() : fallbackPos; + + return new InsertChange(file, lastItemPosition, toInsert); +} + + +export function getContentOfKeyLiteral(_source: ts.SourceFile, node: ts.Node): string | null { + if (node.kind == ts.SyntaxKind.Identifier) { + return (node as ts.Identifier).text; + } else if (node.kind == ts.SyntaxKind.StringLiteral) { + return (node as ts.StringLiteral).text; + } else { + return null; + } +} + + +function _angularImportsFromNode(node: ts.ImportDeclaration, + _sourceFile: ts.SourceFile): {[name: string]: string} { + const ms = node.moduleSpecifier; + let modulePath: string; + switch (ms.kind) { + case ts.SyntaxKind.StringLiteral: + modulePath = (ms as ts.StringLiteral).text; + break; + default: + return {}; + } + + if (!modulePath.startsWith('@angular/')) { + return {}; + } + + if (node.importClause) { + if (node.importClause.name) { + // This is of the form `import Name from 'path'`. Ignore. + return {}; + } else if (node.importClause.namedBindings) { + const nb = node.importClause.namedBindings; + if (nb.kind == ts.SyntaxKind.NamespaceImport) { + // This is of the form `import * as name from 'path'`. Return `name.`. + return { + [(nb as ts.NamespaceImport).name.text + '.']: modulePath, + }; + } else { + // This is of the form `import {a,b,c} from 'path'` + const namedImports = nb as ts.NamedImports; + + return namedImports.elements + .map((is: ts.ImportSpecifier) => is.propertyName ? is.propertyName.text : is.name.text) + .reduce((acc: {[name: string]: string}, curr: string) => { + acc[curr] = modulePath; + + return acc; + }, {}); + } + } + + return {}; + } else { + // This is of the form `import 'path';`. Nothing to do. + return {}; + } +} + + +export function getDecoratorMetadata(source: ts.SourceFile, identifier: string, + module: string): ts.Node[] { + const angularImports = findNodes(source, ts.isImportDeclaration) + .map((node) => _angularImportsFromNode(node, source)) + .reduce((acc, current) => { + for (const key of Object.keys(current)) { + acc[key] = current[key]; + } + + return acc; + }, {}); + + return getSourceNodes(source) + .filter(node => { + return node.kind == ts.SyntaxKind.Decorator + && (node as ts.Decorator).expression.kind == ts.SyntaxKind.CallExpression; + }) + .map(node => (node as ts.Decorator).expression as ts.CallExpression) + .filter(expr => { + if (expr.expression.kind == ts.SyntaxKind.Identifier) { + const id = expr.expression as ts.Identifier; + + return id.text == identifier && angularImports[id.text] === module; + } else if (expr.expression.kind == ts.SyntaxKind.PropertyAccessExpression) { + // This covers foo.NgModule when importing * as foo. + const paExpr = expr.expression as ts.PropertyAccessExpression; + // If the left expression is not an identifier, just give up at that point. + if (paExpr.expression.kind !== ts.SyntaxKind.Identifier) { + return false; + } + + const id = paExpr.name.text; + const moduleId = (paExpr.expression as ts.Identifier).text; + + return id === identifier && (angularImports[moduleId + '.'] === module); + } + + return false; + }) + .filter(expr => expr.arguments[0] + && expr.arguments[0].kind == ts.SyntaxKind.ObjectLiteralExpression) + .map(expr => expr.arguments[0] as ts.ObjectLiteralExpression); +} + +function findClassDeclarationParent(node: ts.Node): ts.ClassDeclaration|undefined { + if (ts.isClassDeclaration(node)) { + return node; + } + + return node.parent && findClassDeclarationParent(node.parent); +} + +/** + * Given a source file with @NgModule class(es), find the name of the first @NgModule class. + * + * @param source source file containing one or more @NgModule + * @returns the name of the first @NgModule, or `undefined` if none is found + */ +export function getFirstNgModuleName(source: ts.SourceFile): string|undefined { + // First, find the @NgModule decorators. + const ngModulesMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core'); + if (ngModulesMetadata.length === 0) { + return undefined; + } + + // Then walk parent pointers up the AST, looking for the ClassDeclaration parent of the NgModule + // metadata. + const moduleClass = findClassDeclarationParent(ngModulesMetadata[0]); + if (!moduleClass || !moduleClass.name) { + return undefined; + } + + // Get the class name of the module ClassDeclaration. + return moduleClass.name.text; +} + +export function getMetadataField( + node: ts.ObjectLiteralExpression, + metadataField: string, +): ts.ObjectLiteralElement[] { + return node.properties + .filter(ts.isPropertyAssignment) + // Filter out every fields that's not "metadataField". Also handles string literals + // (but not expressions). + .filter(({ name }) => { + return (ts.isIdentifier(name) || ts.isStringLiteral(name)) + && name.getText() === metadataField; + }); +} + +export function addSymbolToNgModuleMetadata( + source: ts.SourceFile, + ngModulePath: string, + metadataField: string, + symbolName: string, + importPath: string | null = null, +): Change[] { + const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core'); + let node: any = nodes[0]; // tslint:disable-line:no-any + + // Find the decorator declaration. + if (!node) { + return []; + } + + // Get all the children property assignment of object literals. + const matchingProperties = getMetadataField( + node as ts.ObjectLiteralExpression, + metadataField, + ); + + // Get the last node of the array literal. + if (!matchingProperties) { + return []; + } + if (matchingProperties.length == 0) { + // We haven't found the field in the metadata declaration. Insert a new field. + const expr = node as ts.ObjectLiteralExpression; + let position: number; + let toInsert: string; + if (expr.properties.length == 0) { + position = expr.getEnd() - 1; + toInsert = ` ${metadataField}: [${symbolName}]\n`; + } else { + node = expr.properties[expr.properties.length - 1]; + position = node.getEnd(); + // Get the indentation of the last element, if any. + const text = node.getFullText(source); + const matches = text.match(/^\r?\n\s*/); + if (matches && matches.length > 0) { + toInsert = `,${matches[0]}${metadataField}: [${symbolName}]`; + } else { + toInsert = `, ${metadataField}: [${symbolName}]`; + } + } + if (importPath !== null) { + return [ + new InsertChange(ngModulePath, position, toInsert), + insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath), + ]; + } else { + return [new InsertChange(ngModulePath, position, toInsert)]; + } + } + const assignment = matchingProperties[0] as ts.PropertyAssignment; + + // If it's not an array, nothing we can do really. + if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) { + return []; + } + + const arrLiteral = assignment.initializer as ts.ArrayLiteralExpression; + if (arrLiteral.elements.length == 0) { + // Forward the property. + node = arrLiteral; + } else { + node = arrLiteral.elements; + } + + if (!node) { + // tslint:disable-next-line: no-console + console.error('No app module found. Please add your new class to your component.'); + + return []; + } + + if (Array.isArray(node)) { + const nodeArray = node as {} as Array; + const symbolsArray = nodeArray.map(node => node.getText()); + if (symbolsArray.includes(symbolName)) { + return []; + } + + node = node[node.length - 1]; + } + + let toInsert: string; + let position = node.getEnd(); + if (node.kind == ts.SyntaxKind.ObjectLiteralExpression) { + // We haven't found the field in the metadata declaration. Insert a new + // field. + const expr = node as ts.ObjectLiteralExpression; + if (expr.properties.length == 0) { + position = expr.getEnd() - 1; + toInsert = ` ${symbolName}\n`; + } else { + // Get the indentation of the last element, if any. + const text = node.getFullText(source); + if (text.match(/^\r?\r?\n/)) { + toInsert = `,${text.match(/^\r?\n\s*/)[0]}${symbolName}`; + } else { + toInsert = `, ${symbolName}`; + } + } + } else if (node.kind == ts.SyntaxKind.ArrayLiteralExpression) { + // We found the field but it's empty. Insert it just before the `]`. + position--; + toInsert = `${symbolName}`; + } else { + // Get the indentation of the last element, if any. + const text = node.getFullText(source); + if (text.match(/^\r?\n/)) { + toInsert = `,${text.match(/^\r?\n(\r?)\s*/)[0]}${symbolName}`; + } else { + toInsert = `, ${symbolName}`; + } + } + if (importPath !== null) { + return [ + new InsertChange(ngModulePath, position, toInsert), + insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath), + ]; + } + + return [new InsertChange(ngModulePath, position, toInsert)]; +} + +/** + * Custom function to insert a declaration (component, pipe, directive) + * into NgModule declarations. It also imports the component. + */ +export function addDeclarationToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + return addSymbolToNgModuleMetadata( + source, modulePath, 'declarations', classifiedName, importPath); +} + +/** + * Custom function to insert an NgModule into NgModule imports. It also imports the module. + */ +export function addImportToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + + return addSymbolToNgModuleMetadata(source, modulePath, 'imports', classifiedName, importPath); +} + +/** + * Custom function to insert a provider into NgModule. It also imports it. + */ +export function addProviderToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + return addSymbolToNgModuleMetadata(source, modulePath, 'providers', classifiedName, importPath); +} + +/** + * Custom function to insert an export into NgModule. It also imports it. + */ +export function addExportToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + return addSymbolToNgModuleMetadata(source, modulePath, 'exports', classifiedName, importPath); +} + +/** + * Custom function to insert an export into NgModule. It also imports it. + */ +export function addBootstrapToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + return addSymbolToNgModuleMetadata(source, modulePath, 'bootstrap', classifiedName, importPath); +} + +/** + * Custom function to insert an entryComponent into NgModule. It also imports it. + * @deprecated - Since version 9.0.0 with Ivy, entryComponents is no longer necessary. + */ +export function addEntryComponentToModule(source: ts.SourceFile, + modulePath: string, classifiedName: string, + importPath: string): Change[] { + return addSymbolToNgModuleMetadata( + source, modulePath, + 'entryComponents', classifiedName, importPath, + ); +} + +/** + * Determine if an import already exists. + */ +export function isImported(source: ts.SourceFile, + classifiedName: string, + importPath: string): boolean { + const allNodes = getSourceNodes(source); + const matchingNodes = allNodes + .filter(ts.isImportDeclaration) + .filter( + (imp) => ts.isStringLiteral(imp.moduleSpecifier) && imp.moduleSpecifier.text === importPath, + ) + .filter((imp) => { + if (!imp.importClause) { + return false; + } + const nodes = findNodes(imp.importClause, ts.isImportSpecifier).filter( + (n) => n.getText() === classifiedName, + ); + + return nodes.length > 0; + }); + + return matchingNodes.length > 0; +} + +/** + * This function returns the name of the environment export + * whether this export is aliased or not. If the environment file + * is not imported, then it will return `null`. + */ +export function getEnvironmentExportName(source: ts.SourceFile): string | null { + // Initial value is `null` as we don't know yet if the user + // has imported `environment` into the root module or not. + let environmentExportName: string | null = null; + + const allNodes = getSourceNodes(source); + + allNodes + .filter(ts.isImportDeclaration) + .filter( + (declaration) => + declaration.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral && + declaration.importClause !== undefined, + ) + .map((declaration) => + // If `importClause` property is defined then the first + // child will be `NamedImports` object (or `namedBindings`). + (declaration.importClause as ts.ImportClause).getChildAt(0), + ) + // Find those `NamedImports` object that contains `environment` keyword + // in its text. E.g. `{ environment as env }`. + .filter(ts.isNamedImports) + .filter((namedImports) => namedImports.getText().includes('environment')) + .forEach((namedImports) => { + for (const specifier of namedImports.elements) { + // `propertyName` is defined if the specifier + // has an aliased import. + const name = specifier.propertyName || specifier.name; + + // Find specifier that contains `environment` keyword in its text. + // Whether it's `environment` or `environment as env`. + if (name.text.includes('environment')) { + environmentExportName = specifier.name.text; + } + } + }); + + return environmentExportName; +} + +/** + * Returns the RouterModule declaration from NgModule metadata, if any. + */ +export function getRouterModuleDeclaration(source: ts.SourceFile): ts.Expression | undefined { + const result = getDecoratorMetadata(source, 'NgModule', '@angular/core') as ts.Node[]; + const node = result[0] as ts.ObjectLiteralExpression; + const matchingProperties = getMetadataField(node, 'imports'); + + if (!matchingProperties) { + return; + } + + const assignment = matchingProperties[0] as ts.PropertyAssignment; + + if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) { + return; + } + + const arrLiteral = assignment.initializer as ts.ArrayLiteralExpression; + + return arrLiteral.elements + .filter(el => el.kind === ts.SyntaxKind.CallExpression) + .find(el => (el as ts.Identifier).getText().startsWith('RouterModule')); +} + +/** + * Adds a new route declaration to a router module (i.e. has a RouterModule declaration) + */ +export function addRouteDeclarationToModule( + source: ts.SourceFile, + fileToAdd: string, + routeLiteral: string, +): Change { + const routerModuleExpr = getRouterModuleDeclaration(source); + if (!routerModuleExpr) { + throw new Error(`Couldn't find a route declaration in ${fileToAdd}.`); + } + const scopeConfigMethodArgs = (routerModuleExpr as ts.CallExpression).arguments; + if (!scopeConfigMethodArgs.length) { + const { line } = source.getLineAndCharacterOfPosition(routerModuleExpr.getStart()); + throw new Error( + `The router module method doesn't have arguments ` + + `at line ${line} in ${fileToAdd}`, + ); + } + + let routesArr: ts.ArrayLiteralExpression | undefined; + const routesArg = scopeConfigMethodArgs[0]; + + // Check if the route declarations array is + // an inlined argument of RouterModule or a standalone variable + if (ts.isArrayLiteralExpression(routesArg)) { + routesArr = routesArg; + } else { + const routesVarName = routesArg.getText(); + let routesVar; + if (routesArg.kind === ts.SyntaxKind.Identifier) { + routesVar = source.statements + .filter(ts.isVariableStatement) + .find((v) => { + return v.declarationList.declarations[0].name.getText() === routesVarName; + }); + } + + if (!routesVar) { + const { line } = source.getLineAndCharacterOfPosition(routesArg.getStart()); + throw new Error( + `No route declaration array was found that corresponds ` + + `to router module at line ${line} in ${fileToAdd}`, + ); + } + + routesArr = findNodes(routesVar, ts.SyntaxKind.ArrayLiteralExpression, 1)[0] as ts.ArrayLiteralExpression; + } + + const occurrencesCount = routesArr.elements.length; + const text = routesArr.getFullText(source); + + let route: string = routeLiteral; + let insertPos = routesArr.elements.pos; + + if (occurrencesCount > 0) { + const lastRouteLiteral = [...routesArr.elements].pop() as ts.Expression; + const lastRouteIsWildcard = ts.isObjectLiteralExpression(lastRouteLiteral) + && lastRouteLiteral + .properties + .some(n => ( + ts.isPropertyAssignment(n) + && ts.isIdentifier(n.name) + && n.name.text === 'path' + && ts.isStringLiteral(n.initializer) + && n.initializer.text === '**' + )); + + const indentation = text.match(/\r?\n(\r?)\s*/) || []; + const routeText = `${indentation[0] || ' '}${routeLiteral}`; + + // Add the new route before the wildcard route + // otherwise we'll always redirect to the wildcard route + if (lastRouteIsWildcard) { + insertPos = lastRouteLiteral.pos; + route = `${routeText},`; + } else { + insertPos = lastRouteLiteral.end; + route = `,${routeText}`; + } + } + + return new InsertChange(fileToAdd, insertPos, route); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/change.ts b/npm/ng-packs/packages/schematics/src/utils/angular/change.ts new file mode 100644 index 00000000000..12556352abd --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/change.ts @@ -0,0 +1,127 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +export interface Host { + write(path: string, content: string): Promise; + read(path: string): Promise; +} + + +export interface Change { + apply(host: Host): Promise; + + // The file this change should be applied to. Some changes might not apply to + // a file (maybe the config). + readonly path: string | null; + + // The order this change should be applied. Normally the position inside the file. + // Changes are applied from the bottom of a file to the top. + readonly order: number; + + // The description of this change. This will be outputted in a dry or verbose run. + readonly description: string; +} + + +/** + * An operation that does nothing. + */ +export class NoopChange implements Change { + description = 'No operation.'; + order = Infinity; + path = null; + apply() { return Promise.resolve(); } +} + + +/** + * Will add text to the source code. + */ +export class InsertChange implements Change { + + order: number; + description: string; + + constructor(public path: string, public pos: number, public toAdd: string) { + if (pos < 0) { + throw new Error('Negative positions are invalid'); + } + this.description = `Inserted ${toAdd} into position ${pos} of ${path}`; + this.order = pos; + } + + /** + * This method does not insert spaces if there is none in the original string. + */ + apply(host: Host) { + return host.read(this.path).then(content => { + const prefix = content.substring(0, this.pos); + const suffix = content.substring(this.pos); + + return host.write(this.path, `${prefix}${this.toAdd}${suffix}`); + }); + } +} + +/** + * Will remove text from the source code. + */ +export class RemoveChange implements Change { + + order: number; + description: string; + + constructor(public path: string, private pos: number, private toRemove: string) { + if (pos < 0) { + throw new Error('Negative positions are invalid'); + } + this.description = `Removed ${toRemove} into position ${pos} of ${path}`; + this.order = pos; + } + + apply(host: Host): Promise { + return host.read(this.path).then(content => { + const prefix = content.substring(0, this.pos); + const suffix = content.substring(this.pos + this.toRemove.length); + + // TODO: throw error if toRemove doesn't match removed string. + return host.write(this.path, `${prefix}${suffix}`); + }); + } +} + +/** + * Will replace text from the source code. + */ +export class ReplaceChange implements Change { + order: number; + description: string; + + constructor(public path: string, private pos: number, private oldText: string, + private newText: string) { + if (pos < 0) { + throw new Error('Negative positions are invalid'); + } + this.description = `Replaced ${oldText} into position ${pos} of ${path} with ${newText}`; + this.order = pos; + } + + apply(host: Host): Promise { + return host.read(this.path).then(content => { + const prefix = content.substring(0, this.pos); + const suffix = content.substring(this.pos + this.oldText.length); + const text = content.substring(this.pos, this.pos + this.oldText.length); + + if (text !== this.oldText) { + return Promise.reject(new Error(`Invalid replace: "${text}" != "${this.oldText}".`)); + } + + // TODO: throw error if oldText doesn't match removed string. + return host.write(this.path, `${prefix}${this.newText}${suffix}`); + }); + } +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/config.ts b/npm/ng-packs/packages/schematics/src/utils/angular/config.ts new file mode 100644 index 00000000000..ce0d15320bc --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/config.ts @@ -0,0 +1,532 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { JsonParseMode, parseJson } from '@angular-devkit/core'; +import { Rule, SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; +import { ProjectType, WorkspaceProject, WorkspaceSchema } from './workspace-models'; + +// The interfaces below are generated from the Angular CLI configuration schema +// https://github.com/angular/angular-cli/blob/master/packages/@angular/cli/lib/config/schema.json +export interface AppConfig { + /** + * Name of the app. + */ + name?: string; + /** + * Directory where app files are placed. + */ + appRoot?: string; + /** + * The root directory of the app. + */ + root?: string; + /** + * The output directory for build results. + */ + outDir?: string; + /** + * List of application assets. + */ + assets?: (string | { + /** + * The pattern to match. + */ + glob?: string; + /** + * The dir to search within. + */ + input?: string; + /** + * The output path (relative to the outDir). + */ + output?: string; + })[]; + /** + * URL where files will be deployed. + */ + deployUrl?: string; + /** + * Base url for the application being built. + */ + baseHref?: string; + /** + * The runtime platform of the app. + */ + platform?: ('browser' | 'server'); + /** + * The name of the start HTML file. + */ + index?: string; + /** + * The name of the main entry-point file. + */ + main?: string; + /** + * The name of the polyfills file. + */ + polyfills?: string; + /** + * The name of the test entry-point file. + */ + test?: string; + /** + * The name of the TypeScript configuration file. + */ + tsconfig?: string; + /** + * The name of the TypeScript configuration file for unit tests. + */ + testTsconfig?: string; + /** + * The prefix to apply to generated selectors. + */ + prefix?: string; + /** + * Experimental support for a service worker from @angular/service-worker. + */ + serviceWorker?: boolean; + /** + * Global styles to be included in the build. + */ + styles?: (string | { + input?: string; + [name: string]: any; // tslint:disable-line:no-any + })[]; + /** + * Options to pass to style preprocessors + */ + stylePreprocessorOptions?: { + /** + * Paths to include. Paths will be resolved to project root. + */ + includePaths?: string[]; + }; + /** + * Global scripts to be included in the build. + */ + scripts?: (string | { + input: string; + [name: string]: any; // tslint:disable-line:no-any + })[]; + /** + * Source file for environment config. + */ + environmentSource?: string; + /** + * Name and corresponding file for environment config. + */ + environments?: { + [name: string]: any; // tslint:disable-line:no-any + }; + appShell?: { + app: string; + route: string; + }; + budgets?: { + /** + * The type of budget + */ + type?: ('bundle' | 'initial' | 'allScript' | 'all' | 'anyScript' | 'any' | 'anyComponentStyle'); + /** + * The name of the bundle + */ + name?: string; + /** + * The baseline size for comparison. + */ + baseline?: string; + /** + * The maximum threshold for warning relative to the baseline. + */ + maximumWarning?: string; + /** + * The maximum threshold for error relative to the baseline. + */ + maximumError?: string; + /** + * The minimum threshold for warning relative to the baseline. + */ + minimumWarning?: string; + /** + * The minimum threshold for error relative to the baseline. + */ + minimumError?: string; + /** + * The threshold for warning relative to the baseline (min & max). + */ + warning?: string; + /** + * The threshold for error relative to the baseline (min & max). + */ + error?: string; + }[]; +} + +export interface CliConfig { + $schema?: string; + /** + * The global configuration of the project. + */ + project?: { + /** + * The name of the project. + */ + name?: string; + /** + * Whether or not this project was ejected. + */ + ejected?: boolean; + }; + /** + * Properties of the different applications in this project. + */ + apps?: AppConfig[]; + /** + * Configuration for end-to-end tests. + */ + e2e?: { + protractor?: { + /** + * Path to the config file. + */ + config?: string; + }; + }; + /** + * Properties to be passed to TSLint. + */ + lint?: { + /** + * File glob(s) to lint. + */ + files?: (string | string[]); + /** + * Location of the tsconfig.json project file. + * Will also use as files to lint if 'files' property not present. + */ + project: string; + /** + * Location of the tslint.json configuration. + */ + tslintConfig?: string; + /** + * File glob(s) to ignore. + */ + exclude?: (string | string[]); + }[]; + /** + * Configuration for unit tests. + */ + test?: { + karma?: { + /** + * Path to the karma config file. + */ + config?: string; + }; + codeCoverage?: { + /** + * Globs to exclude from code coverage. + */ + exclude?: string[]; + }; + }; + /** + * Specify the default values for generating. + */ + defaults?: { + /** + * The file extension to be used for style files. + */ + styleExt?: string; + /** + * How often to check for file updates. + */ + poll?: number; + /** + * Use lint to fix files after generation + */ + lintFix?: boolean; + /** + * Options for generating a class. + */ + class?: { + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Options for generating a component. + */ + component?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + /** + * Specifies if the style will be in the ts file. + */ + inlineStyle?: boolean; + /** + * Specifies if the template will be in the ts file. + */ + inlineTemplate?: boolean; + /** + * Specifies the view encapsulation strategy. + */ + viewEncapsulation?: ('Emulated' | 'Native' | 'None'); + /** + * Specifies the change detection strategy. + */ + changeDetection?: ('Default' | 'OnPush'); + }; + /** + * Options for generating a directive. + */ + directive?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Options for generating a guard. + */ + guard?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Options for generating an interface. + */ + interface?: { + /** + * Prefix to apply to interface names. (i.e. I) + */ + prefix?: string; + }; + /** + * Options for generating a module. + */ + module?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Options for generating a pipe. + */ + pipe?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Options for generating a service. + */ + service?: { + /** + * Flag to indicate if a directory is created. + */ + flat?: boolean; + /** + * Specifies if a spec file is generated. + */ + spec?: boolean; + }; + /** + * Properties to be passed to the build command. + */ + build?: { + /** + * Output sourcemaps. + */ + sourcemaps?: boolean; + /** + * Base url for the application being built. + */ + baseHref?: string; + /** + * The ssl key used by the server. + */ + progress?: boolean; + /** + * Enable and define the file watching poll time period (milliseconds). + */ + poll?: number; + /** + * Delete output path before build. + */ + deleteOutputPath?: boolean; + /** + * Do not use the real path when resolving modules. + */ + preserveSymlinks?: boolean; + /** + * Show circular dependency warnings on builds. + */ + showCircularDependencies?: boolean; + /** + * Use a separate bundle containing code used across multiple bundles. + */ + commonChunk?: boolean; + /** + * Use file name for lazy loaded chunks. + */ + namedChunks?: boolean; + }; + /** + * Properties to be passed to the serve command. + */ + serve?: { + /** + * The port the application will be served on. + */ + port?: number; + /** + * The host the application will be served on. + */ + host?: string; + /** + * Enables ssl for the application. + */ + ssl?: boolean; + /** + * The ssl key used by the server. + */ + sslKey?: string; + /** + * The ssl certificate used by the server. + */ + sslCert?: string; + /** + * Proxy configuration file. + */ + proxyConfig?: string; + }; + /** + * Properties about schematics. + */ + schematics?: { + /** + * The schematics collection to use. + */ + collection?: string; + /** + * The new app schematic. + */ + newApp?: string; + }; + }; + /** + * Specify which package manager tool to use. + */ + packageManager?: ('npm' | 'cnpm' | 'yarn' | 'default'); + /** + * Allow people to disable console warnings. + */ + warnings?: { + versionMismatch?: boolean; + }; +} + +export function getWorkspacePath(host: Tree): string { + const possibleFiles = [ '/angular.json', '/.angular.json' ]; + const path = possibleFiles.filter(path => host.exists(path))[0]; + + return path; +} + +export function getWorkspaceSchema(host: Tree): WorkspaceSchema { + const path = getWorkspacePath(host); + const configBuffer = host.read(path); + if (configBuffer === null) { + throw new SchematicsException(`Could not find (${path})`); + } + const content = configBuffer.toString(); + + return parseJson(content, JsonParseMode.Loose) as {} as WorkspaceSchema; +} + +export function addProjectToWorkspace( + workspace: WorkspaceSchema, + name: string, + project: WorkspaceProject, +): Rule { + return (_host: Tree, _context: SchematicContext) => { + + if (workspace.projects[name]) { + throw new Error(`Project '${name}' already exists in workspace.`); + } + + // Add project to workspace. + workspace.projects[name] = project; + + if (!workspace.defaultProject && Object.keys(workspace.projects).length === 1) { + // Make the new project the default one. + workspace.defaultProject = name; + } + + return updateWorkspaceSchema(workspace); + }; +} + +export function updateWorkspaceSchema(workspace: WorkspaceSchema): Rule { + return (host: Tree, _context: SchematicContext) => { + host.overwrite(getWorkspacePath(host), JSON.stringify(workspace, null, 2)); + }; +} + +export const configPath = '/.angular-cli.json'; + +export function getConfig(host: Tree): CliConfig { + const configBuffer = host.read(configPath); + if (configBuffer === null) { + throw new SchematicsException('Could not find .angular-cli.json'); + } + + const config = parseJson(configBuffer.toString(), JsonParseMode.Loose) as {} as CliConfig; + + return config; +} + +export function getAppFromConfig(config: CliConfig, appIndexOrName: string): AppConfig | null { + if (!config.apps) { + return null; + } + + if (parseInt(appIndexOrName) >= 0) { + return config.apps[parseInt(appIndexOrName)]; + } + + return config.apps.filter((app) => app.name === appIndexOrName)[0]; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/dependencies.ts b/npm/ng-packs/packages/schematics/src/utils/angular/dependencies.ts new file mode 100644 index 00000000000..76a60f53e61 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/dependencies.ts @@ -0,0 +1,76 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { Tree } from '@angular-devkit/schematics'; +import { JSONFile } from './json-file'; + +const PKG_JSON_PATH = '/package.json'; +export enum NodeDependencyType { + Default = 'dependencies', + Dev = 'devDependencies', + Peer = 'peerDependencies', + Optional = 'optionalDependencies', +} + +export interface NodeDependency { + type: NodeDependencyType; + name: string; + version: string; + overwrite?: boolean; +} + +const ALL_DEPENDENCY_TYPE = [ + NodeDependencyType.Default, + NodeDependencyType.Dev, + NodeDependencyType.Optional, + NodeDependencyType.Peer, +]; + +export function addPackageJsonDependency(tree: Tree, dependency: NodeDependency, pkgJsonPath = PKG_JSON_PATH): void { + const json = new JSONFile(tree, pkgJsonPath); + if (json.error) { + throw json.error; + } + + const { overwrite, type, name, version } = dependency; + const path = [type, name]; + if (overwrite || !json.get(path)) { + json.modify(path, version); + } +} + +export function removePackageJsonDependency(tree: Tree, name: string, pkgJsonPath = PKG_JSON_PATH): void { + const json = new JSONFile(tree, pkgJsonPath); + if (json.error) { + throw json.error; + } + + for (const depType of ALL_DEPENDENCY_TYPE) { + json.remove([depType, name]); + } +} + +export function getPackageJsonDependency(tree: Tree, name: string, pkgJsonPath = PKG_JSON_PATH): NodeDependency | null { + const json = new JSONFile(tree, pkgJsonPath); + if (json.error) { + throw json.error; + } + + for (const depType of ALL_DEPENDENCY_TYPE) { + const version = json.get([depType, name]); + + if (typeof version === 'string') { + return { + type: depType, + name: name, + version, + }; + } + } + + return null; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/find-module.ts b/npm/ng-packs/packages/schematics/src/utils/angular/find-module.ts new file mode 100644 index 00000000000..cf2a50379a1 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/find-module.ts @@ -0,0 +1,151 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { + dirname, + join, + normalize, NormalizedRoot, + Path, + relative +} from '@angular-devkit/core'; +import { DirEntry, Tree } from '@angular-devkit/schematics'; + + +export interface ModuleOptions { + project?: string; // added this + module?: string; + name: string; + flat?: boolean; + path?: string; + route?: string; // added this + selector?: string; // added this + skipImport?: boolean; + moduleExt?: string; + routingModuleExt?: string; +} + +export const MODULE_EXT = '.module.ts'; +export const ROUTING_MODULE_EXT = '-routing.module.ts'; + +/** + * Find the module referred by a set of options passed to the schematics. + */ +export function findModuleFromOptions(host: Tree, options: ModuleOptions): Path | undefined { + if (options.hasOwnProperty('skipImport') && options.skipImport) { + return undefined; + } + + const moduleExt = options.moduleExt || MODULE_EXT; + const routingModuleExt = options.routingModuleExt || ROUTING_MODULE_EXT; + + if (!options.module) { + const pathToCheck = (options.path || '') + '/' + options.name; + + return normalize(findModule(host, pathToCheck, moduleExt, routingModuleExt)); + } else { + const modulePath = normalize(`/${options.path}/${options.module}`); + const componentPath = normalize(`/${options.path}/${options.name}`); + const moduleBaseName = normalize(modulePath).split('/').pop(); + + const candidateSet = new Set([ + normalize(options.path || '/'), + ]); + + for (let dir = modulePath; dir != NormalizedRoot; dir = dirname(dir)) { + candidateSet.add(dir); + } + for (let dir = componentPath; dir != NormalizedRoot; dir = dirname(dir)) { + candidateSet.add(dir); + } + + const candidatesDirs = [...candidateSet].sort((a, b) => b.length - a.length); + for (const c of candidatesDirs) { + const candidateFiles = [ + '', + `${moduleBaseName}.ts`, + `${moduleBaseName}${moduleExt}`, + ].map(x => join(c, x)); + + for (const sc of candidateFiles) { + if (host.exists(sc)) { + return normalize(sc); + } + } + } + + throw new Error( + `Specified module '${options.module}' does not exist.\n` + + `Looked in the following directories:\n ${candidatesDirs.join('\n ')}`, + ); + } +} + +/** + * Function to find the "closest" module to a generated file's path. + */ +export function findModule(host: Tree, generateDir: string, + moduleExt = MODULE_EXT, routingModuleExt = ROUTING_MODULE_EXT): Path { + + let dir: DirEntry | null = host.getDir('/' + generateDir); + let foundRoutingModule = false; + + while (dir) { + const allMatches = dir.subfiles.filter(p => p.endsWith(moduleExt)); + const filteredMatches = allMatches.filter(p => !p.endsWith(routingModuleExt)); + + foundRoutingModule = foundRoutingModule || allMatches.length !== filteredMatches.length; + + if (filteredMatches.length == 1) { + return join(dir.path, filteredMatches[0]); + } else if (filteredMatches.length > 1) { + throw new Error( + 'More than one module matches. Use the skip-import option to skip importing ' + + 'the component into the closest module or use the module option to specify a module.'); + } + + dir = dir.parent; + } + + const errorMsg = foundRoutingModule ? 'Could not find a non Routing NgModule.' + + `\nModules with suffix '${routingModuleExt}' are strictly reserved for routing.` + + '\nUse the skip-import option to skip importing in NgModule.' + : 'Could not find an NgModule. Use the skip-import option to skip importing in NgModule.'; + + throw new Error(errorMsg); +} + +/** + * Build a relative path from one file path to another file path. + */ +export function buildRelativePath(from: string, to: string): string { + from = normalize(from); + to = normalize(to); + + // Convert to arrays. + const fromParts = from.split('/'); + const toParts = to.split('/'); + + // Remove file names (preserving destination) + fromParts.pop(); + const toFileName = toParts.pop(); + + const relativePath = relative(normalize(fromParts.join('/') || '/'), + normalize(toParts.join('/') || '/')); + let pathPrefix = ''; + + // Set the path prefix for same dir or child dir, parent dir starts with `..` + if (!relativePath) { + pathPrefix = '.'; + } else if (!relativePath.startsWith('.')) { + pathPrefix = `./`; + } + if (pathPrefix && !pathPrefix.endsWith('/')) { + pathPrefix += '/'; + } + + return pathPrefix + (relativePath ? relativePath + '/' : '') + toFileName; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/index.ts b/npm/ng-packs/packages/schematics/src/utils/angular/index.ts new file mode 100644 index 00000000000..fec78af4487 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/index.ts @@ -0,0 +1,17 @@ +export * from './ast-utils'; +export * from './change'; +export * from './config'; +export * from './dependencies'; +export * from './find-module'; +export * from './json-file'; +export * from './json-utils'; +export * from './latest-versions'; +export * from './lint-fix'; +export * from './ng-ast-utils'; +export * from './parse-name'; +export * from './paths'; +export * from './project-targets'; +export * from './tsconfig'; +export * from './validation'; +export * from './workspace'; +export * from './workspace-models'; diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/json-file.ts b/npm/ng-packs/packages/schematics/src/utils/angular/json-file.ts new file mode 100644 index 00000000000..1832f38c5c3 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/json-file.ts @@ -0,0 +1,82 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { JsonValue } from '@angular-devkit/core'; +import { Tree } from '@angular-devkit/schematics'; +import { Node, applyEdits, findNodeAtLocation, getNodeValue, modify, parseTree } from 'jsonc-parser'; + +export type JSONPath = (string | number)[]; + +/** @internal */ +export class JSONFile { + private content: string; + error: undefined | Error; + + constructor( + private readonly host: Tree, + private readonly path: string, + ) { + const buffer = this.host.read(this.path); + if (buffer) { + this.content = buffer.toString(); + } else { + this.error = new Error(`Could not read ${path}.`); + } + } + + private _jsonAst: Node | undefined; + private get JsonAst(): Node { + if (this._jsonAst) { + return this._jsonAst; + } + + this._jsonAst = parseTree(this.content); + + return this._jsonAst; + } + + get(jsonPath: JSONPath): unknown { + if (jsonPath.length === 0) { + return getNodeValue(this.JsonAst); + } + + const node = findNodeAtLocation(this.JsonAst, jsonPath); + + return node === undefined ? undefined : getNodeValue(node); + } + + modify(jsonPath: JSONPath, value: JsonValue | undefined, getInsertionIndex?: (properties: string[]) => number): void { + if (!getInsertionIndex) { + const property = jsonPath.slice(-1)[0]; + getInsertionIndex = properties => [...properties, property].sort().findIndex(p => p === property); + } + + const edits = modify( + this.content, + jsonPath, + value, + { + getInsertionIndex, + formattingOptions: { + insertSpaces: true, + tabSize: 2, + }, + }, + ); + + this.content = applyEdits(this.content, edits); + this.host.overwrite(this.path, this.content); + this._jsonAst = undefined; + } + + remove(jsonPath: JSONPath): void { + if (this.get(jsonPath) !== undefined) { + this.modify(jsonPath, undefined); + } + } +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/json-utils.ts b/npm/ng-packs/packages/schematics/src/utils/angular/json-utils.ts new file mode 100644 index 00000000000..cf1754a9a44 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/json-utils.ts @@ -0,0 +1,231 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { + JsonAstArray, + JsonAstKeyValue, + JsonAstNode, + JsonAstObject, + JsonValue, +} from '@angular-devkit/core'; +import { UpdateRecorder } from '@angular-devkit/schematics'; + +export function appendPropertyInAstObject( + recorder: UpdateRecorder, + node: JsonAstObject, + propertyName: string, + value: JsonValue, + indent: number, +) { + const indentStr = _buildIndent(indent); + let index = node.start.offset + 1; + if (node.properties.length > 0) { + // Insert comma. + const last = node.properties[node.properties.length - 1]; + const { text, end } = last; + const commaIndex = text.endsWith('\n') ? end.offset - 1 : end.offset; + recorder.insertRight(commaIndex, ','); + index = end.offset; + } + const content = _stringifyContent(value, indentStr); + recorder.insertRight( + index, + (node.properties.length === 0 && indent ? '\n' : '') + + ' '.repeat(indent) + + `"${propertyName}":${indent ? ' ' : ''}${content}` + + indentStr.slice(0, -indent), + ); +} + +export function insertPropertyInAstObjectInOrder( + recorder: UpdateRecorder, + node: JsonAstObject, + propertyName: string, + value: JsonValue, + indent: number, +) { + + if (node.properties.length === 0) { + appendPropertyInAstObject(recorder, node, propertyName, value, indent); + + return; + } + + // Find insertion info. + let insertAfterProp: JsonAstKeyValue | null = null; + let prev: JsonAstKeyValue | null = null; + let isLastProp = false; + const last = node.properties[node.properties.length - 1]; + for (const prop of node.properties) { + if (prop.key.value > propertyName) { + if (prev) { + insertAfterProp = prev; + } + break; + } + if (prop === last) { + isLastProp = true; + insertAfterProp = last; + } + prev = prop; + } + + if (isLastProp) { + appendPropertyInAstObject(recorder, node, propertyName, value, indent); + + return; + } + + const indentStr = _buildIndent(indent); + const insertIndex = insertAfterProp === null + ? node.start.offset + 1 + : insertAfterProp.end.offset + 1; + const content = _stringifyContent(value, indentStr); + recorder.insertRight( + insertIndex, + indentStr + + `"${propertyName}":${indent ? ' ' : ''}${content}` + + ',', + ); +} + +export function removePropertyInAstObject( + recorder: UpdateRecorder, + node: JsonAstObject, + propertyName: string, +) { + // Find the property inside the object. + const propIdx = node.properties.findIndex(prop => prop.key.value === propertyName); + + if (propIdx === -1) { + // There's nothing to remove. + return; + } + + if (node.properties.length === 1) { + // This is a special case. Everything should be removed, including indentation. + recorder.remove(node.start.offset, node.end.offset - node.start.offset); + recorder.insertRight(node.start.offset, '{}'); + + return; + } + + // The AST considers commas and indentation to be part of the preceding property. + // To get around messy comma and identation management, we can work over the range between + // two properties instead. + const previousProp = node.properties[propIdx - 1]; + const targetProp = node.properties[propIdx]; + const nextProp = node.properties[propIdx + 1]; + + let start, end; + if (previousProp) { + // Given the object below, and intending to remove the `m` property: + // "{\n \"a\": \"a\",\n \"m\": \"m\",\n \"z\": \"z\"\n}" + // ^---------------^ + // Removing the range above results in: + // "{\n \"a\": \"a\",\n \"z\": \"z\"\n}" + start = previousProp.end; + end = targetProp.end; + } else { + // If there's no previousProp there is a nextProp, since we've specialcased the 1 length case. + // Given the object below, and intending to remove the `a` property: + // "{\n \"a\": \"a\",\n \"m\": \"m\",\n \"z\": \"z\"\n}" + // ^---------------^ + // Removing the range above results in: + // "{\n \"m\": \"m\",\n \"z\": \"z\"\n}" + start = targetProp.start; + end = nextProp.start; + } + + recorder.remove(start.offset, end.offset - start.offset); + if (!nextProp) { + recorder.insertRight(start.offset, '\n'); + } +} + + +export function appendValueInAstArray( + recorder: UpdateRecorder, + node: JsonAstArray, + value: JsonValue, + indent = 4, +) { + let indentStr = _buildIndent(indent); + let index = node.start.offset + 1; + // tslint:disable-next-line: no-any + let newNodes: any[] | undefined; + + if (node.elements.length > 0) { + // Insert comma. + const { end } = node.elements[node.elements.length - 1]; + const isClosingOnSameLine = node.end.offset - end.offset === 1; + + if (isClosingOnSameLine && indent) { + // Reformat the entire array + recorder.remove(node.start.offset, node.end.offset - node.start.offset); + newNodes = [ + ...node.elements.map(({ value }) => value), + value, + ]; + index = node.start.offset; + // In case we are generating the entire node we need to reduce the spacing as + // otherwise we'd end up having incorrect double spacing + indent = indent - 2; + indentStr = _buildIndent(indent); + } else { + recorder.insertRight(end.offset, ','); + index = end.offset; + } + } + + recorder.insertRight( + index, + (newNodes ? '' : indentStr) + + _stringifyContent(newNodes || value, indentStr) + + (node.elements.length === 0 && indent ? indentStr.substr(0, -indent) + '\n' : ''), + ); +} + + +export function findPropertyInAstObject( + node: JsonAstObject, + propertyName: string, +): JsonAstNode | null { + let maybeNode: JsonAstNode | null = null; + for (const property of node.properties) { + if (property.key.value == propertyName) { + maybeNode = property.value; + } + } + + return maybeNode; +} + +function _buildIndent(count: number): string { + return count ? '\n' + ' '.repeat(count) : ''; +} + +function _stringifyContent(value: JsonValue, indentStr: string): string { + // TODO: Add snapshot tests + + // The 'space' value is 2, because we want to add 2 additional + // indents from the 'key' node. + + // If we use the indent provided we will have double indents: + // "budgets": [ + // { + // "type": "initial", + // "maximumWarning": "2mb", + // "maximumError": "5mb" + // }, + // { + // "type": "anyComponentStyle", + // 'maximumWarning": "5kb" + // } + // ] + return JSON.stringify(value, null, 2).replace(/\n/g, indentStr); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions.ts b/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions.ts new file mode 100644 index 00000000000..bead0e6282f --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +export const latestVersions = { + // These versions should be kept up to date with latest Angular peer dependencies. + Angular: '~10.0.0-rc.0', + RxJs: '~6.6.0', + ZoneJs: '~0.10.2', + TypeScript: '~3.9.5', + TsLib: '^2.0.0', + + // The versions below must be manually updated when making a new devkit release. + // For our e2e tests, these versions must match the latest tag present on the branch. + // During RC periods they will not match the latest RC until there's a new git tag, and + // should not be updated. + DevkitBuildAngular: '~0.1000.0-rc.0', + DevkitBuildNgPackagr: '~0.1000.0-rc.0', + DevkitBuildWebpack: '~0.1000.0-rc.0', + + ngPackagr: '^10.0.0', +}; diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/lint-fix.ts b/npm/ng-packs/packages/schematics/src/utils/angular/lint-fix.ts new file mode 100644 index 00000000000..f794bf681fd --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/lint-fix.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { + DirEntry, + Rule, + SchematicContext, + SchematicsException, + Tree, +} from '@angular-devkit/schematics'; +import { TslintFixTask } from '@angular-devkit/schematics/tasks'; + +export function applyLintFix(path = '/'): Rule { + return (tree: Tree, context: SchematicContext) => { + // Find the closest tslint.json or tslint.yaml + let dir: DirEntry | null = tree.getDir(path.substr(0, path.lastIndexOf('/'))); + + do { + if ((dir.subfiles as string[]).some(f => f === 'tslint.json' || f === 'tslint.yaml')) { + break; + } + + dir = dir.parent; + } while (dir !== null); + + if (dir === null) { + throw new SchematicsException( + 'Asked to run lint fixes, but could not find a tslint.json or tslint.yaml config file.'); + } + + // Only include files that have been touched. + const files = tree.actions.reduce((acc: Set, action) => { + const path = action.path.substr(1); // Remove the starting '/'. + if (path.endsWith('.ts') && dir && action.path.startsWith(dir.path)) { + acc.add(path); + } + + return acc; + }, new Set()); + + context.addTask(new TslintFixTask({ + ignoreErrors: true, + tsConfigPath: 'tsconfig.json', + files: [...files], + })); + }; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/ng-ast-utils.ts b/npm/ng-packs/packages/schematics/src/utils/angular/ng-ast-utils.ts new file mode 100644 index 00000000000..2c48c9b8bda --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/ng-ast-utils.ts @@ -0,0 +1,87 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { normalize } from '@angular-devkit/core'; +import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import { dirname } from 'path'; +import * as ts from 'typescript'; +import { findNode, getSourceNodes } from './ast-utils'; + +export function findBootstrapModuleCall(host: Tree, mainPath: string): ts.CallExpression | null { + const mainBuffer = host.read(mainPath); + if (!mainBuffer) { + throw new SchematicsException(`Main file (${mainPath}) not found`); + } + const mainText = mainBuffer.toString('utf-8'); + const source = ts.createSourceFile(mainPath, mainText, ts.ScriptTarget.Latest, true); + + const allNodes = getSourceNodes(source); + + let bootstrapCall: ts.CallExpression | null = null; + + for (const node of allNodes) { + let bootstrapCallNode: ts.Node | null = null; + bootstrapCallNode = findNode(node, ts.SyntaxKind.Identifier, 'bootstrapModule'); + + // Walk up the parent until CallExpression is found. + while ( + bootstrapCallNode && + bootstrapCallNode.parent && + bootstrapCallNode.parent.kind !== ts.SyntaxKind.CallExpression + ) { + bootstrapCallNode = bootstrapCallNode.parent; + } + + if ( + bootstrapCallNode !== null && + bootstrapCallNode.parent !== undefined && + bootstrapCallNode.parent.kind === ts.SyntaxKind.CallExpression + ) { + bootstrapCall = bootstrapCallNode.parent as ts.CallExpression; + break; + } + } + + return bootstrapCall; +} + +export function findBootstrapModulePath(host: Tree, mainPath: string): string { + const bootstrapCall = findBootstrapModuleCall(host, mainPath); + if (!bootstrapCall) { + throw new SchematicsException('Bootstrap call not found'); + } + + const bootstrapModule = bootstrapCall.arguments[0]; + + const mainBuffer = host.read(mainPath); + if (!mainBuffer) { + throw new SchematicsException(`Client app main file (${mainPath}) not found`); + } + const mainText = mainBuffer.toString('utf-8'); + const source = ts.createSourceFile(mainPath, mainText, ts.ScriptTarget.Latest, true); + const allNodes = getSourceNodes(source); + const bootstrapModuleRelativePath = allNodes + .filter(node => node.kind === ts.SyntaxKind.ImportDeclaration) + .filter(imp => { + return findNode(imp, ts.SyntaxKind.Identifier, bootstrapModule.getText()); + }) + .map((imp: ts.ImportDeclaration) => { + const modulePathStringLiteral = imp.moduleSpecifier as ts.StringLiteral; + + return modulePathStringLiteral.text; + })[0]; + + return bootstrapModuleRelativePath; +} + +export function getAppModulePath(host: Tree, mainPath: string): string { + const moduleRelativePath = findBootstrapModulePath(host, mainPath); + const mainDir = dirname(mainPath); + const modulePath = normalize(`/${mainDir}/${moduleRelativePath}.ts`); + + return modulePath; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/parse-name.ts b/npm/ng-packs/packages/schematics/src/utils/angular/parse-name.ts new file mode 100644 index 00000000000..cac57b08680 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/parse-name.ts @@ -0,0 +1,25 @@ + +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +// import { relative, Path } from "../../../angular_devkit/core/src/virtual-fs"; +import { Path, basename, dirname, join, normalize } from '@angular-devkit/core'; + +export interface Location { + name: string; + path: Path; +} + +export function parseName(path: string, name: string): Location { + const nameWithoutPath = basename(normalize(name)); + const namePath = dirname(join(normalize(path), name) as Path); + + return { + name: nameWithoutPath, + path: normalize('/' + namePath), + }; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/paths.ts b/npm/ng-packs/packages/schematics/src/utils/angular/paths.ts new file mode 100644 index 00000000000..35729a64171 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/paths.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { normalize, split } from '@angular-devkit/core'; + +export function relativePathToWorkspaceRoot(projectRoot: string | undefined): string { + const normalizedPath = split(normalize(projectRoot || '')); + + if (normalizedPath.length === 0 || !normalizedPath[0]) { + return '.'; + } else { + return normalizedPath.map(() => '..').join('/'); + } +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/project-targets.ts b/npm/ng-packs/packages/schematics/src/utils/angular/project-targets.ts new file mode 100644 index 00000000000..e99293f10e8 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/project-targets.ts @@ -0,0 +1,13 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { SchematicsException } from '@angular-devkit/schematics'; + +export function targetBuildNotFoundError(): SchematicsException { + return new SchematicsException(`Project target "build" not found.`); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts b/npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts new file mode 100644 index 00000000000..4d6679a1d86 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/tsconfig.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { JsonParseMode, parseJsonAst } from '@angular-devkit/core'; +import { Rule, SchematicsException, Tree } from '@angular-devkit/schematics'; +import { appendValueInAstArray, findPropertyInAstObject } from './json-utils'; + +const SOLUTION_TSCONFIG_PATH = 'tsconfig.json'; + +/** + * Add project references in "Solution Style" tsconfig. + */ +export function addTsConfigProjectReferences(paths: string[]): Rule { + return (host, context) => { + const logger = context.logger; + + // We need to read after each write to avoid missing `,` when appending multiple items. + for (const path of paths) { + const source = host.read(SOLUTION_TSCONFIG_PATH); + if (!source) { + // Solution tsconfig doesn't exist. + logger.warn(`Cannot add reference '${path}' in '${SOLUTION_TSCONFIG_PATH}'. File doesn't exists.`); + + return; + } + + const jsonAst = parseJsonAst(source.toString(), JsonParseMode.Loose); + if (jsonAst?.kind !== 'object') { + // Invalid JSON + throw new SchematicsException(`Invalid JSON AST Object '${SOLUTION_TSCONFIG_PATH}'.`); + } + + // Solutions style tsconfig can contain 2 properties: + // - 'files' with a value of empty array + // - 'references' + const filesAst = findPropertyInAstObject(jsonAst, 'files'); + const referencesAst = findPropertyInAstObject(jsonAst, 'references'); + if ( + filesAst?.kind !== 'array' || + filesAst.elements.length !== 0 || + referencesAst?.kind !== 'array' + ) { + logger.warn(`Cannot add reference '${path}' in '${SOLUTION_TSCONFIG_PATH}'. It appears to be an invalid solution style tsconfig.`); + + return; + } + + // Append new paths + const recorder = host.beginUpdate(SOLUTION_TSCONFIG_PATH); + appendValueInAstArray(recorder, referencesAst, { 'path': `./${path}` }, 4); + host.commitUpdate(recorder); + } + }; +} + +/** + * Throws an exception when the base tsconfig doesn't exists. + */ +export function verifyBaseTsConfigExists(host: Tree): void { + if (host.exists('tsconfig.base.json')) { + return; + } + + throw new SchematicsException(`Cannot find base TypeScript configuration file 'tsconfig.base.json'.`); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/validation.ts b/npm/ng-packs/packages/schematics/src/utils/angular/validation.ts new file mode 100644 index 00000000000..923b819df9d --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/validation.ts @@ -0,0 +1,77 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { tags } from '@angular-devkit/core'; +import { SchematicsException } from '@angular-devkit/schematics'; + +export function validateName(name: string): void { + if (name && /^\d/.test(name)) { + throw new SchematicsException(tags.oneLine`name (${name}) + can not start with a digit.`); + } +} + +// Must start with a letter, and must contain only alphanumeric characters or dashes. +// When adding a dash the segment after the dash must also start with a letter. +export const htmlSelectorRe = /^[a-zA-Z][.0-9a-zA-Z]*(:?-[a-zA-Z][.0-9a-zA-Z]*)*$/; + +export function validateHtmlSelector(selector: string): void { + if (selector && !htmlSelectorRe.test(selector)) { + throw new SchematicsException(tags.oneLine`Selector (${selector}) + is invalid.`); + } +} + + +export function validateProjectName(projectName: string) { + const errorIndex = getRegExpFailPosition(projectName); + const unsupportedProjectNames: string[] = []; + const packageNameRegex = /^(?:@[a-zA-Z0-9_-]+\/)?[a-zA-Z0-9_-]+$/; + if (errorIndex !== null) { + const firstMessage = tags.oneLine` + Project name "${projectName}" is not valid. New project names must + start with a letter, and must contain only alphanumeric characters or dashes. + When adding a dash the segment after the dash must also start with a letter. + `; + const msg = tags.stripIndent` + ${firstMessage} + ${projectName} + ${Array(errorIndex + 1).join(' ') + '^'} + `; + throw new SchematicsException(msg); + } else if (unsupportedProjectNames.indexOf(projectName) !== -1) { + throw new SchematicsException( + `Project name ${JSON.stringify(projectName)} is not a supported name.`); + } else if (!packageNameRegex.test(projectName)) { + throw new SchematicsException(`Project name ${JSON.stringify(projectName)} is invalid.`); + } +} + +function getRegExpFailPosition(str: string): number | null { + const isScope = /^@.*\/.*/.test(str); + if (isScope) { + // Remove starting @ + str = str.replace(/^@/, ''); + // Change / to - for validation + str = str.replace(/\//g, '-'); + } + + const parts = str.indexOf('-') >= 0 ? str.split('-') : [str]; + const matched: string[] = []; + + const projectNameRegexp = /^[a-zA-Z][.0-9a-zA-Z]*(-[.0-9a-zA-Z]*)*$/; + + parts.forEach(part => { + if (part.match(projectNameRegexp)) { + matched.push(part); + } + }); + + const compare = matched.join('-'); + + return (str !== compare) ? compare.length : null; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts b/npm/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts new file mode 100644 index 00000000000..c03a857d43f --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/workspace-models.ts @@ -0,0 +1,171 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import { experimental } from '@angular-devkit/core'; + +export enum ProjectType { + Application = 'application', + Library = 'library', +} + +export enum Builders { + AppShell = '@angular-devkit/build-angular:app-shell', + Server = '@angular-devkit/build-angular:server', + Browser = '@angular-devkit/build-angular:browser', + Karma = '@angular-devkit/build-angular:karma', + TsLint = '@angular-devkit/build-angular:tslint', + NgPackagr = '@angular-devkit/build-ng-packagr:build', + DevServer = '@angular-devkit/build-angular:dev-server', + ExtractI18n = '@angular-devkit/build-angular:extract-i18n', + Protractor = '@angular-devkit/build-angular:protractor', +} + +export interface FileReplacements { + replace: string; + with: string; +} + +export interface BrowserBuilderBaseOptions { + main: string; + tsConfig: string; + fileReplacements?: FileReplacements[]; + outputPath?: string; + index?: string; + polyfills: string; + assets?: (object|string)[]; + styles?: (object|string)[]; + scripts?: (object|string)[]; + sourceMap?: boolean; +} + +export type OutputHashing = 'all' | 'media' | 'none' | 'bundles'; + +export interface BrowserBuilderOptions extends BrowserBuilderBaseOptions { + serviceWorker?: boolean; + optimization?: boolean; + outputHashing?: OutputHashing; + resourcesOutputPath?: string; + extractCss?: boolean; + namedChunks?: boolean; + aot?: boolean; + extractLicenses?: boolean; + vendorChunk?: boolean; + buildOptimizer?: boolean; + ngswConfigPath?: string; + budgets?: { + type: string; + maximumWarning?: string; + maximumError?: string; + }[]; + webWorkerTsConfig?: string; +} + +export interface ServeBuilderOptions { + browserTarget: string; +} +export interface LibraryBuilderOptions { + tsConfig: string; + project: string; +} + +export interface ServerBuilderOptions { + outputPath: string; + tsConfig: string; + main: string; + fileReplacements?: FileReplacements[]; + optimization?: { + scripts?: boolean; + styles?: boolean; + }; + sourceMap?: boolean | { + scripts?: boolean; + styles?: boolean; + hidden?: boolean; + vendor?: boolean; + }; +} + +export interface AppShellBuilderOptions { + browserTarget: string; + serverTarget: string; + route: string; +} + +export interface TestBuilderOptions extends Partial { + karmaConfig: string; +} + +export interface LintBuilderOptions { + tsConfig: string[] | string; + exclude?: string[]; +} + +export interface ExtractI18nOptions { + browserTarget: string; +} + +export interface E2EOptions { + protractorConfig: string; + devServerTarget: string; +} + +export interface BuilderTarget { + builder: TBuilder; + options: TOptions; + configurations?: { + production: Partial; + [key: string]: Partial; + }; +} + +export type LibraryBuilderTarget = BuilderTarget; +export type BrowserBuilderTarget = BuilderTarget; +export type ServerBuilderTarget = BuilderTarget; +export type AppShellBuilderTarget = BuilderTarget; +export type LintBuilderTarget = BuilderTarget; +export type TestBuilderTarget = BuilderTarget; +export type ServeBuilderTarget = BuilderTarget; +export type ExtractI18nBuilderTarget = BuilderTarget; +export type E2EBuilderTarget = BuilderTarget; + +export interface WorkspaceSchema extends experimental.workspace.WorkspaceSchema { + projects: { + [key: string]: WorkspaceProject; + }; +} + +export interface WorkspaceProject + extends experimental.workspace.WorkspaceProject { + /** + * Project type. + */ + projectType: ProjectType; + + /** + * Tool options. + */ + architect?: WorkspaceTargets; + /** + * Tool options. + */ + targets?: WorkspaceTargets; +} + +export interface WorkspaceTargets { + build?: TProjectType extends ProjectType.Library ? LibraryBuilderTarget : BrowserBuilderTarget; + server?: ServerBuilderTarget; + lint?: LintBuilderTarget; + test?: TestBuilderTarget; + serve?: ServeBuilderTarget; + e2e?: E2EBuilderTarget; + 'app-shell'?: AppShellBuilderTarget; + 'extract-i18n'?: ExtractI18nBuilderTarget; + // TODO(hans): change this any to unknown when google3 supports TypeScript 3.0. + // tslint:disable-next-line:no-any + [key: string]: any; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/angular/workspace.ts new file mode 100644 index 00000000000..79dbfbb6add --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/angular/workspace.ts @@ -0,0 +1,91 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +import { virtualFs, workspaces } from '@angular-devkit/core'; +import { Rule, Tree } from '@angular-devkit/schematics'; +import { ProjectType } from './workspace-models'; + +function createHost(tree: Tree): workspaces.WorkspaceHost { + return { + async readFile(path: string): Promise { + const data = tree.read(path); + if (!data) { + throw new Error('File not found.'); + } + + return virtualFs.fileBufferToString(data); + }, + async writeFile(path: string, data: string): Promise { + return tree.overwrite(path, data); + }, + async isDirectory(path: string): Promise { + // approximate a directory check + return !tree.exists(path) && tree.getDir(path).subfiles.length > 0; + }, + async isFile(path: string): Promise { + return tree.exists(path); + }, + }; +} + +export function updateWorkspace( + updater: (workspace: workspaces.WorkspaceDefinition) => void | PromiseLike, +): Rule; +export function updateWorkspace( + workspace: workspaces.WorkspaceDefinition, +): Rule; +export function updateWorkspace( + updaterOrWorkspace: workspaces.WorkspaceDefinition + | ((workspace: workspaces.WorkspaceDefinition) => void | PromiseLike), +): Rule { + return async (tree: Tree) => { + const host = createHost(tree); + + if (typeof updaterOrWorkspace === 'function') { + + const { workspace } = await workspaces.readWorkspace('/', host); + + const result = updaterOrWorkspace(workspace); + if (result !== undefined) { + await result; + } + + await workspaces.writeWorkspace(workspace, host); + } else { + await workspaces.writeWorkspace(updaterOrWorkspace, host); + } + }; +} + +export async function getWorkspace(tree: Tree, path = '/') { + const host = createHost(tree); + + const { workspace } = await workspaces.readWorkspace(path, host); + + return workspace; +} + +/** + * Build a default project path for generating. + * @param project The project which will have its default path generated. + */ +export function buildDefaultPath(project: workspaces.ProjectDefinition): string { + const root = project.sourceRoot ? `/${project.sourceRoot}/` : `/${project.root}/src/`; + const projectDirName = project.extensions['projectType'] === ProjectType.Application ? 'app' : 'lib'; + + return `${root}${projectDirName}`; +} + +export async function createDefaultPath(tree: Tree, projectName: string): Promise { + const workspace = await getWorkspace(tree); + const project = workspace.projects.get(projectName); + if (!project) { + throw new Error('Specified project does not exist.'); + } + + return buildDefaultPath(project); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts new file mode 100644 index 00000000000..f5419fa8d9d --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -0,0 +1 @@ +export * from './angular'; From f6e1c4fd2882982bdce4573bbb96fd8cd9145e8a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:02:05 +0300 Subject: [PATCH 08/95] feat: add clearly named text utils --- npm/ng-packs/packages/schematics/src/utils/index.ts | 1 + npm/ng-packs/packages/schematics/src/utils/text.ts | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/text.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index f5419fa8d9d..5b84b6c8f1a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1 +1,2 @@ export * from './angular'; +export * from './text'; diff --git a/npm/ng-packs/packages/schematics/src/utils/text.ts b/npm/ng-packs/packages/schematics/src/utils/text.ts new file mode 100644 index 00000000000..5d8ed492075 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/text.ts @@ -0,0 +1,9 @@ +import { strings } from '@angular-devkit/core'; + +export const camel = strings.camelize; +export const kebab = strings.dasherize; +export const lower = (text: string) => text.toLowerCase(); +export const macro = (text: string) => strings.underscore(text).toUpperCase(); +export const pascal = strings.classify; +export const snake = strings.underscore; +export const upper = (text: string) => text.toUpperCase(); From caef401064d511ab05ae87381b83df374ce87e4a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:28:48 +0300 Subject: [PATCH 09/95] feat: add exceptions as enum --- npm/ng-packs/packages/schematics/src/enums/exception.ts | 5 +++++ npm/ng-packs/packages/schematics/src/enums/index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/enums/exception.ts create mode 100644 npm/ng-packs/packages/schematics/src/enums/index.ts diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts new file mode 100644 index 00000000000..8577df7d41c --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -0,0 +1,5 @@ +export const enum Exception { + InvalidWorkspace = 'Invalid Workspace: The angular.json should be a valid JSON file.', + NoProject = 'Unknown Project: Either define a default project in your workspace or specify the project name in schematics options.', + NoWorkspace = 'Workspace Not Found: Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', +} diff --git a/npm/ng-packs/packages/schematics/src/enums/index.ts b/npm/ng-packs/packages/schematics/src/enums/index.ts new file mode 100644 index 00000000000..3d5b914d2fc --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/enums/index.ts @@ -0,0 +1 @@ +export * from './exception'; From 0b9fb4885fdfff9a09651639f05ea5b9d97b92c0 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:30:07 +0300 Subject: [PATCH 10/95] feat: add utility function to read workspace schema --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/workspace.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/workspace.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index 5b84b6c8f1a..4ddc9e04c2a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,2 +1,3 @@ export * from './angular'; export * from './text'; +export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/workspace.ts new file mode 100644 index 00000000000..69aae2e726a --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/workspace.ts @@ -0,0 +1,18 @@ +import { experimental } from '@angular-devkit/core'; +import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import { Exception } from '../enums'; + +export function readWorkspaceSchema(tree: Tree) { + const workspaceBuffer = tree.read('/angular.json') || tree.read('/workspace.json'); + if (!workspaceBuffer) throw new SchematicsException(Exception.NoWorkspace); + + let workspaceSchema: experimental.workspace.WorkspaceSchema; + + try { + workspaceSchema = JSON.parse(workspaceBuffer.toString()); + } catch (_) { + throw new SchematicsException(Exception.InvalidWorkspace); + } + + return workspaceSchema; +} From 9d6d7e488c896dcd1c399052168ca429908d9c9f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 12:30:43 +0300 Subject: [PATCH 11/95] feat: add utility function to resolve project definition --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/project.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/project.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index 4ddc9e04c2a..2110caa3d8d 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,3 +1,4 @@ export * from './angular'; +export * from './project'; export * from './text'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/project.ts b/npm/ng-packs/packages/schematics/src/utils/project.ts new file mode 100644 index 00000000000..79bb79c796e --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/project.ts @@ -0,0 +1,22 @@ +import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; +import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import { Exception } from '../enums'; +import { getWorkspace } from './angular/workspace'; +import { readWorkspaceSchema } from './workspace'; + +export async function resolveProject( + tree: Tree, + name: string, +): Promise<{ name: string; definition: ProjectDefinition }> { + const workspace = await getWorkspace(tree); + let definition = workspace.projects.get(name); + + if (!definition) { + name = readWorkspaceSchema(tree).defaultProject!; + definition = workspace.projects.get(name); + } + + if (!definition) throw new SchematicsException(Exception.NoProject); + + return { name, definition }; +} From e00b09b445b73394e41b0a4419b8f808ee6d75da Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 14:11:17 +0300 Subject: [PATCH 12/95] feat: add project parameter to proxy command --- .../schematics/src/commands/proxy/schema.json | 24 +++++++++++++------ .../schematics/src/commands/proxy/schema.ts | 15 ++++++++---- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json index e61ee255673..72a88ecf593 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -10,22 +10,32 @@ "type": "string", "$default": { "$source": "argv", - "index": 1 + "index": 0 }, "x-prompt": "Please enter name of the module you wish to generate proxies for. (default: app)" }, - "apiUrl": { - "alias": "a", + "source": { + "alias": "s", "description": "The URL to get API configuration from", "type": "string", - "x-prompt": "Plese enter URL to get API config from. Leave blank to use environment variables." + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Plese enter URL to get API config from. (default: environment.apis.default.url)" + }, + "project": { + "alias": "p", + "description": "The project to place the generated code in", + "type": "string", + "x-prompt": "Please enter the project to place proxies in. (default: default app in workspace)" }, - "out": { - "alias": "o", + "path": { "description": "The path to place the generated code at", "type": "string", "format": "path", - "x-prompt": "Plese enter a custom output path. Leave blank if you do not need one." + "default": "", + "visible": false } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts index 1acf9328866..4e41904a46a 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts @@ -1,16 +1,21 @@ export interface Schema { /** - * The URL to get API configuration from + * The name of the module to generate code for */ - apiUrl?: string; + module?: string; /** - * The name of the module to generate code for + * The project to place the generated code in */ - module?: string; + project?: string; /** * The path to place the generated code at */ - out?: string; + path?: string; + + /** + * The URL to get API configuration from + */ + source?: string; } From a9a48f49ad2a779a4c3ebb3b66c8100011a7bc3a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 15:06:41 +0300 Subject: [PATCH 13/95] build: add got as dependency of schematics --- npm/ng-packs/package.json | 1 + npm/ng-packs/packages/schematics/package.json | 1 + npm/ng-packs/yarn.lock | 135 ++++++++++++++++++ 3 files changed, 137 insertions(+) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 082cfce422e..4aff547480d 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -70,6 +70,7 @@ "conventional-changelog-cli": "^2.0.31", "cz-conventional-changelog": "3.0.2", "font-awesome": "^4.7.0", + "got": "^11.5.2", "jest": "^25.0.0", "jest-canvas-mock": "^2.2.0", "jest-preset-angular": "^8.2.0", diff --git a/npm/ng-packs/packages/schematics/package.json b/npm/ng-packs/packages/schematics/package.json index adde31639eb..526a20f900a 100644 --- a/npm/ng-packs/packages/schematics/package.json +++ b/npm/ng-packs/packages/schematics/package.json @@ -11,6 +11,7 @@ "dependencies": { "@angular-devkit/core": "~10.0.3", "@angular-devkit/schematics": "~10.0.3", + "got": "^11.5.2", "typescript": "~3.9.2" }, "devDependencies": { diff --git a/npm/ng-packs/yarn.lock b/npm/ng-packs/yarn.lock index af7083c75f9..af54b9730b9 100644 --- a/npm/ng-packs/yarn.lock +++ b/npm/ng-packs/yarn.lock @@ -2595,6 +2595,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/is@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-3.1.0.tgz#d8735532635bea69ad39119df5f0f10099bd09dc" + integrity sha512-n4J+zu52VdY43kdi/XdI9DzuMr1Mur8zFL5ZRG2opCans9aiFwkPxHYFEb5Xgy7n1Z4K6WfI4FpqUqsh3E8BPQ== + "@sinonjs/commons@^1.7.0": version "1.8.1" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" @@ -2614,6 +2619,13 @@ dependencies: defer-to-connect "^1.0.1" +"@szmarczak/http-timer@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" + integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ== + dependencies: + defer-to-connect "^2.0.0" + "@testing-library/dom@6.1.0": version "6.1.0" resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-6.1.0.tgz#8d5a954158e81ecd7c994907f4ec240296ed823b" @@ -2659,6 +2671,16 @@ dependencies: "@babel/types" "^7.3.0" +"@types/cacheable-request@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" + integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -2689,6 +2711,11 @@ dependencies: "@types/node" "*" +"@types/http-cache-semantics@*": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" + integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" @@ -2727,6 +2754,13 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== +"@types/keyv@*": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" + integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== + dependencies: + "@types/node" "*" + "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2784,6 +2818,13 @@ dependencies: "@types/node" "*" +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/selenium-webdriver@^3.0.0": version "3.0.17" resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz#50bea0c3c2acc31c959c5b1e747798b3b3d06d4b" @@ -4001,6 +4042,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-lookup@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.3.tgz#049fdc59dffdd4fc285e8f4f82936591bd59fec3" + integrity sha512-W+JBqF9SWe18A72XFzN/V/CULFzPm7sBXzzR6ekkE+3tLG72wFZrBiBZhrZuDoYexop4PHJVdFAKb/Nj9+tm9w== + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -4014,6 +4060,19 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" +cacheable-request@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.1.tgz#062031c2856232782ed694a257fa35da93942a58" + integrity sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^2.0.0" + cachedir@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.2.0.tgz#19afa4305e05d79e417566882e0c8f960f62ff0e" @@ -5351,6 +5410,13 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + dedent@0.7.0, dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -5408,6 +5474,11 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +defer-to-connect@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1" + integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== + define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -6790,6 +6861,23 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" +got@^11.5.2: + version "11.5.2" + resolved "https://registry.yarnpkg.com/got/-/got-11.5.2.tgz#772e3f3a06d9c7589c7c94dc3c83cdb31ddbf742" + integrity sha512-yUhpEDLeuGiGJjRSzEq3kvt4zJtAcjKmhIiwNp/eUs75tRlXfWcHo5tcBaMQtnjHWC7nQYT5HkY/l0QOQTkVww== + dependencies: + "@sindresorhus/is" "^3.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.1" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.0" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -7102,6 +7190,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^1.0.0-beta.5.0: + version "1.0.0-beta.5.2" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3" + integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -8393,6 +8489,11 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -8502,6 +8603,13 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +keyv@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.1.tgz#9fe703cb4a94d6d11729d320af033307efd02ee6" + integrity sha512-xz6Jv6oNkbhrFCvCP7HQa8AaII8y8LRpoSm661NOKLr4uHuBwhX4epXrPQgF3+xdJnN4Esm5X0xwY4bOlALOtw== + dependencies: + json-buffer "3.0.1" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -9150,6 +9258,11 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -10012,6 +10125,11 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-cancelable@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" + integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== + p-each-series@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48" @@ -11096,6 +11214,11 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -11522,6 +11645,11 @@ resize-observer-polyfill@^1.5.1: resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== +resolve-alpn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" + integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA== + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -11606,6 +11734,13 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +responselike@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" + integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== + dependencies: + lowercase-keys "^2.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" From a961d5d1941413e9a732fab141b697b6627a9848 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 16:09:43 +0300 Subject: [PATCH 14/95] chore: add a generic ignore pattern --- npm/ng-packs/.gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/.gitignore b/npm/ng-packs/.gitignore index aae6beb3b9e..c2dcd7778ea 100644 --- a/npm/ng-packs/.gitignore +++ b/npm/ng-packs/.gitignore @@ -1,5 +1,8 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. +# generic ignore files +*.gitignore.* + # compiled output /tmp /out-tsc @@ -46,4 +49,4 @@ testem.log Thumbs.db !**/[Pp]ackages/* -*.internal.* \ No newline at end of file +*.internal.* From 523542301194e17be1cc495fa5301f3259b4dcad Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 22:30:50 +0300 Subject: [PATCH 15/95] feat: add common utils to schematics --- .../packages/schematics/src/utils/common.ts | 25 +++++++++++++++++++ .../packages/schematics/src/utils/index.ts | 1 + 2 files changed, 26 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/common.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/common.ts b/npm/ng-packs/packages/schematics/src/utils/common.ts new file mode 100644 index 00000000000..8a5aa5fd93d --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/common.ts @@ -0,0 +1,25 @@ +import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import * as ts from 'typescript'; +import { Exception } from '../enums'; + +export function interpolate(text: string, ...params: (string | number | boolean)[]) { + params.forEach((param, i) => { + const pattern = new RegExp('{\\s*' + i + '\\s*}'); + text = text.replace(pattern, String(param)); + }); + + return text; +} + +export function isNullOrUndefined(value: any): value is null | undefined { + return value === null || value === undefined; +} + +export function readFileInTree(tree: Tree, filePath: string): ts.SourceFile { + const buffer = tree.read(filePath); + if (isNullOrUndefined(buffer)) + throw new SchematicsException(interpolate(Exception.FileNotFound, filePath)); + + const text = buffer.toString('utf-8'); + return ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index 2110caa3d8d..f489303b898 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,4 +1,5 @@ export * from './angular'; +export * from './common'; export * from './project'; export * from './text'; export * from './workspace'; From 949e73284e9421315a9d40247561350e789cefdb Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 22:31:15 +0300 Subject: [PATCH 16/95] feat: update schematics exceptions --- npm/ng-packs/packages/schematics/src/enums/exception.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts index 8577df7d41c..234457f037b 100644 --- a/npm/ng-packs/packages/schematics/src/enums/exception.ts +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -1,5 +1,8 @@ export const enum Exception { - InvalidWorkspace = 'Invalid Workspace: The angular.json should be a valid JSON file.', - NoProject = 'Unknown Project: Either define a default project in your workspace or specify the project name in schematics options.', - NoWorkspace = 'Workspace Not Found: Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', + FileNotFound = '[File Not Found] There is no file at "{0}" path.', + InvalidWorkspace = '[Invalid Workspace] The angular.json should be a valid JSON file.', + NoApi = '[API Not Available] Please double-check the source url and make sure your application is up and running.', + NoProject = '[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.', + NoWorkspace = '[Workspace Not Found] Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', + RequiredApiUrl = '[API URL Required] API URL cannot be resolved. Please re-run the schematics and enter the URL to get API definitions from.', } From cd2bddaeef710f2a0c405b46f0e5b4e727688dc1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 22:36:23 +0300 Subject: [PATCH 17/95] feat: add functions to resolve environment and source url --- .../packages/schematics/src/utils/ast.ts | 37 ++++++++++++++++++ .../packages/schematics/src/utils/index.ts | 3 +- .../packages/schematics/src/utils/project.ts | 22 ----------- .../packages/schematics/src/utils/source.ts | 34 +++++++++++++++++ .../schematics/src/utils/workspace.ts | 38 ++++++++++++++++++- 5 files changed, 109 insertions(+), 25 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/utils/ast.ts delete mode 100644 npm/ng-packs/packages/schematics/src/utils/project.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/source.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/ast.ts b/npm/ng-packs/packages/schematics/src/utils/ast.ts new file mode 100644 index 00000000000..a1ffe5a3197 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/ast.ts @@ -0,0 +1,37 @@ +import * as ts from 'typescript'; +import { findNodes } from './angular/ast-utils'; + +export function findEnvironmentExpression(source: ts.SourceFile) { + const expressions = findNodes(source, ts.isObjectLiteralExpression); + return expressions.find(expr => expr.getText().includes('production')); +} + +export function getAssignedPropertyFromObjectliteral( + expression: ts.ObjectLiteralExpression, + variableSelector: string[], +) { + const expressions = findNodes(expression, isBooleanStringOrNumberLiteral); + + const literal = expressions.find(node => + Boolean( + variableSelector.reduceRight( + (acc: ts.PropertyAssignment, key) => + acc?.name?.getText() === key ? acc.parent.parent : undefined, + node.parent, + ), + ), + ); + + return literal ? literal.getText() : undefined; +} + +export function isBooleanStringOrNumberLiteral( + node: ts.Node, +): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral { + return ( + ts.isStringLiteral(node) || + ts.isNumericLiteral(node) || + node.kind === ts.SyntaxKind.TrueKeyword || + node.kind === ts.SyntaxKind.FalseKeyword + ); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index f489303b898..c2acec4d472 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,5 +1,6 @@ export * from './angular'; +export * from './ast'; export * from './common'; -export * from './project'; +export * from './source'; export * from './text'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/project.ts b/npm/ng-packs/packages/schematics/src/utils/project.ts deleted file mode 100644 index 79bb79c796e..00000000000 --- a/npm/ng-packs/packages/schematics/src/utils/project.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ProjectDefinition } from '@angular-devkit/core/src/workspace'; -import { SchematicsException, Tree } from '@angular-devkit/schematics'; -import { Exception } from '../enums'; -import { getWorkspace } from './angular/workspace'; -import { readWorkspaceSchema } from './workspace'; - -export async function resolveProject( - tree: Tree, - name: string, -): Promise<{ name: string; definition: ProjectDefinition }> { - const workspace = await getWorkspace(tree); - let definition = workspace.projects.get(name); - - if (!definition) { - name = readWorkspaceSchema(tree).defaultProject!; - definition = workspace.projects.get(name); - } - - if (!definition) throw new SchematicsException(Exception.NoProject); - - return { name, definition }; -} diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts new file mode 100644 index 00000000000..45de5b00c97 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -0,0 +1,34 @@ +import type { workspaces } from '@angular-devkit/core'; +import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import got from 'got'; +import { Exception } from '../enums'; +import { getAssignedPropertyFromObjectliteral } from './ast'; +import { readEnvironment } from './workspace'; + +export async function getSourceJson(url: string) { + let body: any; + + try { + ({ body } = await got(url, { + responseType: 'json', + https: { rejectUnauthorized: false }, + })); + } catch (e) { + throw new SchematicsException(Exception.NoApi); + } + + return body; +} + +export function getSourceUrl(tree: Tree, projectDefinition: workspaces.ProjectDefinition) { + const environmentExpr = readEnvironment(tree, projectDefinition); + let assignment: string | undefined; + + if (environmentExpr) { + assignment = getAssignedPropertyFromObjectliteral(environmentExpr, ['apis', 'default', 'url']); + } + + if (!assignment) throw new SchematicsException(Exception.RequiredApiUrl); + + return assignment.replace(/[`'"]/g, ''); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/workspace.ts index 69aae2e726a..ccae346835b 100644 --- a/npm/ng-packs/packages/schematics/src/utils/workspace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/workspace.ts @@ -1,6 +1,23 @@ -import { experimental } from '@angular-devkit/core'; -import { SchematicsException, Tree } from '@angular-devkit/schematics'; +import type { experimental, workspaces } from '@angular-devkit/core'; +import { SchematicsException } from '@angular-devkit/schematics'; +import type { Tree } from '@angular-devkit/schematics'; import { Exception } from '../enums'; +import { getWorkspace, ProjectType } from './angular'; +import { findEnvironmentExpression } from './ast'; +import { readFileInTree } from './common'; + +export function isLibrary(project: workspaces.ProjectDefinition): boolean { + return project.extensions['projectType'] === ProjectType.Library; +} + +export function readEnvironment(tree: Tree, project: workspaces.ProjectDefinition) { + if (isLibrary(project)) return undefined; + + const srcPath = project.sourceRoot || `${project.root}/src`; + const envPath = srcPath + '/environments/environment.ts'; + const source = readFileInTree(tree, envPath); + return findEnvironmentExpression(source); +} export function readWorkspaceSchema(tree: Tree) { const workspaceBuffer = tree.read('/angular.json') || tree.read('/workspace.json'); @@ -16,3 +33,20 @@ export function readWorkspaceSchema(tree: Tree) { return workspaceSchema; } + +export async function resolveProject( + tree: Tree, + name: string, +): Promise<{ name: string; definition: workspaces.ProjectDefinition }> { + const workspace = await getWorkspace(tree); + let definition = workspace.projects.get(name); + + if (!definition) { + name = readWorkspaceSchema(tree).defaultProject!; + definition = workspace.projects.get(name); + } + + if (!definition) throw new SchematicsException(Exception.NoProject); + + return { name, definition }; +} From e8d5afb3bc3952676a32f31b2e2150638bc58854 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 22:38:28 +0300 Subject: [PATCH 18/95] feat: get source json for proxy generation --- .../packages/schematics/src/commands/proxy/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index 6c232805c3b..06d67362152 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -1,9 +1,15 @@ import { chain, SchematicContext, Tree } from '@angular-devkit/schematics'; -import { Schema as GenerateProxySchema } from './schema'; +import { getSourceJson, getSourceUrl, resolveProject } from '../../utils'; +import type { Schema as GenerateProxySchema } from './schema'; -export default function(_params: GenerateProxySchema) { +export default function(params: GenerateProxySchema) { return chain([ - async (_tree: Tree, _context: SchematicContext) => { + async (tree: Tree, _context: SchematicContext) => { + const project = await resolveProject(tree, params.module!); + const url = params.source || getSourceUrl(tree, project.definition); + const data = await getSourceJson(url); + + console.log(Object.keys(data.types)); return chain([]); }, ]); From 91bf43201132185d86839a134ac4abce20c4ae4f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 12 Aug 2020 22:38:50 +0300 Subject: [PATCH 19/95] feat: update proxy schema --- .../packages/schematics/src/commands/proxy/schema.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json index 72a88ecf593..492b52dad7e 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -12,23 +12,23 @@ "$source": "argv", "index": 0 }, - "x-prompt": "Please enter name of the module you wish to generate proxies for. (default: app)" + "x-prompt": "Please enter name of the module you wish to generate proxies for. (default: \"app\")" }, "source": { "alias": "s", - "description": "The URL to get API configuration from", + "description": "The URL to get API definitions from", "type": "string", "$default": { "$source": "argv", "index": 1 }, - "x-prompt": "Plese enter URL to get API config from. (default: environment.apis.default.url)" + "x-prompt": "Plese enter URL to get API definitions from. (default: resolved from environment)" }, "project": { "alias": "p", "description": "The project to place the generated code in", "type": "string", - "x-prompt": "Please enter the project to place proxies in. (default: default app in workspace)" + "x-prompt": "Please enter the project to place proxies in. (default: workspace \"defaultProject\")" }, "path": { "description": "The path to place the generated code at", From b8991e1bc72ef0fa96c34752c3229b4c0adb5ee4 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 13 Aug 2020 09:35:17 +0300 Subject: [PATCH 20/95] feat: add includeTypes query param to api definition request --- npm/ng-packs/packages/schematics/src/utils/source.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts index 45de5b00c97..81d0b287fef 100644 --- a/npm/ng-packs/packages/schematics/src/utils/source.ts +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -11,6 +11,7 @@ export async function getSourceJson(url: string) { try { ({ body } = await got(url, { responseType: 'json', + searchParams: { includeTypes: true }, https: { rejectUnauthorized: false }, })); } catch (e) { From 586f0b6f5045affd22271c68a5330fe2a418f35e Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 13 Aug 2020 09:35:59 +0300 Subject: [PATCH 21/95] feat: add models for api definition --- .../schematics/src/models/api-definition.ts | 73 +++++++++++++++++++ .../packages/schematics/src/models/index.ts | 1 + 2 files changed, 74 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/models/api-definition.ts create mode 100644 npm/ng-packs/packages/schematics/src/models/index.ts diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts new file mode 100644 index 00000000000..88542ecd083 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -0,0 +1,73 @@ +export interface ApiDefinition { + modules: Record; + types: Record; +} + +export interface Type { + baseType?: string; + isEnum: boolean; + enumNames?: string[]; + enumValues?: number[]; + genericArguments?: string[]; + properties?: Property[]; +} + +export interface Property { + name: string; + type: string; + typeSimple: string; +} + +export interface Module { + rootPath: string; + remoteServiceName: string; + controllers: Record; +} + +export interface Controller { + controllerName: string; + type: string; + interfaces: Interface[]; + actions: Record; +} + +export interface Interface { + type: string; +} + +export interface Action { + uniqueName: string; + name: string; + httpMethod: string; + url: string; + supportedVersions: string[]; + parametersOnMethod: ParameterOnMethod[]; + parameters: Parameter[]; + returnValue: ReturnValue; +} + +export interface ParameterOnMethod { + name: string; + typeAsString: string; + type: string; + typeSimple: string; + isOptional: boolean; + defaultValue: any; +} + +export interface Parameter { + nameOnMethod: string; + name: string; + type: string; + typeSimple: string; + isOptional: boolean; + defaultValue: any; + constraintTypes?: string[]; + bindingSourceId: string; + descriptorName: string; +} + +export interface ReturnValue { + type: string; + typeSimple: string; +} diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts new file mode 100644 index 00000000000..a4e9855273d --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -0,0 +1 @@ +export * from './api-definition'; From 596e7175c7cd2fd4393a1c28c03ada5d191e6210 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 13 Aug 2020 09:55:56 +0300 Subject: [PATCH 22/95] fix: add endpoint to resolved source url in schematics --- npm/ng-packs/packages/schematics/src/commands/proxy/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index 06d67362152..675b268d10f 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -6,7 +6,7 @@ export default function(params: GenerateProxySchema) { return chain([ async (tree: Tree, _context: SchematicContext) => { const project = await resolveProject(tree, params.module!); - const url = params.source || getSourceUrl(tree, project.definition); + const url = params.source || getSourceUrl(tree, project.definition) + '/api/abp/api-definition'; const data = await getSourceJson(url); console.log(Object.keys(data.types)); From 19f272ca92e2a2c3d1e99eb5e7c3a3f0ef04175d Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 13 Aug 2020 11:01:47 +0300 Subject: [PATCH 23/95] feat: handle redirects in api definition request --- npm/ng-packs/packages/schematics/src/utils/source.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts index 81d0b287fef..b1411b6bcaf 100644 --- a/npm/ng-packs/packages/schematics/src/utils/source.ts +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -14,8 +14,14 @@ export async function getSourceJson(url: string) { searchParams: { includeTypes: true }, https: { rejectUnauthorized: false }, })); - } catch (e) { - throw new SchematicsException(Exception.NoApi); + } catch (err) { + // handle redirects + try { + ({ response: { body } } = err); + if (!body.types) throw Error(''); + } catch (_) { + throw new SchematicsException(Exception.NoApi); + } } return body; From e5ca84eaae95cd5813616a3b9e1d21808c9ceef1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 13 Aug 2020 17:25:06 +0300 Subject: [PATCH 24/95] build: update lint rules for schematics --- npm/ng-packs/packages/schematics/tslint.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/npm/ng-packs/packages/schematics/tslint.json b/npm/ng-packs/packages/schematics/tslint.json index 7380ad5e401..c912f729959 100644 --- a/npm/ng-packs/packages/schematics/tslint.json +++ b/npm/ng-packs/packages/schematics/tslint.json @@ -1,6 +1,11 @@ { "extends": "../../tslint.json", + "linterOptions": { + "exclude": ["**/utils/angular/**/*"] + }, "rules": { + "no-non-null-assertion": false, + "no-string-literal": false, "variable-name": { "options": ["allow-leading-underscore", "ban-keywords", "check-format", "allow-pascal-case"] } From 0e780789c9af3700ce9f33d96106461a0c38534c Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 14 Aug 2020 16:37:30 +0300 Subject: [PATCH 25/95] build: clear previous schematics build artifacts --- npm/ng-packs/scripts/build-schematics.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/npm/ng-packs/scripts/build-schematics.ts b/npm/ng-packs/scripts/build-schematics.ts index 9b4f32cd305..873d503d6eb 100644 --- a/npm/ng-packs/scripts/build-schematics.ts +++ b/npm/ng-packs/scripts/build-schematics.ts @@ -23,6 +23,7 @@ const FILES_TO_COPY_AFTER_BUILD: (FileCopy | string)[] = [ { src: 'src/commands/proxy/files-enum', dest: 'commands/proxy/files-enum' }, { src: 'src/commands/proxy/files-model', dest: 'commands/proxy/files-model' }, { src: 'src/commands/proxy/files-service', dest: 'commands/proxy/files-service' }, + { src: 'src/commands/proxy/schema.json', dest: 'commands/proxy/schema.json' }, { src: 'src/collection.json', dest: 'collection.json' }, 'package.json', 'README.md', @@ -44,6 +45,8 @@ async function* copyPackageFiles(packageName: string) { } (async () => { + await fse.remove(`../dist/${PACKAGE_TO_BUILD}`); + await execa( 'tsc', ['-p', `packages/${PACKAGE_TO_BUILD}/tsconfig.json`, '--outDir', `dist/${PACKAGE_TO_BUILD}`], From ab5a5a46b49ab3ed5f9d4cf9fa4b6a6dd63ea22a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 14 Aug 2020 18:59:01 +0300 Subject: [PATCH 26/95] feat: modify schematics params according to new contract --- .../dev-app/src/environments/environment.ts | 3 ++ .../schematics/src/commands/proxy/index.ts | 22 +++++++++--- .../schematics/src/commands/proxy/schema.json | 23 +++++-------- .../schematics/src/commands/proxy/schema.ts | 15 +++----- .../packages/schematics/src/constants/api.ts | 1 + .../schematics/src/constants/index.ts | 1 + .../schematics/src/enums/exception.ts | 5 +-- .../packages/schematics/src/models/index.ts | 1 + .../packages/schematics/src/models/project.ts | 6 ++++ .../packages/schematics/src/utils/source.ts | 34 +++++++++++-------- .../schematics/src/utils/workspace.ts | 11 +++--- 11 files changed, 70 insertions(+), 52 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/constants/api.ts create mode 100644 npm/ng-packs/packages/schematics/src/constants/index.ts create mode 100644 npm/ng-packs/packages/schematics/src/models/project.ts diff --git a/npm/ng-packs/apps/dev-app/src/environments/environment.ts b/npm/ng-packs/apps/dev-app/src/environments/environment.ts index 2bf42cf7dc5..d8066be1cce 100644 --- a/npm/ng-packs/apps/dev-app/src/environments/environment.ts +++ b/npm/ng-packs/apps/dev-app/src/environments/environment.ts @@ -21,5 +21,8 @@ export const environment = { default: { url: 'https://localhost:44305', }, + saas: { + url: 'https://localhost:44305', + }, }, } as Config.Environment; diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index 675b268d10f..45f39971764 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -1,15 +1,29 @@ +import { strings } from '@angular-devkit/core'; import { chain, SchematicContext, Tree } from '@angular-devkit/schematics'; +import { API_DEFINITION_ENDPOINT } from '../../constants'; +import { ApiDefinition } from '../../models'; import { getSourceJson, getSourceUrl, resolveProject } from '../../utils'; import type { Schema as GenerateProxySchema } from './schema'; export default function(params: GenerateProxySchema) { + const moduleName = strings.camelize(params.module || 'app'); + return chain([ async (tree: Tree, _context: SchematicContext) => { - const project = await resolveProject(tree, params.module!); - const url = params.source || getSourceUrl(tree, project.definition) + '/api/abp/api-definition'; - const data = await getSourceJson(url); + const source = await resolveProject(tree, params.source!); + const url = getSourceUrl(tree, source, moduleName); + const data: ApiDefinition = await getSourceJson(url + API_DEFINITION_ENDPOINT); + + const services = Object.entries(data.modules).map(([name, def]) => [ + name, + Object.values(def.controllers).map( + ({controllerName, actions}) => [controllerName, Object.keys(actions)] + ), + ]); + + const defs = services.filter(([name]) => name === moduleName); - console.log(Object.keys(data.types)); + console.log(defs); return chain([]); }, ]); diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json index 492b52dad7e..8ba6708836c 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -6,36 +6,29 @@ "properties": { "module": { "alias": "m", - "description": "The name of the module to generate code for", + "description": "The name of the backend module to generate code for", "type": "string", "$default": { "$source": "argv", "index": 0 }, - "x-prompt": "Please enter name of the module you wish to generate proxies for. (default: \"app\")" + "x-prompt": "Please enter name of the backend module you wish to generate proxies for. (default: \"app\")" }, "source": { "alias": "s", - "description": "The URL to get API definitions from", + "description": "Angular project to resolve API definition URL from", "type": "string", "$default": { "$source": "argv", "index": 1 }, - "x-prompt": "Plese enter URL to get API definitions from. (default: resolved from environment)" + "x-prompt": "Plese enter Angular project name to resolve API definition URL from. (default: workspace \"defaultProject\")" }, - "project": { - "alias": "p", - "description": "The project to place the generated code in", + "destination": { + "alias": "d", + "description": "Angular project to place the generated code in", "type": "string", - "x-prompt": "Please enter the project to place proxies in. (default: workspace \"defaultProject\")" - }, - "path": { - "description": "The path to place the generated code at", - "type": "string", - "format": "path", - "default": "", - "visible": false + "x-prompt": "Plese enter Angular project name to place generated code in. (default: workspace \"defaultProject\")" } }, "required": [] diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts index 4e41904a46a..0227b17e69b 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts @@ -1,21 +1,16 @@ export interface Schema { /** - * The name of the module to generate code for + * Angular project to place the generated code in */ - module?: string; + destination?: string; /** - * The project to place the generated code in + * The name of the backend module to generate code for */ - project?: string; - - /** - * The path to place the generated code at - */ - path?: string; + module?: string; /** - * The URL to get API configuration from + * Angular project to resolve API definition URL from */ source?: string; } diff --git a/npm/ng-packs/packages/schematics/src/constants/api.ts b/npm/ng-packs/packages/schematics/src/constants/api.ts new file mode 100644 index 00000000000..fdd0c05ded4 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/constants/api.ts @@ -0,0 +1 @@ +export const API_DEFINITION_ENDPOINT = '/api/abp/api-definition'; diff --git a/npm/ng-packs/packages/schematics/src/constants/index.ts b/npm/ng-packs/packages/schematics/src/constants/index.ts new file mode 100644 index 00000000000..b1c13e73406 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/constants/index.ts @@ -0,0 +1 @@ +export * from './api'; diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts index 234457f037b..92f73b7ef42 100644 --- a/npm/ng-packs/packages/schematics/src/enums/exception.ts +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -1,8 +1,9 @@ export const enum Exception { FileNotFound = '[File Not Found] There is no file at "{0}" path.', InvalidWorkspace = '[Invalid Workspace] The angular.json should be a valid JSON file.', - NoApi = '[API Not Available] Please double-check the source url and make sure your application is up and running.', + NoApi = '[API Not Available] Please double-check the URL in the source project environment and make sure your application is up and running.', NoProject = '[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.', NoWorkspace = '[Workspace Not Found] Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', - RequiredApiUrl = '[API URL Required] API URL cannot be resolved. Please re-run the schematics and enter the URL to get API definitions from.', + NoEnvironment = '[Environment Not Found] An environment file cannot be located in "{0}" project.', + NoApiUrl = '[API URL Not Found] Cannot resolve API URL for "{1}" module from "{0}" project.', } diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index a4e9855273d..4b97b395c64 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -1 +1,2 @@ export * from './api-definition'; +export * from './project'; diff --git a/npm/ng-packs/packages/schematics/src/models/project.ts b/npm/ng-packs/packages/schematics/src/models/project.ts new file mode 100644 index 00000000000..f4794719aac --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/project.ts @@ -0,0 +1,6 @@ +import { workspaces } from '@angular-devkit/core'; + +export interface Project { + name: string; + definition: workspaces.ProjectDefinition; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts index b1411b6bcaf..cc1d45cebd2 100644 --- a/npm/ng-packs/packages/schematics/src/utils/source.ts +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -1,8 +1,9 @@ -import type { workspaces } from '@angular-devkit/core'; import { SchematicsException, Tree } from '@angular-devkit/schematics'; import got from 'got'; import { Exception } from '../enums'; +import { Project } from '../models'; import { getAssignedPropertyFromObjectliteral } from './ast'; +import { interpolate } from './common'; import { readEnvironment } from './workspace'; export async function getSourceJson(url: string) { @@ -14,28 +15,33 @@ export async function getSourceJson(url: string) { searchParams: { includeTypes: true }, https: { rejectUnauthorized: false }, })); - } catch (err) { + } catch ({ response }) { // handle redirects - try { - ({ response: { body } } = err); - if (!body.types) throw Error(''); - } catch (_) { - throw new SchematicsException(Exception.NoApi); - } + if (response?.body && response.statusCode < 400) return response.body; + + throw new SchematicsException(Exception.NoApi); } return body; } -export function getSourceUrl(tree: Tree, projectDefinition: workspaces.ProjectDefinition) { - const environmentExpr = readEnvironment(tree, projectDefinition); - let assignment: string | undefined; +export function getSourceUrl(tree: Tree, project: Project, moduleName: string) { + const environmentExpr = readEnvironment(tree, project.definition); + + if (!environmentExpr) + throw new SchematicsException(interpolate(Exception.NoEnvironment, project.name)); - if (environmentExpr) { + let assignment = getAssignedPropertyFromObjectliteral(environmentExpr, [ + 'apis', + moduleName, + 'url', + ]); + + if (!assignment) assignment = getAssignedPropertyFromObjectliteral(environmentExpr, ['apis', 'default', 'url']); - } - if (!assignment) throw new SchematicsException(Exception.RequiredApiUrl); + if (!assignment) + throw new SchematicsException(interpolate(Exception.NoApiUrl, project.name, moduleName)); return assignment.replace(/[`'"]/g, ''); } diff --git a/npm/ng-packs/packages/schematics/src/utils/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/workspace.ts index ccae346835b..1bdbc7181f7 100644 --- a/npm/ng-packs/packages/schematics/src/utils/workspace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/workspace.ts @@ -2,6 +2,7 @@ import type { experimental, workspaces } from '@angular-devkit/core'; import { SchematicsException } from '@angular-devkit/schematics'; import type { Tree } from '@angular-devkit/schematics'; import { Exception } from '../enums'; +import { Project } from '../models'; import { getWorkspace, ProjectType } from './angular'; import { findEnvironmentExpression } from './ast'; import { readFileInTree } from './common'; @@ -37,14 +38,10 @@ export function readWorkspaceSchema(tree: Tree) { export async function resolveProject( tree: Tree, name: string, -): Promise<{ name: string; definition: workspaces.ProjectDefinition }> { +): Promise { + name = name || readWorkspaceSchema(tree).defaultProject!; const workspace = await getWorkspace(tree); - let definition = workspace.projects.get(name); - - if (!definition) { - name = readWorkspaceSchema(tree).defaultProject!; - definition = workspace.projects.get(name); - } + const definition = workspace.projects.get(name); if (!definition) throw new SchematicsException(Exception.NoProject); From 5358d5b9166c99e335b24e2e9389a0a8a53d8fa9 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Sat, 15 Aug 2020 20:51:36 +0300 Subject: [PATCH 27/95] feat: parse controller and create service path --- .../__name@kebab__.ts.template | 0 .../__name@kebab__.service.ts.template | 0 .../schematics/src/commands/proxy/index.ts | 42 +++++++++++++------ .../schematics/src/commands/proxy/schema.json | 4 +- .../schematics/src/commands/proxy/schema.ts | 10 ++--- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/rule.ts | 26 ++++++++++++ .../schematics/src/utils/workspace.ts | 26 +++++++++++- 8 files changed, 87 insertions(+), 22 deletions(-) rename npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/{enums => models}/__name@kebab__.ts.template (100%) rename npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/{enums => services}/__name@kebab__.service.ts.template (100%) create mode 100644 npm/ng-packs/packages/schematics/src/utils/rule.ts diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/enums/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/models/__name@kebab__.ts.template similarity index 100% rename from npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/enums/__name@kebab__.ts.template rename to npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/models/__name@kebab__.ts.template diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/enums/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/services/__name@kebab__.service.ts.template similarity index 100% rename from npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/enums/__name@kebab__.service.ts.template rename to npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/services/__name@kebab__.service.ts.template diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index 45f39971764..b5591431ae1 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -1,8 +1,9 @@ -import { strings } from '@angular-devkit/core'; -import { chain, SchematicContext, Tree } from '@angular-devkit/schematics'; +import { normalize, strings } from '@angular-devkit/core'; +import { applyTemplates, branchAndMerge, chain, move, SchematicContext, Tree, url } from '@angular-devkit/schematics'; import { API_DEFINITION_ENDPOINT } from '../../constants'; import { ApiDefinition } from '../../models'; -import { getSourceJson, getSourceUrl, resolveProject } from '../../utils'; +import { applyWithOverwrite, buildDefaultPath, getSourceJson, getSourceUrl, isLibrary, resolveProject } from '../../utils'; +import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; export default function(params: GenerateProxySchema) { @@ -11,20 +12,35 @@ export default function(params: GenerateProxySchema) { return chain([ async (tree: Tree, _context: SchematicContext) => { const source = await resolveProject(tree, params.source!); - const url = getSourceUrl(tree, source, moduleName); - const data: ApiDefinition = await getSourceJson(url + API_DEFINITION_ENDPOINT); + const target = await resolveProject(tree, params.target!); + const isModule = isLibrary(target.definition); + const sourceUrl = getSourceUrl(tree, source, moduleName); + const targetPath = buildDefaultPath(target.definition); + const data: ApiDefinition = await getSourceJson(sourceUrl + API_DEFINITION_ENDPOINT); - const services = Object.entries(data.modules).map(([name, def]) => [ - name, - Object.values(def.controllers).map( - ({controllerName, actions}) => [controllerName, Object.keys(actions)] + const controllers = Object.values(data.modules[moduleName]?.controllers || {}); + + const createServiceFiles = chain( + controllers.map(controller => { + const {type} = controller; + const [namespace] = type.replace(/^Volo\.(Abp\.)?/, '').split('.'); + + return applyWithOverwrite(url('./files-service'), [ + applyTemplates({ + ...cases, + name: controller.type.split('.').pop()!.replace('Controller', ''), + sharedPath: 'shared/' + strings.dasherize(namespace), + controller, + }), + move(normalize(targetPath)), + ]); + } ), - ]); + ); - const defs = services.filter(([name]) => name === moduleName); + console.log(isModule); - console.log(defs); - return chain([]); + return branchAndMerge(chain([createServiceFiles])); }, ]); } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json index 8ba6708836c..bbf899956ab 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -24,8 +24,8 @@ }, "x-prompt": "Plese enter Angular project name to resolve API definition URL from. (default: workspace \"defaultProject\")" }, - "destination": { - "alias": "d", + "target": { + "alias": "t", "description": "Angular project to place the generated code in", "type": "string", "x-prompt": "Plese enter Angular project name to place generated code in. (default: workspace \"defaultProject\")" diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts index 0227b17e69b..bb54317d68f 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts @@ -1,9 +1,4 @@ export interface Schema { - /** - * Angular project to place the generated code in - */ - destination?: string; - /** * The name of the backend module to generate code for */ @@ -13,4 +8,9 @@ export interface Schema { * Angular project to resolve API definition URL from */ source?: string; + + /** + * Angular project to place the generated code in + */ + target?: string; } diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index c2acec4d472..7dbc2865466 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,6 +1,7 @@ export * from './angular'; export * from './ast'; export * from './common'; +export * from './rule'; export * from './source'; export * from './text'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/rule.ts b/npm/ng-packs/packages/schematics/src/utils/rule.ts new file mode 100644 index 00000000000..6748f30fab2 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/rule.ts @@ -0,0 +1,26 @@ +import { + apply, + forEach, + mergeWith, + Rule, + SchematicContext, + Source, + Tree, +} from '@angular-devkit/schematics'; + +export function applyWithOverwrite(source: Source, rules: Rule[]): Rule { + return (tree: Tree, _context: SchematicContext) => { + const rule = mergeWith(apply(source, [...rules, overwriteFileIfExists(tree)])); + + return rule(tree, _context); + }; +} + +export function overwriteFileIfExists(tree: Tree): Rule { + return forEach(fileEntry => { + if (!tree.exists(fileEntry.path)) return fileEntry; + + tree.overwrite(fileEntry.path, fileEntry.content); + return null; + }); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/workspace.ts index 1bdbc7181f7..b05a7549e83 100644 --- a/npm/ng-packs/packages/schematics/src/utils/workspace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/workspace.ts @@ -1,4 +1,4 @@ -import type { experimental, workspaces } from '@angular-devkit/core'; +import { experimental, strings, workspaces } from '@angular-devkit/core'; import { SchematicsException } from '@angular-devkit/schematics'; import type { Tree } from '@angular-devkit/schematics'; import { Exception } from '../enums'; @@ -41,7 +41,29 @@ export async function resolveProject( ): Promise { name = name || readWorkspaceSchema(tree).defaultProject!; const workspace = await getWorkspace(tree); - const definition = workspace.projects.get(name); + let definition: Project['definition'] | undefined; + + try { + definition = workspace.projects.get(name); + } catch (_) {} + + if (!definition) + try { + name = strings.dasherize(name); + definition = workspace.projects.get(name); + } catch (_) {} + + if (!definition) + try { + name = strings.camelize(name); + definition = workspace.projects.get(name); + } catch (_) {} + + if (!definition) + try { + name = strings.classify(name); + definition = workspace.projects.get(name); + } catch (_) {} if (!definition) throw new SchematicsException(Exception.NoProject); From e8354eeeebea4f706a2600bae8021af1b2521acc Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 17 Aug 2020 15:04:34 +0300 Subject: [PATCH 28/95] feat: update ApiDefinition interface --- .../packages/schematics/src/models/api-definition.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts index 88542ecd083..c8612d83569 100644 --- a/npm/ng-packs/packages/schematics/src/models/api-definition.ts +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -4,12 +4,12 @@ export interface ApiDefinition { } export interface Type { - baseType?: string; + baseType: string | null; isEnum: boolean; - enumNames?: string[]; - enumValues?: number[]; - genericArguments?: string[]; - properties?: Property[]; + enumNames: string[] | null; + enumValues: number[] | null; + genericArguments: string[] | null; + properties: Property[] | null; } export interface Property { @@ -62,7 +62,7 @@ export interface Parameter { typeSimple: string; isOptional: boolean; defaultValue: any; - constraintTypes?: string[]; + constraintTypes: string[] | null; bindingSourceId: string; descriptorName: string; } From 92484c3a16a47996a74ed507976a0292ffce0e0e Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 17 Aug 2020 22:59:03 +0300 Subject: [PATCH 29/95] feat: update schematics text utils --- .../packages/schematics/src/utils/text.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/text.ts b/npm/ng-packs/packages/schematics/src/utils/text.ts index 5d8ed492075..a3c177c1a4d 100644 --- a/npm/ng-packs/packages/schematics/src/utils/text.ts +++ b/npm/ng-packs/packages/schematics/src/utils/text.ts @@ -1,9 +1,15 @@ import { strings } from '@angular-devkit/core'; -export const camel = strings.camelize; -export const kebab = strings.dasherize; export const lower = (text: string) => text.toLowerCase(); -export const macro = (text: string) => strings.underscore(text).toUpperCase(); -export const pascal = strings.classify; -export const snake = strings.underscore; export const upper = (text: string) => text.toUpperCase(); +export const camel = (text: string) => strings.camelize(_(text)); +export const pascal = (text: string) => strings.classify(_(text)); +export const kebab = (text: string) => strings.dasherize(_(text)); +export const snake = (text: string) => strings.underscore(_(text)); +export const macro = (text: string) => upper(snake(text)); +export const dir = (text: string) => + strings.dasherize(text.replace(/\./g, '/').replace(/\/\//g, '/')); + +function _(text: string): string { + return text.replace(/\./g, '_'); +} From c1807a49ec1938c60cc95d032db6322444c91c82 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 17 Aug 2020 22:59:30 +0300 Subject: [PATCH 30/95] feat: add NoApiDefinition exception to schematics --- npm/ng-packs/packages/schematics/src/enums/exception.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts index 92f73b7ef42..37bb6e30d9e 100644 --- a/npm/ng-packs/packages/schematics/src/enums/exception.ts +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -2,6 +2,7 @@ export const enum Exception { FileNotFound = '[File Not Found] There is no file at "{0}" path.', InvalidWorkspace = '[Invalid Workspace] The angular.json should be a valid JSON file.', NoApi = '[API Not Available] Please double-check the URL in the source project environment and make sure your application is up and running.', + NoApiDefinition = '[API Definition Not Found] There is no valid API definition file at "{0}".', NoProject = '[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.', NoWorkspace = '[Workspace Not Found] Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', NoEnvironment = '[Environment Not Found] An environment file cannot be located in "{0}" project.', From bf1ba4c5129d1543c714606d3585fedfaf642a91 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 17 Aug 2020 23:00:18 +0300 Subject: [PATCH 31/95] feat: add rule creators for saving and reading api definition --- .../packages/schematics/src/utils/source.ts | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/source.ts b/npm/ng-packs/packages/schematics/src/utils/source.ts index cc1d45cebd2..e08ecec2859 100644 --- a/npm/ng-packs/packages/schematics/src/utils/source.ts +++ b/npm/ng-packs/packages/schematics/src/utils/source.ts @@ -1,12 +1,12 @@ import { SchematicsException, Tree } from '@angular-devkit/schematics'; import got from 'got'; import { Exception } from '../enums'; -import { Project } from '../models'; +import { ApiDefinition, Project } from '../models'; import { getAssignedPropertyFromObjectliteral } from './ast'; import { interpolate } from './common'; import { readEnvironment } from './workspace'; -export async function getSourceJson(url: string) { +export async function getApiDefinition(url: string) { let body: any; try { @@ -45,3 +45,24 @@ export function getSourceUrl(tree: Tree, project: Project, moduleName: string) { return assignment.replace(/[`'"]/g, ''); } + +export function createApiDefinitionReader(targetPath: string) { + return (tree: Tree) => { + try { + const buffer = tree.read(targetPath); + const apiDefinition: ApiDefinition = JSON.parse(buffer!.toString()); + return apiDefinition; + } catch (_) {} + + throw new SchematicsException(interpolate(Exception.NoApiDefinition, targetPath)); + }; +} + +export function createApiDefinitionSaver(apiDefinition: ApiDefinition, targetPath: string) { + return (tree: Tree) => { + tree[tree.exists(targetPath) ? 'overwrite' : 'create']( + targetPath, + JSON.stringify(apiDefinition, null, 2), + ); + }; +} From 1e41f48c5aa5e08088e96e3a517a78b70ed469a3 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Mon, 17 Aug 2020 23:02:23 +0300 Subject: [PATCH 32/95] feat: divide proxy schematics into two steps --- .../packages/schematics/src/collection.json | 5 ++ .../__name@kebab__.ts.template | 0 .../__namespace@dir__/index.ts.template} | 0 .../__name@kebab__.service.ts.template | 0 .../schematics/src/commands/api/index.ts | 48 +++++++++++++++++++ .../schematics/src/commands/api/schema.json | 39 +++++++++++++++ .../schematics/src/commands/api/schema.ts | 16 +++++++ .../schematics/src/commands/proxy/index.ts | 35 +++----------- .../schematics/src/commands/proxy/schema.json | 30 ++++++++---- .../schematics/src/commands/proxy/schema.ts | 11 +++-- 10 files changed, 145 insertions(+), 39 deletions(-) rename npm/ng-packs/packages/schematics/src/commands/{proxy/files-enum/__namespacePath__/enums => api/files-enum/shared/enums/__namespace@dir__}/__name@kebab__.ts.template (100%) rename npm/ng-packs/packages/schematics/src/commands/{proxy/files-model/__sharedPath__/models/__name@kebab__.ts.template => api/files-model/shared/models/__namespace@dir__/index.ts.template} (100%) rename npm/ng-packs/packages/schematics/src/commands/{proxy/files-service/__sharedPath__/services => api/files-service/shared/services/__namespace@dir__}/__name@kebab__.service.ts.template (100%) create mode 100644 npm/ng-packs/packages/schematics/src/commands/api/index.ts create mode 100644 npm/ng-packs/packages/schematics/src/commands/api/schema.json create mode 100644 npm/ng-packs/packages/schematics/src/commands/api/schema.ts diff --git a/npm/ng-packs/packages/schematics/src/collection.json b/npm/ng-packs/packages/schematics/src/collection.json index 6cfecd4d4a8..9b21d174cab 100644 --- a/npm/ng-packs/packages/schematics/src/collection.json +++ b/npm/ng-packs/packages/schematics/src/collection.json @@ -4,6 +4,11 @@ "description": "ABP Proxy Generator Schematics", "factory": "./commands/proxy", "schema": "./commands/proxy/schema.json" + }, + "api": { + "description": "ABP API Generator Schematics", + "factory": "./commands/api", + "schema": "./commands/api/schema.json" } } } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-enum/__namespacePath__/enums/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template similarity index 100% rename from npm/ng-packs/packages/schematics/src/commands/proxy/files-enum/__namespacePath__/enums/__name@kebab__.ts.template rename to npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/models/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template similarity index 100% rename from npm/ng-packs/packages/schematics/src/commands/proxy/files-model/__sharedPath__/models/__name@kebab__.ts.template rename to npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/services/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template similarity index 100% rename from npm/ng-packs/packages/schematics/src/commands/proxy/files-service/__sharedPath__/services/__name@kebab__.service.ts.template rename to npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts new file mode 100644 index 00000000000..49da9787d44 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -0,0 +1,48 @@ +import { normalize, strings } from '@angular-devkit/core'; +import { applyTemplates, branchAndMerge, chain, move, SchematicContext, Tree, url } from '@angular-devkit/schematics'; +import app from '../../mocks/app.gitignore'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, resolveProject } from '../../utils'; +import * as cases from '../../utils/text'; +import type { Schema as GenerateProxySchema } from './schema'; + +export default function(params: GenerateProxySchema) { + const solution = params.solution; + const moduleName = strings.camelize(params.module || 'app'); + + return chain([ + async (tree: Tree, _context: SchematicContext) => { + const target = await resolveProject(tree, params.target!); + const targetPath = buildDefaultPath(target.definition); + const readApiDefinition = createApiDefinitionReader(`${targetPath}/shared/api-definition.json`); + const data = readApiDefinition(tree); + data.modules.app = app; + + const controllers = Object.values(data.modules[moduleName]?.controllers || {}); + + const createServiceFiles = chain( + controllers.map(controller => { + const {controllerName: name, type, actions, interfaces} = controller; + const namespaceRegex = new RegExp('^' + solution + '\.(Controllers\.)?'); + const namespace = type.replace(namespaceRegex, '').split('.').slice(0, -1).join('.'); + + return applyWithOverwrite(url('./files-service'), [ + applyTemplates({ + ...cases, + solution, + namespace, + name, + apiName: data.modules[moduleName].remoteServiceName, + apiUrl: controller.actions[0]?.url, + actions, + interfaces, + }), + move(normalize(targetPath)), + ]); + } + ), + ); + + return branchAndMerge(chain([createServiceFiles])); + }, + ]); +} diff --git a/npm/ng-packs/packages/schematics/src/commands/api/schema.json b/npm/ng-packs/packages/schematics/src/commands/api/schema.json new file mode 100644 index 00000000000..afed78c2cae --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/api/schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/schema", + "id": "SchematicsAbpGenerateAPI", + "title": "ABP Generate API Schema", + "type": "object", + "properties": { + "solution": { + "alias": "x", + "description": "Solution name", + "type": "string", + "$default": { + "$source": "argv", + "index": 0 + }, + "x-prompt": "Please enter the solution name. (case-sensitive, eg. Acme.BookStore)" + }, + "target": { + "alias": "t", + "description": "Angular project to generate code in", + "type": "string", + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Plese enter Angular project name to place generated code in. (default: workspace \"defaultProject\")" + }, + "module": { + "alias": "m", + "description": "Backend module to generate code for", + "type": "string", + "$default": { + "$source": "argv", + "index": 2 + }, + "x-prompt": "Please enter name of the backend module you wish to generate proxies for. (default: \"app\")" + } + }, + "required": ["solution"] +} diff --git a/npm/ng-packs/packages/schematics/src/commands/api/schema.ts b/npm/ng-packs/packages/schematics/src/commands/api/schema.ts new file mode 100644 index 00000000000..32e316cf53e --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/commands/api/schema.ts @@ -0,0 +1,16 @@ +export interface Schema { + /** + * Solution name + */ + solution: string; + + /** + * Angular project to generate code in + */ + target?: string; + + /** + * Backend module to generate code for + */ + module?: string; +} diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index b5591431ae1..24fcb91d24c 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -1,9 +1,8 @@ -import { normalize, strings } from '@angular-devkit/core'; -import { applyTemplates, branchAndMerge, chain, move, SchematicContext, Tree, url } from '@angular-devkit/schematics'; +import { strings } from '@angular-devkit/core'; +import { branchAndMerge, chain, schematic, SchematicContext, Tree } from '@angular-devkit/schematics'; import { API_DEFINITION_ENDPOINT } from '../../constants'; import { ApiDefinition } from '../../models'; -import { applyWithOverwrite, buildDefaultPath, getSourceJson, getSourceUrl, isLibrary, resolveProject } from '../../utils'; -import * as cases from '../../utils/text'; +import { buildDefaultPath, createApiDefinitionSaver, getApiDefinition, getSourceUrl, resolveProject } from '../../utils'; import type { Schema as GenerateProxySchema } from './schema'; export default function(params: GenerateProxySchema) { @@ -13,34 +12,14 @@ export default function(params: GenerateProxySchema) { async (tree: Tree, _context: SchematicContext) => { const source = await resolveProject(tree, params.source!); const target = await resolveProject(tree, params.target!); - const isModule = isLibrary(target.definition); const sourceUrl = getSourceUrl(tree, source, moduleName); const targetPath = buildDefaultPath(target.definition); - const data: ApiDefinition = await getSourceJson(sourceUrl + API_DEFINITION_ENDPOINT); + const data: ApiDefinition = await getApiDefinition(sourceUrl + API_DEFINITION_ENDPOINT); - const controllers = Object.values(data.modules[moduleName]?.controllers || {}); + const saveApiDefinition = createApiDefinitionSaver(data, `${targetPath}/shared/api-definition.json`) + const createApi = schematic('api', params); - const createServiceFiles = chain( - controllers.map(controller => { - const {type} = controller; - const [namespace] = type.replace(/^Volo\.(Abp\.)?/, '').split('.'); - - return applyWithOverwrite(url('./files-service'), [ - applyTemplates({ - ...cases, - name: controller.type.split('.').pop()!.replace('Controller', ''), - sharedPath: 'shared/' + strings.dasherize(namespace), - controller, - }), - move(normalize(targetPath)), - ]); - } - ), - ); - - console.log(isModule); - - return branchAndMerge(chain([createServiceFiles])); + return branchAndMerge(chain([saveApiDefinition, createApi])); }, ]); } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json index bbf899956ab..7e4c0fc88e5 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.json @@ -1,18 +1,18 @@ { "$schema": "http://json-schema.org/schema", - "id": "SchematicsAbpEntityModule", - "title": "ABP Entity Module Schema", + "id": "SchematicsAbpGenerateProxy", + "title": "ABP Generate Proxy Schema", "type": "object", "properties": { - "module": { - "alias": "m", - "description": "The name of the backend module to generate code for", + "solution": { + "alias": "x", + "description": "Solution name", "type": "string", "$default": { "$source": "argv", "index": 0 }, - "x-prompt": "Please enter name of the backend module you wish to generate proxies for. (default: \"app\")" + "x-prompt": "Please enter the solution name. (case-sensitive, eg. Acme.BookStore)" }, "source": { "alias": "s", @@ -26,10 +26,24 @@ }, "target": { "alias": "t", - "description": "Angular project to place the generated code in", + "description": "Angular project to generate code in", "type": "string", + "$default": { + "$source": "argv", + "index": 2 + }, "x-prompt": "Plese enter Angular project name to place generated code in. (default: workspace \"defaultProject\")" + }, + "module": { + "alias": "m", + "description": "Backend module to generate code for", + "type": "string", + "$default": { + "$source": "argv", + "index": 3 + }, + "x-prompt": "Please enter name of the backend module you wish to generate proxies for. (default: \"app\")" } }, - "required": [] + "required": ["solution"] } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts index bb54317d68f..54f11b2da8c 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/schema.ts @@ -1,8 +1,8 @@ export interface Schema { /** - * The name of the backend module to generate code for + * Solution name */ - module?: string; + solution: string; /** * Angular project to resolve API definition URL from @@ -10,7 +10,12 @@ export interface Schema { source?: string; /** - * Angular project to place the generated code in + * Angular project to generate code in */ target?: string; + + /** + * Backend module to generate code for + */ + module?: string; } From 6339adcd4d70ac5470c7c43216e94cb19ab7f4d1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 09:29:51 +0300 Subject: [PATCH 33/95] feat: remove any solution name variation from namespace --- .../packages/schematics/src/commands/api/index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 49da9787d44..c5e8d4c3ba9 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,6 +1,5 @@ import { normalize, strings } from '@angular-devkit/core'; import { applyTemplates, branchAndMerge, chain, move, SchematicContext, Tree, url } from '@angular-devkit/schematics'; -import app from '../../mocks/app.gitignore'; import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, resolveProject } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -15,15 +14,21 @@ export default function(params: GenerateProxySchema) { const targetPath = buildDefaultPath(target.definition); const readApiDefinition = createApiDefinitionReader(`${targetPath}/shared/api-definition.json`); const data = readApiDefinition(tree); - data.modules.app = app; const controllers = Object.values(data.modules[moduleName]?.controllers || {}); const createServiceFiles = chain( controllers.map(controller => { const {controllerName: name, type, actions, interfaces} = controller; - const namespaceRegex = new RegExp('^' + solution + '\.(Controllers\.)?'); - const namespace = type.replace(namespaceRegex, '').split('.').slice(0, -1).join('.'); + let namespace = type.split('.').slice(0, -1).join('.'); + solution.split('.').reduceRight((acc, part) => { + acc = part + '\.' + acc; + const regex = new RegExp('^' + acc + '(Controllers\.)?'); + namespace = namespace.replace(regex, ''); + return acc; + }, ''); + + console.log(namespace); return applyWithOverwrite(url('./files-service'), [ applyTemplates({ From 994c1418da8e6f1ccd6e85a0afe23f91c306f5b2 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:49:40 +0300 Subject: [PATCH 34/95] feat: add invalid module to schematics exceptions --- npm/ng-packs/packages/schematics/src/enums/exception.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts index 37bb6e30d9e..70d74a832f5 100644 --- a/npm/ng-packs/packages/schematics/src/enums/exception.ts +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -1,5 +1,6 @@ export const enum Exception { FileNotFound = '[File Not Found] There is no file at "{0}" path.', + InvalidModule = '[Invalid Module] Backend module "{0}" does not exist in API definition.', InvalidWorkspace = '[Invalid Workspace] The angular.json should be a valid JSON file.', NoApi = '[API Not Available] Please double-check the URL in the source project environment and make sure your application is up and running.', NoApiDefinition = '[API Definition Not Found] There is no valid API definition file at "{0}".', From 1435ee15ba8f34d1b46769faa1bd23412fa523e8 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:51:19 +0300 Subject: [PATCH 35/95] feat: add binding source id enum to schematics --- .../packages/schematics/src/enums/binding-source-id.ts | 6 ++++++ npm/ng-packs/packages/schematics/src/enums/index.ts | 1 + 2 files changed, 7 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts diff --git a/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts b/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts new file mode 100644 index 00000000000..1e4e65c5f5a --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts @@ -0,0 +1,6 @@ +export enum eBindingSourceId { + Body = 'Body', + Model = 'ModelBinding', + Path = 'Path', + Query = 'Query', +} diff --git a/npm/ng-packs/packages/schematics/src/enums/index.ts b/npm/ng-packs/packages/schematics/src/enums/index.ts index 3d5b914d2fc..3c3dff74e6f 100644 --- a/npm/ng-packs/packages/schematics/src/enums/index.ts +++ b/npm/ng-packs/packages/schematics/src/enums/index.ts @@ -1 +1,2 @@ +export * from './binding-source-id'; export * from './exception'; From d2af128d309cf7fe2f545c752041e25ef70ff559 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:52:02 +0300 Subject: [PATCH 36/95] feat: update api definition model in schematics --- .../packages/schematics/src/models/api-definition.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts index c8612d83569..2903066b745 100644 --- a/npm/ng-packs/packages/schematics/src/models/api-definition.ts +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -1,3 +1,5 @@ +import { eBindingSourceId } from '../enums'; + export interface ApiDefinition { modules: Record; types: Record; @@ -41,12 +43,12 @@ export interface Action { httpMethod: string; url: string; supportedVersions: string[]; - parametersOnMethod: ParameterOnMethod[]; - parameters: Parameter[]; + parametersOnMethod: ParameterInSignature[]; + parameters: ParameterInBody[]; returnValue: ReturnValue; } -export interface ParameterOnMethod { +export interface ParameterInSignature { name: string; typeAsString: string; type: string; @@ -55,7 +57,7 @@ export interface ParameterOnMethod { defaultValue: any; } -export interface Parameter { +export interface ParameterInBody { nameOnMethod: string; name: string; type: string; @@ -63,7 +65,7 @@ export interface Parameter { isOptional: boolean; defaultValue: any; constraintTypes: string[] | null; - bindingSourceId: string; + bindingSourceId: eBindingSourceId; descriptorName: string; } From 05a1a78f93665877ba7d242bf8eac194adb11478 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:53:08 +0300 Subject: [PATCH 37/95] feat: add import keyword enum to schematics --- npm/ng-packs/packages/schematics/src/enums/import-keyword.ts | 4 ++++ npm/ng-packs/packages/schematics/src/enums/index.ts | 1 + 2 files changed, 5 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/enums/import-keyword.ts diff --git a/npm/ng-packs/packages/schematics/src/enums/import-keyword.ts b/npm/ng-packs/packages/schematics/src/enums/import-keyword.ts new file mode 100644 index 00000000000..015c80814f8 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/enums/import-keyword.ts @@ -0,0 +1,4 @@ +export enum eImportKeyword { + Default = 'import', + Type = 'import type', +} diff --git a/npm/ng-packs/packages/schematics/src/enums/index.ts b/npm/ng-packs/packages/schematics/src/enums/index.ts index 3c3dff74e6f..5adb62f3f0e 100644 --- a/npm/ng-packs/packages/schematics/src/enums/index.ts +++ b/npm/ng-packs/packages/schematics/src/enums/index.ts @@ -1,2 +1,3 @@ export * from './binding-source-id'; export * from './exception'; +export * from './import-keyword'; From 2b3b5d29db5ea0e951fc5e2ab770fd73637e17d0 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:53:25 +0300 Subject: [PATCH 38/95] feat: add method modifier enum to schematics --- npm/ng-packs/packages/schematics/src/enums/index.ts | 1 + .../packages/schematics/src/enums/method-modifier.ts | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/enums/method-modifier.ts diff --git a/npm/ng-packs/packages/schematics/src/enums/index.ts b/npm/ng-packs/packages/schematics/src/enums/index.ts index 5adb62f3f0e..aee862a5f5c 100644 --- a/npm/ng-packs/packages/schematics/src/enums/index.ts +++ b/npm/ng-packs/packages/schematics/src/enums/index.ts @@ -1,3 +1,4 @@ export * from './binding-source-id'; export * from './exception'; export * from './import-keyword'; +export * from './method-modifier'; diff --git a/npm/ng-packs/packages/schematics/src/enums/method-modifier.ts b/npm/ng-packs/packages/schematics/src/enums/method-modifier.ts new file mode 100644 index 00000000000..1c10f33a67c --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/enums/method-modifier.ts @@ -0,0 +1,6 @@ +export enum eMethodModifier { + Public = '', + Private = 'private ', + Async = 'async ', + PrivateAsync = 'private async ', +} From 325c02dfe212f34a26c263e68a0f0cc06ee53278 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:54:34 +0300 Subject: [PATCH 39/95] feat: add Omissible utility type to schematics --- npm/ng-packs/packages/schematics/src/models/index.ts | 1 + npm/ng-packs/packages/schematics/src/models/util.ts | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/models/util.ts diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index 4b97b395c64..a50fc39e14b 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -1,2 +1,3 @@ export * from './api-definition'; export * from './project'; +export * from './util'; diff --git a/npm/ng-packs/packages/schematics/src/models/util.ts b/npm/ng-packs/packages/schematics/src/models/util.ts new file mode 100644 index 00000000000..5ff732ccfe4 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/util.ts @@ -0,0 +1,2 @@ +// Omissible (given keys will become optional) +export type Omissible = Partial> & Omit; From 3cc935918d5109d175f69969d0faf9b18be613f7 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:55:54 +0300 Subject: [PATCH 40/95] feat: add parseNamespace utility fn to schematics --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/namespace.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/namespace.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index 7dbc2865466..faec4abeed3 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,6 +1,7 @@ export * from './angular'; export * from './ast'; export * from './common'; +export * from './namespace'; export * from './rule'; export * from './source'; export * from './text'; diff --git a/npm/ng-packs/packages/schematics/src/utils/namespace.ts b/npm/ng-packs/packages/schematics/src/utils/namespace.ts new file mode 100644 index 00000000000..bbee41aa6f3 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/namespace.ts @@ -0,0 +1,15 @@ +export function parseNamespace(solution: string, type: string) { + let namespace = type + .split('.') + .slice(0, -1) + .join('.'); + + solution.split('.').reduceRight((acc, part) => { + acc = part + '.' + acc; + const regex = new RegExp('^' + acc + '(Controllers.)?'); + namespace = namespace.replace(regex, ''); + return acc; + }, ''); + + return namespace; +} From 8968d3ea57a32deb2305d97da8ea9b57c95fee93 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:56:58 +0300 Subject: [PATCH 41/95] feat: add import model to schematics --- .../packages/schematics/src/models/import.ts | 15 +++++++++++++++ .../packages/schematics/src/models/index.ts | 1 + 2 files changed, 16 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/models/import.ts diff --git a/npm/ng-packs/packages/schematics/src/models/import.ts b/npm/ng-packs/packages/schematics/src/models/import.ts new file mode 100644 index 00000000000..e4cf9d0e415 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/import.ts @@ -0,0 +1,15 @@ +import { eImportKeyword } from '../enums'; +import { Omissible } from './util'; + +export class Import { + alias?: string; + keyword = eImportKeyword.Default; + path: string; + specifiers: string[] = []; + + constructor(options: ImportOptions) { + Object.assign(this, options); + } +} + +export type ImportOptions = Omissible; diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index a50fc39e14b..7cff6a3477d 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -1,3 +1,4 @@ export * from './api-definition'; +export * from './import'; export * from './project'; export * from './util'; From eb170e79ded1d0758749942cd5e82c7c40c3262f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:57:46 +0300 Subject: [PATCH 42/95] feat: add method model to schematics --- .../packages/schematics/src/models/index.ts | 1 + .../packages/schematics/src/models/method.ts | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/models/method.ts diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index 7cff6a3477d..dd4e1773532 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -1,4 +1,5 @@ export * from './api-definition'; export * from './import'; +export * from './method'; export * from './project'; export * from './util'; diff --git a/npm/ng-packs/packages/schematics/src/models/method.ts b/npm/ng-packs/packages/schematics/src/models/method.ts new file mode 100644 index 00000000000..51cbaa27bd7 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/method.ts @@ -0,0 +1,85 @@ +import { strings } from '@angular-devkit/core'; +import { eBindingSourceId, eMethodModifier } from '../enums'; +import { ParameterInBody } from './api-definition'; +import { Omissible } from './util'; + +export class Method { + body: Body; + signature: Signature; + + constructor(options: MethodOptions) { + Object.assign(this, options); + } +} + +export type MethodOptions = Method; + +export class Signature { + generics = ''; + modifier = eMethodModifier.Public; + name: string; + parameters: Parameter[] = []; + returnType = ''; + + constructor(options: SignatureOptions) { + Object.assign(this, options); + } +} + +export type SignatureOptions = Omissible< + Signature, + 'generics' | 'modifier' | 'parameters' | 'returnType' +>; + +export class Body { + body?: string; + method: string; + params: string[] = []; + requestType = 'any'; + responseType: string; + url: string; + + registerActionParameter = (param: ParameterInBody) => { + let { bindingSourceId, descriptorName, name, nameOnMethod } = param; + name = strings.camelize(name); + const value = descriptorName ? `${descriptorName}.${name}` : nameOnMethod; + + switch (bindingSourceId) { + case eBindingSourceId.Model: + case eBindingSourceId.Query: + this.params.push(`${name}: ${value}`); + break; + case eBindingSourceId.Body: + this.body = value; + break; + case eBindingSourceId.Path: + const regex = new RegExp('{' + name + '}', 'g'); + this.url = this.url.replace(regex, '${' + value + '}'); + break; + default: + break; + } + }; + + constructor(options: BodyOptions) { + Object.assign(this, options); + } +} + +export type BodyOptions = Omissible< + Omit, + 'params' | 'requestType' +>; + +export class Parameter { + name: string; + type: string; + default: string = ''; // convert actual value with JSON.stringify if not null + optional: '' | '?' = ''; + + constructor(options: ParameterOptions) { + Object.assign(this, options); + } +} + +export type ParameterOptions = Omissible; From 5c5c9e31bb92c2fc77f9c76310b37c5b68a052f1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:58:03 +0300 Subject: [PATCH 43/95] feat: add service model to schematics --- .../packages/schematics/src/models/index.ts | 1 + .../packages/schematics/src/models/service.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/models/service.ts diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index dd4e1773532..9d656bddb04 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -2,4 +2,5 @@ export * from './api-definition'; export * from './import'; export * from './method'; export * from './project'; +export * from './service'; export * from './util'; diff --git a/npm/ng-packs/packages/schematics/src/models/service.ts b/npm/ng-packs/packages/schematics/src/models/service.ts new file mode 100644 index 00000000000..c9ef05eca47 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/service.ts @@ -0,0 +1,17 @@ +import { Import } from './import'; +import { Method } from './method'; +import { Omissible } from './util'; + +export class Service { + apiName: string; + imports: Import[] = []; + methods: Method[] = []; + name: string; + namespace: string; + + constructor(options: ServiceOptions) { + Object.assign(this, options); + } +} + +export type ServiceOptions = Omissible; From a18643aa0f84bba2694c2441b67b33cf932b018d Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:58:47 +0300 Subject: [PATCH 44/95] feat: add service utility functions to schematics --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/service.ts | 130 ++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/service.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index faec4abeed3..f68cb11ded8 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -3,6 +3,7 @@ export * from './ast'; export * from './common'; export * from './namespace'; export * from './rule'; +export * from './service'; export * from './source'; export * from './text'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts new file mode 100644 index 00000000000..2f44e7b0125 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -0,0 +1,130 @@ +import { eImportKeyword } from '../enums'; +import { + Action, + Body, + Controller, + Import, + Method, + Parameter, + ReturnValue, + Service, + Signature, +} from '../models'; +import { parseNamespace } from './namespace'; +import { dir } from './text'; + +export function createControllerToServiceMapper(solution: string, apiName: string) { + const mapActionToMethod = createActionToMethodMapper(solution); + + return (controller: Controller) => { + const actions = Object.values(controller.actions); + const imports = actions.reduce(createActionToImportsReducer(solution), []); + const methods = actions.map(mapActionToMethod); + const name = controller.controllerName; + const namespace = parseNamespace(solution, controller.type); + return new Service({ apiName, imports, methods, name, namespace }); + }; +} + +export function createActionToImportsReducer(solution: string) { + const mapTypeDefToImport = createTypeDefToImportMapper(solution); + + return (imports: Import[], action: Action) => { + const typeDefs = [action.returnValue, ...action.parametersOnMethod]; + typeDefs.forEach(typeDef => { + const def = mapTypeDefToImport(typeDef); + if (!def) return; + + const existingImport = imports.find( + ({ keyword, path }) => keyword === def.keyword && path === def.path, + ); + if (!existingImport) return imports.push(def); + + existingImport.specifiers = [ + ...new Set([...existingImport.specifiers, ...def.specifiers]), + ].sort(); + }); + return imports; + }; +} + +export function createTypeDefToImportMapper(solution: string) { + const adaptType = createTypeAdapter(solution); + + return ({ type, typeSimple }: ReturnValue) => { + if (type.startsWith('System')) return; + const namespace = parseNamespace(solution, type); + const path = type.startsWith('Volo.Abp.Application.Dtos') + ? '@volo/abp.ng.core' + : `@shared/models/${dir(namespace)}`; + const specifier = adaptType(typeSimple.split('<')[0]); + return new Import({ keyword: eImportKeyword.Type, path, specifiers: [specifier] }); + }; +} + +export function createActionToMethodMapper(solution: string) { + const mapActionToBody = createActionToBodyMapper(solution); + const mapActionToSignature = createActionToSignatureMapper(solution); + + return (action: Action) => { + const body = mapActionToBody(action); + const signature = mapActionToSignature(action); + return new Method({ body, signature }); + }; +} + +export function createActionToBodyMapper(solution: string) { + const adaptType = createTypeAdapter(solution); + + return ({ httpMethod, parameters, returnValue, url }: Action) => { + const responseType = adaptType(returnValue.typeSimple); + const body = new Body({ method: httpMethod, responseType, url }); + + parameters.forEach(body.registerActionParameter); + + return body; + }; +} + +export function createActionToSignatureMapper(solution: string) { + const adaptType = createTypeAdapter(solution); + + return (action: Action) => { + const signature = new Signature({ name: getMethodNameFromAction(action) }); + + signature.parameters = action.parametersOnMethod.map(p => { + const type = adaptType(p.typeSimple); + const parameter = new Parameter({ name: p.name, type }); + if (p.defaultValue) parameter.default = ` = ${p.defaultValue}`; + else if (p.isOptional) parameter.optional = '?'; + return parameter; + }); + + return signature; + }; +} + +function getMethodNameFromAction(action: Action): string { + return action.uniqueName.split('Async')[0]; +} + +function createTypeAdapter(solution: string) { + const optionalRegex = /\?/g; + const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); + const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; + + return (typeSimple: string) => { + if (typeSimple === 'System.Void') return 'void'; + + return typeSimple + .replace(/>+$/, '') + .split('<') + .reduceRight((acc, type) => { + type = type.replace(voloRegex, ''); + type = type.replace(solutionRegex, ''); + type = type.replace(optionalRegex, ''); + type = type.split('.').pop()!; + return acc ? `${type}<${acc}>` : type; + }, ''); + }; +} From 5785987e6af2ae45caa835998e820856c92c197c Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 18:59:36 +0300 Subject: [PATCH 45/95] feat: use utility functions in schematics api command --- .../schematics/src/commands/api/index.ts | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index c5e8d4c3ba9..2c3134d03f8 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,6 +1,7 @@ import { normalize, strings } from '@angular-devkit/core'; -import { applyTemplates, branchAndMerge, chain, move, SchematicContext, Tree, url } from '@angular-devkit/schematics'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, resolveProject } from '../../utils'; +import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; +import { Exception } from '../../enums'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, interpolate, parseNamespace, resolveProject } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -14,32 +15,25 @@ export default function(params: GenerateProxySchema) { const targetPath = buildDefaultPath(target.definition); const readApiDefinition = createApiDefinitionReader(`${targetPath}/shared/api-definition.json`); const data = readApiDefinition(tree); + const definition = data.modules[moduleName]; + if (!definition) throw new SchematicsException(interpolate(Exception.InvalidModule, moduleName)); - const controllers = Object.values(data.modules[moduleName]?.controllers || {}); + const mapControllerToService = createControllerToServiceMapper(solution, definition.remoteServiceName); + const controllers = Object.values(definition.controllers || {}); const createServiceFiles = chain( controllers.map(controller => { - const {controllerName: name, type, actions, interfaces} = controller; - let namespace = type.split('.').slice(0, -1).join('.'); - solution.split('.').reduceRight((acc, part) => { - acc = part + '\.' + acc; - const regex = new RegExp('^' + acc + '(Controllers\.)?'); - namespace = namespace.replace(regex, ''); - return acc; - }, ''); - - console.log(namespace); + console.log(JSON.stringify(mapControllerToService(controller), null, 2)); return applyWithOverwrite(url('./files-service'), [ applyTemplates({ ...cases, solution, - namespace, - name, + namespace: parseNamespace(solution, controller.type), + name: controller.controllerName, apiName: data.modules[moduleName].remoteServiceName, apiUrl: controller.actions[0]?.url, - actions, - interfaces, + service: mapControllerToService(controller), }), move(normalize(targetPath)), ]); @@ -51,3 +45,4 @@ export default function(params: GenerateProxySchema) { }, ]); } + From ab710827d618827e9a40731445c6f94b338f9200 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 19:12:37 +0300 Subject: [PATCH 46/95] feat: add relativePathFromServiceToModel utility fn --- npm/ng-packs/packages/schematics/src/utils/index.ts | 1 + npm/ng-packs/packages/schematics/src/utils/path.ts | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/path.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index f68cb11ded8..cc9b0052fad 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -2,6 +2,7 @@ export * from './angular'; export * from './ast'; export * from './common'; export * from './namespace'; +export * from './path'; export * from './rule'; export * from './service'; export * from './source'; diff --git a/npm/ng-packs/packages/schematics/src/utils/path.ts b/npm/ng-packs/packages/schematics/src/utils/path.ts new file mode 100644 index 00000000000..a48534c92cb --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/path.ts @@ -0,0 +1,11 @@ +import { dir } from './text'; + +export function relativePathFromServiceToModel(serviceNamespace: string, modelNamespace: string) { + const repeats = serviceNamespace ? serviceNamespace.split('.').length : 0; + const path = '..' + '/..'.repeat(repeats) + '/models/' + dir(modelNamespace); + return removeTrailingSlash(path); +} + +function removeTrailingSlash(path: string) { + return path.replace(/\/+$/, ''); +} From 49273785f575cf7a96788bdff78f7b968dbad0b0 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 19:13:15 +0300 Subject: [PATCH 47/95] feat: use relative path in service imports --- .../packages/schematics/src/utils/service.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 2f44e7b0125..32eede578e3 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -11,23 +11,23 @@ import { Signature, } from '../models'; import { parseNamespace } from './namespace'; -import { dir } from './text'; +import { relativePathFromServiceToModel } from './path'; export function createControllerToServiceMapper(solution: string, apiName: string) { const mapActionToMethod = createActionToMethodMapper(solution); return (controller: Controller) => { - const actions = Object.values(controller.actions); - const imports = actions.reduce(createActionToImportsReducer(solution), []); - const methods = actions.map(mapActionToMethod); const name = controller.controllerName; const namespace = parseNamespace(solution, controller.type); + const actions = Object.values(controller.actions); + const imports = actions.reduce(createActionToImportsReducer(solution, namespace), []); + const methods = actions.map(mapActionToMethod); return new Service({ apiName, imports, methods, name, namespace }); }; } -export function createActionToImportsReducer(solution: string) { - const mapTypeDefToImport = createTypeDefToImportMapper(solution); +export function createActionToImportsReducer(solution: string, namespace: string) { + const mapTypeDefToImport = createTypeDefToImportMapper(solution, namespace); return (imports: Import[], action: Action) => { const typeDefs = [action.returnValue, ...action.parametersOnMethod]; @@ -48,15 +48,15 @@ export function createActionToImportsReducer(solution: string) { }; } -export function createTypeDefToImportMapper(solution: string) { +export function createTypeDefToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); return ({ type, typeSimple }: ReturnValue) => { if (type.startsWith('System')) return; - const namespace = parseNamespace(solution, type); + const modelNamespace = parseNamespace(solution, type); const path = type.startsWith('Volo.Abp.Application.Dtos') ? '@volo/abp.ng.core' - : `@shared/models/${dir(namespace)}`; + : relativePathFromServiceToModel(namespace, modelNamespace); const specifier = adaptType(typeSimple.split('<')[0]); return new Import({ keyword: eImportKeyword.Type, path, specifiers: [specifier] }); }; From faffc8cddff3c5b8f392aac233ff988babb6d25f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 21:13:45 +0300 Subject: [PATCH 48/95] feat: add imports for generic types in schematics --- .../schematics/src/models/api-definition.ts | 4 +- .../packages/schematics/src/utils/service.ts | 47 ++++++++++++------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts index 2903066b745..32ac847e5b0 100644 --- a/npm/ng-packs/packages/schematics/src/models/api-definition.ts +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -45,7 +45,7 @@ export interface Action { supportedVersions: string[]; parametersOnMethod: ParameterInSignature[]; parameters: ParameterInBody[]; - returnValue: ReturnValue; + returnValue: TypeDef; } export interface ParameterInSignature { @@ -69,7 +69,7 @@ export interface ParameterInBody { descriptorName: string; } -export interface ReturnValue { +export interface TypeDef { type: string; typeSimple: string; } diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 32eede578e3..85034b2ce5c 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -6,9 +6,9 @@ import { Import, Method, Parameter, - ReturnValue, Service, Signature, + TypeDef, } from '../models'; import { parseNamespace } from './namespace'; import { relativePathFromServiceToModel } from './path'; @@ -30,7 +30,8 @@ export function createActionToImportsReducer(solution: string, namespace: string const mapTypeDefToImport = createTypeDefToImportMapper(solution, namespace); return (imports: Import[], action: Action) => { - const typeDefs = [action.returnValue, ...action.parametersOnMethod]; + const typeDefs = getTypeDefsFromAction(action); + typeDefs.forEach(typeDef => { const def = mapTypeDefToImport(typeDef); if (!def) return; @@ -51,14 +52,14 @@ export function createActionToImportsReducer(solution: string, namespace: string export function createTypeDefToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); - return ({ type, typeSimple }: ReturnValue) => { + return ({ type, typeSimple }: TypeDef) => { if (type.startsWith('System')) return; const modelNamespace = parseNamespace(solution, type); const path = type.startsWith('Volo.Abp.Application.Dtos') - ? '@volo/abp.ng.core' + ? '@abp/ng.core' : relativePathFromServiceToModel(namespace, modelNamespace); - const specifier = adaptType(typeSimple.split('<')[0]); - return new Import({ keyword: eImportKeyword.Type, path, specifiers: [specifier] }); + const specifiers = [adaptType(typeSimple.split('<')[0])]; + return new Import({ keyword: eImportKeyword.Type, path, specifiers }); }; } @@ -116,15 +117,29 @@ function createTypeAdapter(solution: string) { return (typeSimple: string) => { if (typeSimple === 'System.Void') return 'void'; - return typeSimple - .replace(/>+$/, '') - .split('<') - .reduceRight((acc, type) => { - type = type.replace(voloRegex, ''); - type = type.replace(solutionRegex, ''); - type = type.replace(optionalRegex, ''); - type = type.split('.').pop()!; - return acc ? `${type}<${acc}>` : type; - }, ''); + return parseGenerics(typeSimple).reduceRight((acc, type) => { + type = type.replace(voloRegex, ''); + type = type.replace(solutionRegex, ''); + type = type.replace(optionalRegex, ''); + type = type.split('.').pop()!; + return acc ? `${type}<${acc}>` : type; + }, ''); }; } + +function parseGenerics(type: string) { + return type.replace(/>+$/, '').split('<'); +} + +function getTypeDefsFromAction({ parametersOnMethod, returnValue }: Action) { + const typeDefs: TypeDef[] = []; + + [returnValue, ...parametersOnMethod].forEach(({ type, typeSimple }) => { + const types = parseGenerics(type); + const simpleTypes = parseGenerics(typeSimple); + + types.forEach((type, i) => typeDefs.push({ type, typeSimple: simpleTypes[i] })); + }); + + return typeDefs; +} From c4f60f35b58e6aeae9095910057ea52d9cf4dfa5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 21:14:14 +0300 Subject: [PATCH 49/95] feat: add serializeParameters utility fn to schematics --- npm/ng-packs/packages/schematics/src/utils/service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 85034b2ce5c..1939195e648 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -13,6 +13,10 @@ import { import { parseNamespace } from './namespace'; import { relativePathFromServiceToModel } from './path'; +export function serializeParameters(parameters: Parameter[]) { + return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); +} + export function createControllerToServiceMapper(solution: string, apiName: string) { const mapActionToMethod = createActionToMethodMapper(solution); From dc17cf6435ef110b825f4d501304bde3512754f6 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Tue, 18 Aug 2020 21:14:43 +0300 Subject: [PATCH 50/95] feat: add template for service in schematics --- .../__name@kebab__.service.ts.template | 25 +++++++++++++++++++ .../schematics/src/commands/api/index.ts | 12 +++------ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template index e69de29bb2d..8200590bdfe 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template @@ -0,0 +1,25 @@ +import { RestService } from '@abp/ng.core'; +import { Injectable } from '@angular/core';<% +for (let _import of imports) { %> +import type { <%= _import.specifiers.join(', ') %> } from '<%= _import.path %>';<% } %> + +@Injectable({ + providedIn: 'root', +}) +export class <%= name %>Service { + apiName = '<%= apiName %>';<% + for (let method of methods) { %> + + <%= camel(method.signature.name) %> = (<%= serializeParameters(method.signature.parameters) %>) => + this.restService.request<<%= method.body.requestType %>, <%= method.body.responseType %>>({ + method: '<%= method.body.method %>', + url: `/<%= method.body.url %>`,<% + if (method.body.params.length) { %> + params: { <%= method.body.params.join(', ') %> }<% } + if (method.body.body) { %> + body: <%= method.body.body %>,<% } %> + }, + { apiName: this.apiName });<% } %> + + constructor(private restService: RestService) {} +} diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 2c3134d03f8..dc885b17ff5 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,7 +1,7 @@ import { normalize, strings } from '@angular-devkit/core'; import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, interpolate, parseNamespace, resolveProject } from '../../utils'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -23,17 +23,11 @@ export default function(params: GenerateProxySchema) { const createServiceFiles = chain( controllers.map(controller => { - console.log(JSON.stringify(mapControllerToService(controller), null, 2)); - return applyWithOverwrite(url('./files-service'), [ applyTemplates({ ...cases, - solution, - namespace: parseNamespace(solution, controller.type), - name: controller.controllerName, - apiName: data.modules[moduleName].remoteServiceName, - apiUrl: controller.actions[0]?.url, - service: mapControllerToService(controller), + serializeParameters, + ...mapControllerToService(controller), }), move(normalize(targetPath)), ]); From 56bf0e6be1977d8da6d3fbc4d451cf847e823aee Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 03:27:36 +0300 Subject: [PATCH 51/95] feat: add a tree structure for generic types --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/tree.ts | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/utils/tree.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index cc9b0052fad..5a56c6d2eb2 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -7,4 +7,5 @@ export * from './rule'; export * from './service'; export * from './source'; export * from './text'; +export * from './tree'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/tree.ts b/npm/ng-packs/packages/schematics/src/utils/tree.ts new file mode 100644 index 00000000000..d1420322553 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/tree.ts @@ -0,0 +1,71 @@ +export class TypeNode { + children: TypeNode[] = []; + + index = 0; + + constructor( + public data: string, + public parent: TypeNode | null, + public mapperFn = (node: TypeNode) => node.data, + ) {} + + toGenerics(): string[] { + const generics = this.children.length ? `<${this.children.map(n => `T${n.index}`)}>` : ''; + return [this.data + generics].concat( + this.children.reduce((acc: string[], node) => acc.concat(node.toGenerics()), []), + ); + } + + toString() { + const self = this.mapperFn(this); + + if (!self) return ''; + + const representation = self + this.children.filter(String || Boolean).join(', '); + + if (!this.parent) return representation; + + const siblings = this.parent.children; + + return ( + (siblings[0] === this ? '<' : '') + + representation + + (siblings[siblings.length - 1] === this ? '>' : '') + ); + } + + valueOf() { + return this.toString(); + } +} + +export function parseGenerics(type: string, mapperFn?: TypeNodeMapperFn) { + const [rootType, ...types] = type.split('<'); + const root = new TypeNode(rootType, null, mapperFn); + + types.reduce((parent, t) => { + const [left, right] = t.split(/>+,?\s*/); + + const leftNode = new TypeNode(left, parent, mapperFn); + leftNode.index = parent.children.length; + parent.children.push(leftNode); + parent = leftNode; + + let { length } = t.match(/>/g) || []; + while (length--) parent = parent.parent!; + + if (right) { + parent = parent.parent!; + const rightNode = new TypeNode(right, parent, mapperFn); + rightNode.index = parent.children.length; + parent.children.push(rightNode); + parent = rightNode; + } + + return parent; + }, root); + + return root; +} + +export type TypeNodeMapperFn = (node: TypeNode) => string; From c6a4a3a62d1c69dd7b1d7e0176dd23b211e0d750 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 03:28:13 +0300 Subject: [PATCH 52/95] feat: collect refs to generic types in service schematics --- .../packages/schematics/src/models/import.ts | 3 +- .../packages/schematics/src/utils/service.ts | 76 +++++++++---------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/import.ts b/npm/ng-packs/packages/schematics/src/models/import.ts index e4cf9d0e415..82dff1e7f68 100644 --- a/npm/ng-packs/packages/schematics/src/models/import.ts +++ b/npm/ng-packs/packages/schematics/src/models/import.ts @@ -5,6 +5,7 @@ export class Import { alias?: string; keyword = eImportKeyword.Default; path: string; + refs: string[] = []; specifiers: string[] = []; constructor(options: ImportOptions) { @@ -12,4 +13,4 @@ export class Import { } } -export type ImportOptions = Omissible; +export type ImportOptions = Omissible; diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 1939195e648..6bb5eff5551 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -1,17 +1,8 @@ import { eImportKeyword } from '../enums'; -import { - Action, - Body, - Controller, - Import, - Method, - Parameter, - Service, - Signature, - TypeDef, -} from '../models'; +import { Action, Body, Controller, Import, Method, Parameter, Service, Signature } from '../models'; import { parseNamespace } from './namespace'; import { relativePathFromServiceToModel } from './path'; +import { parseGenerics } from './tree'; export function serializeParameters(parameters: Parameter[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); @@ -31,13 +22,13 @@ export function createControllerToServiceMapper(solution: string, apiName: strin } export function createActionToImportsReducer(solution: string, namespace: string) { - const mapTypeDefToImport = createTypeDefToImportMapper(solution, namespace); + const mapTypeToImport = createTypeToImportMapper(solution, namespace); return (imports: Import[], action: Action) => { - const typeDefs = getTypeDefsFromAction(action); + const types = getTypesFromAction(action); - typeDefs.forEach(typeDef => { - const def = mapTypeDefToImport(typeDef); + types.forEach(type => { + const def = mapTypeToImport(type); if (!def) return; const existingImport = imports.find( @@ -45,6 +36,7 @@ export function createActionToImportsReducer(solution: string, namespace: string ); if (!existingImport) return imports.push(def); + existingImport.refs = [...new Set([...existingImport.refs, ...def.refs])]; existingImport.specifiers = [ ...new Set([...existingImport.specifiers, ...def.specifiers]), ].sort(); @@ -53,17 +45,20 @@ export function createActionToImportsReducer(solution: string, namespace: string }; } -export function createTypeDefToImportMapper(solution: string, namespace: string) { +export function createTypeToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); - return ({ type, typeSimple }: TypeDef) => { + return (type: string) => { if (type.startsWith('System')) return; + const modelNamespace = parseNamespace(solution, type); const path = type.startsWith('Volo.Abp.Application.Dtos') ? '@abp/ng.core' : relativePathFromServiceToModel(namespace, modelNamespace); - const specifiers = [adaptType(typeSimple.split('<')[0])]; - return new Import({ keyword: eImportKeyword.Type, path, specifiers }); + const refs = [type]; + const specifiers = [adaptType(type.split('<')[0])]; + + return new Import({ keyword: eImportKeyword.Type, path, refs, specifiers }); }; } @@ -114,36 +109,35 @@ function getMethodNameFromAction(action: Action): string { } function createTypeAdapter(solution: string) { - const optionalRegex = /\?/g; - const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); - const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; + const removeNamespace = createNamespaceRemover(solution); return (typeSimple: string) => { if (typeSimple === 'System.Void') return 'void'; - return parseGenerics(typeSimple).reduceRight((acc, type) => { - type = type.replace(voloRegex, ''); - type = type.replace(solutionRegex, ''); - type = type.replace(optionalRegex, ''); - type = type.split('.').pop()!; - return acc ? `${type}<${acc}>` : type; - }, ''); + return parseGenerics(typeSimple, node => removeNamespace(node.data)).toString(); }; } -function parseGenerics(type: string) { - return type.replace(/>+$/, '').split('<'); -} - -function getTypeDefsFromAction({ parametersOnMethod, returnValue }: Action) { - const typeDefs: TypeDef[] = []; +function createNamespaceRemover(solution: string) { + const optionalRegex = /\?/g; + const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); + const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; - [returnValue, ...parametersOnMethod].forEach(({ type, typeSimple }) => { - const types = parseGenerics(type); - const simpleTypes = parseGenerics(typeSimple); + return (type: string) => { + type = type.replace(voloRegex, ''); + type = type.replace(solutionRegex, ''); + type = type.replace(optionalRegex, ''); + type = type.split('.').pop()!; + return type; + }; +} - types.forEach((type, i) => typeDefs.push({ type, typeSimple: simpleTypes[i] })); - }); +function getTypesFromAction({ parametersOnMethod, returnValue }: Action) { + return [returnValue, ...parametersOnMethod].reduce((types: string[], { type }) => { + parseGenerics(type) + .toGenerics() + .forEach(t => types.push(t)); - return typeDefs; + return types; + }, []); } From 6e5c426411565079e8bec1ca63e2d883ab233c83 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 09:38:43 +0300 Subject: [PATCH 53/95] feat: sort service imports and methods in schematics --- .../__name@kebab__.service.ts.template | 8 +++----- .../packages/schematics/src/utils/service.ts | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template index 8200590bdfe..1d6c9eb6aeb 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template @@ -1,8 +1,6 @@ -import { RestService } from '@abp/ng.core'; -import { Injectable } from '@angular/core';<% -for (let _import of imports) { %> -import type { <%= _import.specifiers.join(', ') %> } from '<%= _import.path %>';<% } %> - +<% for (let _import of imports) { +%><%= _import.keyword %> { <%= _import.specifiers.join(', ') %> } from '<%= _import.path %>'; +<% } %> @Injectable({ providedIn: 'root', }) diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 6bb5eff5551..927e881f4e9 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -16,11 +16,29 @@ export function createControllerToServiceMapper(solution: string, apiName: strin const namespace = parseNamespace(solution, controller.type); const actions = Object.values(controller.actions); const imports = actions.reduce(createActionToImportsReducer(solution, namespace), []); + imports.push(new Import({ path: '@abp/ng.core', specifiers: ['RestService'] })); + imports.push(new Import({ path: '@angular/core', specifiers: ['Injectable'] })); + sortImports(imports); const methods = actions.map(mapActionToMethod); + sortMethods(methods); return new Service({ apiName, imports, methods, name, namespace }); }; } +function sortImports(imports: Import[]) { + imports.sort((a, b) => + removeRelative(a) > removeRelative(b) ? 1 : a.keyword > b.keyword ? 1 : -1, + ); +} + +function removeRelative(importDef: Import) { + return importDef.path.replace(/\.\.\//g, ''); +} + +function sortMethods(methods: Method[]) { + methods.sort((a, b) => (a.signature.name > b.signature.name ? 1 : -1)); +} + export function createActionToImportsReducer(solution: string, namespace: string) { const mapTypeToImport = createTypeToImportMapper(solution, namespace); @@ -41,6 +59,7 @@ export function createActionToImportsReducer(solution: string, namespace: string ...new Set([...existingImport.specifiers, ...def.specifiers]), ].sort(); }); + return imports; }; } From cf99dd3222441246debb833a273826f6f20f928f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 09:42:47 +0300 Subject: [PATCH 54/95] feat: use destructuring in service schematics template --- .../__name@kebab__.service.ts.template | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template index 1d6c9eb6aeb..6d1aa25d91a 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template @@ -1,21 +1,21 @@ -<% for (let _import of imports) { -%><%= _import.keyword %> { <%= _import.specifiers.join(', ') %> } from '<%= _import.path %>'; +<% for (const {keyword, specifiers, path} of imports) { +%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>'; <% } %> @Injectable({ providedIn: 'root', }) export class <%= name %>Service { apiName = '<%= apiName %>';<% - for (let method of methods) { %> + for (let {body, signature} of methods) { %> - <%= camel(method.signature.name) %> = (<%= serializeParameters(method.signature.parameters) %>) => - this.restService.request<<%= method.body.requestType %>, <%= method.body.responseType %>>({ - method: '<%= method.body.method %>', - url: `/<%= method.body.url %>`,<% - if (method.body.params.length) { %> - params: { <%= method.body.params.join(', ') %> }<% } - if (method.body.body) { %> - body: <%= method.body.body %>,<% } %> + <%= camel(signature.name) %> = (<%= serializeParameters(signature.parameters) %>) => + this.restService.request<<%= body.requestType %>, <%= body.responseType %>>({ + method: '<%= body.method %>', + url: `/<%= body.url %>`,<% + if (body.params.length) { %> + params: { <%= body.params.join(', ') %> }<% } + if (body.body) { %> + body: <%= body.body %>,<% } %> }, { apiName: this.apiName });<% } %> From bf017bb7f0ab0f9be33eecb567e1c58c5dc3f02c Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 10:24:06 +0300 Subject: [PATCH 55/95] feat: add a base for model generation in schematics --- .../schematics/src/commands/api/index.ts | 25 ++++++++++-- .../schematics/src/models/api-definition.ts | 8 ++-- .../packages/schematics/src/models/index.ts | 1 + .../packages/schematics/src/models/method.ts | 16 +------- .../packages/schematics/src/models/model.ts | 39 +++++++++++++++++++ .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/model.ts | 10 +++++ .../packages/schematics/src/utils/service.ts | 6 +-- 8 files changed, 82 insertions(+), 24 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/models/model.ts create mode 100644 npm/ng-packs/packages/schematics/src/utils/model.ts diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index dc885b17ff5..82d90a6c347 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,7 +1,7 @@ import { normalize, strings } from '@angular-devkit/core'; import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefToModelMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -20,14 +20,33 @@ export default function(params: GenerateProxySchema) { const mapControllerToService = createControllerToServiceMapper(solution, definition.remoteServiceName); const controllers = Object.values(definition.controllers || {}); + const importRefs: string[] = []; const createServiceFiles = chain( controllers.map(controller => { + const service = mapControllerToService(controller); + service.imports.forEach(({refs}) => refs.forEach(ref => importRefs.push(ref))); + return applyWithOverwrite(url('./files-service'), [ applyTemplates({ ...cases, serializeParameters, - ...mapControllerToService(controller), + ...service, + }), + move(normalize(targetPath)), + ]); + } + ), + ); + + const mapImportRefToModel = createImportRefToModelMapper(solution); + + const createModelFiles = chain( + importRefs.map(ref => { + return applyWithOverwrite(url('./files-model'), [ + applyTemplates({ + ...cases, + ...mapImportRefToModel(ref), }), move(normalize(targetPath)), ]); @@ -35,7 +54,7 @@ export default function(params: GenerateProxySchema) { ), ); - return branchAndMerge(chain([createServiceFiles])); + return branchAndMerge(chain([createServiceFiles, createModelFiles])); }, ]); } diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts index 32ac847e5b0..96f40de6443 100644 --- a/npm/ng-packs/packages/schematics/src/models/api-definition.ts +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -11,10 +11,10 @@ export interface Type { enumNames: string[] | null; enumValues: number[] | null; genericArguments: string[] | null; - properties: Property[] | null; + properties: PropertyDef[] | null; } -export interface Property { +export interface PropertyDef { name: string; type: string; typeSimple: string; @@ -29,11 +29,11 @@ export interface Module { export interface Controller { controllerName: string; type: string; - interfaces: Interface[]; + interfaces: InterfaceDef[]; actions: Record; } -export interface Interface { +export interface InterfaceDef { type: string; } diff --git a/npm/ng-packs/packages/schematics/src/models/index.ts b/npm/ng-packs/packages/schematics/src/models/index.ts index 9d656bddb04..900b58b4f12 100644 --- a/npm/ng-packs/packages/schematics/src/models/index.ts +++ b/npm/ng-packs/packages/schematics/src/models/index.ts @@ -1,6 +1,7 @@ export * from './api-definition'; export * from './import'; export * from './method'; +export * from './model'; export * from './project'; export * from './service'; export * from './util'; diff --git a/npm/ng-packs/packages/schematics/src/models/method.ts b/npm/ng-packs/packages/schematics/src/models/method.ts index 51cbaa27bd7..0769904b600 100644 --- a/npm/ng-packs/packages/schematics/src/models/method.ts +++ b/npm/ng-packs/packages/schematics/src/models/method.ts @@ -1,6 +1,7 @@ import { strings } from '@angular-devkit/core'; import { eBindingSourceId, eMethodModifier } from '../enums'; import { ParameterInBody } from './api-definition'; +import { Property } from './model'; import { Omissible } from './util'; export class Method { @@ -18,7 +19,7 @@ export class Signature { generics = ''; modifier = eMethodModifier.Public; name: string; - parameters: Parameter[] = []; + parameters: Property[] = []; returnType = ''; constructor(options: SignatureOptions) { @@ -70,16 +71,3 @@ export type BodyOptions = Omissible< Omit, 'params' | 'requestType' >; - -export class Parameter { - name: string; - type: string; - default: string = ''; // convert actual value with JSON.stringify if not null - optional: '' | '?' = ''; - - constructor(options: ParameterOptions) { - Object.assign(this, options); - } -} - -export type ParameterOptions = Omissible; diff --git a/npm/ng-packs/packages/schematics/src/models/model.ts b/npm/ng-packs/packages/schematics/src/models/model.ts new file mode 100644 index 00000000000..1f24b0b317d --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/models/model.ts @@ -0,0 +1,39 @@ +import { Import } from './import'; +import { Omissible } from './util'; + +export class Model { + imports: Import[] = []; + interfaces: Interface[] = []; + namespace: string; + + constructor(options: ModelOptions) { + Object.assign(this, options); + } +} + +export type ModelOptions = Omissible; + +export class Interface { + base: string | null; + identifier: string; + properties: Property[] = []; + + constructor(options: InterfaceOptions) { + Object.assign(this, options); + } +} + +export type InterfaceOptions = Omissible; + +export class Property { + name: string; + type: string; + default: string = ''; + optional: '' | '?' = ''; + + constructor(options: PropertyOptions) { + Object.assign(this, options); + } +} + +export type PropertyOptions = Omissible; diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index 5a56c6d2eb2..a1d2b04a806 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,6 +1,7 @@ export * from './angular'; export * from './ast'; export * from './common'; +export * from './model'; export * from './namespace'; export * from './path'; export * from './rule'; diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts new file mode 100644 index 00000000000..e1032844abb --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -0,0 +1,10 @@ +import { Model } from '../models'; +import { parseNamespace } from './namespace'; + +export function createImportRefToModelMapper(solution: string) { + return (importRef: string) => { + return new Model({ + namespace: parseNamespace(solution, importRef), + }); + }; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 927e881f4e9..b9347eacc21 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -1,10 +1,10 @@ import { eImportKeyword } from '../enums'; -import { Action, Body, Controller, Import, Method, Parameter, Service, Signature } from '../models'; +import { Action, Body, Controller, Import, Method, Property, Service, Signature } from '../models'; import { parseNamespace } from './namespace'; import { relativePathFromServiceToModel } from './path'; import { parseGenerics } from './tree'; -export function serializeParameters(parameters: Parameter[]) { +export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); } @@ -113,7 +113,7 @@ export function createActionToSignatureMapper(solution: string) { signature.parameters = action.parametersOnMethod.map(p => { const type = adaptType(p.typeSimple); - const parameter = new Parameter({ name: p.name, type }); + const parameter = new Property({ name: p.name, type }); if (p.defaultValue) parameter.default = ` = ${p.defaultValue}`; else if (p.isOptional) parameter.optional = '?'; return parameter; From 8753450857c55df25badd25fa79d452885e7c2bd Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 10:40:12 +0300 Subject: [PATCH 56/95] feat: group import refs before mapping them to models --- .../packages/schematics/src/commands/api/index.ts | 15 +++++++++------ .../packages/schematics/src/utils/model.ts | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 82d90a6c347..f4ad6f7dcf6 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,7 +1,7 @@ import { normalize, strings } from '@angular-devkit/core'; import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefToModelMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefsToModelMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -20,12 +20,15 @@ export default function(params: GenerateProxySchema) { const mapControllerToService = createControllerToServiceMapper(solution, definition.remoteServiceName); const controllers = Object.values(definition.controllers || {}); - const importRefs: string[] = []; + const importRefs: Record = {}; const createServiceFiles = chain( controllers.map(controller => { const service = mapControllerToService(controller); - service.imports.forEach(({refs}) => refs.forEach(ref => importRefs.push(ref))); + service.imports.forEach(({refs, path}) => refs.forEach(ref => { + if (!importRefs[path]) return (importRefs[path] = [ref]); + importRefs[path] = [...new Set([...importRefs[path], ref])]; + })); return applyWithOverwrite(url('./files-service'), [ applyTemplates({ @@ -39,14 +42,14 @@ export default function(params: GenerateProxySchema) { ), ); - const mapImportRefToModel = createImportRefToModelMapper(solution); + const mapImportRefsToModel = createImportRefsToModelMapper(solution); const createModelFiles = chain( - importRefs.map(ref => { + Object.values(importRefs).map(refs => { return applyWithOverwrite(url('./files-model'), [ applyTemplates({ ...cases, - ...mapImportRefToModel(ref), + ...mapImportRefsToModel(refs), }), move(normalize(targetPath)), ]); diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index e1032844abb..5e4b56f803a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,10 +1,10 @@ import { Model } from '../models'; import { parseNamespace } from './namespace'; -export function createImportRefToModelMapper(solution: string) { - return (importRef: string) => { +export function createImportRefsToModelMapper(solution: string) { + return (importRefs: string[]) => { return new Model({ - namespace: parseNamespace(solution, importRef), + namespace: parseNamespace(solution, importRefs[0]), }); }; } From b3db883ce974c86da9a6192660b037254fe5d495 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 11:45:08 +0300 Subject: [PATCH 57/95] feat: add system type map as constant to schematics --- .../schematics/src/constants/index.ts | 1 + .../schematics/src/constants/system-types.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/constants/system-types.ts diff --git a/npm/ng-packs/packages/schematics/src/constants/index.ts b/npm/ng-packs/packages/schematics/src/constants/index.ts index b1c13e73406..533cbf4f90b 100644 --- a/npm/ng-packs/packages/schematics/src/constants/index.ts +++ b/npm/ng-packs/packages/schematics/src/constants/index.ts @@ -1 +1,2 @@ export * from './api'; +export * from './system-types'; diff --git a/npm/ng-packs/packages/schematics/src/constants/system-types.ts b/npm/ng-packs/packages/schematics/src/constants/system-types.ts new file mode 100644 index 00000000000..7adc16933d3 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/constants/system-types.ts @@ -0,0 +1,22 @@ +export const SYSTEM_TYPES = new Map([ + ['Bool', 'boolean'], + ['Byte', 'number'], + ['Char', 'string'], + ['DateTime', 'string'], + ['DateTimeOffset', 'string'], + ['Decimal', 'number'], + ['Double', 'number'], + ['Guid', 'string'], + ['Int16', 'number'], + ['Int32', 'number'], + ['Int64', 'number'], + ['Object', 'object'], + ['Sbyte', 'number'], + ['Single', 'number'], + ['String', 'string'], + ['TimeSpan', 'string'], + ['UInt16', 'number'], + ['UInt32', 'number'], + ['UInt64', 'number'], + ['Void', 'void'], +]); From dc60ff57ff94c691bb82079bb0e52b3538372a69 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 11:59:03 +0300 Subject: [PATCH 58/95] refactor: move schematics type simplifier to separate file --- .../packages/schematics/src/utils/index.ts | 1 + .../packages/schematics/src/utils/service.ts | 19 +++-------------- .../packages/schematics/src/utils/type.ts | 21 +++++++++++++++++++ 3 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/utils/type.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index a1d2b04a806..ee38b83dc11 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -9,4 +9,5 @@ export * from './service'; export * from './source'; export * from './text'; export * from './tree'; +export * from './type'; export * from './workspace'; diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index b9347eacc21..bec531de1ac 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -3,6 +3,7 @@ import { Action, Body, Controller, Import, Method, Property, Service, Signature import { parseNamespace } from './namespace'; import { relativePathFromServiceToModel } from './path'; import { parseGenerics } from './tree'; +import { createTypeSimplifier } from './type'; export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); @@ -128,26 +129,12 @@ function getMethodNameFromAction(action: Action): string { } function createTypeAdapter(solution: string) { - const removeNamespace = createNamespaceRemover(solution); + const simplifyType = createTypeSimplifier(solution); return (typeSimple: string) => { if (typeSimple === 'System.Void') return 'void'; - return parseGenerics(typeSimple, node => removeNamespace(node.data)).toString(); - }; -} - -function createNamespaceRemover(solution: string) { - const optionalRegex = /\?/g; - const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); - const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; - - return (type: string) => { - type = type.replace(voloRegex, ''); - type = type.replace(solutionRegex, ''); - type = type.replace(optionalRegex, ''); - type = type.split('.').pop()!; - return type; + return parseGenerics(typeSimple, node => simplifyType(node.data)).toString(); }; } diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts new file mode 100644 index 00000000000..5af905cabb5 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -0,0 +1,21 @@ +import { strings } from '@angular-devkit/core'; +import { SYSTEM_TYPES } from '../constants'; + +export function createTypeSimplifier(solution: string) { + const optionalRegex = /\?/g; + const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); + const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; + + return (type: string) => { + type = type.replace(voloRegex, ''); + type = type.replace(solutionRegex, ''); + type = type.replace(optionalRegex, ''); + type = type.replace( + /System\.([0-9A-Za-z]+)/g, + (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), + ); + type = type.split('.').pop()!; + type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; + return type; + }; +} From e1959594a6b0650dc14de8ad69af0306909d7cb1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 12:07:08 +0300 Subject: [PATCH 59/95] feat: collect interfaces from types based on importRefs --- .../schematics/src/commands/api/index.ts | 10 +++--- .../packages/schematics/src/utils/model.ts | 35 +++++++++++++++++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index f4ad6f7dcf6..f89bcc2ae9b 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -20,14 +20,14 @@ export default function(params: GenerateProxySchema) { const mapControllerToService = createControllerToServiceMapper(solution, definition.remoteServiceName); const controllers = Object.values(definition.controllers || {}); - const importRefs: Record = {}; + const serviceImports: Record = {}; const createServiceFiles = chain( controllers.map(controller => { const service = mapControllerToService(controller); service.imports.forEach(({refs, path}) => refs.forEach(ref => { - if (!importRefs[path]) return (importRefs[path] = [ref]); - importRefs[path] = [...new Set([...importRefs[path], ref])]; + if (!serviceImports[path]) return (serviceImports[path] = [ref]); + serviceImports[path] = [...new Set([...serviceImports[path], ref])]; })); return applyWithOverwrite(url('./files-service'), [ @@ -42,10 +42,10 @@ export default function(params: GenerateProxySchema) { ), ); - const mapImportRefsToModel = createImportRefsToModelMapper(solution); + const mapImportRefsToModel = createImportRefsToModelMapper(solution, data.types); const createModelFiles = chain( - Object.values(importRefs).map(refs => { + Object.values(serviceImports).map(refs => { return applyWithOverwrite(url('./files-model'), [ applyTemplates({ ...cases, diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 5e4b56f803a..79efea320c8 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,10 +1,39 @@ -import { Model } from '../models'; +import { strings } from '@angular-devkit/core'; +import { Interface, Model, Property, Type } from '../models'; import { parseNamespace } from './namespace'; +import { createTypeSimplifier } from './type'; + +export function createImportRefsToModelMapper(solution: string, types: Record) { + const simplifyType = createTypeSimplifier(solution); -export function createImportRefsToModelMapper(solution: string) { return (importRefs: string[]) => { - return new Model({ + const model = new Model({ namespace: parseNamespace(solution, importRefs[0]), }); + + importRefs.forEach(ref => { + const typeDef = types[ref]; + let identifier = simplifyType(ref); + (typeDef.genericArguments ?? []).forEach((t, i) => { + identifier = identifier.replace(`T${i}`, t); + }); + + const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; + const _interface = new Interface({ identifier, base }); + + typeDef.properties?.forEach(({ name, typeSimple }) => { + name = strings.camelize(name); + const type = simplifyType(typeSimple); + const optional = typeSimple.endsWith('?') ? '?' : ''; + + _interface.properties.push(new Property({ name, type, optional })); + }); + + console.log(_interface); + + model.interfaces.push(_interface); + }); + + return model; }; } From 90ad89c6d651bb7efa943a13b6067c01d2e8b631 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 12:33:05 +0300 Subject: [PATCH 60/95] refactor: make importRef to interface mapper separate fn --- .../packages/schematics/src/utils/model.ts | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 79efea320c8..f76133552b1 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -4,7 +4,7 @@ import { parseNamespace } from './namespace'; import { createTypeSimplifier } from './type'; export function createImportRefsToModelMapper(solution: string, types: Record) { - const simplifyType = createTypeSimplifier(solution); + const mapImportRefToInterface = createImportRefToInterfaceMapper(solution, types); return (importRefs: string[]) => { const model = new Model({ @@ -12,28 +12,36 @@ export function createImportRefsToModelMapper(solution: string, types: Record { - const typeDef = types[ref]; - let identifier = simplifyType(ref); - (typeDef.genericArguments ?? []).forEach((t, i) => { - identifier = identifier.replace(`T${i}`, t); - }); + model.interfaces.push(mapImportRefToInterface(ref)); + }); + + model.interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); + + return model; + }; +} - const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; - const _interface = new Interface({ identifier, base }); +export function createImportRefToInterfaceMapper(solution: string, types: Record) { + const simplifyType = createTypeSimplifier(solution); - typeDef.properties?.forEach(({ name, typeSimple }) => { - name = strings.camelize(name); - const type = simplifyType(typeSimple); - const optional = typeSimple.endsWith('?') ? '?' : ''; + return (ref: string) => { + const typeDef = types[ref]; + let identifier = simplifyType(ref); + (typeDef.genericArguments ?? []).forEach((t, i) => { + identifier = identifier.replace(`T${i}`, t); + }); - _interface.properties.push(new Property({ name, type, optional })); - }); + const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; + const _interface = new Interface({ identifier, base }); - console.log(_interface); + typeDef.properties?.forEach(({ name, typeSimple }) => { + name = strings.camelize(name); + const optional = typeSimple.endsWith('?') ? '?' : ''; + const type = simplifyType(typeSimple); - model.interfaces.push(_interface); + _interface.properties.push(new Property({ name, optional, type })); }); - return model; + return _interface; }; } From 460f21717fc7edb84eebca80bbbf304f7ba605e1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 12:50:58 +0300 Subject: [PATCH 61/95] refactor: make schematics service imports reducer reusable --- .../packages/schematics/src/utils/path.ts | 4 +- .../packages/schematics/src/utils/service.ts | 74 ++++--------------- .../packages/schematics/src/utils/type.ts | 50 +++++++++++++ 3 files changed, 65 insertions(+), 63 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/path.ts b/npm/ng-packs/packages/schematics/src/utils/path.ts index a48534c92cb..5b84ea168b5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/path.ts +++ b/npm/ng-packs/packages/schematics/src/utils/path.ts @@ -1,7 +1,7 @@ import { dir } from './text'; -export function relativePathFromServiceToModel(serviceNamespace: string, modelNamespace: string) { - const repeats = serviceNamespace ? serviceNamespace.split('.').length : 0; +export function relativePathToModel(namespace: string, modelNamespace: string) { + const repeats = namespace ? namespace.split('.').length : 0; const path = '..' + '/..'.repeat(repeats) + '/models/' + dir(modelNamespace); return removeTrailingSlash(path); } diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index bec531de1ac..83e8af22357 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -1,9 +1,7 @@ -import { eImportKeyword } from '../enums'; import { Action, Body, Controller, Import, Method, Property, Service, Signature } from '../models'; import { parseNamespace } from './namespace'; -import { relativePathFromServiceToModel } from './path'; import { parseGenerics } from './tree'; -import { createTypeSimplifier } from './type'; +import { createTypeAdapter, createTypesToImportsReducer } from './type'; export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); @@ -40,48 +38,6 @@ function sortMethods(methods: Method[]) { methods.sort((a, b) => (a.signature.name > b.signature.name ? 1 : -1)); } -export function createActionToImportsReducer(solution: string, namespace: string) { - const mapTypeToImport = createTypeToImportMapper(solution, namespace); - - return (imports: Import[], action: Action) => { - const types = getTypesFromAction(action); - - types.forEach(type => { - const def = mapTypeToImport(type); - if (!def) return; - - const existingImport = imports.find( - ({ keyword, path }) => keyword === def.keyword && path === def.path, - ); - if (!existingImport) return imports.push(def); - - existingImport.refs = [...new Set([...existingImport.refs, ...def.refs])]; - existingImport.specifiers = [ - ...new Set([...existingImport.specifiers, ...def.specifiers]), - ].sort(); - }); - - return imports; - }; -} - -export function createTypeToImportMapper(solution: string, namespace: string) { - const adaptType = createTypeAdapter(solution); - - return (type: string) => { - if (type.startsWith('System')) return; - - const modelNamespace = parseNamespace(solution, type); - const path = type.startsWith('Volo.Abp.Application.Dtos') - ? '@abp/ng.core' - : relativePathFromServiceToModel(namespace, modelNamespace); - const refs = [type]; - const specifiers = [adaptType(type.split('<')[0])]; - - return new Import({ keyword: eImportKeyword.Type, path, refs, specifiers }); - }; -} - export function createActionToMethodMapper(solution: string) { const mapActionToBody = createActionToBodyMapper(solution); const mapActionToSignature = createActionToSignatureMapper(solution); @@ -128,22 +84,18 @@ function getMethodNameFromAction(action: Action): string { return action.uniqueName.split('Async')[0]; } -function createTypeAdapter(solution: string) { - const simplifyType = createTypeSimplifier(solution); - - return (typeSimple: string) => { - if (typeSimple === 'System.Void') return 'void'; - - return parseGenerics(typeSimple, node => simplifyType(node.data)).toString(); - }; -} +function createActionToImportsReducer(solution: string, namespace: string) { + const mapTypesToImports = createTypesToImportsReducer(solution, namespace); -function getTypesFromAction({ parametersOnMethod, returnValue }: Action) { - return [returnValue, ...parametersOnMethod].reduce((types: string[], { type }) => { - parseGenerics(type) - .toGenerics() - .forEach(t => types.push(t)); + return (imports: Import[], { parametersOnMethod, returnValue }: Action) => + mapTypesToImports( + imports, + [returnValue, ...parametersOnMethod].reduce((types: string[], { type }) => { + parseGenerics(type) + .toGenerics() + .forEach(t => types.push(t)); - return types; - }, []); + return types; + }, []), + ); } diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 5af905cabb5..18726d03344 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -1,5 +1,10 @@ import { strings } from '@angular-devkit/core'; import { SYSTEM_TYPES } from '../constants'; +import { eImportKeyword } from '../enums'; +import { Import } from '../models'; +import { parseNamespace } from './namespace'; +import { relativePathToModel } from './path'; +import { parseGenerics } from './tree'; export function createTypeSimplifier(solution: string) { const optionalRegex = /\?/g; @@ -19,3 +24,48 @@ export function createTypeSimplifier(solution: string) { return type; }; } + +export function createTypesToImportsReducer(solution: string, namespace: string) { + const mapTypeToImport = createTypeToImportMapper(solution, namespace); + + return (imports: Import[], types: string[]) => { + types.forEach(type => { + const def = mapTypeToImport(type); + if (!def) return; + + const existingImport = imports.find( + ({ keyword, path }) => keyword === def.keyword && path === def.path, + ); + if (!existingImport) return imports.push(def); + + existingImport.refs = [...new Set([...existingImport.refs, ...def.refs])]; + existingImport.specifiers = [ + ...new Set([...existingImport.specifiers, ...def.specifiers]), + ].sort(); + }); + + return imports; + }; +} + +export function createTypeToImportMapper(solution: string, namespace: string) { + const adaptType = createTypeAdapter(solution); + + return (type: string) => { + if (type.startsWith('System')) return; + + const modelNamespace = parseNamespace(solution, type); + const path = type.startsWith('Volo.Abp.Application.Dtos') + ? '@abp/ng.core' + : relativePathToModel(namespace, modelNamespace); + const refs = [type]; + const specifiers = [adaptType(type.split('<')[0])]; + + return new Import({ keyword: eImportKeyword.Type, path, refs, specifiers }); + }; +} + +export function createTypeAdapter(solution: string) { + const simplifyType = createTypeSimplifier(solution); + return (type: string) => parseGenerics(type, node => simplifyType(node.data)).toString(); +} From f467dc75c82e17f38c2100b50f67a10f364369fd Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 15:49:05 +0300 Subject: [PATCH 62/95] refactor: make schematics import sort fn reusable --- npm/ng-packs/packages/schematics/src/utils/import.ts | 11 +++++++++++ npm/ng-packs/packages/schematics/src/utils/index.ts | 1 + npm/ng-packs/packages/schematics/src/utils/service.ts | 11 +---------- 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/utils/import.ts diff --git a/npm/ng-packs/packages/schematics/src/utils/import.ts b/npm/ng-packs/packages/schematics/src/utils/import.ts new file mode 100644 index 00000000000..26b22d44e6c --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/import.ts @@ -0,0 +1,11 @@ +import { Import } from '../models'; + +export function sortImports(imports: Import[]) { + imports.sort((a, b) => + removeRelative(a) > removeRelative(b) ? 1 : a.keyword > b.keyword ? 1 : -1, + ); +} + +export function removeRelative(importDef: Import) { + return importDef.path.replace(/\.\.\//g, ''); +} diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index ee38b83dc11..fc6c973b81e 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,6 +1,7 @@ export * from './angular'; export * from './ast'; export * from './common'; +export * from './import'; export * from './model'; export * from './namespace'; export * from './path'; diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 83e8af22357..5fc2e18e36d 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -1,4 +1,5 @@ import { Action, Body, Controller, Import, Method, Property, Service, Signature } from '../models'; +import { sortImports } from './import'; import { parseNamespace } from './namespace'; import { parseGenerics } from './tree'; import { createTypeAdapter, createTypesToImportsReducer } from './type'; @@ -24,16 +25,6 @@ export function createControllerToServiceMapper(solution: string, apiName: strin }; } -function sortImports(imports: Import[]) { - imports.sort((a, b) => - removeRelative(a) > removeRelative(b) ? 1 : a.keyword > b.keyword ? 1 : -1, - ); -} - -function removeRelative(importDef: Import) { - return importDef.path.replace(/\.\.\//g, ''); -} - function sortMethods(methods: Method[]) { methods.sort((a, b) => (a.signature.name > b.signature.name ? 1 : -1)); } From d31aee32b3e0bb92e45b45cd7f476b1b670843b5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 16:08:01 +0300 Subject: [PATCH 63/95] feat: handle model imports in model schematics --- .../__namespace@dir__/index.ts.template | 10 +++ .../schematics/src/commands/api/index.ts | 1 + .../packages/schematics/src/utils/model.ts | 80 ++++++++++++++++--- .../packages/schematics/src/utils/type.ts | 14 ++-- 4 files changed, 88 insertions(+), 17 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template index e69de29bb2d..c5790647c51 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-model/shared/models/__namespace@dir__/index.ts.template @@ -0,0 +1,10 @@ +<% +for (const {keyword, specifiers, path} of imports) { +%><%= keyword %> { <%= specifiers.join(', ') %> } from '<%= path %>'; +<% } +for (let {base, identifier, properties} of interfaces) { %> +export interface <%= identifier %> <%= base ? `extends ${base} ` : '' %>{<% + for (let {name, optional, type} of properties) { %> + <%= name + optional %>: <%= type %>;<% } %> +} +<% } %> \ No newline at end of file diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index f89bcc2ae9b..fa599adc719 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -26,6 +26,7 @@ export default function(params: GenerateProxySchema) { controllers.map(controller => { const service = mapControllerToService(controller); service.imports.forEach(({refs, path}) => refs.forEach(ref => { + if (path === '@abp/ng.core') return; if (!serviceImports[path]) return (serviceImports[path] = [ref]); serviceImports[path] = [...new Set([...serviceImports[path], ref])]; })); diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index f76133552b1..ceb0603f2de 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,18 +1,30 @@ import { strings } from '@angular-devkit/core'; -import { Interface, Model, Property, Type } from '../models'; +import { Import, Interface, Model, Property, Type } from '../models'; +import { sortImports } from './import'; import { parseNamespace } from './namespace'; -import { createTypeSimplifier } from './type'; +import { relativePathToModel } from './path'; +import { parseGenerics } from './tree'; +import { createTypeSimplifier, createTypesToImportsReducer } from './type'; export function createImportRefsToModelMapper(solution: string, types: Record) { const mapImportRefToInterface = createImportRefToInterfaceMapper(solution, types); + const createImportRefToImportReducer = createImportRefToImportReducerCreator(solution, types); return (importRefs: string[]) => { - const model = new Model({ - namespace: parseNamespace(solution, importRefs[0]), - }); + const namespace = parseNamespace(solution, importRefs[0]); + const model = new Model({ namespace }); - importRefs.forEach(ref => { + const reduceImportRefToImport = createImportRefToImportReducer(namespace); + const imports = importRefs.reduce((accumulatedImports, ref) => { model.interfaces.push(mapImportRefToInterface(ref)); + return reduceImportRefToImport(accumulatedImports, ref); + }, []); + + sortImports(imports); + const selfPath = relativePathToModel(namespace, namespace); + imports.forEach(i => { + if (i.path === selfPath) return; + model.imports.push(i); }); model.interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); @@ -26,10 +38,10 @@ export function createImportRefToInterfaceMapper(solution: string, types: Record return (ref: string) => { const typeDef = types[ref]; - let identifier = simplifyType(ref); - (typeDef.genericArguments ?? []).forEach((t, i) => { - identifier = identifier.replace(`T${i}`, t); - }); + const identifier = (typeDef.genericArguments ?? []).reduce( + (acc, t, i) => acc.replace(`T${i}`, t), + simplifyType(ref), + ); const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; const _interface = new Interface({ identifier, base }); @@ -45,3 +57,51 @@ export function createImportRefToInterfaceMapper(solution: string, types: Record return _interface; }; } + +export function createImportRefToImportReducerCreator( + solution: string, + types: Record, +) { + return (namespace: string) => { + const reduceTypesToImport = createTypesToImportsReducer(solution, namespace); + + return (imports: Import[], importRef: string) => + reduceTypesToImport( + imports, + mergeBaseTypeWithProperties(types[importRef]).reduce((typeNames: string[], { type }) => { + parseGenerics(type) + .toGenerics() + .forEach(t => typeNames.push(t)); + + return typeNames; + }, []), + ); + }; +} + +export function mergeBaseTypeWithProperties({ baseType, genericArguments, properties }: Type) { + const removeGenerics = createGenericRemover(genericArguments); + const baseTypes = baseType ? [{ type: baseType }] : []; + const propTypes = (properties ?? []).map(({ type }) => ({ type })); + + return [...baseTypes, ...propTypes].map(removeGenerics); +} + +export function createGenericRemover(genericArguments: string[] | null) { + if (!genericArguments) return (def: SimpleTypeDef) => def; + + return ({ type }: SimpleTypeDef) => ({ + type: genericArguments.includes(type) + ? '' + : type.replace(/<([^<>]+)>/, (_, match) => { + return match + .split(/,\s*/) + .filter((t: string) => !genericArguments.includes(t)) + .join(','); + }), + }); +} + +interface SimpleTypeDef { + type: string; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 18726d03344..81dc412f014 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -30,17 +30,17 @@ export function createTypesToImportsReducer(solution: string, namespace: string) return (imports: Import[], types: string[]) => { types.forEach(type => { - const def = mapTypeToImport(type); - if (!def) return; + const newImport = mapTypeToImport(type); + if (!newImport) return; const existingImport = imports.find( - ({ keyword, path }) => keyword === def.keyword && path === def.path, + ({ keyword, path }) => keyword === newImport.keyword && path === newImport.path, ); - if (!existingImport) return imports.push(def); + if (!existingImport) return imports.push(newImport); - existingImport.refs = [...new Set([...existingImport.refs, ...def.refs])]; + existingImport.refs = [...new Set([...existingImport.refs, ...newImport.refs])]; existingImport.specifiers = [ - ...new Set([...existingImport.specifiers, ...def.specifiers]), + ...new Set([...existingImport.specifiers, ...newImport.specifiers]), ].sort(); }); @@ -52,7 +52,7 @@ export function createTypeToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); return (type: string) => { - if (type.startsWith('System')) return; + if (!type || type.startsWith('System')) return; const modelNamespace = parseNamespace(solution, type); const path = type.startsWith('Volo.Abp.Application.Dtos') From 61cc1f660432ba2780dc52a7b9f3c4239237be38 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 16:28:33 +0300 Subject: [PATCH 64/95] fix: check list types before splitting them in schematics --- .../packages/schematics/src/utils/type.ts | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 81dc412f014..b365e0e4ade 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -11,17 +11,26 @@ export function createTypeSimplifier(solution: string) { const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; - return (type: string) => { - type = type.replace(voloRegex, ''); - type = type.replace(solutionRegex, ''); - type = type.replace(optionalRegex, ''); - type = type.replace( - /System\.([0-9A-Za-z]+)/g, - (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), - ); - type = type.split('.').pop()!; - type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; - return type; + return (originalType: string) => { + const union = originalType + .replace(/^{/, '') + .replace(/}$/, '') + .split(':'); + return union + .map(type => { + type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; + type = type.replace(voloRegex, ''); + type = type.replace(solutionRegex, ''); + type = type.replace(optionalRegex, ''); + type = type.replace( + /System\.([0-9A-Za-z]+)/g, + (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), + ); + type = type.split('.').pop()!; + console.log(type); + return type; + }) + .join(' | '); }; } From d41e621e0e3e5c1c694731843d82c965fe44c546 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 16:59:29 +0300 Subject: [PATCH 65/95] fix: parse namespaces after removing type modifiers --- .../schematics/src/utils/namespace.ts | 5 +++- .../packages/schematics/src/utils/type.ts | 25 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/namespace.ts b/npm/ng-packs/packages/schematics/src/utils/namespace.ts index bbee41aa6f3..003198adcb0 100644 --- a/npm/ng-packs/packages/schematics/src/utils/namespace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/namespace.ts @@ -1,5 +1,8 @@ +import { createTypeParser } from './type'; + export function parseNamespace(solution: string, type: string) { - let namespace = type + const parseType = createTypeParser(); + let namespace = parseType(type) .split('.') .slice(0, -1) .join('.'); diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index b365e0e4ade..5a56e2e4458 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -7,28 +7,37 @@ import { relativePathToModel } from './path'; import { parseGenerics } from './tree'; export function createTypeSimplifier(solution: string) { - const optionalRegex = /\?/g; const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; + return createTypeParser( + type => + type + .replace(voloRegex, '') + .replace(solutionRegex, '') + .split('.') + .pop()!, + ); +} + +export function createTypeParser(replacerFn = (t: string) => t) { + const optionalRegex = /\?/g; + return (originalType: string) => { - const union = originalType + const unionType = originalType .replace(/^{/, '') .replace(/}$/, '') .split(':'); - return union + + return unionType .map(type => { type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; - type = type.replace(voloRegex, ''); - type = type.replace(solutionRegex, ''); type = type.replace(optionalRegex, ''); type = type.replace( /System\.([0-9A-Za-z]+)/g, (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), ); - type = type.split('.').pop()!; - console.log(type); - return type; + return replacerFn(type); }) .join(' | '); }; From 82967a8195dcbc8e4d7e8f64681201c3418e7e63 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 17:07:23 +0300 Subject: [PATCH 66/95] refactor: simplify merging of baseType w/ properties --- .../packages/schematics/src/utils/model.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index ceb0603f2de..6c13317d75f 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -68,7 +68,7 @@ export function createImportRefToImportReducerCreator( return (imports: Import[], importRef: string) => reduceTypesToImport( imports, - mergeBaseTypeWithProperties(types[importRef]).reduce((typeNames: string[], { type }) => { + mergeBaseTypeWithProperties(types[importRef]).reduce((typeNames: string[], type) => { parseGenerics(type) .toGenerics() .forEach(t => typeNames.push(t)); @@ -81,27 +81,22 @@ export function createImportRefToImportReducerCreator( export function mergeBaseTypeWithProperties({ baseType, genericArguments, properties }: Type) { const removeGenerics = createGenericRemover(genericArguments); - const baseTypes = baseType ? [{ type: baseType }] : []; - const propTypes = (properties ?? []).map(({ type }) => ({ type })); + const baseTypes = baseType ? [baseType] : []; + const propTypes = (properties ?? []).map(({ type }) => type); return [...baseTypes, ...propTypes].map(removeGenerics); } export function createGenericRemover(genericArguments: string[] | null) { - if (!genericArguments) return (def: SimpleTypeDef) => def; + if (!genericArguments) return (type: string) => type; - return ({ type }: SimpleTypeDef) => ({ - type: genericArguments.includes(type) + return (type: string) => + genericArguments.includes(type) ? '' : type.replace(/<([^<>]+)>/, (_, match) => { return match .split(/,\s*/) .filter((t: string) => !genericArguments.includes(t)) .join(','); - }), - }); -} - -interface SimpleTypeDef { - type: string; + }); } From 0c9c5da87d791825e12a46dd4cd4940281a1e6ad Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 17:22:32 +0300 Subject: [PATCH 67/95] fix: avoid union types to be imported in schematics --- npm/ng-packs/packages/schematics/src/utils/model.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 6c13317d75f..0dd2c4e020b 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -84,7 +84,17 @@ export function mergeBaseTypeWithProperties({ baseType, genericArguments, proper const baseTypes = baseType ? [baseType] : []; const propTypes = (properties ?? []).map(({ type }) => type); - return [...baseTypes, ...propTypes].map(removeGenerics); + return [...baseTypes, ...propTypes].reduce(flattenUnionTypes, []).map(removeGenerics); +} + +export function flattenUnionTypes(types: string[], type: string) { + type + .replace(/^{/, '') + .replace(/}$/, '') + .split(':') + .forEach(t => types.push(t)); + + return types; } export function createGenericRemover(genericArguments: string[] | null) { From 7d272958ba7d772416171c18ebca678bad7ff807 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 17:32:10 +0300 Subject: [PATCH 68/95] fix: avoid importing modified types in schematics --- .../packages/schematics/src/utils/model.ts | 20 +++++------- .../packages/schematics/src/utils/type.ts | 31 ++++++++++++------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 0dd2c4e020b..9078f422b7c 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -4,7 +4,12 @@ import { sortImports } from './import'; import { parseNamespace } from './namespace'; import { relativePathToModel } from './path'; import { parseGenerics } from './tree'; -import { createTypeSimplifier, createTypesToImportsReducer } from './type'; +import { + createTypeSimplifier, + createTypesToImportsReducer, + flattenUnionTypes, + removeTypeModifiers, +} from './type'; export function createImportRefsToModelMapper(solution: string, types: Record) { const mapImportRefToInterface = createImportRefToInterfaceMapper(solution, types); @@ -81,20 +86,11 @@ export function createImportRefToImportReducerCreator( export function mergeBaseTypeWithProperties({ baseType, genericArguments, properties }: Type) { const removeGenerics = createGenericRemover(genericArguments); + const clearTypes = (type: string) => removeTypeModifiers(removeGenerics(type)); const baseTypes = baseType ? [baseType] : []; const propTypes = (properties ?? []).map(({ type }) => type); - return [...baseTypes, ...propTypes].reduce(flattenUnionTypes, []).map(removeGenerics); -} - -export function flattenUnionTypes(types: string[], type: string) { - type - .replace(/^{/, '') - .replace(/}$/, '') - .split(':') - .forEach(t => types.push(t)); - - return types; + return [...baseTypes, ...propTypes].reduce(flattenUnionTypes, []).map(clearTypes); } export function createGenericRemover(genericArguments: string[] | null) { diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 5a56e2e4458..d82dd001bc8 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -21,26 +21,33 @@ export function createTypeSimplifier(solution: string) { } export function createTypeParser(replacerFn = (t: string) => t) { - const optionalRegex = /\?/g; - - return (originalType: string) => { - const unionType = originalType - .replace(/^{/, '') - .replace(/}$/, '') - .split(':'); - - return unionType + return (originalType: string) => + flattenUnionTypes([], originalType) .map(type => { - type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; - type = type.replace(optionalRegex, ''); + type = removeTypeModifiers(type); type = type.replace( /System\.([0-9A-Za-z]+)/g, (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), ); + return replacerFn(type); }) .join(' | '); - }; +} + +export function flattenUnionTypes(types: string[], type: string) { + type + .replace(/^{/, '') + .replace(/}$/, '') + .split(':') + .forEach(t => types.push(t)); + + return types; +} + +export function removeTypeModifiers(type: string) { + type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; + return type.replace(/\?/g, ''); } export function createTypesToImportsReducer(solution: string, namespace: string) { From 198ea436af0a52bb007ebfd9b3b9b8b2ade15581 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 18:18:35 +0300 Subject: [PATCH 69/95] feat: handle enum imports in schematics --- .../schematics/src/commands/api/index.ts | 5 +-- .../schematics/src/models/api-definition.ts | 5 +++ .../packages/schematics/src/utils/model.ts | 10 +++--- .../packages/schematics/src/utils/path.ts | 12 ++++++- .../packages/schematics/src/utils/service.ts | 35 ++++++++++++++----- .../packages/schematics/src/utils/type.ts | 18 +++++----- 6 files changed, 61 insertions(+), 24 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index fa599adc719..652ec601890 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -15,10 +15,11 @@ export default function(params: GenerateProxySchema) { const targetPath = buildDefaultPath(target.definition); const readApiDefinition = createApiDefinitionReader(`${targetPath}/shared/api-definition.json`); const data = readApiDefinition(tree); + const types = data.types; const definition = data.modules[moduleName]; if (!definition) throw new SchematicsException(interpolate(Exception.InvalidModule, moduleName)); - const mapControllerToService = createControllerToServiceMapper(solution, definition.remoteServiceName); + const mapControllerToService = createControllerToServiceMapper(solution, types, definition.remoteServiceName); const controllers = Object.values(definition.controllers || {}); const serviceImports: Record = {}; @@ -43,7 +44,7 @@ export default function(params: GenerateProxySchema) { ), ); - const mapImportRefsToModel = createImportRefsToModelMapper(solution, data.types); + const mapImportRefsToModel = createImportRefsToModelMapper(solution, types); const createModelFiles = chain( Object.values(serviceImports).map(refs => { diff --git a/npm/ng-packs/packages/schematics/src/models/api-definition.ts b/npm/ng-packs/packages/schematics/src/models/api-definition.ts index 96f40de6443..3b75f266e70 100644 --- a/npm/ng-packs/packages/schematics/src/models/api-definition.ts +++ b/npm/ng-packs/packages/schematics/src/models/api-definition.ts @@ -73,3 +73,8 @@ export interface TypeDef { type: string; typeSimple: string; } + +export interface TypeWithEnum { + isEnum: boolean; + type: string; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 9078f422b7c..a8676ce639e 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,5 +1,5 @@ import { strings } from '@angular-devkit/core'; -import { Import, Interface, Model, Property, Type } from '../models'; +import { Import, Interface, Model, Property, Type, TypeWithEnum } from '../models'; import { sortImports } from './import'; import { parseNamespace } from './namespace'; import { relativePathToModel } from './path'; @@ -73,12 +73,12 @@ export function createImportRefToImportReducerCreator( return (imports: Import[], importRef: string) => reduceTypesToImport( imports, - mergeBaseTypeWithProperties(types[importRef]).reduce((typeNames: string[], type) => { - parseGenerics(type) + mergeBaseTypeWithProperties(types[importRef]).reduce((acc: TypeWithEnum[], typeName) => { + parseGenerics(typeName) .toGenerics() - .forEach(t => typeNames.push(t)); + .forEach(type => acc.push({ type, isEnum: types[type]?.isEnum })); - return typeNames; + return acc; }, []), ); }; diff --git a/npm/ng-packs/packages/schematics/src/utils/path.ts b/npm/ng-packs/packages/schematics/src/utils/path.ts index 5b84ea168b5..d040ac0bddc 100644 --- a/npm/ng-packs/packages/schematics/src/utils/path.ts +++ b/npm/ng-packs/packages/schematics/src/utils/path.ts @@ -1,4 +1,10 @@ -import { dir } from './text'; +import { dir, kebab } from './text'; + +export function relativePathToEnum(namespace: string, enumNamespace: string, enumName: string) { + const repeats = namespace ? namespace.split('.').length : 0; + const path = '..' + '/..'.repeat(repeats) + '/enums/' + dir(enumNamespace) + kebab(enumName); + return removeDoubleSlash(path); +} export function relativePathToModel(namespace: string, modelNamespace: string) { const repeats = namespace ? namespace.split('.').length : 0; @@ -6,6 +12,10 @@ export function relativePathToModel(namespace: string, modelNamespace: string) { return removeTrailingSlash(path); } +function removeDoubleSlash(path: string) { + return path.replace(/\/{2,}/g, ''); +} + function removeTrailingSlash(path: string) { return path.replace(/\/+$/, ''); } diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 5fc2e18e36d..57d8c97e0c2 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -1,4 +1,15 @@ -import { Action, Body, Controller, Import, Method, Property, Service, Signature } from '../models'; +import { + Action, + Body, + Controller, + Import, + Method, + Property, + Service, + Signature, + Type, + TypeWithEnum, +} from '../models'; import { sortImports } from './import'; import { parseNamespace } from './namespace'; import { parseGenerics } from './tree'; @@ -8,14 +19,18 @@ export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); } -export function createControllerToServiceMapper(solution: string, apiName: string) { +export function createControllerToServiceMapper( + solution: string, + types: Record, + apiName: string, +) { const mapActionToMethod = createActionToMethodMapper(solution); return (controller: Controller) => { const name = controller.controllerName; const namespace = parseNamespace(solution, controller.type); const actions = Object.values(controller.actions); - const imports = actions.reduce(createActionToImportsReducer(solution, namespace), []); + const imports = actions.reduce(createActionToImportsReducer(solution, types, namespace), []); imports.push(new Import({ path: '@abp/ng.core', specifiers: ['RestService'] })); imports.push(new Import({ path: '@angular/core', specifiers: ['Injectable'] })); sortImports(imports); @@ -75,18 +90,22 @@ function getMethodNameFromAction(action: Action): string { return action.uniqueName.split('Async')[0]; } -function createActionToImportsReducer(solution: string, namespace: string) { +function createActionToImportsReducer( + solution: string, + types: Record, + namespace: string, +) { const mapTypesToImports = createTypesToImportsReducer(solution, namespace); return (imports: Import[], { parametersOnMethod, returnValue }: Action) => mapTypesToImports( imports, - [returnValue, ...parametersOnMethod].reduce((types: string[], { type }) => { - parseGenerics(type) + [returnValue, ...parametersOnMethod].reduce((acc: TypeWithEnum[], param) => { + parseGenerics(param.type) .toGenerics() - .forEach(t => types.push(t)); + .forEach(type => acc.push({ type, isEnum: types[type]?.isEnum })); - return types; + return acc; }, []), ); } diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index d82dd001bc8..ebae7c802bc 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -1,9 +1,9 @@ import { strings } from '@angular-devkit/core'; import { SYSTEM_TYPES } from '../constants'; import { eImportKeyword } from '../enums'; -import { Import } from '../models'; +import { Import, TypeWithEnum } from '../models'; import { parseNamespace } from './namespace'; -import { relativePathToModel } from './path'; +import { relativePathToEnum, relativePathToModel } from './path'; import { parseGenerics } from './tree'; export function createTypeSimplifier(solution: string) { @@ -53,9 +53,9 @@ export function removeTypeModifiers(type: string) { export function createTypesToImportsReducer(solution: string, namespace: string) { const mapTypeToImport = createTypeToImportMapper(solution, namespace); - return (imports: Import[], types: string[]) => { - types.forEach(type => { - const newImport = mapTypeToImport(type); + return (imports: Import[], types: TypeWithEnum[]) => { + types.forEach(({ type, isEnum }) => { + const newImport = mapTypeToImport(type, isEnum); if (!newImport) return; const existingImport = imports.find( @@ -76,15 +76,17 @@ export function createTypesToImportsReducer(solution: string, namespace: string) export function createTypeToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); - return (type: string) => { + return (type: string, isEnum: boolean) => { if (!type || type.startsWith('System')) return; const modelNamespace = parseNamespace(solution, type); + const refs = [type]; + const specifiers = [adaptType(type.split('<')[0])]; const path = type.startsWith('Volo.Abp.Application.Dtos') ? '@abp/ng.core' + : isEnum + ? relativePathToEnum(namespace, modelNamespace, specifiers[0]) : relativePathToModel(namespace, modelNamespace); - const refs = [type]; - const specifiers = [adaptType(type.split('<')[0])]; return new Import({ keyword: eImportKeyword.Type, path, refs, specifiers }); }; From c0aa4720bc57f42802a9b8c172b2949abe555fbd Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 18:30:57 +0300 Subject: [PATCH 70/95] fix: replace double slashes with single slashes --- npm/ng-packs/packages/schematics/src/utils/path.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/path.ts b/npm/ng-packs/packages/schematics/src/utils/path.ts index d040ac0bddc..cb1d4997556 100644 --- a/npm/ng-packs/packages/schematics/src/utils/path.ts +++ b/npm/ng-packs/packages/schematics/src/utils/path.ts @@ -2,8 +2,8 @@ import { dir, kebab } from './text'; export function relativePathToEnum(namespace: string, enumNamespace: string, enumName: string) { const repeats = namespace ? namespace.split('.').length : 0; - const path = '..' + '/..'.repeat(repeats) + '/enums/' + dir(enumNamespace) + kebab(enumName); - return removeDoubleSlash(path); + const path = '..' + '/..'.repeat(repeats) + '/enums/' + dir(enumNamespace); + return removeDoubleSlash(path + '/' + kebab(enumName)); } export function relativePathToModel(namespace: string, modelNamespace: string) { @@ -13,7 +13,7 @@ export function relativePathToModel(namespace: string, modelNamespace: string) { } function removeDoubleSlash(path: string) { - return path.replace(/\/{2,}/g, ''); + return path.replace(/\/{2,}/g, '/'); } function removeTrailingSlash(path: string) { From a70cfd6d2728a360d78a71d7af7f6bf9ed4af0e5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 18:52:28 +0300 Subject: [PATCH 71/95] fix: avoid creating interfaces for enums in schematics --- npm/ng-packs/packages/schematics/src/utils/model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index a8676ce639e..cadede7e6b3 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -21,7 +21,8 @@ export function createImportRefsToModelMapper(solution: string, types: Record { - model.interfaces.push(mapImportRefToInterface(ref)); + if (!types[ref].isEnum) model.interfaces.push(mapImportRefToInterface(ref)); + return reduceImportRefToImport(accumulatedImports, ref); }, []); From 6f10a83282b86465e4b9434fd98ba5024750c90f Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 19 Aug 2020 18:52:34 +0300 Subject: [PATCH 72/95] feat: import ObjectExtending namespace from core package --- npm/ng-packs/packages/schematics/src/utils/type.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index ebae7c802bc..74e116c7469 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -8,7 +8,7 @@ import { parseGenerics } from './tree'; export function createTypeSimplifier(solution: string) { const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); - const voloRegex = /^Volo\.(Abp\.?)(Application\.?)/; + const voloRegex = /^Volo\.(Abp\.?)(Application|ObjectExtending\.?)/; return createTypeParser( type => @@ -82,7 +82,7 @@ export function createTypeToImportMapper(solution: string, namespace: string) { const modelNamespace = parseNamespace(solution, type); const refs = [type]; const specifiers = [adaptType(type.split('<')[0])]; - const path = type.startsWith('Volo.Abp.Application.Dtos') + const path = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/.test(type) ? '@abp/ng.core' : isEnum ? relativePathToEnum(namespace, modelNamespace, specifiers[0]) From 556150999b2e894b2af3fac4d6e3237def604c81 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 09:51:28 +0300 Subject: [PATCH 73/95] feat: create interfaces for self imports in schematics --- .../schematics/src/commands/api/index.ts | 3 +-- .../packages/schematics/src/models/model.ts | 1 + .../packages/schematics/src/utils/model.ts | 27 ++++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 652ec601890..f18ee5985d3 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -55,8 +55,7 @@ export default function(params: GenerateProxySchema) { }), move(normalize(targetPath)), ]); - } - ), + }), ); return branchAndMerge(chain([createServiceFiles, createModelFiles])); diff --git a/npm/ng-packs/packages/schematics/src/models/model.ts b/npm/ng-packs/packages/schematics/src/models/model.ts index 1f24b0b317d..2318d6c181e 100644 --- a/npm/ng-packs/packages/schematics/src/models/model.ts +++ b/npm/ng-packs/packages/schematics/src/models/model.ts @@ -17,6 +17,7 @@ export class Interface { base: string | null; identifier: string; properties: Property[] = []; + ref: string; constructor(options: InterfaceOptions) { Object.assign(this, options); diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index cadede7e6b3..d02ec1db046 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -21,36 +21,51 @@ export function createImportRefsToModelMapper(solution: string, types: Record { - if (!types[ref].isEnum) model.interfaces.push(mapImportRefToInterface(ref)); + const interfaceDirect = mapImportRefToInterface(ref); + if (interfaceDirect && !types[ref].isEnum) model.interfaces.push(interfaceDirect); return reduceImportRefToImport(accumulatedImports, ref); }, []); sortImports(imports); + const selfPath = relativePathToModel(namespace, namespace); - imports.forEach(i => { - if (i.path === selfPath) return; - model.imports.push(i); + imports.forEach(_import => { + if (_import.path === selfPath) + return _import.refs.forEach(ref => { + if (model.interfaces.some(i => i.ref === ref)) return; + + const interfaceIndirect = mapImportRefToInterface(ref); + if (interfaceIndirect) model.interfaces.push(interfaceIndirect); + }); + + model.imports.push(_import); }); - model.interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); + sortInterfaces(model.interfaces); return model; }; } +function sortInterfaces(interfaces: Interface[]) { + interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); +} + export function createImportRefToInterfaceMapper(solution: string, types: Record) { const simplifyType = createTypeSimplifier(solution); return (ref: string) => { const typeDef = types[ref]; + if (!typeDef) return; + const identifier = (typeDef.genericArguments ?? []).reduce( (acc, t, i) => acc.replace(`T${i}`, t), simplifyType(ref), ); const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; - const _interface = new Interface({ identifier, base }); + const _interface = new Interface({ identifier, base, ref }); typeDef.properties?.forEach(({ name, typeSimple }) => { name = strings.camelize(name); From a8c1a49148759444bb7c92cdcc920b2e0b608c1a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 11:35:11 +0300 Subject: [PATCH 74/95] feat: create enums and enum options with schematics --- .../__name@kebab__.ts.template | 8 +++++ .../schematics/src/commands/api/index.ts | 32 +++++++++++++++++-- .../schematics/src/enums/exception.ts | 1 + .../packages/schematics/src/utils/enum.ts | 31 ++++++++++++++++++ .../packages/schematics/src/utils/index.ts | 1 + 5 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 npm/ng-packs/packages/schematics/src/utils/enum.ts diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template index e69de29bb2d..795ec2bbf68 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-enum/shared/enums/__namespace@dir__/__name@kebab__.ts.template @@ -0,0 +1,8 @@ +import { mapEnumToOptions } from '@abp/ng.core'; + +export enum <%= name %> {<% + for (let member of members) { %> + <%= member.key %> = <%= member.value %>,<% } %> +} + +export const <%= camel(name) %>Options = mapEnumToOptions(<%= name %>); diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index f18ee5985d3..d6c01373e01 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,7 +1,7 @@ import { normalize, strings } from '@angular-devkit/core'; import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefsToModelMapper, interpolate, resolveProject, serializeParameters } from '../../utils'; +import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefsToModelMapper, createImportRefToEnumMapper, getEnumNamesFromImports, interpolate, resolveProject, serializeParameters } from '../../utils'; import * as cases from '../../utils/text'; import type { Schema as GenerateProxySchema } from './schema'; @@ -45,20 +45,46 @@ export default function(params: GenerateProxySchema) { ); const mapImportRefsToModel = createImportRefsToModelMapper(solution, types); + const modelImports: Record = {}; const createModelFiles = chain( Object.values(serviceImports).map(refs => { + const model = mapImportRefsToModel(refs); + model.imports.forEach(({refs, path}) => refs.forEach(ref => { + if (path === '@abp/ng.core') return; + if (!modelImports[path]) return (modelImports[path] = [ref]); + modelImports[path] = [...new Set([...modelImports[path], ref])]; + })); + return applyWithOverwrite(url('./files-model'), [ applyTemplates({ ...cases, - ...mapImportRefsToModel(refs), + ...model, + }), + move(normalize(targetPath)), + ]); + }), + ); + + const mapImportRefToEnum = createImportRefToEnumMapper(solution, types); + const enumRefs = [...new Set([ + ...getEnumNamesFromImports(serviceImports), + ...getEnumNamesFromImports(modelImports), + ])]; + + const createEnumFiles = chain( + enumRefs.map(ref => { + return applyWithOverwrite(url('./files-enum'), [ + applyTemplates({ + ...cases, + ...mapImportRefToEnum(ref), }), move(normalize(targetPath)), ]); }), ); - return branchAndMerge(chain([createServiceFiles, createModelFiles])); + return branchAndMerge(chain([createServiceFiles, createModelFiles, createEnumFiles])); }, ]); } diff --git a/npm/ng-packs/packages/schematics/src/enums/exception.ts b/npm/ng-packs/packages/schematics/src/enums/exception.ts index 70d74a832f5..b1402daf5c9 100644 --- a/npm/ng-packs/packages/schematics/src/enums/exception.ts +++ b/npm/ng-packs/packages/schematics/src/enums/exception.ts @@ -5,6 +5,7 @@ export const enum Exception { NoApi = '[API Not Available] Please double-check the URL in the source project environment and make sure your application is up and running.', NoApiDefinition = '[API Definition Not Found] There is no valid API definition file at "{0}".', NoProject = '[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.', + NoTypeDefinition = '[Type Definition Not Found] There is no type definition for "{0}".', NoWorkspace = '[Workspace Not Found] Make sure you are running schematics at the root directory of your workspace and it has an angular.json file.', NoEnvironment = '[Environment Not Found] An environment file cannot be located in "{0}" project.', NoApiUrl = '[API URL Not Found] Cannot resolve API URL for "{1}" module from "{0}" project.', diff --git a/npm/ng-packs/packages/schematics/src/utils/enum.ts b/npm/ng-packs/packages/schematics/src/utils/enum.ts new file mode 100644 index 00000000000..d58ed23a368 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/utils/enum.ts @@ -0,0 +1,31 @@ +import { SchematicsException } from '@angular-devkit/schematics'; +import { Exception } from '../enums'; +import { Type } from '../models'; +import { interpolate } from './common'; +import { parseNamespace } from './namespace'; + +export function getEnumNamesFromImports(serviceImports: Record) { + return Object.keys(serviceImports) + .filter(path => path.includes('/enums/')) + .reduce((acc: string[], path) => { + serviceImports[path].forEach(_import => acc.push(_import)); + return acc; + }, []); +} + +export function createImportRefToEnumMapper(solution: string, types: Record) { + return (ref: string) => { + const { enumNames, enumValues } = types[ref]; + if (!enumNames || !enumValues) + throw new SchematicsException(interpolate(Exception.NoTypeDefinition, ref)); + + const namespace = parseNamespace(solution, ref); + const members = enumNames!.map((key, i) => ({ key, value: enumValues[i] })); + + return { + namespace, + name: ref.split('.').pop()!, + members, + }; + }; +} diff --git a/npm/ng-packs/packages/schematics/src/utils/index.ts b/npm/ng-packs/packages/schematics/src/utils/index.ts index fc6c973b81e..badfaa79ee5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/index.ts +++ b/npm/ng-packs/packages/schematics/src/utils/index.ts @@ -1,6 +1,7 @@ export * from './angular'; export * from './ast'; export * from './common'; +export * from './enum'; export * from './import'; export * from './model'; export * from './namespace'; From 5bfc5dcf945148e97fc2de36dcf99baded2b98c3 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 12:57:41 +0300 Subject: [PATCH 75/95] fix: add imports for referred types in model schematics --- .../packages/schematics/src/utils/model.ts | 5 +++-- .../packages/schematics/src/utils/type.ts | 15 ++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index d02ec1db046..ec454aad6fe 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -8,7 +8,7 @@ import { createTypeSimplifier, createTypesToImportsReducer, flattenUnionTypes, - removeTypeModifiers, + normalizeTypeAnnotations, } from './type'; export function createImportRefsToModelMapper(solution: string, types: Record) { @@ -37,6 +37,7 @@ export function createImportRefsToModelMapper(solution: string, types: Record removeTypeModifiers(removeGenerics(type)); + const clearTypes = (type: string) => normalizeTypeAnnotations(removeGenerics(type)); const baseTypes = baseType ? [baseType] : []; const propTypes = (properties ?? []).map(({ type }) => type); diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 74e116c7469..6157275fc2a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -24,7 +24,7 @@ export function createTypeParser(replacerFn = (t: string) => t) { return (originalType: string) => flattenUnionTypes([], originalType) .map(type => { - type = removeTypeModifiers(type); + type = removeTypeModifiers(normalizeTypeAnnotations(type)); type = type.replace( /System\.([0-9A-Za-z]+)/g, (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), @@ -45,11 +45,15 @@ export function flattenUnionTypes(types: string[], type: string) { return types; } -export function removeTypeModifiers(type: string) { - type = type.startsWith('[') ? type.slice(1, -1) + '[]' : type; +export function normalizeTypeAnnotations(type: string) { + type = type.replace(/\[(.+)+\]/g, '$1[]'); return type.replace(/\?/g, ''); } +export function removeTypeModifiers(type: string) { + return type.replace(/\[\]/g, ''); +} + export function createTypesToImportsReducer(solution: string, namespace: string) { const mapTypeToImport = createTypeToImportMapper(solution, namespace); @@ -75,13 +79,14 @@ export function createTypesToImportsReducer(solution: string, namespace: string) export function createTypeToImportMapper(solution: string, namespace: string) { const adaptType = createTypeAdapter(solution); + const simplifyType = createTypeSimplifier(solution); return (type: string, isEnum: boolean) => { if (!type || type.startsWith('System')) return; const modelNamespace = parseNamespace(solution, type); - const refs = [type]; - const specifiers = [adaptType(type.split('<')[0])]; + const refs = [removeTypeModifiers(type)]; + const specifiers = [adaptType(simplifyType(type).split('<')[0])]; const path = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/.test(type) ? '@abp/ng.core' : isEnum From a3108f86aba0521c9a2f9670135b32cd7b119e8a Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 15:08:11 +0300 Subject: [PATCH 76/95] refactor: move generation rules to separate functions --- .../schematics/src/commands/api/index.ts | 189 ++++++++++++------ .../schematics/src/commands/proxy/index.ts | 23 ++- .../packages/schematics/src/models/service.ts | 10 + .../packages/schematics/src/utils/enum.ts | 10 +- .../packages/schematics/src/utils/model.ts | 22 +- .../packages/schematics/src/utils/service.ts | 27 +-- .../packages/schematics/src/utils/type.ts | 26 +-- .../schematics/src/utils/workspace.ts | 8 +- 8 files changed, 207 insertions(+), 108 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index d6c01373e01..bf2922dc25c 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -1,9 +1,33 @@ import { normalize, strings } from '@angular-devkit/core'; -import { applyTemplates, branchAndMerge, chain, move, SchematicContext, SchematicsException, Tree, url } from '@angular-devkit/schematics'; +import { + applyTemplates, + branchAndMerge, + chain, + move, + Rule, + SchematicContext, + SchematicsException, + Tree, + url, +} from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, createImportRefsToModelMapper, createImportRefToEnumMapper, getEnumNamesFromImports, interpolate, resolveProject, serializeParameters } from '../../utils'; +import { ServiceGeneratorParams } from '../../models'; +import { + applyWithOverwrite, + buildDefaultPath, + createApiDefinitionReader, + createControllerToServiceMapper, + createImportRefsToModelMapper, + createImportRefToEnumMapper, + EnumGeneratorParams, + getEnumNamesFromImports, + interpolate, + ModelGeneratorParams, + resolveProject, + serializeParameters, +} from '../../utils'; import * as cases from '../../utils/text'; -import type { Schema as GenerateProxySchema } from './schema'; +import { Schema as GenerateProxySchema } from './schema'; export default function(params: GenerateProxySchema) { const solution = params.solution; @@ -13,79 +37,124 @@ export default function(params: GenerateProxySchema) { async (tree: Tree, _context: SchematicContext) => { const target = await resolveProject(tree, params.target!); const targetPath = buildDefaultPath(target.definition); - const readApiDefinition = createApiDefinitionReader(`${targetPath}/shared/api-definition.json`); + const readApiDefinition = createApiDefinitionReader( + `${targetPath}/shared/api-definition.json`, + ); const data = readApiDefinition(tree); const types = data.types; const definition = data.modules[moduleName]; - if (!definition) throw new SchematicsException(interpolate(Exception.InvalidModule, moduleName)); + if (!definition) + throw new SchematicsException(interpolate(Exception.InvalidModule, moduleName)); - const mapControllerToService = createControllerToServiceMapper(solution, types, definition.remoteServiceName); + const apiName = definition.remoteServiceName; const controllers = Object.values(definition.controllers || {}); const serviceImports: Record = {}; + const generateServices = createServiceGenerator({ + targetPath, + solution, + types, + apiName, + controllers, + serviceImports, + }); - const createServiceFiles = chain( - controllers.map(controller => { - const service = mapControllerToService(controller); - service.imports.forEach(({refs, path}) => refs.forEach(ref => { - if (path === '@abp/ng.core') return; - if (!serviceImports[path]) return (serviceImports[path] = [ref]); - serviceImports[path] = [...new Set([...serviceImports[path], ref])]; - })); + const modelImports: Record = {}; + const generateModels = createModelGenerator({ + targetPath, + solution, + types, + serviceImports, + modelImports, + }); - return applyWithOverwrite(url('./files-service'), [ - applyTemplates({ - ...cases, - serializeParameters, - ...service, - }), - move(normalize(targetPath)), - ]); - } - ), - ); + const generateEnums = createEnumGenerator({ + targetPath, + solution, + types, + serviceImports, + modelImports, + }); - const mapImportRefsToModel = createImportRefsToModelMapper(solution, types); - const modelImports: Record = {}; + return branchAndMerge(chain([generateServices, generateModels, generateEnums])); + }, + ]); +} - const createModelFiles = chain( - Object.values(serviceImports).map(refs => { - const model = mapImportRefsToModel(refs); - model.imports.forEach(({refs, path}) => refs.forEach(ref => { - if (path === '@abp/ng.core') return; - if (!modelImports[path]) return (modelImports[path] = [ref]); - modelImports[path] = [...new Set([...modelImports[path], ref])]; - })); +function createEnumGenerator(params: EnumGeneratorParams) { + const { targetPath, serviceImports, modelImports } = params; + const mapImportRefToEnum = createImportRefToEnumMapper(params); + const enumRefs = [ + ...new Set([ + ...getEnumNamesFromImports(serviceImports), + ...getEnumNamesFromImports(modelImports), + ]), + ]; - return applyWithOverwrite(url('./files-model'), [ - applyTemplates({ - ...cases, - ...model, - }), - move(normalize(targetPath)), - ]); + return chain( + enumRefs.map(ref => { + return applyWithOverwrite(url('./files-enum'), [ + applyTemplates({ + ...cases, + ...mapImportRefToEnum(ref), }), - ); + move(normalize(targetPath)), + ]); + }), + ); +} - const mapImportRefToEnum = createImportRefToEnumMapper(solution, types); - const enumRefs = [...new Set([ - ...getEnumNamesFromImports(serviceImports), - ...getEnumNamesFromImports(modelImports), - ])]; +function createModelGenerator(params: ModelGeneratorParams) { + const { targetPath, serviceImports, modelImports } = params; + const mapImportRefsToModel = createImportRefsToModelMapper(params); - const createEnumFiles = chain( - enumRefs.map(ref => { - return applyWithOverwrite(url('./files-enum'), [ - applyTemplates({ - ...cases, - ...mapImportRefToEnum(ref), - }), - move(normalize(targetPath)), - ]); + return chain( + Object.values(serviceImports).reduce((rules: Rule[], refs) => { + const model = mapImportRefsToModel(refs); + model.imports.forEach(({ refs, path }) => + refs.forEach(ref => { + if (path === '@abp/ng.core') return; + if (!modelImports[path]) return (modelImports[path] = [ref]); + modelImports[path] = [...new Set([...modelImports[path], ref])]; }), ); - return branchAndMerge(chain([createServiceFiles, createModelFiles, createEnumFiles])); - }, - ]); + const rule = applyWithOverwrite(url('./files-model'), [ + applyTemplates({ + ...cases, + ...model, + }), + move(normalize(targetPath)), + ]); + rules.push(rule); + + return rules; + }, []), + ); } +function createServiceGenerator(params: ServiceGeneratorParams) { + const { targetPath, controllers, serviceImports } = params; + const mapControllerToService = createControllerToServiceMapper(params); + + return chain( + controllers.map(controller => { + const service = mapControllerToService(controller); + service.imports.forEach(({ refs, path }) => + refs.forEach(ref => { + if (path === '@abp/ng.core') return; + if (!serviceImports[path]) return (serviceImports[path] = [ref]); + serviceImports[path] = [...new Set([...serviceImports[path], ref])]; + }), + ); + + return applyWithOverwrite(url('./files-service'), [ + applyTemplates({ + ...cases, + serializeParameters, + ...service, + }), + move(normalize(targetPath)), + ]); + }), + ); +} diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index 24fcb91d24c..d597f720cdf 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -1,9 +1,21 @@ import { strings } from '@angular-devkit/core'; -import { branchAndMerge, chain, schematic, SchematicContext, Tree } from '@angular-devkit/schematics'; +import { + branchAndMerge, + chain, + schematic, + SchematicContext, + Tree, +} from '@angular-devkit/schematics'; import { API_DEFINITION_ENDPOINT } from '../../constants'; import { ApiDefinition } from '../../models'; -import { buildDefaultPath, createApiDefinitionSaver, getApiDefinition, getSourceUrl, resolveProject } from '../../utils'; -import type { Schema as GenerateProxySchema } from './schema'; +import { + buildDefaultPath, + createApiDefinitionSaver, + getApiDefinition, + getSourceUrl, + resolveProject, +} from '../../utils'; +import { Schema as GenerateProxySchema } from './schema'; export default function(params: GenerateProxySchema) { const moduleName = strings.camelize(params.module || 'app'); @@ -16,7 +28,10 @@ export default function(params: GenerateProxySchema) { const targetPath = buildDefaultPath(target.definition); const data: ApiDefinition = await getApiDefinition(sourceUrl + API_DEFINITION_ENDPOINT); - const saveApiDefinition = createApiDefinitionSaver(data, `${targetPath}/shared/api-definition.json`) + const saveApiDefinition = createApiDefinitionSaver( + data, + `${targetPath}/shared/api-definition.json`, + ); const createApi = schematic('api', params); return branchAndMerge(chain([saveApiDefinition, createApi])); diff --git a/npm/ng-packs/packages/schematics/src/models/service.ts b/npm/ng-packs/packages/schematics/src/models/service.ts index c9ef05eca47..98a18bddd88 100644 --- a/npm/ng-packs/packages/schematics/src/models/service.ts +++ b/npm/ng-packs/packages/schematics/src/models/service.ts @@ -1,7 +1,17 @@ +import { Controller, Type } from './api-definition'; import { Import } from './import'; import { Method } from './method'; import { Omissible } from './util'; +export interface ServiceGeneratorParams { + targetPath: string; + solution: string; + types: Record; + apiName: string; + controllers: Controller[]; + serviceImports: Record; +} + export class Service { apiName: string; imports: Import[] = []; diff --git a/npm/ng-packs/packages/schematics/src/utils/enum.ts b/npm/ng-packs/packages/schematics/src/utils/enum.ts index d58ed23a368..3b6de0134a3 100644 --- a/npm/ng-packs/packages/schematics/src/utils/enum.ts +++ b/npm/ng-packs/packages/schematics/src/utils/enum.ts @@ -4,6 +4,14 @@ import { Type } from '../models'; import { interpolate } from './common'; import { parseNamespace } from './namespace'; +export interface EnumGeneratorParams { + targetPath: string; + solution: string; + types: Record; + serviceImports: Record; + modelImports: Record; +} + export function getEnumNamesFromImports(serviceImports: Record) { return Object.keys(serviceImports) .filter(path => path.includes('/enums/')) @@ -13,7 +21,7 @@ export function getEnumNamesFromImports(serviceImports: Record }, []); } -export function createImportRefToEnumMapper(solution: string, types: Record) { +export function createImportRefToEnumMapper({ solution, types }: EnumGeneratorParams) { return (ref: string) => { const { enumNames, enumValues } = types[ref]; if (!enumNames || !enumValues) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index ec454aad6fe..89de6e3888f 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -9,10 +9,19 @@ import { createTypesToImportsReducer, flattenUnionTypes, normalizeTypeAnnotations, + removeTypeModifiers, } from './type'; -export function createImportRefsToModelMapper(solution: string, types: Record) { - const mapImportRefToInterface = createImportRefToInterfaceMapper(solution, types); +export interface ModelGeneratorParams { + targetPath: string; + solution: string; + types: Record; + serviceImports: Record; + modelImports: Record; +} + +export function createImportRefsToModelMapper({ solution, types }: ModelGeneratorParams) { + const mapImportRefToInterface = createImportRefToInterfaceMapper(types); const createImportRefToImportReducer = createImportRefToImportReducerCreator(solution, types); return (importRefs: string[]) => { @@ -53,8 +62,9 @@ function sortInterfaces(interfaces: Interface[]) { interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); } -export function createImportRefToInterfaceMapper(solution: string, types: Record) { - const simplifyType = createTypeSimplifier(solution); +export function createImportRefToInterfaceMapper(types: Record) { + const simplifyType = createTypeSimplifier(); + const getIdentifier = (type: string) => removeTypeModifiers(simplifyType(type)); return (ref: string) => { const typeDef = types[ref]; @@ -62,10 +72,10 @@ export function createImportRefToInterfaceMapper(solution: string, types: Record const identifier = (typeDef.genericArguments ?? []).reduce( (acc, t, i) => acc.replace(`T${i}`, t), - simplifyType(ref), + getIdentifier(ref), ); - const base = typeDef.baseType ? simplifyType(typeDef.baseType) : null; + const base = typeDef.baseType ? getIdentifier(typeDef.baseType) : null; const _interface = new Interface({ identifier, base, ref }); typeDef.properties?.forEach(({ name, typeSimple }) => { diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 57d8c97e0c2..085b57c1720 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -6,6 +6,7 @@ import { Method, Property, Service, + ServiceGeneratorParams, Signature, Type, TypeWithEnum, @@ -19,12 +20,12 @@ export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); } -export function createControllerToServiceMapper( - solution: string, - types: Record, - apiName: string, -) { - const mapActionToMethod = createActionToMethodMapper(solution); +export function createControllerToServiceMapper({ + solution, + types, + apiName, +}: ServiceGeneratorParams) { + const mapActionToMethod = createActionToMethodMapper(); return (controller: Controller) => { const name = controller.controllerName; @@ -44,9 +45,9 @@ function sortMethods(methods: Method[]) { methods.sort((a, b) => (a.signature.name > b.signature.name ? 1 : -1)); } -export function createActionToMethodMapper(solution: string) { - const mapActionToBody = createActionToBodyMapper(solution); - const mapActionToSignature = createActionToSignatureMapper(solution); +export function createActionToMethodMapper() { + const mapActionToBody = createActionToBodyMapper(); + const mapActionToSignature = createActionToSignatureMapper(); return (action: Action) => { const body = mapActionToBody(action); @@ -55,8 +56,8 @@ export function createActionToMethodMapper(solution: string) { }; } -export function createActionToBodyMapper(solution: string) { - const adaptType = createTypeAdapter(solution); +export function createActionToBodyMapper() { + const adaptType = createTypeAdapter(); return ({ httpMethod, parameters, returnValue, url }: Action) => { const responseType = adaptType(returnValue.typeSimple); @@ -68,8 +69,8 @@ export function createActionToBodyMapper(solution: string) { }; } -export function createActionToSignatureMapper(solution: string) { - const adaptType = createTypeAdapter(solution); +export function createActionToSignatureMapper() { + const adaptType = createTypeAdapter(); return (action: Action) => { const signature = new Signature({ name: getMethodNameFromAction(action) }); diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 6157275fc2a..3a48fd9018a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -6,25 +6,15 @@ import { parseNamespace } from './namespace'; import { relativePathToEnum, relativePathToModel } from './path'; import { parseGenerics } from './tree'; -export function createTypeSimplifier(solution: string) { - const solutionRegex = new RegExp(solution.replace(/\./g, `\.`) + `\.`); - const voloRegex = /^Volo\.(Abp\.?)(Application|ObjectExtending\.?)/; - - return createTypeParser( - type => - type - .replace(voloRegex, '') - .replace(solutionRegex, '') - .split('.') - .pop()!, - ); +export function createTypeSimplifier() { + return createTypeParser(type => type.split('.').pop()!); } export function createTypeParser(replacerFn = (t: string) => t) { return (originalType: string) => flattenUnionTypes([], originalType) .map(type => { - type = removeTypeModifiers(normalizeTypeAnnotations(type)); + type = normalizeTypeAnnotations(type); type = type.replace( /System\.([0-9A-Za-z]+)/g, (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), @@ -78,15 +68,15 @@ export function createTypesToImportsReducer(solution: string, namespace: string) } export function createTypeToImportMapper(solution: string, namespace: string) { - const adaptType = createTypeAdapter(solution); - const simplifyType = createTypeSimplifier(solution); + const adaptType = createTypeAdapter(); + const simplifyType = createTypeSimplifier(); return (type: string, isEnum: boolean) => { if (!type || type.startsWith('System')) return; const modelNamespace = parseNamespace(solution, type); const refs = [removeTypeModifiers(type)]; - const specifiers = [adaptType(simplifyType(type).split('<')[0])]; + const specifiers = [adaptType(simplifyType(refs[0]).split('<')[0])]; const path = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/.test(type) ? '@abp/ng.core' : isEnum @@ -97,7 +87,7 @@ export function createTypeToImportMapper(solution: string, namespace: string) { }; } -export function createTypeAdapter(solution: string) { - const simplifyType = createTypeSimplifier(solution); +export function createTypeAdapter() { + const simplifyType = createTypeSimplifier(); return (type: string) => parseGenerics(type, node => simplifyType(node.data)).toString(); } diff --git a/npm/ng-packs/packages/schematics/src/utils/workspace.ts b/npm/ng-packs/packages/schematics/src/utils/workspace.ts index b05a7549e83..56c0411493f 100644 --- a/npm/ng-packs/packages/schematics/src/utils/workspace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/workspace.ts @@ -1,6 +1,5 @@ import { experimental, strings, workspaces } from '@angular-devkit/core'; -import { SchematicsException } from '@angular-devkit/schematics'; -import type { Tree } from '@angular-devkit/schematics'; +import { SchematicsException, Tree } from '@angular-devkit/schematics'; import { Exception } from '../enums'; import { Project } from '../models'; import { getWorkspace, ProjectType } from './angular'; @@ -35,10 +34,7 @@ export function readWorkspaceSchema(tree: Tree) { return workspaceSchema; } -export async function resolveProject( - tree: Tree, - name: string, -): Promise { +export async function resolveProject(tree: Tree, name: string): Promise { name = name || readWorkspaceSchema(tree).defaultProject!; const workspace = await getWorkspace(tree); let definition: Project['definition'] | undefined; From d4044c657220ca1dd5011d0e74868ed11040771c Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 16:23:22 +0300 Subject: [PATCH 77/95] feat: generate referred models recursively in schematics --- .../schematics/src/commands/api/index.ts | 21 ++++++++++++---- .../packages/schematics/src/models/model.ts | 1 + .../packages/schematics/src/utils/enum.ts | 6 ++++- .../packages/schematics/src/utils/model.ts | 24 ++++++++++++++----- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index bf2922dc25c..1d19c8e7777 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -11,7 +11,7 @@ import { url, } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { ServiceGeneratorParams } from '../../models'; +import { Model, ServiceGeneratorParams } from '../../models'; import { applyWithOverwrite, buildDefaultPath, @@ -20,6 +20,7 @@ import { createImportRefsToModelMapper, createImportRefToEnumMapper, EnumGeneratorParams, + filterModelRefsToGenerate, getEnumNamesFromImports, interpolate, ModelGeneratorParams, @@ -107,8 +108,12 @@ function createModelGenerator(params: ModelGeneratorParams) { const { targetPath, serviceImports, modelImports } = params; const mapImportRefsToModel = createImportRefsToModelMapper(params); - return chain( - Object.values(serviceImports).reduce((rules: Rule[], refs) => { + return chain(reduceImportRefsToRules(Object.values(serviceImports))); + + function reduceImportRefsToRules(importRefs: string[][], models: Model[] = []): Rule[] { + if (!importRefs.length) return []; + + const accumulatedRules = importRefs.reduce((rules: Rule[], refs) => { const model = mapImportRefsToModel(refs); model.imports.forEach(({ refs, path }) => refs.forEach(ref => { @@ -117,6 +122,7 @@ function createModelGenerator(params: ModelGeneratorParams) { modelImports[path] = [...new Set([...modelImports[path], ref])]; }), ); + models.push(model); const rule = applyWithOverwrite(url('./files-model'), [ applyTemplates({ @@ -128,8 +134,13 @@ function createModelGenerator(params: ModelGeneratorParams) { rules.push(rule); return rules; - }, []), - ); + }, []); + + const refsToGenerate = filterModelRefsToGenerate(modelImports, models); + reduceImportRefsToRules(refsToGenerate).forEach(rule => accumulatedRules.push(rule)); + + return accumulatedRules; + } } function createServiceGenerator(params: ServiceGeneratorParams) { diff --git a/npm/ng-packs/packages/schematics/src/models/model.ts b/npm/ng-packs/packages/schematics/src/models/model.ts index 2318d6c181e..76289ef2caf 100644 --- a/npm/ng-packs/packages/schematics/src/models/model.ts +++ b/npm/ng-packs/packages/schematics/src/models/model.ts @@ -5,6 +5,7 @@ export class Model { imports: Import[] = []; interfaces: Interface[] = []; namespace: string; + path: string; constructor(options: ModelOptions) { Object.assign(this, options); diff --git a/npm/ng-packs/packages/schematics/src/utils/enum.ts b/npm/ng-packs/packages/schematics/src/utils/enum.ts index 3b6de0134a3..818a1a089b8 100644 --- a/npm/ng-packs/packages/schematics/src/utils/enum.ts +++ b/npm/ng-packs/packages/schematics/src/utils/enum.ts @@ -12,9 +12,13 @@ export interface EnumGeneratorParams { modelImports: Record; } +export function isEnumImport(path: string) { + return path.includes('/enums/'); +} + export function getEnumNamesFromImports(serviceImports: Record) { return Object.keys(serviceImports) - .filter(path => path.includes('/enums/')) + .filter(isEnumImport) .reduce((acc: string[], path) => { serviceImports[path].forEach(_import => acc.push(_import)); return acc; diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 89de6e3888f..b46cf3a0172 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,6 +1,6 @@ import { strings } from '@angular-devkit/core'; import { Import, Interface, Model, Property, Type, TypeWithEnum } from '../models'; -import { sortImports } from './import'; +import { isEnumImport } from './enum'; import { parseNamespace } from './namespace'; import { relativePathToModel } from './path'; import { parseGenerics } from './tree'; @@ -26,7 +26,8 @@ export function createImportRefsToModelMapper({ solution, types }: ModelGenerato return (importRefs: string[]) => { const namespace = parseNamespace(solution, importRefs[0]); - const model = new Model({ namespace }); + const path = relativePathToModel(namespace, namespace); + const model = new Model({ namespace, path }); const reduceImportRefToImport = createImportRefToImportReducer(namespace); const imports = importRefs.reduce((accumulatedImports, ref) => { @@ -36,11 +37,8 @@ export function createImportRefsToModelMapper({ solution, types }: ModelGenerato return reduceImportRefToImport(accumulatedImports, ref); }, []); - sortImports(imports); - - const selfPath = relativePathToModel(namespace, namespace); imports.forEach(_import => { - if (_import.path === selfPath) + if (_import.path === model.path) return _import.refs.forEach(ref => { if (model.interfaces.some(i => i.ref === ref)) return; @@ -133,3 +131,17 @@ export function createGenericRemover(genericArguments: string[] | null) { .join(','); }); } + +export function filterModelRefsToGenerate( + modelImports: Record, + modelsCreated: Model[], +) { + const created = modelsCreated.map(m => m.path); + + return Object.entries(modelImports).reduce((acc: string[][], [path, refs]) => { + if (isEnumImport(path)) return acc; + if (created.includes(path)) return acc; + acc.push(refs); + return acc; + }, []); +} From adeab8a8131f70713b8bb3b0571a62b9d60e4693 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 17:01:48 +0300 Subject: [PATCH 78/95] feat: generate interfaces recursively in model schematics --- .../packages/schematics/src/utils/model.ts | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index b46cf3a0172..7ba44465c3c 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -28,18 +28,11 @@ export function createImportRefsToModelMapper({ solution, types }: ModelGenerato const namespace = parseNamespace(solution, importRefs[0]); const path = relativePathToModel(namespace, namespace); const model = new Model({ namespace, path }); + const imports: Import[] = []; - const reduceImportRefToImport = createImportRefToImportReducer(namespace); - const imports = importRefs.reduce((accumulatedImports, ref) => { - const interfaceDirect = mapImportRefToInterface(ref); - if (interfaceDirect && !types[ref].isEnum) model.interfaces.push(interfaceDirect); - - return reduceImportRefToImport(accumulatedImports, ref); - }, []); - - imports.forEach(_import => { - if (_import.path === model.path) - return _import.refs.forEach(ref => { + const reduceImportRefToImport = createImportRefToImportReducer(namespace, _import => { + if (_import.path === model.path) { + _import.refs.forEach(ref => { if (model.interfaces.some(i => i.ref === ref)) return; const interfaceIndirect = mapImportRefToInterface(ref); @@ -47,9 +40,21 @@ export function createImportRefsToModelMapper({ solution, types }: ModelGenerato reduceImportRefToImport(imports, ref); }); - model.imports.push(_import); + return false; + } + + return true; }); + importRefs + .reduce((accumulatedImports, ref) => { + const interfaceDirect = mapImportRefToInterface(ref); + if (interfaceDirect && !types[ref].isEnum) model.interfaces.push(interfaceDirect); + + return reduceImportRefToImport(accumulatedImports, ref); + }, imports) + .forEach(_import => model.imports.push(_import)); + sortInterfaces(model.interfaces); return model; @@ -92,7 +97,7 @@ export function createImportRefToImportReducerCreator( solution: string, types: Record, ) { - return (namespace: string) => { + return (namespace: string, filterFn: (imports: Import) => boolean) => { const reduceTypesToImport = createTypesToImportsReducer(solution, namespace); return (imports: Import[], importRef: string) => @@ -105,7 +110,7 @@ export function createImportRefToImportReducerCreator( return acc; }, []), - ); + ).filter(filterFn); }; } From 4a6b9b409fdba6b04df3d0f7e4f9642841da9912 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 17:30:30 +0300 Subject: [PATCH 79/95] feat: map System.Net.HttpStatusCode to number in schematics --- npm/ng-packs/packages/schematics/src/constants/system-types.ts | 1 + npm/ng-packs/packages/schematics/src/utils/type.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/constants/system-types.ts b/npm/ng-packs/packages/schematics/src/constants/system-types.ts index 7adc16933d3..75497a424ab 100644 --- a/npm/ng-packs/packages/schematics/src/constants/system-types.ts +++ b/npm/ng-packs/packages/schematics/src/constants/system-types.ts @@ -10,6 +10,7 @@ export const SYSTEM_TYPES = new Map([ ['Int16', 'number'], ['Int32', 'number'], ['Int64', 'number'], + ['Net.HttpStatusCode', 'number'], ['Object', 'object'], ['Sbyte', 'number'], ['Single', 'number'], diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index 3a48fd9018a..ebc669ff7f1 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -16,7 +16,7 @@ export function createTypeParser(replacerFn = (t: string) => t) { .map(type => { type = normalizeTypeAnnotations(type); type = type.replace( - /System\.([0-9A-Za-z]+)/g, + /System\.([0-9A-Za-z.]+)/g, (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), ); From 2fc7161349ae7697710ff5e233d5d1ead5e8a739 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 18:46:38 +0300 Subject: [PATCH 80/95] fix: add comma after params in service schematics --- .../__namespace@dir__/__name@kebab__.service.ts.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template index 6d1aa25d91a..ed2f8296c76 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template +++ b/npm/ng-packs/packages/schematics/src/commands/api/files-service/shared/services/__namespace@dir__/__name@kebab__.service.ts.template @@ -13,7 +13,7 @@ export class <%= name %>Service { method: '<%= body.method %>', url: `/<%= body.url %>`,<% if (body.params.length) { %> - params: { <%= body.params.join(', ') %> }<% } + params: { <%= body.params.join(', ') %> },<% } if (body.body) { %> body: <%= body.body %>,<% } %> }, From 1dc58c5a6528df1a6978a59cbbe1a2eb0c9714ac Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Thu, 20 Aug 2020 18:58:11 +0300 Subject: [PATCH 81/95] refactor: unify reduction of refs to imports & interfaces --- .../packages/schematics/src/utils/model.ts | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 7ba44465c3c..63737857798 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -31,33 +31,27 @@ export function createImportRefsToModelMapper({ solution, types }: ModelGenerato const imports: Import[] = []; const reduceImportRefToImport = createImportRefToImportReducer(namespace, _import => { - if (_import.path === model.path) { - _import.refs.forEach(ref => { - if (model.interfaces.some(i => i.ref === ref)) return; + if (_import.path !== model.path) return true; - const interfaceIndirect = mapImportRefToInterface(ref); - if (interfaceIndirect) model.interfaces.push(interfaceIndirect); - reduceImportRefToImport(imports, ref); - }); - - return false; - } - - return true; + _import.refs.reduce(reduceImportRefsToImportsAndInterfaces, imports); + return false; }); importRefs - .reduce((accumulatedImports, ref) => { - const interfaceDirect = mapImportRefToInterface(ref); - if (interfaceDirect && !types[ref].isEnum) model.interfaces.push(interfaceDirect); - - return reduceImportRefToImport(accumulatedImports, ref); - }, imports) + .reduce(reduceImportRefsToImportsAndInterfaces, imports) .forEach(_import => model.imports.push(_import)); sortInterfaces(model.interfaces); return model; + + function reduceImportRefsToImportsAndInterfaces(accumulatedImports: Import[], ref: string) { + if (model.interfaces.some(i => i.ref === ref)) return accumulatedImports; + + const _interface = mapImportRefToInterface(ref); + if (_interface && !types[ref].isEnum) model.interfaces.push(_interface); + return reduceImportRefToImport(accumulatedImports, ref); + } }; } From 12c20fd7c31f502cbab38632c434fd52ebba4835 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 05:50:34 +0300 Subject: [PATCH 82/95] feat: add volo regex as constant to schematics --- npm/ng-packs/packages/schematics/src/constants/index.ts | 1 + npm/ng-packs/packages/schematics/src/constants/volo.ts | 1 + 2 files changed, 2 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/src/constants/volo.ts diff --git a/npm/ng-packs/packages/schematics/src/constants/index.ts b/npm/ng-packs/packages/schematics/src/constants/index.ts index 533cbf4f90b..01053d93337 100644 --- a/npm/ng-packs/packages/schematics/src/constants/index.ts +++ b/npm/ng-packs/packages/schematics/src/constants/index.ts @@ -1,2 +1,3 @@ export * from './api'; export * from './system-types'; +export * from './volo'; diff --git a/npm/ng-packs/packages/schematics/src/constants/volo.ts b/npm/ng-packs/packages/schematics/src/constants/volo.ts new file mode 100644 index 00000000000..00fde72c790 --- /dev/null +++ b/npm/ng-packs/packages/schematics/src/constants/volo.ts @@ -0,0 +1 @@ +export const VOLO_REGEX = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/; From 654cdb6ea8c1ac8b8bc299428c9d1b97c9344f30 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 05:51:08 +0300 Subject: [PATCH 83/95] fix: improve recursive model lookup in schematics --- .../schematics/src/commands/api/index.ts | 52 ++--- .../packages/schematics/src/models/model.ts | 4 +- .../packages/schematics/src/utils/model.ts | 193 +++++++++--------- .../schematics/src/utils/namespace.ts | 2 +- .../packages/schematics/src/utils/service.ts | 18 +- .../packages/schematics/src/utils/type.ts | 35 ++-- 6 files changed, 152 insertions(+), 152 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 1d19c8e7777..688430f35fe 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -4,23 +4,21 @@ import { branchAndMerge, chain, move, - Rule, SchematicContext, SchematicsException, Tree, url, } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { Model, ServiceGeneratorParams } from '../../models'; +import { ServiceGeneratorParams } from '../../models'; import { applyWithOverwrite, buildDefaultPath, createApiDefinitionReader, createControllerToServiceMapper, - createImportRefsToModelMapper, + createImportRefsToModelReducer, createImportRefToEnumMapper, EnumGeneratorParams, - filterModelRefsToGenerate, getEnumNamesFromImports, interpolate, ModelGeneratorParams, @@ -106,41 +104,29 @@ function createEnumGenerator(params: EnumGeneratorParams) { function createModelGenerator(params: ModelGeneratorParams) { const { targetPath, serviceImports, modelImports } = params; - const mapImportRefsToModel = createImportRefsToModelMapper(params); - - return chain(reduceImportRefsToRules(Object.values(serviceImports))); - - function reduceImportRefsToRules(importRefs: string[][], models: Model[] = []): Rule[] { - if (!importRefs.length) return []; - - const accumulatedRules = importRefs.reduce((rules: Rule[], refs) => { - const model = mapImportRefsToModel(refs); - model.imports.forEach(({ refs, path }) => - refs.forEach(ref => { - if (path === '@abp/ng.core') return; - if (!modelImports[path]) return (modelImports[path] = [ref]); - modelImports[path] = [...new Set([...modelImports[path], ref])]; - }), - ); - models.push(model); + const reduceImportRefsToModels = createImportRefsToModelReducer(params); + const models = Object.values(serviceImports).reduce(reduceImportRefsToModels, []); + models.forEach(({ imports }) => + imports.forEach(({ refs, path }) => + refs.forEach(ref => { + if (path === '@abp/ng.core') return; + if (!modelImports[path]) return (modelImports[path] = [ref]); + modelImports[path] = [...new Set([...modelImports[path], ref])]; + }), + ), + ); - const rule = applyWithOverwrite(url('./files-model'), [ + return chain( + models.map(model => + applyWithOverwrite(url('./files-model'), [ applyTemplates({ ...cases, ...model, }), move(normalize(targetPath)), - ]); - rules.push(rule); - - return rules; - }, []); - - const refsToGenerate = filterModelRefsToGenerate(modelImports, models); - reduceImportRefsToRules(refsToGenerate).forEach(rule => accumulatedRules.push(rule)); - - return accumulatedRules; - } + ]), + ), + ); } function createServiceGenerator(params: ServiceGeneratorParams) { diff --git a/npm/ng-packs/packages/schematics/src/models/model.ts b/npm/ng-packs/packages/schematics/src/models/model.ts index 76289ef2caf..5f389fe9688 100644 --- a/npm/ng-packs/packages/schematics/src/models/model.ts +++ b/npm/ng-packs/packages/schematics/src/models/model.ts @@ -17,6 +17,7 @@ export type ModelOptions = Omissible; export class Interface { base: string | null; identifier: string; + namespace: string; properties: Property[] = []; ref: string; @@ -32,10 +33,11 @@ export class Property { type: string; default: string = ''; optional: '' | '?' = ''; + refs: string[] = []; constructor(options: PropertyOptions) { Object.assign(this, options); } } -export type PropertyOptions = Omissible; +export type PropertyOptions = Omissible; diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 63737857798..94841c615ad 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -1,14 +1,13 @@ import { strings } from '@angular-devkit/core'; -import { Import, Interface, Model, Property, Type, TypeWithEnum } from '../models'; -import { isEnumImport } from './enum'; +import { VOLO_REGEX } from '../constants'; +import { Interface, Model, Property, Type, TypeWithEnum } from '../models'; import { parseNamespace } from './namespace'; import { relativePathToModel } from './path'; import { parseGenerics } from './tree'; import { + createTypeParser, createTypeSimplifier, createTypesToImportsReducer, - flattenUnionTypes, - normalizeTypeAnnotations, removeTypeModifiers, } from './type'; @@ -20,38 +19,69 @@ export interface ModelGeneratorParams { modelImports: Record; } -export function createImportRefsToModelMapper({ solution, types }: ModelGeneratorParams) { - const mapImportRefToInterface = createImportRefToInterfaceMapper(types); - const createImportRefToImportReducer = createImportRefToImportReducerCreator(solution, types); - - return (importRefs: string[]) => { - const namespace = parseNamespace(solution, importRefs[0]); - const path = relativePathToModel(namespace, namespace); - const model = new Model({ namespace, path }); - const imports: Import[] = []; - - const reduceImportRefToImport = createImportRefToImportReducer(namespace, _import => { - if (_import.path !== model.path) return true; - - _import.refs.reduce(reduceImportRefsToImportsAndInterfaces, imports); - return false; +export function createImportRefsToModelReducer(params: ModelGeneratorParams) { + const reduceImportRefsToInterfaces = createImportRefToInterfaceReducerCreator(params); + const createRefToImportReducer = createRefToImportReducerCreator(params); + const { solution, types } = params; + + return (models: Model[], importRefs: string[]) => { + const enums: string[] = []; + const interfaces = importRefs.reduce(reduceImportRefsToInterfaces, []); + sortInterfaces(interfaces); + + interfaces.forEach(_interface => { + if (VOLO_REGEX.test(_interface.ref)) return; + + if (types[_interface.ref]!.isEnum) { + if (!enums.includes(_interface.ref)) enums.push(_interface.ref); + return; + } + + const index = models.findIndex(m => m.namespace === _interface.namespace); + if (index > -1) { + if (models[index].interfaces.some(i => i.identifier === _interface.identifier)) return; + models[index].interfaces.push(_interface); + } else { + const { namespace } = _interface; + + models.push( + new Model({ + interfaces: [_interface], + namespace, + path: relativePathToModel(namespace, namespace), + }), + ); + } }); - importRefs - .reduce(reduceImportRefsToImportsAndInterfaces, imports) - .forEach(_import => model.imports.push(_import)); - - sortInterfaces(model.interfaces); + models.forEach(model => { + let toBeImported: TypeWithEnum[] = []; + + model.interfaces.forEach(_interface => { + const { baseType } = types[_interface.ref]; + if (baseType && parseNamespace(solution, baseType) !== model.namespace) + toBeImported.push({ + type: parseGenerics(baseType) + .toGenerics() + .join(''), + isEnum: false, + }); + + _interface.properties.forEach(prop => { + prop.refs.forEach(ref => { + if (parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: types[ref]?.isEnum }); + }); + }); + }); - return model; + if (!toBeImported.length) return; - function reduceImportRefsToImportsAndInterfaces(accumulatedImports: Import[], ref: string) { - if (model.interfaces.some(i => i.ref === ref)) return accumulatedImports; + const reduceRefToImport = createRefToImportReducer(model.namespace); + reduceRefToImport(model.imports, toBeImported); + }); - const _interface = mapImportRefToInterface(ref); - if (_interface && !types[ref].isEnum) model.interfaces.push(_interface); - return reduceImportRefToImport(accumulatedImports, ref); - } + return models; }; } @@ -59,13 +89,19 @@ function sortInterfaces(interfaces: Interface[]) { interfaces.sort((a, b) => (a.identifier > b.identifier ? 1 : -1)); } -export function createImportRefToInterfaceMapper(types: Record) { +export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorParams) { + const { solution, types } = params; + const parseType = createTypeParser(removeTypeModifiers); const simplifyType = createTypeSimplifier(); const getIdentifier = (type: string) => removeTypeModifiers(simplifyType(type)); - return (ref: string) => { + return reduceRefsToInterfaces; + + function reduceRefsToInterfaces(interfaces: Interface[], ref: string) { const typeDef = types[ref]; - if (!typeDef) return; + if (!typeDef) return interfaces; + + const namespace = parseNamespace(solution, ref); const identifier = (typeDef.genericArguments ?? []).reduce( (acc, t, i) => acc.replace(`T${i}`, t), @@ -73,74 +109,33 @@ export function createImportRefToInterfaceMapper(types: Record) { ); const base = typeDef.baseType ? getIdentifier(typeDef.baseType) : null; - const _interface = new Interface({ identifier, base, ref }); - - typeDef.properties?.forEach(({ name, typeSimple }) => { - name = strings.camelize(name); - const optional = typeSimple.endsWith('?') ? '?' : ''; - const type = simplifyType(typeSimple); - - _interface.properties.push(new Property({ name, optional, type })); + const _interface = new Interface({ identifier, base, namespace, ref }); + + typeDef.properties?.forEach(prop => { + const name = strings.camelize(prop.name); + const optional = prop.typeSimple.endsWith('?') ? '?' : ''; + const type = simplifyType(prop.typeSimple); + const refs = parseType(prop.type).reduce( + (acc: string[], r) => acc.concat(parseGenerics(r).toGenerics()), + [], + ); + + _interface.properties.push(new Property({ name, optional, type, refs })); }); - return _interface; - }; -} - -export function createImportRefToImportReducerCreator( - solution: string, - types: Record, -) { - return (namespace: string, filterFn: (imports: Import) => boolean) => { - const reduceTypesToImport = createTypesToImportsReducer(solution, namespace); - - return (imports: Import[], importRef: string) => - reduceTypesToImport( - imports, - mergeBaseTypeWithProperties(types[importRef]).reduce((acc: TypeWithEnum[], typeName) => { - parseGenerics(typeName) - .toGenerics() - .forEach(type => acc.push({ type, isEnum: types[type]?.isEnum })); - - return acc; - }, []), - ).filter(filterFn); - }; -} + interfaces.push(_interface); -export function mergeBaseTypeWithProperties({ baseType, genericArguments, properties }: Type) { - const removeGenerics = createGenericRemover(genericArguments); - const clearTypes = (type: string) => normalizeTypeAnnotations(removeGenerics(type)); - const baseTypes = baseType ? [baseType] : []; - const propTypes = (properties ?? []).map(({ type }) => type); - - return [...baseTypes, ...propTypes].reduce(flattenUnionTypes, []).map(clearTypes); -} - -export function createGenericRemover(genericArguments: string[] | null) { - if (!genericArguments) return (type: string) => type; - - return (type: string) => - genericArguments.includes(type) - ? '' - : type.replace(/<([^<>]+)>/, (_, match) => { - return match - .split(/,\s*/) - .filter((t: string) => !genericArguments.includes(t)) - .join(','); - }); + return _interface.properties + .reduce((refs, prop) => { + prop.refs.forEach(type => !types[type]?.isEnum && refs.push(type)); + return refs; + }, []) + .concat(base || []) + .reduce(reduceRefsToInterfaces, interfaces); + } } -export function filterModelRefsToGenerate( - modelImports: Record, - modelsCreated: Model[], -) { - const created = modelsCreated.map(m => m.path); - - return Object.entries(modelImports).reduce((acc: string[][], [path, refs]) => { - if (isEnumImport(path)) return acc; - if (created.includes(path)) return acc; - acc.push(refs); - return acc; - }, []); +export function createRefToImportReducerCreator(params: ModelGeneratorParams) { + const { solution } = params; + return (namespace: string) => createTypesToImportsReducer(solution, namespace); } diff --git a/npm/ng-packs/packages/schematics/src/utils/namespace.ts b/npm/ng-packs/packages/schematics/src/utils/namespace.ts index 003198adcb0..8b7c1a8c66d 100644 --- a/npm/ng-packs/packages/schematics/src/utils/namespace.ts +++ b/npm/ng-packs/packages/schematics/src/utils/namespace.ts @@ -2,7 +2,7 @@ import { createTypeParser } from './type'; export function parseNamespace(solution: string, type: string) { const parseType = createTypeParser(); - let namespace = parseType(type) + let namespace = parseType(type)[0] .split('.') .slice(0, -1) .join('.'); diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 085b57c1720..b8a2d692b24 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -14,7 +14,12 @@ import { import { sortImports } from './import'; import { parseNamespace } from './namespace'; import { parseGenerics } from './tree'; -import { createTypeAdapter, createTypesToImportsReducer } from './type'; +import { + createTypeAdapter, + createTypeParser, + createTypesToImportsReducer, + removeTypeModifiers, +} from './type'; export function serializeParameters(parameters: Property[]) { return parameters.map(p => p.name + p.optional + ': ' + p.type + p.default, '').join(', '); @@ -97,14 +102,19 @@ function createActionToImportsReducer( namespace: string, ) { const mapTypesToImports = createTypesToImportsReducer(solution, namespace); + const parseType = createTypeParser(removeTypeModifiers); return (imports: Import[], { parametersOnMethod, returnValue }: Action) => mapTypesToImports( imports, [returnValue, ...parametersOnMethod].reduce((acc: TypeWithEnum[], param) => { - parseGenerics(param.type) - .toGenerics() - .forEach(type => acc.push({ type, isEnum: types[type]?.isEnum })); + parseType(param.type).forEach(paramType => + parseGenerics(paramType) + .toGenerics() + .forEach(type => { + if (types[type]) acc.push({ type, isEnum: types[type].isEnum }); + }), + ); return acc; }, []), diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index ebc669ff7f1..b74cf953133 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -1,5 +1,6 @@ import { strings } from '@angular-devkit/core'; import { SYSTEM_TYPES } from '../constants'; +import { VOLO_REGEX } from '../constants/volo'; import { eImportKeyword } from '../enums'; import { Import, TypeWithEnum } from '../models'; import { parseNamespace } from './namespace'; @@ -7,22 +8,28 @@ import { relativePathToEnum, relativePathToModel } from './path'; import { parseGenerics } from './tree'; export function createTypeSimplifier() { - return createTypeParser(type => type.split('.').pop()!); + const parseType = createTypeParser(type => { + type = type.replace( + /System\.([0-9A-Za-z.]+)/g, + (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), + ); + return type.split('.').pop()!; + }); + return (type: string) => parseType(type).join(' | '); } export function createTypeParser(replacerFn = (t: string) => t) { - return (originalType: string) => - flattenUnionTypes([], originalType) - .map(type => { - type = normalizeTypeAnnotations(type); - type = type.replace( - /System\.([0-9A-Za-z.]+)/g, - (_, match) => SYSTEM_TYPES.get(match) ?? strings.camelize(match), - ); - - return replacerFn(type); - }) - .join(' | '); + const normalizeType = createTypeNormalizer(replacerFn); + + return (originalType: string) => flattenUnionTypes([], originalType).map(normalizeType); +} + +export function createTypeNormalizer(replacerFn = (t: string) => t) { + return (type: string) => { + type = normalizeTypeAnnotations(type); + + return replacerFn(type); + }; } export function flattenUnionTypes(types: string[], type: string) { @@ -77,7 +84,7 @@ export function createTypeToImportMapper(solution: string, namespace: string) { const modelNamespace = parseNamespace(solution, type); const refs = [removeTypeModifiers(type)]; const specifiers = [adaptType(simplifyType(refs[0]).split('<')[0])]; - const path = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/.test(type) + const path = VOLO_REGEX.test(type) ? '@abp/ng.core' : isEnum ? relativePathToEnum(namespace, modelNamespace, specifiers[0]) From 832692a2389e40a58b15eec11d072638b95d9550 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 05:57:15 +0300 Subject: [PATCH 84/95] fix: avoid importing generic type placeholders in schematics --- npm/ng-packs/packages/schematics/src/utils/model.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 94841c615ad..688d72123ab 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -69,8 +69,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { - if (parseNamespace(solution, ref) !== model.namespace) - toBeImported.push({ type: ref, isEnum: types[ref]?.isEnum }); + const propType = types[ref]; + if (propType && parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: propType?.isEnum }); }); }); }); From a1ae2d9973ae90b3c72e3cae04e6f1f0bb341df8 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:10:55 +0300 Subject: [PATCH 85/95] fix: remove condition blocking enum generation in schematics --- npm/ng-packs/packages/schematics/src/utils/model.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 688d72123ab..04eea19524b 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -70,8 +70,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { const propType = types[ref]; - if (propType && parseNamespace(solution, ref) !== model.namespace) - toBeImported.push({ type: ref, isEnum: propType?.isEnum }); + if (propType?.isEnum) toBeImported.push({ type: ref, isEnum: true }); + else if (parseNamespace(solution, ref) !== model.namespace) + toBeImported.push({ type: ref, isEnum: false }); }); }); }); From edadf0e74e1268e867c58f04cf7f68a2e97a04a1 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:14:47 +0300 Subject: [PATCH 86/95] fix: avoid lint errors in schematics --- npm/ng-packs/packages/schematics/src/models/method.ts | 10 +++++----- npm/ng-packs/packages/schematics/src/models/model.ts | 2 +- npm/ng-packs/packages/schematics/src/utils/model.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/method.ts b/npm/ng-packs/packages/schematics/src/models/method.ts index 0769904b600..036392e0a11 100644 --- a/npm/ng-packs/packages/schematics/src/models/method.ts +++ b/npm/ng-packs/packages/schematics/src/models/method.ts @@ -41,20 +41,20 @@ export class Body { url: string; registerActionParameter = (param: ParameterInBody) => { - let { bindingSourceId, descriptorName, name, nameOnMethod } = param; - name = strings.camelize(name); - const value = descriptorName ? `${descriptorName}.${name}` : nameOnMethod; + const { bindingSourceId, descriptorName, name, nameOnMethod } = param; + const camelName = strings.camelize(name); + const value = descriptorName ? `${descriptorName}.${camelName}` : nameOnMethod; switch (bindingSourceId) { case eBindingSourceId.Model: case eBindingSourceId.Query: - this.params.push(`${name}: ${value}`); + this.params.push(`${camelName}: ${value}`); break; case eBindingSourceId.Body: this.body = value; break; case eBindingSourceId.Path: - const regex = new RegExp('{' + name + '}', 'g'); + const regex = new RegExp('{' + camelName + '}', 'g'); this.url = this.url.replace(regex, '${' + value + '}'); break; default: diff --git a/npm/ng-packs/packages/schematics/src/models/model.ts b/npm/ng-packs/packages/schematics/src/models/model.ts index 5f389fe9688..6c7feb318dd 100644 --- a/npm/ng-packs/packages/schematics/src/models/model.ts +++ b/npm/ng-packs/packages/schematics/src/models/model.ts @@ -31,7 +31,7 @@ export type InterfaceOptions = Omissible; export class Property { name: string; type: string; - default: string = ''; + default = ''; optional: '' | '?' = ''; refs: string[] = []; diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 04eea19524b..de23e6a992a 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -55,7 +55,7 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { }); models.forEach(model => { - let toBeImported: TypeWithEnum[] = []; + const toBeImported: TypeWithEnum[] = []; model.interfaces.forEach(_interface => { const { baseType } = types[_interface.ref]; From 7423b1cd234b1fe796590e0c7d39b2424ea8f550 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:19:12 +0300 Subject: [PATCH 87/95] fix: add property type definition control back --- npm/ng-packs/packages/schematics/src/utils/model.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index de23e6a992a..58e6e79d0a5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -70,7 +70,8 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { _interface.properties.forEach(prop => { prop.refs.forEach(ref => { const propType = types[ref]; - if (propType?.isEnum) toBeImported.push({ type: ref, isEnum: true }); + if (!propType) return; + if (propType.isEnum) toBeImported.push({ type: ref, isEnum: true }); else if (parseNamespace(solution, ref) !== model.namespace) toBeImported.push({ type: ref, isEnum: false }); }); From 2e82d0a20d05209ef7f260610c0def07cdd760fe Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:27:52 +0300 Subject: [PATCH 88/95] fix: generate interface for base types too --- npm/ng-packs/packages/schematics/src/utils/model.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 58e6e79d0a5..3c688fc7ebe 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -133,7 +133,13 @@ export function createImportRefToInterfaceReducerCreator(params: ModelGeneratorP prop.refs.forEach(type => !types[type]?.isEnum && refs.push(type)); return refs; }, []) - .concat(base || []) + .concat( + base + ? parseGenerics(typeDef.baseType!) + .toGenerics() + .join('') + : [], + ) .reduce(reduceRefsToInterfaces, interfaces); } } From 283c04ca9a68fa2bad623bf4b6ca4bea1c1a7ff5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:43:34 +0300 Subject: [PATCH 89/95] feat: handle complex union types in schematics --- npm/ng-packs/packages/schematics/src/utils/type.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index b74cf953133..d6e451f2027 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -36,7 +36,10 @@ export function flattenUnionTypes(types: string[], type: string) { type .replace(/^{/, '') .replace(/}$/, '') + .replace(/{/, '(') + .replace(/}/, ')') .split(':') + .filter(Boolean) .forEach(t => types.push(t)); return types; From 5be8544504d250cf6227f368b21024f984a52786 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 07:45:25 +0300 Subject: [PATCH 90/95] fix: cut out generics from base type for better parsing --- npm/ng-packs/packages/schematics/src/utils/model.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/model.ts b/npm/ng-packs/packages/schematics/src/utils/model.ts index 3c688fc7ebe..22e2b553476 100644 --- a/npm/ng-packs/packages/schematics/src/utils/model.ts +++ b/npm/ng-packs/packages/schematics/src/utils/model.ts @@ -61,9 +61,7 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) { const { baseType } = types[_interface.ref]; if (baseType && parseNamespace(solution, baseType) !== model.namespace) toBeImported.push({ - type: parseGenerics(baseType) - .toGenerics() - .join(''), + type: baseType.split('<')[0], isEnum: false, }); From c90f70eee692e3a23a792531f9fc015e8959cad9 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 21 Aug 2020 08:45:03 +0300 Subject: [PATCH 91/95] build: exclude @abp/schematics pakage --- npm/ng-packs/scripts/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/scripts/build.ts b/npm/ng-packs/scripts/build.ts index 8d442f0740d..8ced29ec77f 100644 --- a/npm/ng-packs/scripts/build.ts +++ b/npm/ng-packs/scripts/build.ts @@ -38,7 +38,7 @@ import fse from 'fs-extra'; '--no-watch', '--all-packages', '--excluded-packages', - '@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components,@abp/ng.feature-management,@abp/ng.permission-management', + '@abp/ng.schematics,@abp/ng.core,@abp/ng.theme.shared,@abp/ng.components,@abp/ng.feature-management,@abp/ng.permission-management', ], { stdout: 'inherit', cwd: '../' }, ); From 105d44067f7f5c6d37a812abf816d0f0e3efe8ec Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 21 Aug 2020 08:45:26 +0300 Subject: [PATCH 92/95] chore: add build property with options property to schematics package config --- npm/ng-packs/angular.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/npm/ng-packs/angular.json b/npm/ng-packs/angular.json index 916dea84575..0f1ca59f485 100644 --- a/npm/ng-packs/angular.json +++ b/npm/ng-packs/angular.json @@ -372,6 +372,12 @@ "sourceRoot": "packages/schematics/src", "prefix": "abp", "architect": { + "build": { + "options": { + "tsConfig": "packages/schematics/tsconfig.lib.json", + "project": "packages/schematics/ng-package.json" + } + }, "test": { "builder": "@angular-builders/jest:run", "options": { From 8b968e6e0521bcd9b3f8b7f9501a4a7cef56cbb1 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 21 Aug 2020 08:45:39 +0300 Subject: [PATCH 93/95] chore: add an ng-package.json for schematics --- npm/ng-packs/packages/schematics/ng-package.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 npm/ng-packs/packages/schematics/ng-package.json diff --git a/npm/ng-packs/packages/schematics/ng-package.json b/npm/ng-packs/packages/schematics/ng-package.json new file mode 100644 index 00000000000..48cd3623247 --- /dev/null +++ b/npm/ng-packs/packages/schematics/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/schematics", + "lib": { + "entryFile": "src/public-api.ts" + } +} From 2bfb0533c7763c8abbec7e4da9f6898d7bd45c18 Mon Sep 17 00:00:00 2001 From: Bunyamin Coskuner Date: Fri, 21 Aug 2020 10:23:46 +0300 Subject: [PATCH 94/95] fix: remove sass from env Co-authored-by: Mehmet Erim <34455572+mehmet-erim@users.noreply.github.com> --- npm/ng-packs/apps/dev-app/src/environments/environment.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/environments/environment.ts b/npm/ng-packs/apps/dev-app/src/environments/environment.ts index d8066be1cce..2bf42cf7dc5 100644 --- a/npm/ng-packs/apps/dev-app/src/environments/environment.ts +++ b/npm/ng-packs/apps/dev-app/src/environments/environment.ts @@ -21,8 +21,5 @@ export const environment = { default: { url: 'https://localhost:44305', }, - saas: { - url: 'https://localhost:44305', - }, }, } as Config.Environment; From 109e3f50e905a319fa863afc88836a3de6b9a304 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 10:36:02 +0300 Subject: [PATCH 95/95] build: fix build-schematics script to copy correct folders --- npm/ng-packs/scripts/build-schematics.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/scripts/build-schematics.ts b/npm/ng-packs/scripts/build-schematics.ts index 873d503d6eb..89aa5c9992a 100644 --- a/npm/ng-packs/scripts/build-schematics.ts +++ b/npm/ng-packs/scripts/build-schematics.ts @@ -20,10 +20,11 @@ class FileCopy { const PACKAGE_TO_BUILD = 'schematics'; const FILES_TO_COPY_AFTER_BUILD: (FileCopy | string)[] = [ - { src: 'src/commands/proxy/files-enum', dest: 'commands/proxy/files-enum' }, - { src: 'src/commands/proxy/files-model', dest: 'commands/proxy/files-model' }, - { src: 'src/commands/proxy/files-service', dest: 'commands/proxy/files-service' }, { src: 'src/commands/proxy/schema.json', dest: 'commands/proxy/schema.json' }, + { src: 'src/commands/api/files-enum', dest: 'commands/api/files-enum' }, + { src: 'src/commands/api/files-model', dest: 'commands/api/files-model' }, + { src: 'src/commands/api/files-service', dest: 'commands/api/files-service' }, + { src: 'src/commands/api/schema.json', dest: 'commands/api/schema.json' }, { src: 'src/collection.json', dest: 'collection.json' }, 'package.json', 'README.md',