@bloque/sdk-compliance 0.1.5 → 0.1.7

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var _ in t)__webpack_require__.o(t,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:t[_]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{KycClient:()=>KycClient,ComplianceClient:()=>ComplianceClient});const sdk_core_namespaceObject=require("@bloque/sdk-core");class KycClient extends sdk_core_namespaceObject.BaseClient{async startVerification(e){let t=await this.httpClient.request({method:"POST",path:"/api/compliance",body:{urn:e.urn,type:"kyc",accompliceType:"person",...e.webhookUrl&&{webhookUrl:e.webhookUrl}}});return{url:t.url,status:t.status,completedAt:null}}async getVerification(e){let t=await this.httpClient.request({method:"GET",path:`/api/compliance/${e.urn}`});return{status:t.status,url:t.verification_url,completedAt:t.completed_at}}}class ComplianceClient extends sdk_core_namespaceObject.BaseClient{kyc;constructor(e){super(e),this.kyc=new KycClient(this.httpClient)}}for(var __rspack_i in exports.ComplianceClient=__webpack_exports__.ComplianceClient,exports.KycClient=__webpack_exports__.KycClient,__webpack_exports__)-1===["ComplianceClient","KycClient"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var _ in t)__webpack_require__.o(t,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:t[_]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{KycClient:()=>KycClient,ComplianceClient:()=>ComplianceClient});const sdk_core_namespaceObject=require("@bloque/sdk-core");class KycClient extends sdk_core_namespaceObject.BaseClient{async startVerification(e){let t=await this.httpClient.request({method:"POST",path:"/api/compliance",body:{urn:e.urn,type:"kyc",accompliceType:"person"}});return{url:t.url,status:t.status,completedAt:null}}async getVerification(e){let t=await this.httpClient.request({method:"GET",path:`/api/compliance/${e.urn}`});return{status:t.status,url:t.verification_url,completedAt:t.completed_at,result:t.result,documentsStatus:t.documents_status}}async getDocuments(e){let t=await this.httpClient.request({method:"GET",path:`/api/compliance/${e.urn}/documents`});return{documentsStatus:t.documents_status,documents:t.documents.map(e=>({documentType:e.document_type,side:e.side,imageBase64:e.image_base64,imageSizeBytes:e.image_size_bytes}))}}}class ComplianceClient extends sdk_core_namespaceObject.BaseClient{kyc;constructor(e){super(e),this.kyc=new KycClient(this.httpClient)}}for(var __rspack_i in exports.ComplianceClient=__webpack_exports__.ComplianceClient,exports.KycClient=__webpack_exports__.KycClient,__webpack_exports__)-1===["ComplianceClient","KycClient"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{BaseClient as t}from"@bloque/sdk-core";class e extends t{async startVerification(t){let e=await this.httpClient.request({method:"POST",path:"/api/compliance",body:{urn:t.urn,type:"kyc",accompliceType:"person",...t.webhookUrl&&{webhookUrl:t.webhookUrl}}});return{url:e.url,status:e.status,completedAt:null}}async getVerification(t){let e=await this.httpClient.request({method:"GET",path:`/api/compliance/${t.urn}`});return{status:e.status,url:e.verification_url,completedAt:e.completed_at}}}class r extends t{kyc;constructor(t){super(t),this.kyc=new e(this.httpClient)}}export{r as ComplianceClient,e as KycClient};
1
+ import{BaseClient as t}from"@bloque/sdk-core";class e extends t{async startVerification(t){let e=await this.httpClient.request({method:"POST",path:"/api/compliance",body:{urn:t.urn,type:"kyc",accompliceType:"person"}});return{url:e.url,status:e.status,completedAt:null}}async getVerification(t){let e=await this.httpClient.request({method:"GET",path:`/api/compliance/${t.urn}`});return{status:e.status,url:e.verification_url,completedAt:e.completed_at,result:e.result,documentsStatus:e.documents_status}}async getDocuments(t){let e=await this.httpClient.request({method:"GET",path:`/api/compliance/${t.urn}/documents`});return{documentsStatus:e.documents_status,documents:e.documents.map(t=>({documentType:t.document_type,side:t.side,imageBase64:t.image_base64,imageSizeBytes:t.image_size_bytes}))}}}class s extends t{kyc;constructor(t){super(t),this.kyc=new e(this.httpClient)}}export{s as ComplianceClient,e as KycClient};
@@ -17,7 +17,6 @@ export interface StartKycVerificationRequest {
17
17
  urn: string;
18
18
  type: 'kyc' | 'kyb';
19
19
  accompliceType: AccompliceType;
20
- webhookUrl?: string;
21
20
  }
22
21
  /**
23
22
  * @internal
@@ -41,4 +40,24 @@ export interface GetKycVerificationResponse {
41
40
  status: 'awaiting_compliance_verification' | 'approved' | 'rejected';
42
41
  verification_url: string;
43
42
  completed_at: string | null;
43
+ result?: unknown;
44
+ documents_status?: string;
45
+ }
46
+ /**
47
+ * @internal
48
+ * Document image returned by the documents endpoint.
49
+ */
50
+ export interface ComplianceDocumentImage {
51
+ document_type: string;
52
+ side: string;
53
+ image_base64: string;
54
+ image_size_bytes: number;
55
+ }
56
+ /**
57
+ * @internal
58
+ * Get compliance documents response.
59
+ */
60
+ export interface GetKycDocumentsResponse {
61
+ documents_status: string;
62
+ documents: ComplianceDocumentImage[];
44
63
  }
@@ -1,6 +1,7 @@
1
1
  import { BaseClient } from '@bloque/sdk-core';
2
- import type { GetKycVerificationParams, KycVerificationParams, KycVerificationResponse } from './types';
2
+ import type { GetKycDocumentsParams, GetKycVerificationParams, KycDocumentsResponse, KycVerificationParams, KycVerificationResponse } from './types';
3
3
  export declare class KycClient extends BaseClient {
4
4
  startVerification(params: KycVerificationParams): Promise<KycVerificationResponse>;
5
5
  getVerification(params: GetKycVerificationParams): Promise<KycVerificationResponse>;
6
+ getDocuments(params: GetKycDocumentsParams): Promise<KycDocumentsResponse>;
6
7
  }
@@ -34,6 +34,16 @@ export interface KycVerificationResponse {
34
34
  * null if verification is not yet completed
35
35
  */
36
36
  completedAt: string | null;
37
+ /**
38
+ * Documents download status (when document retrieval is enabled server-side).
39
+ *
40
+ * Values vary by provider; common values are "complete", "partial", "failed".
41
+ */
42
+ documentsStatus?: string;
43
+ /**
44
+ * Provider-specific verification payload (when available).
45
+ */
46
+ result?: unknown;
37
47
  }
38
48
  export interface GetKycVerificationParams {
39
49
  /**
@@ -44,3 +54,20 @@ export interface GetKycVerificationParams {
44
54
  */
45
55
  urn: string;
46
56
  }
57
+ export interface GetKycDocumentsParams {
58
+ /**
59
+ * URN (Uniform Resource Name) that uniquely identifies the user
60
+ * within the system.
61
+ */
62
+ urn: string;
63
+ }
64
+ export interface KycDocumentImage {
65
+ documentType: string;
66
+ side: string;
67
+ imageBase64: string;
68
+ imageSizeBytes: number;
69
+ }
70
+ export interface KycDocumentsResponse {
71
+ documentsStatus: string;
72
+ documents: KycDocumentImage[];
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bloque/sdk-compliance",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "bloque",
@@ -34,6 +34,6 @@
34
34
  "node": ">=22"
35
35
  },
36
36
  "dependencies": {
37
- "@bloque/sdk-core": "0.1.5"
37
+ "@bloque/sdk-core": "0.1.7"
38
38
  }
39
39
  }