@akad/sdk 1.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.
@@ -0,0 +1,6 @@
1
+ import { Config } from '../base';
2
+ import { addressType } from './types';
3
+
4
+ export declare function createAddress(config: Config): {
5
+ getAddress: (data: addressType) => Promise<addressType>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare type addressType = {
2
+ cep: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ import { Config } from '../base';
2
+ import { loginType, getTokenType } from './types';
3
+
4
+ export declare const createAuth: (config: Config) => {
5
+ postLogin: (data: loginType) => Promise<loginType>;
6
+ getToken: (exchangeCode: string) => Promise<getTokenType>;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare type loginType = {
2
+ username: string;
3
+ password: string;
4
+ data?: {
5
+ accessToken?: string;
6
+ };
7
+ status?: number;
8
+ accessToken?: string;
9
+ expiresIn?: number;
10
+ };
11
+ export declare type getTokenType = {
12
+ accessToken: string;
13
+ };
package/base.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { AxiosResponse, AxiosError } from 'axios';
2
+
3
+ export type Config = {
4
+ apiVersion: string;
5
+ baseUrl?: string;
6
+ productCode: string;
7
+ responseInterceptor?: {
8
+ onFulfilled: (value: AxiosResponse) => AxiosResponse | Promise<typeof value>;
9
+ onReject: (error: AxiosError) => Promise<typeof error> | Promise<never>;
10
+ };
11
+ };
12
+ export declare const createBase: (config: Config) => {
13
+ request: <T>(endpoint: string, options?: {
14
+ method: string;
15
+ data: string;
16
+ contentType?: string;
17
+ }) => Promise<T>;
18
+ };
package/base.test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Config } from '../base';
2
+ import { brokerType } from './types';
3
+
4
+ export declare const createBroker: (config: Config) => {
5
+ getBroker: () => Promise<brokerType>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export interface brokerType {
2
+ }
@@ -0,0 +1,6 @@
1
+ import { Config } from '../base';
2
+ import { dataType } from './types';
3
+
4
+ export declare const createData: (config: Config) => {
5
+ postData: (data: dataType) => Promise<dataType>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare type dataType = {
2
+ parameters: string[];
3
+ };
package/main.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { Config } from './base';
2
+
3
+ export default function sdkInitialize(config: Config): {
4
+ auth: {
5
+ postLogin: (data: import('./auth/types').loginType) => Promise<import('./auth/types').loginType>;
6
+ getToken: (exchangeCode: string) => Promise<import('./auth/types').getTokenType>;
7
+ };
8
+ data: {
9
+ postData: (data: import('./data/types').dataType) => Promise<import('./data/types').dataType>;
10
+ };
11
+ quotation: {
12
+ postQuickQuote: (data: import('./quotation/quickQuoteType').quickQuoteType) => Promise<import('./quotation/quickQuoteType').quickQuoteType>;
13
+ postFullQuote: (data: import('./quotation/fullQuoteType').fullQuoteType) => Promise<import('./quotation/fullQuoteType').fullQuoteType>;
14
+ postBind: (data: import('./quotation/bindType').bindType) => Promise<import('./quotation/bindType').bindType>;
15
+ };
16
+ payment: {
17
+ postPayment: (data: import('./payment/types').paymentType) => Promise<import('./payment/types').paymentType>;
18
+ getPaymentStatus: (data: import('./payment/types').paymentStatusType) => Promise<import('./payment/types').paymentStatusType>;
19
+ getPaymentSummary: (data: import('./payment/types').paymentSummaryType) => Promise<import('./payment/types').paymentSummaryType>;
20
+ };
21
+ address: {
22
+ getAddress: (data: import('./address/types').addressType) => Promise<import('./address/types').addressType>;
23
+ };
24
+ broker: {
25
+ getBroker: () => Promise<import('./broker/types').brokerType>;
26
+ };
27
+ plugin: {
28
+ getCnpjStatus: (cnpj: string) => Promise<import('./plugin/types').CnpjStatus>;
29
+ };
30
+ report: {
31
+ getCertificateReport: (data: import('./report/types').certificateReportType) => Promise<import('./report/types').certificateReportType>;
32
+ };
33
+ };
package/main.test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@akad/sdk",
3
+ "version": "1.0.0",
4
+ "main": "./ts-lib.umd.cjs",
5
+ "module": "./ts-lib.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./ts-lib.js",
9
+ "require": "./ts-lib.umd.cjs"
10
+ }
11
+ },
12
+ "types": "./main.d.ts"
13
+ }
@@ -0,0 +1,8 @@
1
+ import { Config } from '../base';
2
+ import { paymentType, paymentStatusType, paymentSummaryType } from './types';
3
+
4
+ export declare const createPayment: (config: Config) => {
5
+ postPayment: (data: paymentType) => Promise<paymentType>;
6
+ getPaymentStatus: (data: paymentStatusType) => Promise<paymentStatusType>;
7
+ getPaymentSummary: (data: paymentSummaryType) => Promise<paymentSummaryType>;
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ export interface paymentType {
2
+ paymentCode: string;
3
+ creditCard?: {
4
+ installment: number;
5
+ name: string;
6
+ number: string;
7
+ identity: string;
8
+ expiration: string;
9
+ cvv: string;
10
+ };
11
+ pix?: {
12
+ installment: number;
13
+ };
14
+ billet?: {
15
+ installment: number;
16
+ };
17
+ }
18
+ export interface paymentSummaryType {
19
+ policyId: string;
20
+ }
21
+ export interface paymentStatusType {
22
+ policyId: string;
23
+ }
@@ -0,0 +1,6 @@
1
+ import { Config } from '../base';
2
+ import { CnpjStatus } from './types';
3
+
4
+ export declare const createPlugin: (config: Config) => {
5
+ getCnpjStatus: (cnpj: string) => Promise<CnpjStatus>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type CnpjStatus = {
2
+ status: boolean;
3
+ name: string;
4
+ };
@@ -0,0 +1,189 @@
1
+ export interface bindType {
2
+ brokerIdentity?: string;
3
+ insured?: {
4
+ name?: string;
5
+ email?: string;
6
+ crea?: number;
7
+ gender?: string;
8
+ document?: string;
9
+ mobile?: string;
10
+ dateOfBirth?: string;
11
+ address?: {
12
+ postCode: string;
13
+ number: string;
14
+ ibge: number;
15
+ state: string;
16
+ city: string;
17
+ street: string;
18
+ suburb: string;
19
+ complement: string;
20
+ };
21
+ isHolding?: boolean;
22
+ };
23
+ responsibleTechnical?: {
24
+ name?: string;
25
+ email?: string;
26
+ crea?: number;
27
+ gender?: string;
28
+ document?: string;
29
+ mobile?: string;
30
+ dateOfBirth?: string;
31
+ address?: {
32
+ postCode: string;
33
+ number: string;
34
+ ibge: number;
35
+ state: string;
36
+ city: string;
37
+ street: string;
38
+ suburb: string;
39
+ complement: string;
40
+ };
41
+ };
42
+ claim?: {
43
+ reportedClaim?: string;
44
+ totalAmount?: number;
45
+ priorKnowledge?: boolean;
46
+ description?: string;
47
+ expectedNotification?: {
48
+ amount?: number;
49
+ occurence?: [
50
+ {
51
+ date?: Date;
52
+ claimValue?: number;
53
+ description?: string;
54
+ }
55
+ ];
56
+ };
57
+ inquireClaims?: {
58
+ amount?: number;
59
+ occurence?: [
60
+ {
61
+ date?: Date;
62
+ claimValue?: number;
63
+ description?: string;
64
+ }
65
+ ];
66
+ };
67
+ };
68
+ habitation?: {
69
+ isInsideCondominum?: boolean;
70
+ propertyType?: string;
71
+ apf?: string;
72
+ artOrRrt?: number;
73
+ insuredAmount?: number;
74
+ unit?: {
75
+ registrationNumber?: number;
76
+ parentRegistrationNumber?: number;
77
+ housingNumber?: number;
78
+ housingDate?: string;
79
+ registryName?: string;
80
+ bookNumber?: string;
81
+ startConstructionDate?: string;
82
+ endConstructionDate?: string;
83
+ address?: {
84
+ postCode: string;
85
+ number: string;
86
+ ibge: number;
87
+ state: string;
88
+ city: string;
89
+ street: string;
90
+ suburb: string;
91
+ complement: string;
92
+ };
93
+ };
94
+ };
95
+ broker?: {
96
+ identity?: string;
97
+ comission?: number;
98
+ contact?: {
99
+ phone?: string;
100
+ email?: string;
101
+ };
102
+ coBrokerage?: [
103
+ {
104
+ name?: string;
105
+ document?: string;
106
+ comission?: number;
107
+ susepNumber?: number;
108
+ }
109
+ ];
110
+ showBrokerageInfo?: boolean;
111
+ };
112
+ companyActivityStart?: string;
113
+ constitutionType?: string;
114
+ corporateControl?: string;
115
+ annualNetRevenue?: number;
116
+ netIncome?: number;
117
+ totalAssetAmount?: number;
118
+ totalLoanAmount?: number;
119
+ netWorth?: number;
120
+ judicialRecovery?: {
121
+ hasOccurence?: boolean;
122
+ occurence?: [
123
+ {
124
+ date?: Date;
125
+ description?: string;
126
+ }
127
+ ];
128
+ };
129
+ activities?: string[];
130
+ hasLoanWithAdministrationPublic?: boolean;
131
+ hasParticipationTendersPublic?: boolean;
132
+ hasContractsPublic?: boolean;
133
+ deductible?: string;
134
+ coveragePlan?: {
135
+ id?: number;
136
+ coverages?: [
137
+ {
138
+ id?: number;
139
+ lmg?: number;
140
+ }
141
+ ];
142
+ };
143
+ netPremium?: number;
144
+ discount?: number;
145
+ surcharge?: number;
146
+ multiQuoteRiskAnalysis?: [
147
+ {
148
+ insuredAmount?: number;
149
+ }
150
+ ];
151
+ companyModification?: {
152
+ corporateName?: {
153
+ hasOccurence?: boolean;
154
+ occurence?: [
155
+ {
156
+ date?: Date;
157
+ description?: string;
158
+ }
159
+ ];
160
+ };
161
+ shareholder?: {
162
+ hasOccurence?: boolean;
163
+ occurence?: [
164
+ {
165
+ date?: Date;
166
+ description?: string;
167
+ }
168
+ ];
169
+ };
170
+ acquirement?: {
171
+ hasOccurence?: boolean;
172
+ occurence?: [
173
+ {
174
+ date?: Date;
175
+ description?: string;
176
+ }
177
+ ];
178
+ };
179
+ affiliatedCompanies?: {
180
+ hasOccurence?: boolean;
181
+ occurence?: [
182
+ {
183
+ name?: string;
184
+ document?: string;
185
+ }
186
+ ];
187
+ };
188
+ };
189
+ }
@@ -0,0 +1,189 @@
1
+ export interface fullQuoteType {
2
+ brokerIdentity?: string;
3
+ insured?: {
4
+ name?: string;
5
+ email?: string;
6
+ crea?: number;
7
+ gender?: string;
8
+ document?: string;
9
+ mobile?: string;
10
+ dateOfBirth?: string;
11
+ address?: {
12
+ postCode: string;
13
+ number: string;
14
+ ibge: number;
15
+ state: string;
16
+ city: string;
17
+ street: string;
18
+ suburb: string;
19
+ complement: string;
20
+ };
21
+ isHolding?: boolean;
22
+ };
23
+ responsibleTechnical?: {
24
+ name?: string;
25
+ email?: string;
26
+ crea?: number;
27
+ gender?: string;
28
+ document?: string;
29
+ mobile?: string;
30
+ dateOfBirth?: string;
31
+ address?: {
32
+ postCode: string;
33
+ number: string;
34
+ ibge: number;
35
+ state: string;
36
+ city: string;
37
+ street: string;
38
+ suburb: string;
39
+ complement: string;
40
+ };
41
+ };
42
+ claim?: {
43
+ reportedClaim?: string;
44
+ totalAmount?: number;
45
+ priorKnowledge?: boolean;
46
+ description?: string;
47
+ expectedNotification?: {
48
+ amount?: number;
49
+ occurence?: [
50
+ {
51
+ date?: Date;
52
+ claimValue?: number;
53
+ description?: string;
54
+ }
55
+ ];
56
+ };
57
+ inquireClaims?: {
58
+ amount?: number;
59
+ occurence?: [
60
+ {
61
+ date?: Date;
62
+ claimValue?: number;
63
+ description?: string;
64
+ }
65
+ ];
66
+ };
67
+ };
68
+ habitation?: {
69
+ isInsideCondominum?: boolean;
70
+ propertyType?: string;
71
+ apf?: string;
72
+ artOrRrt?: number;
73
+ insuredAmount?: number;
74
+ unit?: {
75
+ registrationNumber?: number;
76
+ parentRegistrationNumber?: number;
77
+ housingNumber?: number;
78
+ housingDate?: string;
79
+ registryName?: string;
80
+ bookNumber?: string;
81
+ startConstructionDate?: string;
82
+ endConstructionDate?: string;
83
+ address?: {
84
+ postCode: string;
85
+ number: string;
86
+ ibge: number;
87
+ state: string;
88
+ city: string;
89
+ street: string;
90
+ suburb: string;
91
+ complement: string;
92
+ };
93
+ };
94
+ };
95
+ broker?: {
96
+ identity?: string;
97
+ comission?: number;
98
+ contact?: {
99
+ phone?: string;
100
+ email?: string;
101
+ };
102
+ coBrokerage?: [
103
+ {
104
+ name?: string;
105
+ document?: string;
106
+ comission?: number;
107
+ susepNumber?: number;
108
+ }
109
+ ];
110
+ showBrokerageInfo?: boolean;
111
+ };
112
+ companyActivityStart?: string;
113
+ constitutionType?: string;
114
+ corporateControl?: string;
115
+ annualNetRevenue?: number;
116
+ netIncome?: number;
117
+ totalAssetAmount?: number;
118
+ totalLoanAmount?: number;
119
+ netWorth?: number;
120
+ judicialRecovery?: {
121
+ hasOccurence?: boolean;
122
+ occurence?: [
123
+ {
124
+ date?: Date;
125
+ description?: string;
126
+ }
127
+ ];
128
+ };
129
+ activities?: string[];
130
+ hasLoanWithAdministrationPublic?: boolean;
131
+ hasParticipationTendersPublic?: boolean;
132
+ hasContractsPublic?: boolean;
133
+ deductible?: string;
134
+ coveragePlan?: {
135
+ id?: number;
136
+ coverages?: [
137
+ {
138
+ id?: number;
139
+ lmg?: number;
140
+ }
141
+ ];
142
+ };
143
+ netPremium?: number;
144
+ discount?: number;
145
+ surcharge?: number;
146
+ multiQuoteRiskAnalysis?: [
147
+ {
148
+ insuredAmount?: number;
149
+ }
150
+ ];
151
+ companyModification?: {
152
+ corporateName?: {
153
+ hasOccurence?: boolean;
154
+ occurence?: [
155
+ {
156
+ date?: Date;
157
+ description?: string;
158
+ }
159
+ ];
160
+ };
161
+ shareholder?: {
162
+ hasOccurence?: boolean;
163
+ occurence?: [
164
+ {
165
+ date?: Date;
166
+ description?: string;
167
+ }
168
+ ];
169
+ };
170
+ acquirement?: {
171
+ hasOccurence?: boolean;
172
+ occurence?: [
173
+ {
174
+ date?: Date;
175
+ description?: string;
176
+ }
177
+ ];
178
+ };
179
+ affiliatedCompanies?: {
180
+ hasOccurence?: boolean;
181
+ occurence?: [
182
+ {
183
+ name?: string;
184
+ document?: string;
185
+ }
186
+ ];
187
+ };
188
+ };
189
+ }
@@ -0,0 +1,10 @@
1
+ import { Config } from '../base';
2
+ import { bindType } from './bindType';
3
+ import { fullQuoteType } from './fullQuoteType';
4
+ import { quickQuoteType } from './quickQuoteType';
5
+
6
+ export declare const createQuote: (config: Config) => {
7
+ postQuickQuote: (data: quickQuoteType) => Promise<quickQuoteType>;
8
+ postFullQuote: (data: fullQuoteType) => Promise<fullQuoteType>;
9
+ postBind: (data: bindType) => Promise<bindType>;
10
+ };
@@ -0,0 +1 @@
1
+ export {};