nextemos 5.2.5 → 5.2.7

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,3 +2,40 @@ import { IResponse } from "./response";
2
2
  export interface ICheckUpdateResponse extends IResponse {
3
3
  isVersionValid: boolean;
4
4
  }
5
+ export interface IDynamicPropertiesResponse extends IResponse {
6
+ data: IDynamicProperty[];
7
+ }
8
+ export interface IDynamicValuesResponse extends IResponse {
9
+ }
10
+ export interface IDynamicProperty {
11
+ id: number;
12
+ name: string;
13
+ dynamicTypeId: number;
14
+ isEditable: boolean;
15
+ orderNumber: number;
16
+ rules: string;
17
+ searchable: boolean;
18
+ childTypeId: number;
19
+ contentTypeId: number;
20
+ dynamicTypePropertyType: IDynamicTypePropertyType;
21
+ options: IDynamicPropertyOption[];
22
+ }
23
+ export interface IDynamicTypePropertyType {
24
+ id: number;
25
+ name: string;
26
+ typeName: string;
27
+ assemblyName: string;
28
+ isList: boolean;
29
+ isChild: boolean;
30
+ }
31
+ export interface IDynamicPropertyOption {
32
+ id: number;
33
+ data: {
34
+ disabled: boolean;
35
+ selected: boolean;
36
+ value: string;
37
+ text: string;
38
+ };
39
+ orderNumber: number;
40
+ isApproved: boolean;
41
+ }
@@ -19,7 +19,7 @@ export interface IProductTypeResponse extends IResponse {
19
19
  productType: IProductType;
20
20
  }
21
21
  export interface IProductTypeListResponse extends IResponsePaging {
22
- productType: IProductType[];
22
+ productTypes: IProductType[];
23
23
  }
24
24
  export interface ISearchProductsResponse extends IResponsePaging {
25
25
  products: IProduct[];
@@ -1,8 +1,19 @@
1
- import { IApiResponse, ICheckUpdateResponse, IRequestBase, IRequestInit, IService } from "../..";
1
+ import { IApiResponse, ICheckUpdateResponse, IDynamicPropertiesResponse, IDynamicValuesResponse, IRequestBase, IRequestInit, IService } from "../..";
2
2
  export interface ICheckUpdateRequest extends IRequestBase {
3
3
  version: string;
4
4
  mobilePlatform: string;
5
5
  }
6
+ export interface IDynamicPropertiesRequest extends IRequestBase {
7
+ formName: string;
8
+ }
9
+ export interface IDynamicValuesRequest extends IRequestBase {
10
+ request: {
11
+ key: string;
12
+ value: string[];
13
+ }[];
14
+ }
6
15
  export interface ICoreService extends IService {
7
16
  CheckUpdate: (data: ICheckUpdateRequest, options?: IRequestInit) => Promise<IApiResponse<ICheckUpdateResponse>>;
17
+ DynamicProperties: (data: IDynamicPropertiesRequest, options?: IRequestInit) => Promise<IApiResponse<IDynamicPropertiesResponse>>;
18
+ DynamicValues: (data: IDynamicValuesRequest, options?: IRequestInit) => Promise<IApiResponse<IDynamicValuesResponse>>;
8
19
  }
@@ -54,4 +54,18 @@ exports.CoreService = {
54
54
  CheckUpdate: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
55
55
  return (0, __1.fetchRequest)().get(exports.CoreService.Url(urls_1.default.MobileApi.CheckUpdate, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
56
56
  }),
57
+ // Dynamic Form Api
58
+ DynamicProperties: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
59
+ return (0, __1.fetchRequest)().get(exports.CoreService.Url(urls_1.default.DynamicForm.Properties, options, data === null || data === void 0 ? void 0 : data.language), Object.assign(Object.assign({}, options), { params: data }));
60
+ }),
61
+ DynamicValues: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
62
+ const formData = new FormData();
63
+ Object.keys(data).forEach((key) => {
64
+ const value = data[key];
65
+ if (value !== undefined && value !== null) {
66
+ formData.append(key, value.toString());
67
+ }
68
+ });
69
+ return (0, __1.fetchRequest)().post(exports.CoreService.Url(urls_1.default.DynamicForm.Values, options, data === null || data === void 0 ? void 0 : data.language), Object.assign({ body: formData }, options));
70
+ }),
57
71
  };
@@ -153,6 +153,10 @@ declare const _default: {
153
153
  MobileApi: {
154
154
  CheckUpdate: string;
155
155
  };
156
+ DynamicForm: {
157
+ Properties: string;
158
+ Values: string;
159
+ };
156
160
  };
157
161
  export default _default;
158
162
  export declare const getUrl: ({ isClient, language, methodName, serviceUrl, prefix, id, }: {
@@ -164,6 +164,10 @@ exports.default = {
164
164
  MobileApi: {
165
165
  CheckUpdate: "/{language}/MobileApi/v1/CheckUpdate",
166
166
  },
167
+ DynamicForm: {
168
+ Properties: "/{language}/DynamicForm/v1/Properties",
169
+ Values: "/{language}/DynamicForm/v1/Values",
170
+ },
167
171
  };
168
172
  const getUrl = ({ isClient = false, language = DEFAULT_LANGUAGE || "tr", methodName, serviceUrl, prefix, id = "", }) => {
169
173
  let url = serviceUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "5.2.5",
3
+ "version": "5.2.7",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",