@benup/bensdk 1.11.16 → 1.12.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/bin/lib/schemas/action.schema.d.ts +3423 -1190
- package/bin/lib/schemas/benefit-definition.schema.d.ts +94 -2
- package/bin/src/cli/init.js +224 -7
- package/bin/src/cli/init.js.map +1 -1
- package/bin/src/cli/templates/bensdk-base/.benSDKIgnore.template +3 -2
- package/bin/src/cli/templates/bensdk-base/.gitignore.template +4 -1
- package/bin/src/cli/templates/bensdk-base/README.md.template +52 -74
- package/bin/src/cli/templates/bensdk-base/context.config.ts.template +97 -21
- package/bin/src/cli/templates/bensdk-base/dev-test.example.json +22 -0
- package/bin/src/cli/templates/bensdk-base/docs/DEV_SERVER.md +201 -0
- package/bin/src/cli/templates/bensdk-docs/update-readme.ts +96 -0
- package/bin/src/cli/templates/bensdk-local-server/app.ts +234 -33
- package/bin/src/cli/templates/package.template.json +4 -1
- package/package.json +1 -1
|
@@ -61,6 +61,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
61
61
|
}, {
|
|
62
62
|
next?: string;
|
|
63
63
|
}>;
|
|
64
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
65
|
+
next: z.ZodString;
|
|
66
|
+
fail: z.ZodString;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
next?: string;
|
|
69
|
+
fail?: string;
|
|
70
|
+
}, {
|
|
71
|
+
next?: string;
|
|
72
|
+
fail?: string;
|
|
73
|
+
}>;
|
|
64
74
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
65
75
|
REQUESTED_RECHARGE: z.ZodObject<{
|
|
66
76
|
next: z.ZodString;
|
|
@@ -69,6 +79,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
69
79
|
}, {
|
|
70
80
|
next?: string;
|
|
71
81
|
}>;
|
|
82
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
83
|
+
next: z.ZodString;
|
|
84
|
+
fail: z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
next?: string;
|
|
87
|
+
fail?: string;
|
|
88
|
+
}, {
|
|
89
|
+
next?: string;
|
|
90
|
+
fail?: string;
|
|
91
|
+
}>;
|
|
72
92
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
73
93
|
REQUESTED_RECHARGE: z.ZodObject<{
|
|
74
94
|
next: z.ZodString;
|
|
@@ -77,6 +97,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
77
97
|
}, {
|
|
78
98
|
next?: string;
|
|
79
99
|
}>;
|
|
100
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
101
|
+
next: z.ZodString;
|
|
102
|
+
fail: z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
next?: string;
|
|
105
|
+
fail?: string;
|
|
106
|
+
}, {
|
|
107
|
+
next?: string;
|
|
108
|
+
fail?: string;
|
|
109
|
+
}>;
|
|
80
110
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
81
111
|
BEFORE_ALL_RECHARGE: z.ZodOptional<z.ZodObject<{
|
|
82
112
|
REQUESTED_BEFORE_ALL_RECHARGE: z.ZodObject<{
|
|
@@ -186,6 +216,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
186
216
|
}, {
|
|
187
217
|
next?: string;
|
|
188
218
|
}>;
|
|
219
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
220
|
+
next: z.ZodString;
|
|
221
|
+
fail: z.ZodString;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
next?: string;
|
|
224
|
+
fail?: string;
|
|
225
|
+
}, {
|
|
226
|
+
next?: string;
|
|
227
|
+
fail?: string;
|
|
228
|
+
}>;
|
|
189
229
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
190
230
|
REQUESTED_DEDUCTION: z.ZodObject<{
|
|
191
231
|
next: z.ZodString;
|
|
@@ -194,6 +234,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
194
234
|
}, {
|
|
195
235
|
next?: string;
|
|
196
236
|
}>;
|
|
237
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
238
|
+
next: z.ZodString;
|
|
239
|
+
fail: z.ZodString;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
next?: string;
|
|
242
|
+
fail?: string;
|
|
243
|
+
}, {
|
|
244
|
+
next?: string;
|
|
245
|
+
fail?: string;
|
|
246
|
+
}>;
|
|
197
247
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
198
248
|
REQUESTED_DEDUCTION: z.ZodObject<{
|
|
199
249
|
next: z.ZodString;
|
|
@@ -202,6 +252,16 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
202
252
|
}, {
|
|
203
253
|
next?: string;
|
|
204
254
|
}>;
|
|
255
|
+
GUARDRAILS_CHECK: z.ZodObject<{
|
|
256
|
+
next: z.ZodString;
|
|
257
|
+
fail: z.ZodString;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
next?: string;
|
|
260
|
+
fail?: string;
|
|
261
|
+
}, {
|
|
262
|
+
next?: string;
|
|
263
|
+
fail?: string;
|
|
264
|
+
}>;
|
|
205
265
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
206
266
|
DEDUCTION_FILE_INGESTION: z.ZodOptional<z.ZodObject<{
|
|
207
267
|
REQUESTED_DEDUCTION_FILE_INGESTION: z.ZodObject<{
|
|
@@ -254,6 +314,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
254
314
|
REQUESTED_RECHARGE?: {
|
|
255
315
|
next?: string;
|
|
256
316
|
};
|
|
317
|
+
GUARDRAILS_CHECK?: {
|
|
318
|
+
next?: string;
|
|
319
|
+
fail?: string;
|
|
320
|
+
};
|
|
257
321
|
} & {
|
|
258
322
|
[k: string]: unknown;
|
|
259
323
|
};
|
|
@@ -265,6 +329,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
265
329
|
[k: string]: any;
|
|
266
330
|
};
|
|
267
331
|
DEDUCTION?: {
|
|
332
|
+
GUARDRAILS_CHECK?: {
|
|
333
|
+
next?: string;
|
|
334
|
+
fail?: string;
|
|
335
|
+
};
|
|
268
336
|
REQUESTED_DEDUCTION?: {
|
|
269
337
|
next?: string;
|
|
270
338
|
};
|
|
@@ -318,6 +386,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
318
386
|
REQUESTED_RECHARGE?: {
|
|
319
387
|
next?: string;
|
|
320
388
|
};
|
|
389
|
+
GUARDRAILS_CHECK?: {
|
|
390
|
+
next?: string;
|
|
391
|
+
fail?: string;
|
|
392
|
+
};
|
|
321
393
|
} & {
|
|
322
394
|
[k: string]: unknown;
|
|
323
395
|
};
|
|
@@ -329,6 +401,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
329
401
|
[k: string]: any;
|
|
330
402
|
};
|
|
331
403
|
DEDUCTION?: {
|
|
404
|
+
GUARDRAILS_CHECK?: {
|
|
405
|
+
next?: string;
|
|
406
|
+
fail?: string;
|
|
407
|
+
};
|
|
332
408
|
REQUESTED_DEDUCTION?: {
|
|
333
409
|
next?: string;
|
|
334
410
|
};
|
|
@@ -360,8 +436,8 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
360
436
|
actions: z.ZodObject<{
|
|
361
437
|
eligibilityOptions: z.ZodObject<{
|
|
362
438
|
GRANT: z.ZodType<z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>, z.ZodTypeDef, z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>>;
|
|
363
|
-
RECHARGE: z.ZodType<z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>, z.ZodTypeDef, z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown
|
|
364
|
-
GRANT_DEPENDENT: z.ZodType<z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>, z.ZodTypeDef, z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown
|
|
439
|
+
RECHARGE: z.ZodOptional<z.ZodType<z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>, z.ZodTypeDef, z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>>>;
|
|
440
|
+
GRANT_DEPENDENT: z.ZodOptional<z.ZodType<z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>, z.ZodTypeDef, z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>>>;
|
|
365
441
|
}, "strip", z.ZodTypeAny, {
|
|
366
442
|
GRANT?: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
|
|
367
443
|
RECHARGE?: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
|
|
@@ -469,6 +545,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
469
545
|
REQUESTED_RECHARGE?: {
|
|
470
546
|
next?: string;
|
|
471
547
|
};
|
|
548
|
+
GUARDRAILS_CHECK?: {
|
|
549
|
+
next?: string;
|
|
550
|
+
fail?: string;
|
|
551
|
+
};
|
|
472
552
|
} & {
|
|
473
553
|
[k: string]: unknown;
|
|
474
554
|
};
|
|
@@ -480,6 +560,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
480
560
|
[k: string]: any;
|
|
481
561
|
};
|
|
482
562
|
DEDUCTION?: {
|
|
563
|
+
GUARDRAILS_CHECK?: {
|
|
564
|
+
next?: string;
|
|
565
|
+
fail?: string;
|
|
566
|
+
};
|
|
483
567
|
REQUESTED_DEDUCTION?: {
|
|
484
568
|
next?: string;
|
|
485
569
|
};
|
|
@@ -556,6 +640,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
556
640
|
REQUESTED_RECHARGE?: {
|
|
557
641
|
next?: string;
|
|
558
642
|
};
|
|
643
|
+
GUARDRAILS_CHECK?: {
|
|
644
|
+
next?: string;
|
|
645
|
+
fail?: string;
|
|
646
|
+
};
|
|
559
647
|
} & {
|
|
560
648
|
[k: string]: unknown;
|
|
561
649
|
};
|
|
@@ -567,6 +655,10 @@ export declare const BenefitDefinitionSchema: z.ZodObject<{
|
|
|
567
655
|
[k: string]: any;
|
|
568
656
|
};
|
|
569
657
|
DEDUCTION?: {
|
|
658
|
+
GUARDRAILS_CHECK?: {
|
|
659
|
+
next?: string;
|
|
660
|
+
fail?: string;
|
|
661
|
+
};
|
|
570
662
|
REQUESTED_DEDUCTION?: {
|
|
571
663
|
next?: string;
|
|
572
664
|
};
|
package/bin/src/cli/init.js
CHANGED
|
@@ -26,6 +26,195 @@ const getAllFiles = (dirPath, arrayOfFiles = []) => {
|
|
|
26
26
|
});
|
|
27
27
|
return arrayOfFiles;
|
|
28
28
|
};
|
|
29
|
+
const BENEFIT_CATEGORIES = [
|
|
30
|
+
'Saúde',
|
|
31
|
+
'Alimentação',
|
|
32
|
+
'Transporte',
|
|
33
|
+
'Engajamento',
|
|
34
|
+
'Flexíveis',
|
|
35
|
+
'Auxílio Farmácia',
|
|
36
|
+
'Outros'
|
|
37
|
+
];
|
|
38
|
+
/** Convert BENEFIT-ID or BENEFIT_ID to Friendly Name */
|
|
39
|
+
function toFriendlyName(benefitID) {
|
|
40
|
+
return benefitID
|
|
41
|
+
.split(/[-_]/)
|
|
42
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
43
|
+
.join(' ');
|
|
44
|
+
}
|
|
45
|
+
function generateActionDiagram(action) {
|
|
46
|
+
switch (action) {
|
|
47
|
+
case 'GRANT':
|
|
48
|
+
return `### Concessão de Benefício (GRANT)
|
|
49
|
+
|
|
50
|
+
\`\`\`mermaid
|
|
51
|
+
flowchart TD
|
|
52
|
+
START([Início]) --> REQUESTED_GRANT
|
|
53
|
+
REQUESTED_GRANT -->|next| SYNC_EXISTING_GRANT
|
|
54
|
+
SYNC_EXISTING_GRANT -->|next| REQUEST_CREATE_EMPLOYEE
|
|
55
|
+
SYNC_EXISTING_GRANT -->|skip| GRANTED
|
|
56
|
+
REQUEST_CREATE_EMPLOYEE -->|next| GRANTED
|
|
57
|
+
REQUEST_CREATE_EMPLOYEE -->|fail| FAILED_TO_GRANT
|
|
58
|
+
|
|
59
|
+
GRANTED([GRANTED ✅])
|
|
60
|
+
FAILED_TO_GRANT([FAILED_TO_GRANT ❌])
|
|
61
|
+
\`\`\``;
|
|
62
|
+
case 'REVOKE':
|
|
63
|
+
return `### Revogação de Benefício (REVOKE)
|
|
64
|
+
|
|
65
|
+
\`\`\`mermaid
|
|
66
|
+
flowchart TD
|
|
67
|
+
START([Início]) --> REQUESTED_REVOKE
|
|
68
|
+
REQUESTED_REVOKE -->|next| SYNC_EXISTING_REVOKE
|
|
69
|
+
SYNC_EXISTING_REVOKE -->|next| REQUEST_REMOVE_EMPLOYEE
|
|
70
|
+
SYNC_EXISTING_REVOKE -->|skip| REVOKED
|
|
71
|
+
REQUEST_REMOVE_EMPLOYEE -->|next| REVOKED
|
|
72
|
+
REQUEST_REMOVE_EMPLOYEE -->|fail| FAILED_TO_REVOKE
|
|
73
|
+
|
|
74
|
+
REVOKED([REVOKED ✅])
|
|
75
|
+
FAILED_TO_REVOKE([FAILED_TO_REVOKE ❌])
|
|
76
|
+
\`\`\``;
|
|
77
|
+
case 'RECHARGE':
|
|
78
|
+
return `### Recarga de Benefício (RECHARGE)
|
|
79
|
+
|
|
80
|
+
\`\`\`mermaid
|
|
81
|
+
flowchart TD
|
|
82
|
+
START([Início]) --> REQUESTED_RECHARGE
|
|
83
|
+
REQUESTED_RECHARGE -->|next| CHECK_FOR_DUPLICATE_RECHARGES
|
|
84
|
+
CHECK_FOR_DUPLICATE_RECHARGES -->|next| PROCESS_RECHARGE
|
|
85
|
+
CHECK_FOR_DUPLICATE_RECHARGES -->|fail| RECHARGE_FAILED
|
|
86
|
+
PROCESS_RECHARGE -->|next| RECHARGE_SUCCEEDED
|
|
87
|
+
PROCESS_RECHARGE -->|fail| RECHARGE_FAILED
|
|
88
|
+
|
|
89
|
+
RECHARGE_SUCCEEDED([RECHARGE_SUCCEEDED ✅])
|
|
90
|
+
RECHARGE_FAILED([RECHARGE_FAILED ❌])
|
|
91
|
+
\`\`\``;
|
|
92
|
+
case 'GRANT_DEPENDENT':
|
|
93
|
+
return `### Concessão para Dependente (GRANT_DEPENDENT)
|
|
94
|
+
|
|
95
|
+
\`\`\`mermaid
|
|
96
|
+
flowchart TD
|
|
97
|
+
START([Início]) --> REQUESTED_GRANT_DEPENDENT
|
|
98
|
+
REQUESTED_GRANT_DEPENDENT -->|next| REQUEST_CREATE_DEPENDENT
|
|
99
|
+
REQUEST_CREATE_DEPENDENT -->|next| GRANTED_DEPENDENT
|
|
100
|
+
REQUEST_CREATE_DEPENDENT -->|fail| FAILED_TO_GRANT_DEPENDENT
|
|
101
|
+
|
|
102
|
+
GRANTED_DEPENDENT([GRANTED_DEPENDENT ✅])
|
|
103
|
+
FAILED_TO_GRANT_DEPENDENT([FAILED_TO_GRANT_DEPENDENT ❌])
|
|
104
|
+
\`\`\``;
|
|
105
|
+
case 'REVOKE_DEPENDENT':
|
|
106
|
+
return `### Revogação de Dependente (REVOKE_DEPENDENT)
|
|
107
|
+
|
|
108
|
+
\`\`\`mermaid
|
|
109
|
+
flowchart TD
|
|
110
|
+
START([Início]) --> REQUESTED_REVOKE_DEPENDENT
|
|
111
|
+
REQUESTED_REVOKE_DEPENDENT -->|next| REQUEST_REMOVE_DEPENDENT
|
|
112
|
+
REQUEST_REMOVE_DEPENDENT -->|next| REVOKED_DEPENDENT
|
|
113
|
+
REQUEST_REMOVE_DEPENDENT -->|fail| FAILED_TO_REVOKE_DEPENDENT
|
|
114
|
+
|
|
115
|
+
REVOKED_DEPENDENT([REVOKED_DEPENDENT ✅])
|
|
116
|
+
FAILED_TO_REVOKE_DEPENDENT([FAILED_TO_REVOKE_DEPENDENT ❌])
|
|
117
|
+
\`\`\``;
|
|
118
|
+
default:
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function generateReadme({ benefitID, benefitCategory, benefitDescription, actions }) {
|
|
123
|
+
const friendlyName = toFriendlyName(benefitID);
|
|
124
|
+
const metaLines = [];
|
|
125
|
+
if (benefitCategory)
|
|
126
|
+
metaLines.push(`**Categoria:** ${benefitCategory}`);
|
|
127
|
+
if (benefitDescription)
|
|
128
|
+
metaLines.push(benefitDescription);
|
|
129
|
+
const metaBlock = metaLines.length > 0 ? `\n> ${metaLines.join(' · ')}\n` : '';
|
|
130
|
+
const diagrams = actions
|
|
131
|
+
.map((a) => generateActionDiagram(a))
|
|
132
|
+
.filter(Boolean)
|
|
133
|
+
.join('\n\n');
|
|
134
|
+
return `<img src="ICON.png" alt="${friendlyName}" width="120">
|
|
135
|
+
|
|
136
|
+
# bensdk - ${friendlyName}
|
|
137
|
+
${metaBlock}
|
|
138
|
+
## Estrutura do Projeto
|
|
139
|
+
|
|
140
|
+
\`\`\`
|
|
141
|
+
├── src/
|
|
142
|
+
│ ├── benefit-definition.ts # Definição do benefício + máquina de estados
|
|
143
|
+
│ ├── handlers/ # Handlers executados pelo integrador
|
|
144
|
+
│ └── lib/ # Utilitários e mocks
|
|
145
|
+
├── bin/
|
|
146
|
+
│ ├── cli/ # CLI para geração de handlers e testes
|
|
147
|
+
│ └── server/ # Servidor local para testes (npm run dev:start)
|
|
148
|
+
├── ICON.png # Ícone do benefício
|
|
149
|
+
├── .benSDKIgnore # Ignora arquivos no empacotamento
|
|
150
|
+
└── dev-test.example.json # Modelo de credenciais para testes locais
|
|
151
|
+
\`\`\`
|
|
152
|
+
|
|
153
|
+
## Conceitos Básicos
|
|
154
|
+
|
|
155
|
+
### Actions
|
|
156
|
+
|
|
157
|
+
As **Actions** são os eventos enviados pelo integrador ao seu BenSDK. Cada action representa uma operação sobre um benefício (ex: concessão, revogação, recarga) e é processada de acordo com a **máquina de estados** definida em \`src/benefit-definition.ts\`.
|
|
158
|
+
|
|
159
|
+
### Handlers
|
|
160
|
+
|
|
161
|
+
Cada **estado** da máquina de estados corresponde a um arquivo de handler em \`src/handlers/\`. O handler recebe:
|
|
162
|
+
|
|
163
|
+
- \`message\` — contexto da mensagem recebida da fila
|
|
164
|
+
- \`action\` — dados da operação (funcionário, empresa, eligibilityOptions, ctx compartilhado)
|
|
165
|
+
- \`ctx\` — contexto de execução (APIs, logger, benefitDefinition)
|
|
166
|
+
|
|
167
|
+
**Exemplo:**
|
|
168
|
+
|
|
169
|
+
\`\`\`ts
|
|
170
|
+
const handler: StateHandler<ActionGrant, ActionLogGrant['REQUEST_CREATE_EMPLOYEE'], ActionCtx> =
|
|
171
|
+
async (message, action, ctx) => {
|
|
172
|
+
const res = await ctx.benefitPartnerAPI.post('/employees', { ... });
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
handlerResponse: { response: 'ACK' },
|
|
176
|
+
action: {
|
|
177
|
+
state: stateMachine.GRANT.REQUEST_CREATE_EMPLOYEE.next,
|
|
178
|
+
ctx: {},
|
|
179
|
+
logs: {}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
\`\`\`
|
|
184
|
+
|
|
185
|
+
### ctx — Contexto compartilhado entre handlers
|
|
186
|
+
|
|
187
|
+
O campo \`ctx\` dentro de \`action\` é um objeto de estado acumulado ao longo de um fluxo. Use-o para passar dados entre etapas — por exemplo, um ID retornado pela API do parceiro que será necessário em handlers subsequentes. O schema do \`ctx\` é definido em \`benefit-definition.ts\`.
|
|
188
|
+
|
|
189
|
+
### eligibilityOptions
|
|
190
|
+
|
|
191
|
+
As \`eligibilityOptions\` são configurações por empresa que chegam junto com cada action (ex: código externo da empresa no sistema do parceiro, tipo de cartão). O schema é tipado em \`benefit-definition.ts\` e validado pelo integrador antes da execução.
|
|
192
|
+
|
|
193
|
+
## Fluxos
|
|
194
|
+
|
|
195
|
+
${diagrams}
|
|
196
|
+
|
|
197
|
+
## Comandos
|
|
198
|
+
|
|
199
|
+
| Comando | Descrição |
|
|
200
|
+
|---------|-----------|
|
|
201
|
+
| \`npm run dev:start\` | Inicia o servidor local com autenticação real contra a API do parceiro. [→ Ver documentação](docs/DEV_SERVER.md) |
|
|
202
|
+
| \`npm run test\` | Executa os testes unitários com Vitest |
|
|
203
|
+
| \`npm run generate\` | Gera handlers e testes a partir do \`benefit-definition.ts\` |
|
|
204
|
+
| \`npm run start\` | Abre o painel visual da máquina de estados |
|
|
205
|
+
| \`npm run lint\` | Valida tipos TypeScript, formatação e linting |
|
|
206
|
+
| \`npm run build\` | Compila o projeto para \`dist/\` |
|
|
207
|
+
|
|
208
|
+
## Publicação
|
|
209
|
+
|
|
210
|
+
1. Instale o [maria-cli](https://github.com/benup-dev/maria) seguindo as instruções do repositório.
|
|
211
|
+
2. Execute o comando abaixo na raiz do projeto:
|
|
212
|
+
|
|
213
|
+
\`\`\`bash
|
|
214
|
+
maria benefit deploy -r <link-ssh-do-repositorio> -n ${benefitID.toUpperCase()}
|
|
215
|
+
\`\`\`
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
29
218
|
const staticFiles = getAllFiles(path.join(templatesDir, 'bensdk-base'));
|
|
30
219
|
export default async function (benefitID) {
|
|
31
220
|
const availableActions = ['GRANT', 'REVOKE'];
|
|
@@ -39,21 +228,35 @@ export default async function (benefitID) {
|
|
|
39
228
|
message: 'Select the available actions',
|
|
40
229
|
choices: ['RECHARGE', 'DEDUCTION', 'GRANT_DEPENDENT', 'REVOKE_DEPENDENT']
|
|
41
230
|
});
|
|
231
|
+
const { benefitCategory } = await inquirer.prompt({
|
|
232
|
+
type: 'list',
|
|
233
|
+
name: 'benefitCategory',
|
|
234
|
+
message: 'Categoria do benefício (opcional):',
|
|
235
|
+
choices: [
|
|
236
|
+
{ name: '(pular)', value: '' },
|
|
237
|
+
...BENEFIT_CATEGORIES.map((c) => ({ name: c, value: c }))
|
|
238
|
+
],
|
|
239
|
+
default: ''
|
|
240
|
+
});
|
|
241
|
+
const { benefitDescription } = await inquirer.prompt({
|
|
242
|
+
type: 'input',
|
|
243
|
+
name: 'benefitDescription',
|
|
244
|
+
message: 'Descrição curta do benefício (opcional, Enter para pular):'
|
|
245
|
+
});
|
|
42
246
|
const { projectGitSetup } = await inquirer.prompt({
|
|
43
247
|
type: 'confirm',
|
|
44
248
|
name: "projectGitSetup",
|
|
45
|
-
default:
|
|
46
|
-
message: '
|
|
249
|
+
default: true,
|
|
250
|
+
message: 'Configurar um projeto git com husky no pre-commit (recomendado)?'
|
|
47
251
|
});
|
|
48
252
|
const spinner = ora('Creating project').start();
|
|
49
|
-
|
|
253
|
+
const allActions = [...availableActions, ...customAvailableActions];
|
|
50
254
|
packageTemplate.name = benefitID;
|
|
51
255
|
let benefitDefinition = benefitDefinitionTemplate.replace(/benefitID: '.*'/, `benefitID: "${benefitID.toUpperCase()}"`);
|
|
52
256
|
if (!customAvailableActions.includes('RECHARGE')) {
|
|
53
257
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <recharge> \*\/[\s\S]*?\/\*\* <\/recharge> \*\//g, '');
|
|
54
258
|
}
|
|
55
259
|
else {
|
|
56
|
-
// If RECHARGE is selected, just remove the recharge comment markers
|
|
57
260
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <recharge> \*\/\n?/g, '');
|
|
58
261
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <\/recharge> \*\/\n?/g, '');
|
|
59
262
|
}
|
|
@@ -62,7 +265,6 @@ export default async function (benefitID) {
|
|
|
62
265
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <dependent> \*\/[\s\S]*?\/\*\* <\/dependent> \*\//g, '');
|
|
63
266
|
}
|
|
64
267
|
else {
|
|
65
|
-
// If RECHARGE is selected, just remove the recharge comment markers
|
|
66
268
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <dependent> \*\/\n?/g, '');
|
|
67
269
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <\/dependent> \*\/\n?/g, '');
|
|
68
270
|
}
|
|
@@ -84,25 +286,40 @@ export default async function (benefitID) {
|
|
|
84
286
|
});
|
|
85
287
|
fs.mkdirSync(`${appDirectory}/bin/cli`, { recursive: true });
|
|
86
288
|
fs.cpSync(path.join(templatesDir, 'bensdk-cli'), `${appDirectory}/bin/cli`, { recursive: true });
|
|
289
|
+
fs.mkdirSync(`${appDirectory}/bin/docs`, { recursive: true });
|
|
290
|
+
fs.cpSync(path.join(templatesDir, 'bensdk-docs'), `${appDirectory}/bin/docs`, { recursive: true });
|
|
87
291
|
staticFiles.forEach((relativeFilePath) => {
|
|
292
|
+
// README.md is generated dynamically below — skip the template copy
|
|
293
|
+
if (relativeFilePath === 'README.md.template')
|
|
294
|
+
return;
|
|
88
295
|
const sourcePath = path.join(templatesDir, 'bensdk-base', relativeFilePath);
|
|
89
296
|
const destinationPath = path.join(appDirectory, relativeFilePath.replace(/\.template$/, ''));
|
|
90
297
|
// Ensure the destination directory exists
|
|
91
298
|
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
|
|
92
299
|
fs.writeFileSync(destinationPath, fs.readFileSync(sourcePath, 'utf-8'));
|
|
93
300
|
});
|
|
301
|
+
// Generate README.md with benefit metadata and mermaid diagrams
|
|
302
|
+
const readme = generateReadme({
|
|
303
|
+
benefitID,
|
|
304
|
+
benefitCategory,
|
|
305
|
+
benefitDescription,
|
|
306
|
+
actions: allActions
|
|
307
|
+
});
|
|
308
|
+
fs.writeFileSync(`${appDirectory}/README.md`, readme);
|
|
94
309
|
spinner.stop();
|
|
95
310
|
fs.writeFileSync(`${appDirectory}/package.json`, JSON.stringify(packageTemplate, null, 4));
|
|
96
311
|
console.log(chalk.green('✔ Project created'));
|
|
97
312
|
let setupCmd = `cd ${appDirectory} && npm install > /dev/null && npm install @benup/bensdk > /dev/null`;
|
|
98
313
|
if (projectGitSetup) {
|
|
99
|
-
setupCmd += ` && git init && npm install --save-dev husky > /dev/null && npx husky init
|
|
314
|
+
setupCmd += ` && git init && npm install --save-dev husky > /dev/null && npx husky init`;
|
|
315
|
+
setupCmd += ` && echo "npm run docs:update && git add README.md" >> .husky/pre-commit`;
|
|
316
|
+
setupCmd += ` && echo "npm run lint" >> .husky/pre-commit`;
|
|
100
317
|
}
|
|
101
318
|
setupCmd += ` && npm run format > /dev/null && cd bin/viewer && npx vite build > /dev/null`;
|
|
102
319
|
spinner.text = `Building benSDK app '${benefitID}'`;
|
|
103
320
|
spinner.start();
|
|
104
321
|
exec(setupCmd, (error, stdout, stderr) => {
|
|
105
|
-
if (error
|
|
322
|
+
if (error) {
|
|
106
323
|
console.log(error, stderr);
|
|
107
324
|
console.log(chalk.red('Something was wrong during Building benSDK app'));
|
|
108
325
|
spinner.stop();
|
package/bin/src/cli/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/init.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,eAAe,MAAM,mCAAmC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEtF,MAAM,UAAU,GAAG,aAAa,CAAC,M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