@benup/bensdk 1.4.0 → 1.5.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/lib/consumer/index.d.ts +6 -0
- package/bin/lib/schemas/action.schema.d.ts +68 -23
- package/bin/lib/types/action.types.d.ts +2 -1
- package/bin/lib/types/benefit-definition.types.d.ts +16 -1
- package/bin/lib/types/state-handler.types.d.ts +4 -0
- package/bin/src/cli/init.js +20 -4
- package/bin/src/cli/init.js.map +1 -1
- package/bin/src/cli/templates/bensdk-base/.github/workflows/security-scan.yml +22 -0
- package/bin/src/cli/templates/bensdk-base/.github/workflows/sm-tests.yml +29 -0
- package/package.json +1 -1
|
@@ -76,10 +76,16 @@ export interface ConsumerOptions<T> {
|
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* helper for send message to a sqs queue
|
|
79
|
+
* @param sqs
|
|
80
|
+
* @param queueUrl
|
|
81
|
+
* @param message
|
|
82
|
+
* @param attributes
|
|
79
83
|
*/
|
|
80
84
|
export declare function send(sqs: SQSClient, queueUrl: string, message: object | string, attributes: Record<string, MessageAttributeValue>): Promise<SendMessageCommandOutput>;
|
|
81
85
|
/**
|
|
82
86
|
* Create a new consumerHandler
|
|
87
|
+
* @param options
|
|
88
|
+
* @param sqs
|
|
83
89
|
*/
|
|
84
90
|
export declare const createConsumerHandler: <T>(options: ConsumerOptions<T>, sqs: SQSClient) => (rawMessage: Message) => Promise<Message | void>;
|
|
85
91
|
/**
|
|
@@ -8016,7 +8016,6 @@ export declare const DeductionFileIngestionActionSchema: z.ZodObject<{
|
|
|
8016
8016
|
};
|
|
8017
8017
|
}>;
|
|
8018
8018
|
eligibilityOptions: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
8019
|
-
ctx: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
8020
8019
|
hooksCtx: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
8021
8020
|
log: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
8022
8021
|
origin: z.ZodString;
|
|
@@ -8040,6 +8039,58 @@ export declare const DeductionFileIngestionActionSchema: z.ZodObject<{
|
|
|
8040
8039
|
url?: string;
|
|
8041
8040
|
size?: number;
|
|
8042
8041
|
}>;
|
|
8042
|
+
ctx: z.ZodOptional<z.ZodObject<{
|
|
8043
|
+
deductions: z.ZodArray<z.ZodObject<{
|
|
8044
|
+
cpf: z.ZodString;
|
|
8045
|
+
value: z.ZodNumber;
|
|
8046
|
+
isAccumulative: z.ZodOptional<z.ZodBoolean>;
|
|
8047
|
+
date: z.ZodString;
|
|
8048
|
+
}, "strip", z.ZodTypeAny, {
|
|
8049
|
+
value?: number;
|
|
8050
|
+
date?: string;
|
|
8051
|
+
cpf?: string;
|
|
8052
|
+
isAccumulative?: boolean;
|
|
8053
|
+
}, {
|
|
8054
|
+
value?: number;
|
|
8055
|
+
date?: string;
|
|
8056
|
+
cpf?: string;
|
|
8057
|
+
isAccumulative?: boolean;
|
|
8058
|
+
}>, "many">;
|
|
8059
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
8060
|
+
deductions: z.ZodArray<z.ZodObject<{
|
|
8061
|
+
cpf: z.ZodString;
|
|
8062
|
+
value: z.ZodNumber;
|
|
8063
|
+
isAccumulative: z.ZodOptional<z.ZodBoolean>;
|
|
8064
|
+
date: z.ZodString;
|
|
8065
|
+
}, "strip", z.ZodTypeAny, {
|
|
8066
|
+
value?: number;
|
|
8067
|
+
date?: string;
|
|
8068
|
+
cpf?: string;
|
|
8069
|
+
isAccumulative?: boolean;
|
|
8070
|
+
}, {
|
|
8071
|
+
value?: number;
|
|
8072
|
+
date?: string;
|
|
8073
|
+
cpf?: string;
|
|
8074
|
+
isAccumulative?: boolean;
|
|
8075
|
+
}>, "many">;
|
|
8076
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
8077
|
+
deductions: z.ZodArray<z.ZodObject<{
|
|
8078
|
+
cpf: z.ZodString;
|
|
8079
|
+
value: z.ZodNumber;
|
|
8080
|
+
isAccumulative: z.ZodOptional<z.ZodBoolean>;
|
|
8081
|
+
date: z.ZodString;
|
|
8082
|
+
}, "strip", z.ZodTypeAny, {
|
|
8083
|
+
value?: number;
|
|
8084
|
+
date?: string;
|
|
8085
|
+
cpf?: string;
|
|
8086
|
+
isAccumulative?: boolean;
|
|
8087
|
+
}, {
|
|
8088
|
+
value?: number;
|
|
8089
|
+
date?: string;
|
|
8090
|
+
cpf?: string;
|
|
8091
|
+
isAccumulative?: boolean;
|
|
8092
|
+
}>, "many">;
|
|
8093
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
8043
8094
|
}, "strip", z.ZodTypeAny, {
|
|
8044
8095
|
origin?: string;
|
|
8045
8096
|
state?: string;
|
|
@@ -8284,7 +8335,14 @@ export declare const DeductionFileIngestionActionSchema: z.ZodObject<{
|
|
|
8284
8335
|
eligibilityOptions?: {} & {
|
|
8285
8336
|
[k: string]: unknown;
|
|
8286
8337
|
};
|
|
8287
|
-
ctx?: {
|
|
8338
|
+
ctx?: {
|
|
8339
|
+
deductions?: {
|
|
8340
|
+
value?: number;
|
|
8341
|
+
date?: string;
|
|
8342
|
+
cpf?: string;
|
|
8343
|
+
isAccumulative?: boolean;
|
|
8344
|
+
}[];
|
|
8345
|
+
} & {
|
|
8288
8346
|
[k: string]: unknown;
|
|
8289
8347
|
};
|
|
8290
8348
|
hooksCtx?: {} & {
|
|
@@ -8543,7 +8601,14 @@ export declare const DeductionFileIngestionActionSchema: z.ZodObject<{
|
|
|
8543
8601
|
eligibilityOptions?: {} & {
|
|
8544
8602
|
[k: string]: unknown;
|
|
8545
8603
|
};
|
|
8546
|
-
ctx?: {
|
|
8604
|
+
ctx?: {
|
|
8605
|
+
deductions?: {
|
|
8606
|
+
value?: number;
|
|
8607
|
+
date?: string;
|
|
8608
|
+
cpf?: string;
|
|
8609
|
+
isAccumulative?: boolean;
|
|
8610
|
+
}[];
|
|
8611
|
+
} & {
|
|
8547
8612
|
[k: string]: unknown;
|
|
8548
8613
|
};
|
|
8549
8614
|
hooksCtx?: {} & {
|
|
@@ -12357,29 +12422,17 @@ export declare const DeductionActionSchema: z.ZodObject<{
|
|
|
12357
12422
|
updatedAt: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
|
|
12358
12423
|
} & {
|
|
12359
12424
|
deductionInput: z.ZodObject<{
|
|
12360
|
-
payrollSystem: z.ZodString;
|
|
12361
|
-
externalSheetID: z.ZodString;
|
|
12362
|
-
externalEventID: z.ZodString;
|
|
12363
|
-
externalSituationID: z.ZodNumber;
|
|
12364
12425
|
isAccumulative: z.ZodBoolean;
|
|
12365
12426
|
date: z.ZodString;
|
|
12366
12427
|
value: z.ZodNumber;
|
|
12367
12428
|
}, "strip", z.ZodTypeAny, {
|
|
12368
12429
|
value?: number;
|
|
12369
12430
|
date?: string;
|
|
12370
|
-
payrollSystem?: string;
|
|
12371
|
-
externalSheetID?: string;
|
|
12372
12431
|
isAccumulative?: boolean;
|
|
12373
|
-
externalSituationID?: number;
|
|
12374
|
-
externalEventID?: string;
|
|
12375
12432
|
}, {
|
|
12376
12433
|
value?: number;
|
|
12377
12434
|
date?: string;
|
|
12378
|
-
payrollSystem?: string;
|
|
12379
|
-
externalSheetID?: string;
|
|
12380
12435
|
isAccumulative?: boolean;
|
|
12381
|
-
externalSituationID?: number;
|
|
12382
|
-
externalEventID?: string;
|
|
12383
12436
|
}>;
|
|
12384
12437
|
}, "strip", z.ZodTypeAny, {
|
|
12385
12438
|
origin?: string;
|
|
@@ -12637,11 +12690,7 @@ export declare const DeductionActionSchema: z.ZodObject<{
|
|
|
12637
12690
|
deductionInput?: {
|
|
12638
12691
|
value?: number;
|
|
12639
12692
|
date?: string;
|
|
12640
|
-
payrollSystem?: string;
|
|
12641
|
-
externalSheetID?: string;
|
|
12642
12693
|
isAccumulative?: boolean;
|
|
12643
|
-
externalSituationID?: number;
|
|
12644
|
-
externalEventID?: string;
|
|
12645
12694
|
};
|
|
12646
12695
|
}, {
|
|
12647
12696
|
origin?: string;
|
|
@@ -12899,10 +12948,6 @@ export declare const DeductionActionSchema: z.ZodObject<{
|
|
|
12899
12948
|
deductionInput?: {
|
|
12900
12949
|
value?: number;
|
|
12901
12950
|
date?: string;
|
|
12902
|
-
payrollSystem?: string;
|
|
12903
|
-
externalSheetID?: string;
|
|
12904
12951
|
isAccumulative?: boolean;
|
|
12905
|
-
externalSituationID?: number;
|
|
12906
|
-
externalEventID?: string;
|
|
12907
12952
|
};
|
|
12908
12953
|
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { ActionSchema, DeductionActionSchema, DependentActionSchema, GrantRevokeActionSchema, RechargeActionSchema } from '../schemas/action.schema';
|
|
2
|
+
import { ActionSchema, DeductionActionSchema, DeductionFileIngestionActionSchema, DependentActionSchema, GrantRevokeActionSchema, RechargeActionSchema } from '../schemas/action.schema';
|
|
3
3
|
export type ActionBaseGrantRevoke = z.infer<typeof GrantRevokeActionSchema>;
|
|
4
4
|
export type ActionBaseRecharge = z.infer<typeof RechargeActionSchema>;
|
|
5
5
|
export type ActionBaseDeduction = z.infer<typeof DeductionActionSchema>;
|
|
6
6
|
export type ActionBaseDependent = z.infer<typeof DependentActionSchema>;
|
|
7
7
|
export type ActionBase = z.infer<typeof ActionSchema>;
|
|
8
|
+
export type ActionBaseDeductionFileIngestion = z.infer<typeof DeductionFileIngestionActionSchema>;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import { BenefitDefinitionSchema } from '../schemas/benefit-definition.schema';
|
|
3
|
-
|
|
3
|
+
type Base = z.infer<typeof BenefitDefinitionSchema>;
|
|
4
|
+
export type BenefitDefinition = Omit<Base, 'stateMachine'> & {
|
|
5
|
+
stateMachine: Base['stateMachine'] & {
|
|
6
|
+
DEDUCTION_FILE_INGESTION?: {
|
|
7
|
+
REQUESTED_DEDUCTION_FILE_INGESTION: {
|
|
8
|
+
next: 'PENDING_CREATE_DEDUCTION' | string;
|
|
9
|
+
};
|
|
10
|
+
} & any;
|
|
11
|
+
DEDUCTION?: {
|
|
12
|
+
REQUESTED_DEDUCTION: {
|
|
13
|
+
next: 'REQUESTED_PAYROLL_DEDUCTION' | string;
|
|
14
|
+
};
|
|
15
|
+
} & any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/bin/src/cli/init.js
CHANGED
|
@@ -11,7 +11,20 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
11
11
|
const __dirname = path.dirname(__filename);
|
|
12
12
|
const templatesDir = path.join(__dirname, 'templates');
|
|
13
13
|
const benefitDefinitionTemplate = fs.readFileSync(path.join(templatesDir, 'benefit-definition.template.ts'), 'utf-8');
|
|
14
|
-
const
|
|
14
|
+
const getAllFiles = (dirPath, arrayOfFiles = []) => {
|
|
15
|
+
const files = fs.readdirSync(dirPath);
|
|
16
|
+
files.forEach((file) => {
|
|
17
|
+
const fullPath = path.join(dirPath, file);
|
|
18
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
19
|
+
getAllFiles(fullPath, arrayOfFiles);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
arrayOfFiles.push(path.relative(path.join(templatesDir, 'bensdk-base'), fullPath));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return arrayOfFiles;
|
|
26
|
+
};
|
|
27
|
+
const staticFiles = getAllFiles(path.join(templatesDir, 'bensdk-base'));
|
|
15
28
|
export default async function (benefitID) {
|
|
16
29
|
const availableActions = ['GRANT', 'REVOKE'];
|
|
17
30
|
if (!benefitID) {
|
|
@@ -28,7 +41,6 @@ export default async function (benefitID) {
|
|
|
28
41
|
let actions = [...availableActions, ...customAvailableActions].map((action) => `"${action}"`);
|
|
29
42
|
packageTemplate.name = benefitID;
|
|
30
43
|
let benefitDefinition = benefitDefinitionTemplate.replace(/benefitID: '.*'/, `benefitID: "${benefitID.toUpperCase()}"`);
|
|
31
|
-
benefitDefinition = benefitDefinition.replace(/availableActions: \[\].*/, `availableActions: [${actions.join(', ')}],`);
|
|
32
44
|
if (!customAvailableActions.includes('RECHARGE')) {
|
|
33
45
|
benefitDefinition = benefitDefinition.replace(/\/\*\* <recharge> \*\/[\s\S]*?\/\*\* <\/recharge> \*\//g, '');
|
|
34
46
|
}
|
|
@@ -62,8 +74,12 @@ export default async function (benefitID) {
|
|
|
62
74
|
});
|
|
63
75
|
fs.mkdirSync(`${appDirectory}/bin/cli`, { recursive: true });
|
|
64
76
|
fs.cpSync(path.join(templatesDir, 'bensdk-cli'), `${appDirectory}/bin/cli`, { recursive: true });
|
|
65
|
-
staticFiles.forEach((
|
|
66
|
-
|
|
77
|
+
staticFiles.forEach((relativeFilePath) => {
|
|
78
|
+
const sourcePath = path.join(templatesDir, 'bensdk-base', relativeFilePath);
|
|
79
|
+
const destinationPath = path.join(appDirectory, relativeFilePath.replace(/\.template$/, ''));
|
|
80
|
+
// Ensure the destination directory exists
|
|
81
|
+
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
|
|
82
|
+
fs.writeFileSync(destinationPath, fs.readFileSync(sourcePath, 'utf-8'));
|
|
67
83
|
});
|
|
68
84
|
spinner.stop();
|
|
69
85
|
fs.writeFileSync(`${appDirectory}/package.json`, JSON.stringify(packageTemplate, null, 4));
|
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,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEvD,MAAM,yBAAyB,GAAG,EAAE,CAAC,YAAY,CAC/C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,gCAAgC,CAAC,EACzD,OAAO,CACR,CAAC;AAEF,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;
|
|
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,OAA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CAAC,IAAI,GAAG,qBAAqB,CAAC;IACrC,OAAO,CAAC,KAAK,EAAE,CAAC;IAChB,IAAI,CACF,MAAM,YAAY,mJAAmJ,EACrK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC,CAAC;YACzE,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QACD,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Security Scan
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
# Evita execuções duplicadas simultâneas.
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
semgrep-security-scan:
|
|
16
|
+
uses: benup-dev/.github/.github/workflows/semgrep-scan.yml@main # repositório remoto
|
|
17
|
+
with:
|
|
18
|
+
scan-mode: ${{ github.event_name == 'pull_request' && 'pr' || 'push' }}
|
|
19
|
+
secrets:
|
|
20
|
+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
|
21
|
+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
22
|
+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Integration Tests CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Use Node.js 20.x
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: 20.x
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm install
|
|
27
|
+
|
|
28
|
+
- name: Run tests
|
|
29
|
+
run: npm test
|