@akad/sdk 1.0.18 → 1.0.20

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/base.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare const createBase: (config: Config) => {
19
19
  data: string;
20
20
  contentType?: string;
21
21
  responseType?: ResponseType;
22
+ headers?: Record<string, string>;
22
23
  }) => Promise<T>;
23
24
  getAccessToken: () => string | null;
24
25
  setTokens: (tokens: TokenResponse) => void;
package/broker/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Config } from '../base';
2
- import { brokerageFirmType, brokerType } from './types';
2
+ import { BrokerageFirmType } from './types';
3
3
 
4
4
  export declare const createBroker: (config: Config) => {
5
- getBroker: () => Promise<brokerType>;
6
- getAllBrokerages: (name: string) => Promise<brokerageFirmType>;
5
+ getBroker: () => Promise<unknown>;
6
+ getAllBrokerages: (name: string) => Promise<BrokerageFirmType>;
7
7
  };
package/broker/types.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- export interface brokerType {
2
- }
3
- export interface brokerageFirmType {
1
+ export interface BrokerageFirmType {
4
2
  identity: string;
5
3
  name: string;
6
4
  }
@@ -0,0 +1,5 @@
1
+ import { Config } from '../base';
2
+
3
+ export declare const createEndorsement: (config: Config) => {
4
+ putEndorsement: <ReqPayload = unknown, ResPayload = unknown>(data: ReqPayload, attachments?: File | File[]) => Promise<ResPayload>;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
package/main.d.ts CHANGED
@@ -16,37 +16,52 @@ export default function sdkInitialize(config: Config): {
16
16
  postData: (data: import('./data/types').dataType) => Promise<import('./data/types').dataType>;
17
17
  };
18
18
  quotation: {
19
- getQuotations: (params: import('./quotation/quotationType').quotationListParams) => Promise<import('./quotation/quotationType').quotationDetail[]>;
20
- getQuotationDetail: (params: import('./quotation/quotationType').quotationType) => Promise<import('./quotation/quotationType').quotationDetail>;
21
- postQuickQuote: (data: import('./quotation/quickQuoteType').quickQuoteType) => Promise<import('./quotation/quickQuoteType').quickQuoteType>;
22
- postFullQuote: (data: import('./quotation/fullQuoteType').fullQuoteType) => Promise<import('./quotation/fullQuoteType').fullQuoteType>;
23
- postBind: (data: import('./quotation/bindType').bindType) => Promise<import('./quotation/bindType').bindType>;
24
- getQuotation: (data: import('./quotation/quotationType').quotationType) => Promise<import('./quotation/quotationType').quotationType>;
25
- getVersions: (data: import('./quotation/versionsType').versionsType) => Promise<import('./quotation/versionsType').versionsType>;
26
- switchSelectedVersion: (data: import('./quotation/switchSelectedVersionType').switchSelectedVersionType) => Promise<import('./quotation/switchSelectedVersionType').switchSelectedVersionType>;
19
+ getQuotations: (params: import('./quotation/quotationType').QuotationListParams) => Promise<import('./quotation/quotationType').QuotationDetail[]>;
20
+ getQuotationDetail: (params: import('./quotation/quotationType').QuotationType) => Promise<import('./quotation/quotationType').QuotationDetail>;
21
+ postQuickQuote: (data: import('./quotation/quickQuoteType').QuickQuoteType) => Promise<import('./quotation/quickQuoteType').QuickQuoteType>;
22
+ postFullQuote: (data: import('./quotation/fullQuoteType').FullQuoteType) => Promise<import('./quotation/fullQuoteType').FullQuoteType>;
23
+ postBind: (data: import('./quotation/bindType').BindType) => Promise<import('./quotation/bindType').BindType>;
24
+ getQuotation: (data: import('./quotation/quotationType').QuotationType) => Promise<import('./quotation/quotationType').QuotationType>;
25
+ getVersions: (data: import('./quotation/versionsType').VersionsType) => Promise<import('./quotation/versionsType').VersionsType>;
26
+ switchSelectedVersion: (data: import('./quotation/switchSelectedVersionType').SwitchSelectedVersionType) => Promise<import('./quotation/switchSelectedVersionType').SwitchSelectedVersionType>;
27
27
  };
28
28
  payment: {
29
- postPayment: (data: import('./payment/types').paymentType) => Promise<import('./payment/types').paymentType>;
30
- getPaymentStatus: (data: import('./payment/types').paymentStatusType) => Promise<import('./payment/types').paymentStatusType>;
31
- getPaymentSummary: (data: import('./payment/types').paymentSummaryType) => Promise<import('./payment/types').paymentSummaryType>;
29
+ postPayment: (data: import('./payment/types').PaymentType) => Promise<import('./payment/types').PaymentType>;
30
+ getPaymentStatus: (data: import('./payment/types').PaymentStatusType) => Promise<import('./payment/types').PaymentStatusType>;
31
+ getPaymentSummary: (data: import('./payment/types').PaymentSummaryType) => Promise<import('./payment/types').PaymentSummaryType>;
32
32
  };
33
33
  address: {
34
34
  getAddress: (data: import('./address/types').addressType) => Promise<import('./address/types').addressType>;
35
35
  };
36
36
  broker: {
37
- getBroker: () => Promise<import('./broker/types').brokerType>;
38
- getAllBrokerages: (name: string) => Promise<import('./broker/types').brokerageFirmType>;
37
+ getBroker: () => Promise<unknown>;
38
+ getAllBrokerages: (name: string) => Promise<import('./broker/types').BrokerageFirmType>;
39
+ };
40
+ endorsement: {
41
+ putEndorsement: <ReqPayload = unknown, ResPayload = unknown>(data: ReqPayload, attachments?: File | File[] | undefined) => Promise<ResPayload>;
39
42
  };
40
43
  plugin: {
41
44
  getCnpjStatus: (cnpj: string) => Promise<import('./plugin/types').CnpjStatus>;
42
- getKeyNumber: () => Promise<import('./plugin/types').keyNumberType>;
43
- getProposalNumberByKeyNumber: (data: import('./plugin/types').proposalNumberByKeyNumberType) => Promise<import('./plugin/types').proposalNumberByKeyNumberType>;
44
- postCoveragesAndClausesRules: (data: import('./plugin/types').coveragesAndClausesRulesType) => Promise<import('./plugin/types').coveragesAndClausesRulesType>;
45
+ getKeyNumber: () => Promise<unknown>;
46
+ getProposalNumberByKeyNumber: (data: import('./plugin/types').ProposalNumberByKeyNumberType) => Promise<import('./plugin/types').ProposalNumberByKeyNumberType>;
47
+ postCoveragesAndClausesRules: (data: import('./plugin/types').CoveragesAndClausesRulesType) => Promise<import('./plugin/types').CoveragesAndClausesRulesType>;
45
48
  };
46
49
  report: {
47
- getReportStream: (data: import('./report/types').certificateReportType) => Promise<import('./report/types').certificateReportType>;
50
+ getReportStream: (data: import('./report/types').CertificateReportType) => Promise<import('./report/types').CertificateReportType>;
48
51
  };
49
52
  subscriber: {
50
53
  getSubscriber: (cnpj: string) => Promise<import('./subscriber/types').getSubscriberType>;
51
54
  };
55
+ base: {
56
+ request: <T>(endpoint: string, options?: {
57
+ method: string;
58
+ data: string;
59
+ contentType?: string | undefined;
60
+ responseType?: import('axios').ResponseType | undefined;
61
+ headers?: Record<string, string> | undefined;
62
+ } | undefined) => Promise<T>;
63
+ getAccessToken: () => string | null;
64
+ setTokens: (tokens: import('./helpers/TokenRefreshManager').TokenResponse) => void;
65
+ clearTokens: () => void;
66
+ };
52
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akad/sdk",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "main": "./ts-lib.umd.cjs",
5
5
  "module": "./ts-lib.js",
6
6
  "exports": {
@@ -1,8 +1,8 @@
1
1
  import { Config } from '../base';
2
- import { paymentType, paymentStatusType, paymentSummaryType } from './types';
2
+ import { PaymentType, PaymentStatusType, PaymentSummaryType } from './types';
3
3
 
4
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>;
5
+ postPayment: (data: PaymentType) => Promise<PaymentType>;
6
+ getPaymentStatus: (data: PaymentStatusType) => Promise<PaymentStatusType>;
7
+ getPaymentSummary: (data: PaymentSummaryType) => Promise<PaymentSummaryType>;
8
8
  };
@@ -1,4 +1,4 @@
1
- export interface paymentType {
1
+ export interface PaymentType {
2
2
  paymentCode: string;
3
3
  creditCard?: {
4
4
  installment: number;
@@ -32,9 +32,9 @@ export interface paymentType {
32
32
  };
33
33
  };
34
34
  }
35
- export interface paymentSummaryType {
35
+ export interface PaymentSummaryType {
36
36
  policyId: string;
37
37
  }
38
- export interface paymentStatusType {
38
+ export interface PaymentStatusType {
39
39
  policyId: string;
40
40
  }
package/plugin/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Config } from '../base';
2
- import { CnpjStatus, coveragesAndClausesRulesType, keyNumberType, proposalNumberByKeyNumberType } from './types';
2
+ import { CnpjStatus, CoveragesAndClausesRulesType, ProposalNumberByKeyNumberType } from './types';
3
3
 
4
4
  export declare const createPlugin: (config: Config) => {
5
5
  getCnpjStatus: (cnpj: string) => Promise<CnpjStatus>;
6
- getKeyNumber: () => Promise<keyNumberType>;
7
- getProposalNumberByKeyNumber: (data: proposalNumberByKeyNumberType) => Promise<proposalNumberByKeyNumberType>;
8
- postCoveragesAndClausesRules: (data: coveragesAndClausesRulesType) => Promise<coveragesAndClausesRulesType>;
6
+ getKeyNumber: () => Promise<unknown>;
7
+ getProposalNumberByKeyNumber: (data: ProposalNumberByKeyNumberType) => Promise<ProposalNumberByKeyNumberType>;
8
+ postCoveragesAndClausesRules: (data: CoveragesAndClausesRulesType) => Promise<CoveragesAndClausesRulesType>;
9
9
  };
package/plugin/types.d.ts CHANGED
@@ -2,12 +2,10 @@ export type CnpjStatus = {
2
2
  status: boolean;
3
3
  name: string;
4
4
  };
5
- export interface keyNumberType {
6
- }
7
- export type proposalNumberByKeyNumberType = {
5
+ export type ProposalNumberByKeyNumberType = {
8
6
  keyNumber: string;
9
7
  };
10
- export type coveragesAndClausesRulesType = {
8
+ export type CoveragesAndClausesRulesType = {
11
9
  brokerIdentity?: string;
12
10
  insured?: {
13
11
  name?: string;
@@ -1,4 +1,4 @@
1
- export interface bindType {
1
+ export interface BindType {
2
2
  brokerIdentity?: string;
3
3
  insured?: {
4
4
  name?: string;
@@ -1,4 +1,4 @@
1
- export interface fullQuoteType {
1
+ export interface FullQuoteType {
2
2
  brokerIdentity?: string;
3
3
  insured?: {
4
4
  name?: string;
@@ -1,18 +1,18 @@
1
1
  import { Config } from '../base';
2
- import { bindType } from './bindType';
3
- import { fullQuoteType } from './fullQuoteType';
4
- import { quickQuoteType } from './quickQuoteType';
5
- import { quotationType, quotationListParams, quotationDetail } from './quotationType';
6
- import { switchSelectedVersionType } from './switchSelectedVersionType';
7
- import { versionsType } from './versionsType';
2
+ import { BindType } from './bindType';
3
+ import { FullQuoteType } from './fullQuoteType';
4
+ import { QuickQuoteType } from './quickQuoteType';
5
+ import { QuotationType, QuotationListParams, QuotationDetail } from './quotationType';
6
+ import { SwitchSelectedVersionType } from './switchSelectedVersionType';
7
+ import { VersionsType } from './versionsType';
8
8
 
9
9
  export declare const createQuote: (config: Config) => {
10
- getQuotations: (params: quotationListParams) => Promise<quotationDetail[]>;
11
- getQuotationDetail: (params: quotationType) => Promise<quotationDetail>;
12
- postQuickQuote: (data: quickQuoteType) => Promise<quickQuoteType>;
13
- postFullQuote: (data: fullQuoteType) => Promise<fullQuoteType>;
14
- postBind: (data: bindType) => Promise<bindType>;
15
- getQuotation: (data: quotationType) => Promise<quotationType>;
16
- getVersions: (data: versionsType) => Promise<versionsType>;
17
- switchSelectedVersion: (data: switchSelectedVersionType) => Promise<switchSelectedVersionType>;
10
+ getQuotations: (params: QuotationListParams) => Promise<QuotationDetail[]>;
11
+ getQuotationDetail: (params: QuotationType) => Promise<QuotationDetail>;
12
+ postQuickQuote: (data: QuickQuoteType) => Promise<QuickQuoteType>;
13
+ postFullQuote: (data: FullQuoteType) => Promise<FullQuoteType>;
14
+ postBind: (data: BindType) => Promise<BindType>;
15
+ getQuotation: (data: QuotationType) => Promise<QuotationType>;
16
+ getVersions: (data: VersionsType) => Promise<VersionsType>;
17
+ switchSelectedVersion: (data: SwitchSelectedVersionType) => Promise<SwitchSelectedVersionType>;
18
18
  };
@@ -1,4 +1,4 @@
1
- export interface quickQuoteType {
1
+ export interface QuickQuoteType {
2
2
  brokerIdentity?: string;
3
3
  insured?: {
4
4
  name?: string;
@@ -1,7 +1,7 @@
1
- export interface quotationType {
1
+ export interface QuotationType {
2
2
  policyId: string;
3
3
  }
4
- export interface quotationListParams {
4
+ export interface QuotationListParams {
5
5
  skip: string;
6
6
  take: string;
7
7
  startDate?: string;
@@ -10,7 +10,7 @@ export interface quotationListParams {
10
10
  policyOrCertificate?: string;
11
11
  policyStatus?: string;
12
12
  }
13
- export interface quotationDetail {
13
+ export interface QuotationDetail {
14
14
  insuredDocument: string;
15
15
  insuredName: string;
16
16
  insuredAmount: number;
@@ -1,4 +1,4 @@
1
- export interface switchSelectedVersionType {
1
+ export interface SwitchSelectedVersionType {
2
2
  policyId: string;
3
3
  quotationVersionId: string;
4
4
  }
@@ -1,3 +1,3 @@
1
- export interface versionsType {
1
+ export interface VersionsType {
2
2
  policyId: string;
3
3
  }
package/report/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Config } from '../base';
2
- import { certificateReportType } from './types';
2
+ import { CertificateReportType } from './types';
3
3
 
4
4
  export declare const createReport: (config: Config) => {
5
- getReportStream: (data: certificateReportType) => Promise<certificateReportType>;
5
+ getReportStream: (data: CertificateReportType) => Promise<CertificateReportType>;
6
6
  };
package/report/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export interface certificateReportType {
1
+ export interface CertificateReportType {
2
2
  policyId: string;
3
3
  documentType?: string;
4
4
  additionalParams?: object;