rapida-partner 1.1.5 → 1.1.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.
@@ -1,4 +1,5 @@
1
1
  import type { EFormContractDataType } from "../enums/form-contract.enum";
2
+ import type { EDataType } from "../enums/form.enum";
2
3
  import type { IFormArray } from "./form-array.interface";
3
4
  import type { IFormAutocomplete } from "./form-autocomplete.interface";
4
5
  import type { IFormButton } from "./form-button.interface";
@@ -22,7 +23,7 @@ export interface IForm {
22
23
  contracts: {
23
24
  endpoint: string;
24
25
  methods: { verb: "GET" | "POST" | "PUT" | "DELETE" }[];
25
- request?: IApiRequest;
26
+ request?: IContractRequest;
26
27
  }[];
27
28
  kanban?: {
28
29
  status: "toDo" | "inProgress" | "done";
@@ -40,6 +41,32 @@ interface IFormContractGeneral {
40
41
  dataType: EFormContractDataType;
41
42
  }
42
43
 
44
+ interface IContractRequest {
45
+ entity: string,
46
+ description?: string,
47
+ fields: IContractRequestField[]
48
+ }
49
+
50
+ interface IContractRequestField {
51
+ name: string;
52
+ dataType: EFormContractDataType;
53
+ isRequired?: boolean;
54
+ foreignKey?: IContractRequestFieldForeignKey;
55
+ isPrimaryKey?: boolean;
56
+ minSize?: number;
57
+ maxSize?: number;
58
+ enum?: string[];
59
+ isUnique?: boolean;
60
+ uniqueComposedFields?: string[];
61
+ methodsExceptions?: { verb: "GET" | "POST" | "PUT" | "DELETE" }[];
62
+ }
63
+
64
+ interface IContractRequestFieldForeignKey {
65
+ entity: string;
66
+ connectionAttribute: string;
67
+ relationship: "many-to-many" | "one-to-many" | "one-to-one"
68
+ }
69
+
43
70
  interface IFormContractArray {
44
71
  name: string;
45
72
  dataType: "array";
@@ -100,6 +100,9 @@
100
100
  },
101
101
  "rawQuery": {
102
102
  "type": "string"
103
+ },
104
+ "relatedEntity": {
105
+ "type": "string"
103
106
  }
104
107
  },
105
108
  "required": [
@@ -107,7 +110,8 @@
107
110
  "labelField",
108
111
  "valueField",
109
112
  "paramsToFilter",
110
- "paramType"
113
+ "paramType",
114
+ "relatedEntity"
111
115
  ]
112
116
  },
113
117
  "optionsApiWithConditions": {
@@ -157,6 +161,9 @@
157
161
  },
158
162
  "rawQuery": {
159
163
  "type": "string"
164
+ },
165
+ "relatedEntity": {
166
+ "type": "string"
160
167
  }
161
168
  }
162
169
  },
@@ -165,15 +172,13 @@
165
172
  "labelField",
166
173
  "valueField",
167
174
  "paramsToFilter",
168
- "paramType"
175
+ "paramType",
176
+ "relatedEntity"
169
177
  ]
170
178
  },
171
179
  "isMultiple": {
172
180
  "type": "boolean"
173
- },
174
- "relatedEntity": {
175
- "type": "string"
176
181
  }
177
182
  },
178
- "required": ["type", "dataType", "name", "label", "relatedEntity"]
183
+ "required": ["type", "dataType", "name", "label"]
179
184
  }
@@ -51,16 +51,88 @@
51
51
  "request": {
52
52
  "type": "object",
53
53
  "properties": {
54
- "body": {
54
+ "entity": {
55
+ "type": "string"
56
+ },
57
+ "description": {
58
+ "type": "string"
59
+ },
60
+ "fields": {
55
61
  "type": "array",
56
62
  "items": {
57
- "oneOf": [
58
- { "$ref": "form-contract-request.ref.json" },
59
- { "$ref": "form-contract-request-array.ref.json" }
60
- ]
63
+ "type": "object",
64
+ "properties": {
65
+ "name": {
66
+ "type": "string"
67
+ },
68
+ "dataType": {
69
+ "$ref": "types-datatype.ref.json"
70
+ },
71
+ "isRequired": {
72
+ "type": "boolean"
73
+ },
74
+ "foreignKey": {
75
+ "type": "object",
76
+ "properties": {
77
+ "entity": {
78
+ "type": "string"
79
+ },
80
+ "connectionAttribute": {
81
+ "type": "string"
82
+ },
83
+ "relationship": {
84
+ "type": "string",
85
+ "enum": ["one-to-one", "one-to-many", "many-to-many"]
86
+ }
87
+ },
88
+ "required": [
89
+ "entity",
90
+ "connectionAttribute",
91
+ "relationship"
92
+ ]
93
+ },
94
+ "isPrimaryKey": {
95
+ "type": "boolean"
96
+ },
97
+ "minSize": {
98
+ "type": "number"
99
+ },
100
+ "maxSize": {
101
+ "type": "number"
102
+ },
103
+ "enum": {
104
+ "type": "array",
105
+ "items": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "isUnique": {
110
+ "type": "boolean"
111
+ },
112
+ "uniqueComposedFields": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "methods": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "object",
122
+ "properties": {
123
+ "verb": {
124
+ "type": "string",
125
+ "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"]
126
+ }
127
+ }
128
+ }
129
+ }
130
+ },
131
+ "required": ["name", "dataType"]
61
132
  }
62
133
  }
63
- }
134
+ },
135
+ "required": ["entity", "fields"]
64
136
  }
65
137
  },
66
138
  "required": ["endpoint", "methods"]