Browse Source

feat: add proxy entry point in feature-management

pull/10086/head
bnymncoskuner 5 years ago
parent
commit
dddd1714f7
  1. 7
      npm/ng-packs/packages/feature-management/proxy/ng-package.json
  2. 2
      npm/ng-packs/packages/feature-management/proxy/src/lib/index.ts
  3. 17
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/README.md
  4. 29
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/features.service.ts
  5. 2
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/index.ts
  6. 36
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/models.ts
  7. 5305
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/generate-proxy.json
  8. 3
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/index.ts
  9. 2
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/index.ts
  10. 1
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/string-values/index.ts
  11. 13
      npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/string-values/models.ts
  12. 1
      npm/ng-packs/packages/feature-management/proxy/src/public-api.ts
  13. 1
      npm/ng-packs/tsconfig.json

7
npm/ng-packs/packages/feature-management/proxy/ng-package.json

@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/packages/feature-management/proxy",
"lib": {
"entryFile": "src/public-api.ts"
}
}

2
npm/ng-packs/packages/feature-management/proxy/src/lib/index.ts

@ -0,0 +1,2 @@
export * from './proxy/feature-management';
export * from './proxy/validation';

17
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/README.md

@ -0,0 +1,17 @@
# Proxy Generation Output
This directory includes the output of the latest proxy generation.
The files and folders in it will be overwritten when proxy generation is run again.
Therefore, please do not place your own content in this folder.
In addition, `generate-proxy.json` works like a lock file.
It includes information used by the proxy generator, so please do not delete or modify it.
Finally, the name of the files and folders should not be changed for two reasons:
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
- ABP Suite generates files which include imports from this folder.
> **Important Notice:** If you are building a module and are planning to publish to npm,
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
> please make sure you export files directly and not from barrel exports. In other words,
> do not include index.ts exports in your public-api.ts exports.

29
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/features.service.ts

@ -0,0 +1,29 @@
import type { GetFeatureListResultDto, UpdateFeaturesDto } from './models';
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class FeaturesService {
apiName = 'AbpFeatureManagement';
get = (providerName: string, providerKey: string) =>
this.restService.request<any, GetFeatureListResultDto>({
method: 'GET',
url: '/api/feature-management/features',
params: { providerName, providerKey },
},
{ apiName: this.apiName });
update = (providerName: string, providerKey: string, input: UpdateFeaturesDto) =>
this.restService.request<any, void>({
method: 'PUT',
url: '/api/feature-management/features',
params: { providerName, providerKey },
body: input,
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

2
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/index.ts

@ -0,0 +1,2 @@
export * from './features.service';
export * from './models';

36
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/feature-management/models.ts

@ -0,0 +1,36 @@
import type { IStringValueType } from '../validation/string-values/models';
export interface FeatureDto {
name?: string;
displayName?: string;
value?: string;
provider: FeatureProviderDto;
description?: string;
valueType: IStringValueType;
depth: number;
parentName?: string;
}
export interface FeatureGroupDto {
name?: string;
displayName?: string;
features: FeatureDto[];
}
export interface FeatureProviderDto {
name?: string;
key?: string;
}
export interface GetFeatureListResultDto {
groups: FeatureGroupDto[];
}
export interface UpdateFeatureDto {
name?: string;
value?: string;
}
export interface UpdateFeaturesDto {
features: UpdateFeatureDto[];
}

5305
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/generate-proxy.json

File diff suppressed because it is too large

3
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/index.ts

@ -0,0 +1,3 @@
import * as FeatureManagement from './feature-management';
import * as Validation from './validation';
export { FeatureManagement, Validation };

2
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/index.ts

@ -0,0 +1,2 @@
import * as StringValues from './string-values';
export { StringValues };

1
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/string-values/index.ts

@ -0,0 +1 @@
export * from './models';

13
npm/ng-packs/packages/feature-management/proxy/src/lib/proxy/validation/string-values/models.ts

@ -0,0 +1,13 @@
export interface IStringValueType {
name?: string;
item: object;
properties: Record<string, object>;
validator: IValueValidator;
}
export interface IValueValidator {
name?: string;
item: object;
properties: Record<string, object>;
}

1
npm/ng-packs/packages/feature-management/proxy/src/public-api.ts

@ -0,0 +1 @@
export * from './lib';

1
npm/ng-packs/tsconfig.json

@ -25,6 +25,7 @@
"@abp/ng.core/locale": ["packages/core/locale/src/public-api.ts"],
"@abp/ng.core/testing": ["packages/core/testing/src/public-api.ts"],
"@abp/ng.feature-management": ["packages/feature-management/src/public-api.ts"],
"@abp/ng.feature-management/proxy": ["packages/feature-management/proxy/src/public-api.ts"],
"@abp/ng.identity": ["packages/identity//src/public-api.ts"],
"@abp/ng.identity/config": ["packages/identity/config/src/public-api.ts"],
"@abp/ng.identity/proxy": ["packages/identity/proxy/src/public-api.ts"],

Loading…
Cancel
Save