rapida-partner 2.3.0 → 3.0.0
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.
- package/package.json +1 -1
- package/src/examples/components/forms/company.form.ts +4 -4
- package/src/examples/components/forms/person.form.ts +4 -4
- package/src/interfaces/form-button.interface.ts +3 -2
- package/src/interfaces/form-input.interface.ts +5 -1
- package/src/interfaces/project.interface.ts +14 -0
- package/src/schemas/business-rules.ref.json +85 -1
- package/src/schemas/form-button.ref.json +9 -3
- package/src/schemas/form-input.ref.json +4 -1
package/package.json
CHANGED
|
@@ -213,7 +213,7 @@ export const companyForm: IForm = {
|
|
|
213
213
|
name: "addressOneZipCode",
|
|
214
214
|
type: "input",
|
|
215
215
|
dataType: EDataType.NVARCHAR,
|
|
216
|
-
apiRequest: {
|
|
216
|
+
apiRequest: [{
|
|
217
217
|
endpoint: "https://brasilapi.com.br/api/cep/v1/",
|
|
218
218
|
paramType: "path",
|
|
219
219
|
formFieldsFilledByApiResponse: [
|
|
@@ -234,7 +234,7 @@ export const companyForm: IForm = {
|
|
|
234
234
|
propertiesFromApiToFillFormField: ["state"],
|
|
235
235
|
},
|
|
236
236
|
],
|
|
237
|
-
},
|
|
237
|
+
}],
|
|
238
238
|
validators: ["cep"],
|
|
239
239
|
},
|
|
240
240
|
{
|
|
@@ -297,7 +297,7 @@ export const companyForm: IForm = {
|
|
|
297
297
|
name: "addressTwoZipCode",
|
|
298
298
|
type: "input",
|
|
299
299
|
dataType: EDataType.NVARCHAR,
|
|
300
|
-
apiRequest: {
|
|
300
|
+
apiRequest: [{
|
|
301
301
|
endpoint: "https://brasilapi.com.br/api/cep/v1/",
|
|
302
302
|
paramType: "path",
|
|
303
303
|
formFieldsFilledByApiResponse: [
|
|
@@ -318,7 +318,7 @@ export const companyForm: IForm = {
|
|
|
318
318
|
propertiesFromApiToFillFormField: ["state"],
|
|
319
319
|
},
|
|
320
320
|
],
|
|
321
|
-
},
|
|
321
|
+
}],
|
|
322
322
|
validators: ["cep"],
|
|
323
323
|
},
|
|
324
324
|
{
|
|
@@ -162,7 +162,7 @@ export const personForm: IForm = {
|
|
|
162
162
|
type: "input",
|
|
163
163
|
dataType: EDataType.NVARCHAR,
|
|
164
164
|
name: "mainAddressZipCode",
|
|
165
|
-
apiRequest: {
|
|
165
|
+
apiRequest: [{
|
|
166
166
|
endpoint: "https://brasilapi.com.br/api/cep/v1/",
|
|
167
167
|
paramType: "path",
|
|
168
168
|
formFieldsFilledByApiResponse: [
|
|
@@ -194,7 +194,7 @@ export const personForm: IForm = {
|
|
|
194
194
|
],
|
|
195
195
|
},
|
|
196
196
|
},
|
|
197
|
-
},
|
|
197
|
+
}],
|
|
198
198
|
validators: ["cep"],
|
|
199
199
|
space: 1,
|
|
200
200
|
},
|
|
@@ -266,7 +266,7 @@ export const personForm: IForm = {
|
|
|
266
266
|
type: "input",
|
|
267
267
|
dataType: EDataType.NVARCHAR,
|
|
268
268
|
name: "otherAddressZipCode",
|
|
269
|
-
apiRequest: {
|
|
269
|
+
apiRequest: [{
|
|
270
270
|
endpoint: "https://brasilapi.com.br/api/cep/v1/",
|
|
271
271
|
paramType: "path",
|
|
272
272
|
formFieldsFilledByApiResponse: [
|
|
@@ -287,7 +287,7 @@ export const personForm: IForm = {
|
|
|
287
287
|
propertiesFromApiToFillFormField: ["state"],
|
|
288
288
|
},
|
|
289
289
|
],
|
|
290
|
-
},
|
|
290
|
+
}],
|
|
291
291
|
validators: ["cep"],
|
|
292
292
|
space: 1,
|
|
293
293
|
},
|
|
@@ -15,7 +15,8 @@ export interface IFormButton {
|
|
|
15
15
|
isDisabledOnUpdate?: boolean;
|
|
16
16
|
isHidden?: boolean;
|
|
17
17
|
conditions?: IFormCondition;
|
|
18
|
-
|
|
18
|
+
/** Chamadas em ordem: a seguinte só é tentada se a anterior falhar (chamada reserva). */
|
|
19
|
+
apiRequest?: IApiRequest[];
|
|
19
20
|
onSuccessRedirect?: {
|
|
20
21
|
url: string;
|
|
21
22
|
openIn: "sameTab" | "newTab" | "newWindow";
|
|
@@ -32,7 +33,7 @@ export interface IFormButton {
|
|
|
32
33
|
closeButtonLabel?: string;
|
|
33
34
|
actionButtonLabel?: string;
|
|
34
35
|
actionButtonType?: "submit" | "reset" | "link" | "apiRequest" | "modal";
|
|
35
|
-
actionButtonApiRequest?: IApiRequest;
|
|
36
|
+
actionButtonApiRequest?: IApiRequest[];
|
|
36
37
|
actionButtonBusinessRules?: IBusinessRule[];
|
|
37
38
|
conditions?: IFormCondition;
|
|
38
39
|
},
|
|
@@ -25,7 +25,11 @@ interface IFormInputBase {
|
|
|
25
25
|
todo?: string;
|
|
26
26
|
maxLength?: number;
|
|
27
27
|
minLength?: number;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Chamadas feitas ao preencher o campo, em ordem: a seguinte só é tentada se a anterior falhar ou não
|
|
30
|
+
* preencher nenhum campo (chamada reserva). Cada item segue IApiRequest.
|
|
31
|
+
*/
|
|
32
|
+
apiRequest?: IApiRequest[];
|
|
29
33
|
businessRules?: IBusinessRule[];
|
|
30
34
|
mask?: string | string[];
|
|
31
35
|
suffix?: string;
|
|
@@ -108,7 +108,17 @@ interface IBusinessPLan {
|
|
|
108
108
|
* `{ exceljs: "4.4.0" }`). O gerador soma ao package.json do lado correspondente quando o `framework`
|
|
109
109
|
* bate com o ativo na geração; se o pacote já existir no template com outra versão, mantém a do
|
|
110
110
|
* template e avisa.
|
|
111
|
+
*
|
|
112
|
+
* `files`: arquivos novos que o código complementar cria no projeto gerado (ex.: testes unitários,
|
|
113
|
+
* fixtures), quando o `framework` bate com o ativo. `path` é relativo à raiz do projeto gerado, sem
|
|
114
|
+
* `..` e sem caminho absoluto; a geração falha se o arquivo já existir (gerado pelo template ou por
|
|
115
|
+
* outra regra), para nunca sobrescrever código gerado em silêncio.
|
|
111
116
|
*/
|
|
117
|
+
export interface IComplementaryFile {
|
|
118
|
+
path: string;
|
|
119
|
+
content: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
112
122
|
export interface IBusinessRule {
|
|
113
123
|
rule: {
|
|
114
124
|
description: string;
|
|
@@ -127,6 +137,7 @@ export interface IBusinessRule {
|
|
|
127
137
|
}[];
|
|
128
138
|
dependencies?: Record<string, string>;
|
|
129
139
|
devDependencies?: Record<string, string>;
|
|
140
|
+
files?: IComplementaryFile[];
|
|
130
141
|
};
|
|
131
142
|
frontendComplementaryCode?: {
|
|
132
143
|
framework:
|
|
@@ -143,6 +154,7 @@ export interface IBusinessRule {
|
|
|
143
154
|
}[];
|
|
144
155
|
dependencies?: Record<string, string>;
|
|
145
156
|
devDependencies?: Record<string, string>;
|
|
157
|
+
files?: IComplementaryFile[];
|
|
146
158
|
};
|
|
147
159
|
}[];
|
|
148
160
|
implementation?: {
|
|
@@ -158,6 +170,7 @@ export interface IBusinessRule {
|
|
|
158
170
|
}[];
|
|
159
171
|
dependencies?: Record<string, string>;
|
|
160
172
|
devDependencies?: Record<string, string>;
|
|
173
|
+
files?: IComplementaryFile[];
|
|
161
174
|
};
|
|
162
175
|
frontendComplementaryCode?: {
|
|
163
176
|
framework:
|
|
@@ -174,6 +187,7 @@ export interface IBusinessRule {
|
|
|
174
187
|
}[];
|
|
175
188
|
dependencies?: Record<string, string>;
|
|
176
189
|
devDependencies?: Record<string, string>;
|
|
190
|
+
files?: IComplementaryFile[];
|
|
177
191
|
};
|
|
178
192
|
};
|
|
179
193
|
}
|
|
@@ -85,6 +85,27 @@
|
|
|
85
85
|
"type": "string",
|
|
86
86
|
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
|
|
87
87
|
}
|
|
88
|
+
},
|
|
89
|
+
"files": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"description": "Arquivos novos que o código complementar cria no projeto gerado (ex.: testes unitários, fixtures). path é relativo à raiz do projeto gerado, sem '..' e sem caminho absoluto; a geração falha se o arquivo já existir.",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"path": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"pattern": "^(?![/\\\\])(?!.*(^|[/\\\\])\\.\\.([/\\\\]|$))[^\\0]+$"
|
|
98
|
+
},
|
|
99
|
+
"content": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": [
|
|
104
|
+
"path",
|
|
105
|
+
"content"
|
|
106
|
+
],
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
}
|
|
88
109
|
}
|
|
89
110
|
},
|
|
90
111
|
"required": [
|
|
@@ -147,6 +168,27 @@
|
|
|
147
168
|
"type": "string",
|
|
148
169
|
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
|
|
149
170
|
}
|
|
171
|
+
},
|
|
172
|
+
"files": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"description": "Arquivos novos que o código complementar cria no projeto gerado (ex.: testes unitários, fixtures). path é relativo à raiz do projeto gerado, sem '..' e sem caminho absoluto; a geração falha se o arquivo já existir.",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"path": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^(?![/\\\\])(?!.*(^|[/\\\\])\\.\\.([/\\\\]|$))[^\\0]+$"
|
|
181
|
+
},
|
|
182
|
+
"content": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": [
|
|
187
|
+
"path",
|
|
188
|
+
"content"
|
|
189
|
+
],
|
|
190
|
+
"additionalProperties": false
|
|
191
|
+
}
|
|
150
192
|
}
|
|
151
193
|
},
|
|
152
194
|
"required": [
|
|
@@ -239,6 +281,27 @@
|
|
|
239
281
|
"type": "string",
|
|
240
282
|
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
|
|
241
283
|
}
|
|
284
|
+
},
|
|
285
|
+
"files": {
|
|
286
|
+
"type": "array",
|
|
287
|
+
"description": "Arquivos novos que o código complementar cria no projeto gerado (ex.: testes unitários, fixtures). path é relativo à raiz do projeto gerado, sem '..' e sem caminho absoluto; a geração falha se o arquivo já existir.",
|
|
288
|
+
"items": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"properties": {
|
|
291
|
+
"path": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"pattern": "^(?![/\\\\])(?!.*(^|[/\\\\])\\.\\.([/\\\\]|$))[^\\0]+$"
|
|
294
|
+
},
|
|
295
|
+
"content": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"required": [
|
|
300
|
+
"path",
|
|
301
|
+
"content"
|
|
302
|
+
],
|
|
303
|
+
"additionalProperties": false
|
|
304
|
+
}
|
|
242
305
|
}
|
|
243
306
|
},
|
|
244
307
|
"required": [
|
|
@@ -302,6 +365,27 @@
|
|
|
302
365
|
"type": "string",
|
|
303
366
|
"pattern": "^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$"
|
|
304
367
|
}
|
|
368
|
+
},
|
|
369
|
+
"files": {
|
|
370
|
+
"type": "array",
|
|
371
|
+
"description": "Arquivos novos que o código complementar cria no projeto gerado (ex.: testes unitários, fixtures). path é relativo à raiz do projeto gerado, sem '..' e sem caminho absoluto; a geração falha se o arquivo já existir.",
|
|
372
|
+
"items": {
|
|
373
|
+
"type": "object",
|
|
374
|
+
"properties": {
|
|
375
|
+
"path": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"pattern": "^(?![/\\\\])(?!.*(^|[/\\\\])\\.\\.([/\\\\]|$))[^\\0]+$"
|
|
378
|
+
},
|
|
379
|
+
"content": {
|
|
380
|
+
"type": "string"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"required": [
|
|
384
|
+
"path",
|
|
385
|
+
"content"
|
|
386
|
+
],
|
|
387
|
+
"additionalProperties": false
|
|
388
|
+
}
|
|
305
389
|
}
|
|
306
390
|
},
|
|
307
391
|
"required": [
|
|
@@ -318,4 +402,4 @@
|
|
|
318
402
|
}
|
|
319
403
|
}
|
|
320
404
|
}
|
|
321
|
-
}
|
|
405
|
+
}
|
|
@@ -45,7 +45,10 @@
|
|
|
45
45
|
"$ref": "condition.ref.json"
|
|
46
46
|
},
|
|
47
47
|
"apiRequest": {
|
|
48
|
-
"
|
|
48
|
+
"type": "array",
|
|
49
|
+
"minItems": 1,
|
|
50
|
+
"description": "Chamadas em ordem; a seguinte só é tentada se a anterior falhar ou não preencher nenhum campo (chamada reserva).",
|
|
51
|
+
"items": { "$ref": "form-common-api-request.ref.json" }
|
|
49
52
|
},
|
|
50
53
|
"onSuccessRedirect": {
|
|
51
54
|
"type": "object",
|
|
@@ -125,8 +128,11 @@
|
|
|
125
128
|
"enum": ["submit", "reset", "link", "apiRequest", "modal"]
|
|
126
129
|
},
|
|
127
130
|
"actionButtonApiRequest": {
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
"type": "array",
|
|
132
|
+
"minItems": 1,
|
|
133
|
+
"description": "Chamadas em ordem; a seguinte só é tentada se a anterior falhar ou não preencher nenhum campo (chamada reserva).",
|
|
134
|
+
"items": { "$ref": "form-common-api-request.ref.json" }
|
|
135
|
+
},
|
|
130
136
|
"actionButtonBusinessRules": { "$ref": "business-rules.ref.json" },
|
|
131
137
|
"conditions": { "$ref": "condition.ref.json" }
|
|
132
138
|
},
|
|
@@ -69,7 +69,10 @@
|
|
|
69
69
|
"type": "number"
|
|
70
70
|
},
|
|
71
71
|
"apiRequest": {
|
|
72
|
-
"
|
|
72
|
+
"type": "array",
|
|
73
|
+
"minItems": 1,
|
|
74
|
+
"description": "Chamadas em ordem; a seguinte só é tentada se a anterior falhar ou não preencher nenhum campo (chamada reserva).",
|
|
75
|
+
"items": { "$ref": "form-common-api-request.ref.json" }
|
|
73
76
|
},
|
|
74
77
|
"mask": {
|
|
75
78
|
"type": [
|