nextemos 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,9 @@ import { IResponse } from "./response";
2
2
  export interface IAddressSourceDataResponse extends IResponse {
3
3
  data: IAddressSourceData[];
4
4
  }
5
+ export interface IAddressSchemaResponse extends IResponse {
6
+ data: IAddressField[];
7
+ }
5
8
  export interface IAddressSourceData {
6
9
  id?: number;
7
10
  addressPartTypeId?: number;
@@ -38,3 +41,14 @@ export interface IAddressPart {
38
41
  valueId: number;
39
42
  valueIntegrationCode: string;
40
43
  }
44
+ export interface IAddressField {
45
+ id: number;
46
+ name: string;
47
+ addressPartTypeId: number;
48
+ inputTypeId: number;
49
+ fieldTypeId?: number;
50
+ isRequired: boolean;
51
+ order: number;
52
+ tenantId: string;
53
+ parentId?: number;
54
+ }
@@ -1,5 +1,4 @@
1
- import { IApiResponse, IRequestInit, IService } from '../..';
2
- import { IAddressSourceDataResponse } from 'nextemos/interfaces/address';
1
+ import { IAddressSchemaResponse, IAddressSourceDataResponse, IApiResponse, IRequestInit, IService } from '../..';
3
2
  export type TAddressPartTypeId = 'Continent' | 'Country' | 'GoverningDistrict' | 'City' | 'County' | 'Town' | 'Neighbourhood' | 'PostalCode' | 'Street' | 'Complex' | 'Apartment' | 'Description' | 'TelephoneNumber' | 'Name' | 'Surname' | 'CorporationName' | 'MobilePhone';
4
3
  export interface IAddressSourceDataRequest {
5
4
  addressPartTypeId: TAddressPartTypeId;
@@ -7,6 +6,15 @@ export interface IAddressSourceDataRequest {
7
6
  parentId?: number;
8
7
  tags?: string[];
9
8
  }
9
+ export interface IAddressSchemaRequest {
10
+ name?: string;
11
+ inputTypeId?: 'DataBasedFreeText' | 'FreeText' | 'Data';
12
+ addressPartTypeId?: TAddressPartTypeId;
13
+ TenantId?: string;
14
+ language?: string;
15
+ tags?: string[];
16
+ }
10
17
  export interface IAddressService extends IService {
11
18
  AddressSourceData: (data: IAddressSourceDataRequest, options?: IRequestInit) => Promise<IApiResponse<IAddressSourceDataResponse>>;
19
+ AddressSchema: (data: IAddressSchemaRequest, options?: IRequestInit) => Promise<IApiResponse<IAddressSchemaResponse>>;
12
20
  }
@@ -52,4 +52,14 @@ exports.AddressService = {
52
52
  }), Object.assign(Object.assign({}, options), { params: data }));
53
53
  });
54
54
  },
55
+ AddressSchema: function (data, options) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ return yield (0, __1.fetchRequest)().get((0, urls_1.getUrl)({
58
+ serviceUrl: this.ServiceUrl(),
59
+ prefix: this.Prefix,
60
+ isClient: options === null || options === void 0 ? void 0 : options.useClient,
61
+ methodName: urls_1.default.Address.AddressSchemaForTenants.All,
62
+ }), Object.assign(Object.assign({}, options), { params: data }));
63
+ });
64
+ },
55
65
  };
@@ -64,6 +64,9 @@ declare const _default: {
64
64
  AddressSourceData: {
65
65
  All: string;
66
66
  };
67
+ AddressSchemaForTenants: {
68
+ All: string;
69
+ };
67
70
  };
68
71
  Localization: {
69
72
  AllByTagName: string;
@@ -69,6 +69,9 @@ exports.default = {
69
69
  Address: {
70
70
  AddressSourceData: {
71
71
  All: '/api/AddressSourceData/All',
72
+ },
73
+ AddressSchemaForTenants: {
74
+ All: '/{language}/AddressSchemaForTenants/v1/All',
72
75
  }
73
76
  },
74
77
  Localization: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",