@dossier-wiki/cloud-sdk 0.1.0 → 0.2.0-staging.568b313

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.
Files changed (120) hide show
  1. package/README.md +697 -46
  2. package/dist/cjs/api.js +34 -0
  3. package/dist/cjs/api.js.map +1 -0
  4. package/dist/cjs/error.js +29 -0
  5. package/dist/cjs/error.js.map +1 -0
  6. package/dist/cjs/http.js +75 -0
  7. package/dist/cjs/http.js.map +1 -0
  8. package/dist/cjs/index.js +48 -0
  9. package/dist/cjs/index.js.map +1 -0
  10. package/dist/cjs/resources/aml.js +88 -0
  11. package/dist/cjs/resources/aml.js.map +1 -0
  12. package/dist/cjs/resources/documents.js +170 -0
  13. package/dist/cjs/resources/documents.js.map +1 -0
  14. package/dist/cjs/resources/form-templates.js +117 -0
  15. package/dist/cjs/resources/form-templates.js.map +1 -0
  16. package/dist/cjs/resources/kyc/index.js +32 -0
  17. package/dist/cjs/resources/kyc/index.js.map +1 -0
  18. package/dist/cjs/resources/kyc/sessions.js +103 -0
  19. package/dist/cjs/resources/kyc/sessions.js.map +1 -0
  20. package/dist/cjs/resources/kyc/workflows.js +150 -0
  21. package/dist/cjs/resources/kyc/workflows.js.map +1 -0
  22. package/dist/cjs/resources/media.js +62 -0
  23. package/dist/cjs/resources/media.js.map +1 -0
  24. package/dist/cjs/schemas/index.js +9 -0
  25. package/dist/cjs/schemas/index.js.map +1 -0
  26. package/dist/cjs/schemas/kyc/workflow-steps.js +145 -0
  27. package/dist/cjs/schemas/kyc/workflow-steps.js.map +1 -0
  28. package/dist/cjs/service.js +132 -0
  29. package/dist/cjs/service.js.map +1 -0
  30. package/dist/cjs/session.js +379 -0
  31. package/dist/cjs/session.js.map +1 -0
  32. package/dist/cjs/types.js +36 -0
  33. package/dist/cjs/types.js.map +1 -0
  34. package/dist/cjs/webhooks.js +93 -0
  35. package/dist/cjs/webhooks.js.map +1 -0
  36. package/dist/esm/api.js +33 -0
  37. package/dist/esm/api.js.map +1 -0
  38. package/dist/esm/error.js +25 -0
  39. package/dist/esm/error.js.map +1 -0
  40. package/dist/esm/http.js +71 -0
  41. package/dist/esm/http.js.map +1 -0
  42. package/dist/esm/index.js +19 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/resources/aml.js +84 -0
  45. package/dist/esm/resources/aml.js.map +1 -0
  46. package/dist/esm/resources/documents.js +166 -0
  47. package/dist/esm/resources/documents.js.map +1 -0
  48. package/dist/esm/resources/form-templates.js +113 -0
  49. package/dist/esm/resources/form-templates.js.map +1 -0
  50. package/dist/esm/resources/kyc/index.js +26 -0
  51. package/dist/esm/resources/kyc/index.js.map +1 -0
  52. package/dist/esm/resources/kyc/sessions.js +99 -0
  53. package/dist/esm/resources/kyc/sessions.js.map +1 -0
  54. package/dist/esm/resources/kyc/workflows.js +146 -0
  55. package/dist/esm/resources/kyc/workflows.js.map +1 -0
  56. package/dist/esm/resources/media.js +58 -0
  57. package/dist/esm/resources/media.js.map +1 -0
  58. package/dist/esm/schemas/index.js +2 -0
  59. package/dist/esm/schemas/index.js.map +1 -0
  60. package/dist/esm/schemas/kyc/workflow-steps.js +142 -0
  61. package/dist/esm/schemas/kyc/workflow-steps.js.map +1 -0
  62. package/dist/esm/service.js +127 -0
  63. package/dist/esm/service.js.map +1 -0
  64. package/dist/esm/session.js +375 -0
  65. package/dist/esm/session.js.map +1 -0
  66. package/dist/{types.js → esm/types.js} +11 -27
  67. package/dist/esm/types.js.map +1 -0
  68. package/dist/{webhooks.js → esm/webhooks.js} +10 -11
  69. package/dist/esm/webhooks.js.map +1 -0
  70. package/dist/{api.d.ts → types/api.d.ts} +297 -166
  71. package/dist/types/api.d.ts.map +1 -0
  72. package/dist/types/error.d.ts +24 -0
  73. package/dist/types/error.d.ts.map +1 -0
  74. package/dist/types/http.d.ts +17 -0
  75. package/dist/types/http.d.ts.map +1 -0
  76. package/dist/types/index.d.ts +15 -0
  77. package/dist/types/index.d.ts.map +1 -0
  78. package/dist/types/resources/aml.d.ts +79 -0
  79. package/dist/types/resources/aml.d.ts.map +1 -0
  80. package/dist/types/resources/documents.d.ts +153 -0
  81. package/dist/types/resources/documents.d.ts.map +1 -0
  82. package/dist/types/resources/form-templates.d.ts +104 -0
  83. package/dist/types/resources/form-templates.d.ts.map +1 -0
  84. package/dist/types/resources/kyc/index.d.ts +34 -0
  85. package/dist/types/resources/kyc/index.d.ts.map +1 -0
  86. package/dist/types/resources/kyc/sessions.d.ts +92 -0
  87. package/dist/types/resources/kyc/sessions.d.ts.map +1 -0
  88. package/dist/types/resources/kyc/workflows.d.ts +135 -0
  89. package/dist/types/resources/kyc/workflows.d.ts.map +1 -0
  90. package/dist/types/resources/media.d.ts +56 -0
  91. package/dist/types/resources/media.d.ts.map +1 -0
  92. package/dist/types/schemas/index.d.ts +3 -0
  93. package/dist/types/schemas/index.d.ts.map +1 -0
  94. package/dist/types/schemas/kyc/workflow-steps.d.ts +5113 -0
  95. package/dist/types/schemas/kyc/workflow-steps.d.ts.map +1 -0
  96. package/dist/types/service.d.ts +143 -0
  97. package/dist/types/service.d.ts.map +1 -0
  98. package/dist/types/session.d.ts +176 -0
  99. package/dist/types/session.d.ts.map +1 -0
  100. package/dist/{types.d.ts → types/types.d.ts} +100 -2
  101. package/dist/types/types.d.ts.map +1 -0
  102. package/dist/{webhooks.d.ts → types/webhooks.d.ts} +5 -5
  103. package/dist/types/webhooks.d.ts.map +1 -0
  104. package/package.json +26 -32
  105. package/dist/api.d.ts.map +0 -1
  106. package/dist/api.js +0 -22
  107. package/dist/api.js.map +0 -1
  108. package/dist/index.d.ts +0 -6
  109. package/dist/index.d.ts.map +0 -1
  110. package/dist/index.js +0 -5
  111. package/dist/index.js.map +0 -1
  112. package/dist/service.d.ts +0 -39
  113. package/dist/service.d.ts.map +0 -1
  114. package/dist/service.js +0 -150
  115. package/dist/service.js.map +0 -1
  116. package/dist/types.d.ts.map +0 -1
  117. package/dist/types.js.map +0 -1
  118. package/dist/webhooks.d.ts.map +0 -1
  119. package/dist/webhooks.js.map +0 -1
  120. package/docs/REFERENCE.md +0 -114
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /*
3
+ Dossiers REST API types.
4
+
5
+ Endpoints:
6
+ POST /sanctions/search searchSanctions
7
+ POST /high-risk/search searchDossiers
8
+ POST /screening/request createScreeningRequest
9
+ POST /kyc-sessions createKycSession
10
+ GET /kyc-sessions listKycSessions
11
+ GET /kyc-sessions/{id} getKycSession
12
+ DELETE /kyc-sessions/{id} deleteKycSession
13
+ POST /kyc-workflows createKycWorkflow
14
+ GET /kyc-workflows listKycWorkflows
15
+ GET /kyc-workflows/{id} getKycWorkflow
16
+ PUT /kyc-workflows/{id} updateKycWorkflow
17
+ DELETE /kyc-workflows/{id} deleteKycWorkflow
18
+ GET /kyc-workflows/step-defaults getWorkflowStepDefaults
19
+ POST /document-processing initiateDocumentProcessing
20
+ GET /document-processing listDocumentProcessingInstances
21
+ GET /document-processing/processors listDocumentProcessors
22
+ GET /document-processing/{id} getDocumentProcessingInstance
23
+ GET /document-processing/{id}/stages/{stageId} getDocumentProcessingStage
24
+ GET /document-processing/{id}/events streamDocumentProcessingEvents (SSE)
25
+ DELETE /document-processing/{id} deleteDocumentProcessingInstance
26
+ POST /form-templates createFormTemplate
27
+ GET /form-templates listFormTemplates
28
+ GET /form-templates/{id} getFormTemplate
29
+ PUT /form-templates/{id} updateFormTemplate
30
+ DELETE /form-templates/{id} deleteFormTemplate
31
+ GET /media/{token} getMedia (binary stream)
32
+ */
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DossiersAPIError = void 0;
4
+ /**
5
+ * Thrown by every SDK method when the Dossiers API returns a non-2xx status.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { DossiersAPIService, DossiersAPIError } from '@dossier-wiki/cloud-sdk';
10
+ *
11
+ * try {
12
+ * await service.aml.searchSanctions({ fullName: 'John Doe' });
13
+ * } catch (err) {
14
+ * if (err instanceof DossiersAPIError) {
15
+ * console.error(err.status, err.message, err.body);
16
+ * }
17
+ * }
18
+ * ```
19
+ */
20
+ class DossiersAPIError extends Error {
21
+ constructor(status, message, body) {
22
+ super(message);
23
+ this.name = 'DossiersAPIError';
24
+ this.status = status;
25
+ this.body = body;
26
+ }
27
+ }
28
+ exports.DossiersAPIError = DossiersAPIError;
29
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IAMvC,YAAY,MAAc,EAAE,OAAe,EAAE,IAAa;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AAZD,4CAYC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DossiersHttp = void 0;
4
+ const error_js_1 = require("./error.js");
5
+ /** @internal Shared HTTP transport layer injected into every resource class. */
6
+ class DossiersHttp {
7
+ constructor(apiKey, baseUrl, fetchImpl) {
8
+ this.apiKey = apiKey;
9
+ this.baseUrl = baseUrl;
10
+ this.fetchImpl = fetchImpl;
11
+ }
12
+ async request(method, path, opts = {}) {
13
+ const url = new URL(`${this.baseUrl}${path}`);
14
+ if (opts.query) {
15
+ for (const [key, value] of Object.entries(opts.query)) {
16
+ if (value === undefined || value === null)
17
+ continue;
18
+ if (Array.isArray(value)) {
19
+ for (const v of value)
20
+ url.searchParams.append(key, String(v));
21
+ }
22
+ else if (typeof value === 'object') {
23
+ url.searchParams.append(key, JSON.stringify(value));
24
+ }
25
+ else {
26
+ url.searchParams.append(key, String(value));
27
+ }
28
+ }
29
+ }
30
+ const headers = {
31
+ Authorization: `Bearer ${this.apiKey}`,
32
+ Accept: 'application/json',
33
+ };
34
+ let body;
35
+ if (opts.body !== undefined) {
36
+ headers['Content-Type'] = 'application/json';
37
+ body = JSON.stringify(opts.body);
38
+ }
39
+ const response = await this.fetchImpl(url.toString(), { method, headers, body });
40
+ const raw = await response.text();
41
+ const parsed = raw.length > 0 ? safeJsonParse(raw) : undefined;
42
+ if (!response.ok) {
43
+ const message = (parsed && typeof parsed === 'object' && 'message' in parsed
44
+ ? String(parsed.message)
45
+ : null) ?? `Dossiers API ${method} ${path} failed: ${response.status}`;
46
+ throw new error_js_1.DossiersAPIError(response.status, message, parsed ?? raw);
47
+ }
48
+ return parsed;
49
+ }
50
+ /**
51
+ * Opens a raw HTTP connection without parsing the response body.
52
+ * Used for SSE streams and binary file downloads.
53
+ */
54
+ stream(path, accept, init) {
55
+ return this.fetchImpl(`${this.baseUrl}${path}`, {
56
+ ...init,
57
+ method: 'GET',
58
+ headers: {
59
+ ...(init?.headers ?? {}),
60
+ Authorization: `Bearer ${this.apiKey}`,
61
+ Accept: accept,
62
+ },
63
+ });
64
+ }
65
+ }
66
+ exports.DossiersHttp = DossiersHttp;
67
+ function safeJsonParse(raw) {
68
+ try {
69
+ return JSON.parse(raw);
70
+ }
71
+ catch {
72
+ return raw;
73
+ }
74
+ }
75
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,gFAAgF;AAChF,MAAa,YAAY;IACrB,YACqB,MAAc,EACd,OAAe,EACf,SAAuB;Q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IACP,CAAC;CACJ;AAnED,oCAmEC;AAED,SAAS,aAAa,CAAC,GAAW;IAC9B,IAAI,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,GAAG,CAAC;IACf,CAAC;AACL,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.schemas = exports.DossiersKycSession = exports.KycWorkflowsResource = exports.KycSessionsResource = exports.KycResource = exports.MediaResource = exports.FormTemplatesResource = exports.DocumentsResource = exports.AmlResource = exports.DossiersWebhookRouter = exports.DOSSIERS_API_BASE_URL = exports.DossiersAPIError = exports.DossiersAPIService = void 0;
18
+ // API types
19
+ __exportStar(require("./api.js"), exports);
20
+ // Webhook event types & enums
21
+ __exportStar(require("./types.js"), exports);
22
+ // Core service
23
+ var service_js_1 = require("./service.js");
24
+ Object.defineProperty(exports, "DossiersAPIService", { enumerable: true, get: function () { return service_js_1.DossiersAPIService; } });
25
+ Object.defineProperty(exports, "DossiersAPIError", { enumerable: true, get: function () { return service_js_1.DossiersAPIError; } });
26
+ Object.defineProperty(exports, "DOSSIERS_API_BASE_URL", { enumerable: true, get: function () { return service_js_1.DOSSIERS_API_BASE_URL; } });
27
+ // Webhook router
28
+ var webhooks_js_1 = require("./webhooks.js");
29
+ Object.defineProperty(exports, "DossiersWebhookRouter", { enumerable: true, get: function () { return webhooks_js_1.DossiersWebhookRouter; } });
30
+ // Resource classes (for consumers who want to type method parameters/returns)
31
+ var aml_js_1 = require("./resources/aml.js");
32
+ Object.defineProperty(exports, "AmlResource", { enumerable: true, get: function () { return aml_js_1.AmlResource; } });
33
+ var documents_js_1 = require("./resources/documents.js");
34
+ Object.defineProperty(exports, "DocumentsResource", { enumerable: true, get: function () { return documents_js_1.DocumentsResource; } });
35
+ var form_templates_js_1 = require("./resources/form-templates.js");
36
+ Object.defineProperty(exports, "FormTemplatesResource", { enumerable: true, get: function () { return form_templates_js_1.FormTemplatesResource; } });
37
+ var media_js_1 = require("./resources/media.js");
38
+ Object.defineProperty(exports, "MediaResource", { enumerable: true, get: function () { return media_js_1.MediaResource; } });
39
+ var index_js_1 = require("./resources/kyc/index.js");
40
+ Object.defineProperty(exports, "KycResource", { enumerable: true, get: function () { return index_js_1.KycResource; } });
41
+ Object.defineProperty(exports, "KycSessionsResource", { enumerable: true, get: function () { return index_js_1.KycSessionsResource; } });
42
+ Object.defineProperty(exports, "KycWorkflowsResource", { enumerable: true, get: function () { return index_js_1.KycWorkflowsResource; } });
43
+ // Customer-facing KYC session client
44
+ var session_js_1 = require("./session.js");
45
+ Object.defineProperty(exports, "DossiersKycSession", { enumerable: true, get: function () { return session_js_1.DossiersKycSession; } });
46
+ // Zod schemas for runtime validation
47
+ exports.schemas = require("./schemas/index.js");
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,YAAY;AACZ,2CAAyB;AAEzB,8BAA8B;AAC9B,6CAA2B;AAE3B,eAAe;AACf,2CAA2F;AAAlF,gHAAA,kBAAkB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAAE,mHAAA,qBAAqB,OAAA;AAGpE,iBAAiB;AACjB,6CAAsD;AAA7C,oHAAA,qBAAqB,OAAA;AAG9B,8EAA8E;AAC9E,6CAAiD;AAAxC,qGAAA,WAAW,OAAA;AACpB,yDAA6D;AAApD,iHAAA,iBAAiB,OAAA;AAC1B,mEAAsE;AAA7D,0HAAA,qBAAqB,OAAA;AAC9B,iDAAqD;AAA5C,yGAAA,aAAa,OAAA;AACtB,qDAAkG;AAAzF,uGAAA,WAAW,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAE/D,qCAAqC;AACrC,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAG3B,qCAAqC;AACrC,gDAA8C"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmlResource = void 0;
4
+ /**
5
+ * AML (Anti-Money Laundering) screening and due-diligence methods.
6
+ *
7
+ * Access via `service.aml`.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const hits = await service.aml.searchSanctions({ fullName: 'Jane Smith' });
12
+ * console.log(hits.totalHits);
13
+ * ```
14
+ */
15
+ class AmlResource {
16
+ /** @internal */
17
+ constructor(http) {
18
+ this.http = http;
19
+ }
20
+ /**
21
+ * Search global sanctions lists (OFAC, UN, FCDO, DFAT, CASL, INTERPOL) for
22
+ * individuals or entities matching the provided name.
23
+ *
24
+ * Costs 5 credits per request.
25
+ *
26
+ * @param input - Search criteria including full name and optional filters.
27
+ * @returns Matching sanction records with source attribution.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const results = await service.aml.searchSanctions({
32
+ * fullName: 'John Doe',
33
+ * sources: ['ofac', 'un'],
34
+ * countries: ['US'],
35
+ * });
36
+ * ```
37
+ */
38
+ searchSanctions(input) {
39
+ return this.http.request('POST', '/sanctions/search', { body: input });
40
+ }
41
+ /**
42
+ * Search PEP registries, sanctions lists, and adverse media databases for
43
+ * individuals matching the provided name. Returns detailed dossiers including
44
+ * risk scores, positions held, associates, and identification documents.
45
+ *
46
+ * @param input - Search criteria. Use `noCache: true` to force a fresh search.
47
+ * @returns An array of matching individual dossiers with risk scorecards.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const dossiers = await service.aml.searchDossiers({
52
+ * fullName: 'Robert Jones',
53
+ * onlyShowHighRiskProfiles: true,
54
+ * });
55
+ * for (const d of dossiers) {
56
+ * console.log(d.fullName, d.riskScorecard?.riskCategory);
57
+ * }
58
+ * ```
59
+ */
60
+ searchDossiers(input) {
61
+ return this.http.request('POST', '/high-risk/search', { body: input });
62
+ }
63
+ /**
64
+ * Submit an individual for ongoing background screening against global
65
+ * sanctions lists, PEP registries, and adverse media databases.
66
+ *
67
+ * A webhook event is emitted when the screening completes or when new
68
+ * alerts are triggered.
69
+ *
70
+ * @param input - Individual details for screening.
71
+ * @returns A screening request ID for tracking status.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const { requestId } = await service.aml.createScreeningRequest({
76
+ * fullName: 'Alice Brown',
77
+ * externalId: 'cust_123',
78
+ * dateOfBirth: '1985-06-15',
79
+ * country: 'GB',
80
+ * });
81
+ * ```
82
+ */
83
+ createScreeningRequest(input) {
84
+ return this.http.request('POST', '/screening/request', { body: input });
85
+ }
86
+ }
87
+ exports.AmlResource = AmlResource;
88
+ //# sourceMappingURL=aml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aml.js","sourceRoot":"","sources":["../../../src/resources/aml.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IACpB,gBAAgB;IAChB,YAA6B,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;IAAG,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,KAA0B;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,cAAc,CAAC,KAAyB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,sBAAsB,CAClB,KAAgC;QAEhC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;CACJ;AA1ED,kCA0EC"}
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentsResource = void 0;
4
+ /**
5
+ * Document processing methods — initiate, track, and retrieve AI-extracted
6
+ * data from uploaded documents.
7
+ *
8
+ * Access via `service.documents`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const instance = await service.documents.initiate({
13
+ * processorId: 'INVOICE',
14
+ * files: [{ url: 'https://example.com/invoice.pdf', mimeType: 'application/pdf' }],
15
+ * });
16
+ * console.log(instance.instanceId);
17
+ * ```
18
+ */
19
+ class DocumentsResource {
20
+ /** @internal */
21
+ constructor(http) {
22
+ this.http = http;
23
+ }
24
+ /**
25
+ * Initiate a new document processing job.
26
+ *
27
+ * By default, processing runs asynchronously in the background — subscribe
28
+ * to the SSE stream via {@link stream} or listen for webhook events to know
29
+ * when it completes. Set `backgroundProcessing: false` to wait synchronously.
30
+ *
31
+ * The generic parameter `TSchema` narrows the `result.schema` field to a
32
+ * processor-specific extraction schema for full type safety.
33
+ *
34
+ * @param input - Files, processor ID, optional cross-check context, and flags.
35
+ * @returns The created processing instance (result is `null` until completed).
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * // Typed extraction schema for Sri Lanka NIC
40
+ * type SriLankaIdSchema = {
41
+ * name: DocumentProcessingTransliteratedField;
42
+ * idNumber: DocumentProcessingExtractedField<string>;
43
+ * dateOfBirth: DocumentProcessingExtractedField<string>;
44
+ * };
45
+ *
46
+ * const instance = await service.documents.initiate<SriLankaIdSchema>({
47
+ * processorId: 'SRI_LANKA_ID',
48
+ * files: [{ base64Data: '...', mimeType: 'image/jpeg' }],
49
+ * inputData: { name: 'Nimal Perera' },
50
+ * });
51
+ * ```
52
+ */
53
+ initiate(input) {
54
+ return this.http.request('POST', '/document-processing', { body: input });
55
+ }
56
+ /**
57
+ * List document processing instances for your organization, with optional
58
+ * filtering and pagination.
59
+ *
60
+ * @param query - Optional filters: `processorId`, `status`, `limit`, `offset`.
61
+ * @returns A paginated list of instance summaries.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const { instances, count } = await service.documents.list({
66
+ * processorId: 'INVOICE',
67
+ * status: 'completed',
68
+ * limit: 20,
69
+ * });
70
+ * ```
71
+ */
72
+ list(query = {}) {
73
+ return this.http.request('GET', '/document-processing', { query });
74
+ }
75
+ /**
76
+ * List all available document processor types registered for your organization.
77
+ *
78
+ * @returns An array of processor descriptors including IDs and labels.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const processors = await service.documents.listProcessors();
83
+ * processors.forEach(p => console.log(p.id, p.label));
84
+ * ```
85
+ */
86
+ listProcessors() {
87
+ return this.http.request('GET', '/document-processing/processors');
88
+ }
89
+ /**
90
+ * Retrieve the full details of a single document processing instance by ID.
91
+ *
92
+ * The generic parameter `TSchema` narrows `result.schema` for processor-specific
93
+ * type safety — use the same type you passed to {@link initiate}.
94
+ *
95
+ * @param id - The `instanceId` returned by {@link initiate}.
96
+ * @returns The full instance including result once processing is complete.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const instance = await service.documents.get('inst_abc123');
101
+ * if (instance.status === 'completed') {
102
+ * console.log(instance.result?.normalizedData);
103
+ * }
104
+ * ```
105
+ */
106
+ get(id) {
107
+ return this.http.request('GET', `/document-processing/${encodeURIComponent(id)}`);
108
+ }
109
+ /**
110
+ * Retrieve the result of a specific processing stage within an instance.
111
+ * Useful for debugging or inspecting intermediate pipeline results.
112
+ *
113
+ * Stage IDs: `crop_and_detect_faces`, `pre_validate_and_extract`, `post_validation`.
114
+ *
115
+ * @param id - The `instanceId`.
116
+ * @param stageId - The stage ID to retrieve.
117
+ * @returns The stage status and extracted data.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const stage = await service.documents.getStage('inst_abc123', 'post_validation');
122
+ * console.log(stage.status, stage.data.validation.passed);
123
+ * ```
124
+ */
125
+ getStage(id, stageId) {
126
+ return this.http.request('GET', `/document-processing/${encodeURIComponent(id)}/stages/${encodeURIComponent(stageId)}`);
127
+ }
128
+ /**
129
+ * Delete a document processing instance and all associated files.
130
+ *
131
+ * @param id - The `instanceId` to delete.
132
+ * @returns A success confirmation.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * const { success } = await service.documents.delete('inst_abc123');
137
+ * ```
138
+ */
139
+ delete(id) {
140
+ return this.http.request('DELETE', `/document-processing/${encodeURIComponent(id)}`);
141
+ }
142
+ /**
143
+ * Open a Server-Sent Events (SSE) stream for real-time stage progress updates
144
+ * on a document processing instance.
145
+ *
146
+ * Returns the raw `Response` — iterate over `response.body` using a
147
+ * `ReadableStream` reader to consume SSE events.
148
+ *
149
+ * @param id - The `instanceId` to stream events for.
150
+ * @param init - Optional fetch init options (e.g. `signal` for cancellation).
151
+ * @returns A live SSE `Response` stream.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * const res = await service.documents.stream('inst_abc123');
156
+ * const reader = res.body!.getReader();
157
+ * const decoder = new TextDecoder();
158
+ * while (true) {
159
+ * const { done, value } = await reader.read();
160
+ * if (done) break;
161
+ * console.log(decoder.decode(value));
162
+ * }
163
+ * ```
164
+ */
165
+ stream(id, init) {
166
+ return this.http.stream(`/document-processing/${encodeURIComponent(id)}/events`, 'text/event-stream', init);
167
+ }
168
+ }
169
+ exports.DocumentsResource = DocumentsResource;
170
+ //# sourceMappingURL=documents.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kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,CAAC,EAAU,EAAE,IAAkB;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CACnB,wBAAwB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EACvD,mBAAmB,EACnB,IAAI,CACP,CAAC;IACN,CAAC;CACJ;AAvKD,8CAuKC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormTemplatesResource = void 0;
4
+ /**
5
+ * Form template management — create and manage reusable form schemas for
6
+ * the `form_collection` KYC workflow step.
7
+ *
8
+ * Access via `service.formTemplates`.
9
+ *
10
+ * A form template defines the fields (text, select, file upload, etc.) that
11
+ * customers fill in during a form collection step. Templates can be referenced
12
+ * by `templateId` in the step's `input.config`, or fields can be defined inline
13
+ * on the step itself.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const template = await service.formTemplates.create({
18
+ * name: 'Employment Details',
19
+ * fields: [
20
+ * { id: 'employer', type: 'text', label: 'Employer Name', required: true },
21
+ * { id: 'salary', type: 'currency', label: 'Annual Salary', required: true },
22
+ * ],
23
+ * });
24
+ * ```
25
+ */
26
+ class FormTemplatesResource {
27
+ /** @internal */
28
+ constructor(http) {
29
+ this.http = http;
30
+ }
31
+ /**
32
+ * Create a new form template.
33
+ *
34
+ * @param input - Template name, optional description, visibility, and field definitions.
35
+ * @returns The created form template.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const template = await service.formTemplates.create({
40
+ * name: 'Address Collection',
41
+ * fields: [
42
+ * { id: 'street', type: 'text', label: 'Street Address', required: true },
43
+ * { id: 'city', type: 'text', label: 'City', required: true },
44
+ * { id: 'country', type: 'country', label: 'Country', required: true },
45
+ * ],
46
+ * });
47
+ * ```
48
+ */
49
+ create(input) {
50
+ return this.http.request('POST', '/form-templates', { body: input });
51
+ }
52
+ /**
53
+ * List form templates available to your organization, with optional
54
+ * search and pagination.
55
+ *
56
+ * @param query - Optional `searchQuery`, `limit`, and `offset`.
57
+ * @returns A paginated list of template summaries (fields omitted for brevity).
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const { templates, totalCount } = await service.formTemplates.list({
62
+ * searchQuery: 'address',
63
+ * limit: 10,
64
+ * });
65
+ * ```
66
+ */
67
+ list(query = {}) {
68
+ return this.http.request('GET', '/form-templates', { query });
69
+ }
70
+ /**
71
+ * Retrieve a single form template by ID, including all field definitions.
72
+ *
73
+ * @param id - The template ID.
74
+ * @returns The full template with fields.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const template = await service.formTemplates.get('tmpl_abc123');
79
+ * template.fields.forEach(f => console.log(f.id, f.type));
80
+ * ```
81
+ */
82
+ get(id) {
83
+ return this.http.request('GET', `/form-templates/${encodeURIComponent(id)}`);
84
+ }
85
+ /**
86
+ * Update an existing form template.
87
+ *
88
+ * @param id - The template ID to update.
89
+ * @param input - Fields to update (all optional).
90
+ * @returns The updated template.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * const updated = await service.formTemplates.update('tmpl_abc123', {
95
+ * name: 'Updated Address Form',
96
+ * });
97
+ * ```
98
+ */
99
+ update(id, input) {
100
+ return this.http.request('PUT', `/form-templates/${encodeURIComponent(id)}`, { body: input });
101
+ }
102
+ /**
103
+ * Delete a form template.
104
+ *
105
+ * @param id - The template ID to delete.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * await service.formTemplates.delete('tmpl_abc123');
110
+ * ```
111
+ */
112
+ delete(id) {
113
+ return this.http.request('DELETE', `/form-templates/${encodeURIComponent(id)}`);
114
+ }
115
+ }
116
+ exports.FormTemplatesResource = FormTemplatesResource;
117
+ //# sourceMappingURL=form-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-templates.js","sourceRoot":"","sources":["../../../src/resources/form-templates.ts"],"names":[],"mappings":";;;AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,qBAAqB;IAC9B,gBAAgB;IAChB,YAA6B,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;IAAG,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAA8B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,CAAC,QAAgC,EAAE;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,iBAAiB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,EAAU;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,mBAAmB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,KAA8B;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,mBAAmB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;CACJ;AA5FD,sDA4FC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KycResource = exports.KycWorkflowsResource = exports.KycSessionsResource = void 0;
4
+ const sessions_js_1 = require("./sessions.js");
5
+ const workflows_js_1 = require("./workflows.js");
6
+ var sessions_js_2 = require("./sessions.js");
7
+ Object.defineProperty(exports, "KycSessionsResource", { enumerable: true, get: function () { return sessions_js_2.KycSessionsResource; } });
8
+ var workflows_js_2 = require("./workflows.js");
9
+ Object.defineProperty(exports, "KycWorkflowsResource", { enumerable: true, get: function () { return workflows_js_2.KycWorkflowsResource; } });
10
+ /**
11
+ * KYC (Know Your Customer) namespace — sessions and workflow management.
12
+ *
13
+ * Access via `service.kyc`.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Create a session using an existing workflow
18
+ * const { sessionUrl } = await service.kyc.sessions.create({ workflowId: 'wf_abc' });
19
+ *
20
+ * // Manage workflows
21
+ * const workflows = await service.kyc.workflows.list();
22
+ * ```
23
+ */
24
+ class KycResource {
25
+ /** @internal */
26
+ constructor(http) {
27
+ this.sessions = new sessions_js_1.KycSessionsResource(http);
28
+ this.workflows = new workflows_js_1.KycWorkflowsResource(http);
29
+ }
30
+ }
31
+ exports.KycResource = KycResource;
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/kyc/index.ts"],"names":[],"mappings":";;;AACA,+CAAoD;AACpD,iDAAsD;AAEtD,6CAAoD;AAA3C,kHAAA,mBAAmB,OAAA;AAC5B,+CAAsD;AAA7C,oHAAA,oBAAoB,OAAA;AAE7B;;;;;;;;;;;;;GAaG;AACH,MAAa,WAAW;IAapB,gBAAgB;IAChB,YAAY,IAAkB;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,iCAAmB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,IAAI,mCAAoB,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;CACJ;AAlBD,kCAkBC"}