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 646f2170ea..7e73b1285f 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -10,7 +10,7 @@ import { url, } from '@angular-devkit/schematics'; import { Exception } from '../../enums'; -import { GenerateProxySchema, ServiceGeneratorParams } from '../../models'; +import { GenerateApiSchema, ServiceGeneratorParams } from '../../models'; import { applyWithOverwrite, buildDefaultPath, @@ -31,7 +31,7 @@ import { } from '../../utils'; import * as cases from '../../utils/text'; -export default function(schema: GenerateProxySchema) { +export default function(schema: GenerateApiSchema) { const params = removeDefaultPlaceholders(schema); const moduleName = strings.camelize(params.module || 'app'); diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json index f9e762c597..c817882730 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-add/schema.json @@ -5,7 +5,6 @@ "type": "object", "properties": { "module": { - "alias": "m", "description": "Backend module name", "type": "string", "$default": { @@ -14,23 +13,30 @@ }, "x-prompt": "Please enter backend module name. (default: \"app\")" }, + "api-name": { + "description": "Backend api name, a.k.a. remoteServiceName", + "type": "string", + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")" + }, "source": { - "alias": "s", "description": "Source Angular project for API definition URL & root namespace resolution", "type": "string", "$default": { "$source": "argv", - "index": 1 + "index": 2 }, "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { - "alias": "t", "description": "Target Angular project to place the generated code", "type": "string", "$default": { "$source": "argv", - "index": 2 + "index": 3 }, "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json index f9e762c597..c817882730 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-refresh/schema.json @@ -5,7 +5,6 @@ "type": "object", "properties": { "module": { - "alias": "m", "description": "Backend module name", "type": "string", "$default": { @@ -14,23 +13,30 @@ }, "x-prompt": "Please enter backend module name. (default: \"app\")" }, + "api-name": { + "description": "Backend api name, a.k.a. remoteServiceName", + "type": "string", + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")" + }, "source": { - "alias": "s", "description": "Source Angular project for API definition URL & root namespace resolution", "type": "string", "$default": { "$source": "argv", - "index": 1 + "index": 2 }, "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { - "alias": "t", "description": "Target Angular project to place the generated code", "type": "string", "$default": { "$source": "argv", - "index": 2 + "index": 3 }, "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json b/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json index f9e762c597..c817882730 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json +++ b/npm/ng-packs/packages/schematics/src/commands/proxy-remove/schema.json @@ -5,7 +5,6 @@ "type": "object", "properties": { "module": { - "alias": "m", "description": "Backend module name", "type": "string", "$default": { @@ -14,23 +13,30 @@ }, "x-prompt": "Please enter backend module name. (default: \"app\")" }, + "api-name": { + "description": "Backend api name, a.k.a. remoteServiceName", + "type": "string", + "$default": { + "$source": "argv", + "index": 1 + }, + "x-prompt": "Please enter backend api name, a.k.a. remoteServiceName. (default: \"default\")" + }, "source": { - "alias": "s", "description": "Source Angular project for API definition URL & root namespace resolution", "type": "string", "$default": { "$source": "argv", - "index": 1 + "index": 2 }, "x-prompt": "Plese enter source Angular project for API definition URL & root namespace resolution. (default: workspace \"defaultProject\")" }, "target": { - "alias": "t", "description": "Target Angular project to place the generated code", "type": "string", "$default": { "$source": "argv", - "index": 2 + "index": 3 }, "x-prompt": "Plese enter target Angular project to place the generated code. (default: workspace \"defaultProject\")" } diff --git a/npm/ng-packs/packages/schematics/src/models/generate-proxy-schema.ts b/npm/ng-packs/packages/schematics/src/models/generate-proxy-schema.ts index 59c4e6adab..4e58f355b1 100644 --- a/npm/ng-packs/packages/schematics/src/models/generate-proxy-schema.ts +++ b/npm/ng-packs/packages/schematics/src/models/generate-proxy-schema.ts @@ -4,6 +4,11 @@ export interface GenerateProxySchema { */ module?: string; + /** + * Backend api name, a.k.a. remoteServiceName + */ + ['api-name']?: string; + /** * Source Angular project for API definition URL & root namespace resolution */ @@ -14,3 +19,5 @@ export interface GenerateProxySchema { */ target?: string; } + +export type GenerateApiSchema = Omit;