@buzztech/boi-ui 0.2.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,53 @@
1
+ import { EdocBank } from '../types/edoc';
2
+ export interface UseEdocBanksOptions {
3
+ get: (url: string) => Promise<{
4
+ data?: unknown;
5
+ }>;
6
+ /** Path or absolute URL; or a getter so it stays in sync with props (e.g. integration base URL). */
7
+ getBanksUrl?: string | (() => string);
8
+ fallbackBanksUrl?: string | (() => string);
9
+ }
10
+ export declare function useEdocBanks(options: UseEdocBanksOptions): {
11
+ edocBanks: import('vue').Ref<{
12
+ bankId: number;
13
+ name: string;
14
+ icon?: string | undefined;
15
+ bankCode: string;
16
+ code?: string | undefined;
17
+ enabled?: boolean | undefined;
18
+ mandateEnabled?: boolean | undefined;
19
+ bankInstructions?: string[] | undefined;
20
+ }[], EdocBank[] | {
21
+ bankId: number;
22
+ name: string;
23
+ icon?: string | undefined;
24
+ bankCode: string;
25
+ code?: string | undefined;
26
+ enabled?: boolean | undefined;
27
+ mandateEnabled?: boolean | undefined;
28
+ bankInstructions?: string[] | undefined;
29
+ }[]>;
30
+ banks: import('vue').Ref<{
31
+ bankId: number;
32
+ name: string;
33
+ icon?: string | undefined;
34
+ bankCode: string;
35
+ code?: string | undefined;
36
+ enabled?: boolean | undefined;
37
+ mandateEnabled?: boolean | undefined;
38
+ bankInstructions?: string[] | undefined;
39
+ }[], EdocBank[] | {
40
+ bankId: number;
41
+ name: string;
42
+ icon?: string | undefined;
43
+ bankCode: string;
44
+ code?: string | undefined;
45
+ enabled?: boolean | undefined;
46
+ mandateEnabled?: boolean | undefined;
47
+ bankInstructions?: string[] | undefined;
48
+ }[]>;
49
+ loading: import('vue').Ref<boolean, boolean>;
50
+ error: import('vue').Ref<string | null, string | null>;
51
+ loadBanksForStatement: () => Promise<EdocBank[]>;
52
+ invalidateCache: () => void;
53
+ };
@@ -0,0 +1,21 @@
1
+ import { App } from 'vue';
2
+ export { default as BoiButton } from './components/BoiButton.vue';
3
+ export { default as Button } from './components/Button.vue';
4
+ export { default as EmtsIntegration } from './components/EmtsIntegration.vue';
5
+ export { default as BankStatementIntegration } from './components/BankStatementIntegration.vue';
6
+ export { default as BankSelect } from './components/BankSelect.vue';
7
+ export { default as FileInput } from './components/FileInput.vue';
8
+ export { useEdocBanks } from './composables/useEdocBanks';
9
+ export type { UseEdocBanksOptions } from './composables/useEdocBanks';
10
+ export { useAccountVerification } from './composables/useAccountVerification';
11
+ export type { VerifyBankAccountFn, VerificationState } from './composables/useAccountVerification';
12
+ export { edocApi } from './api/edoc';
13
+ export type { EdocApi } from './api/edoc';
14
+ export { bankStatementsApi, bankStatementsUrls } from './api/bankStatements';
15
+ export { filesApi } from './api/files';
16
+ export type { EdocBank, BankStatementRecord, EdocConsentInitializePayload, EdocAttachAccountPayload, EdocGetTransactionsPayload, BankOption, IndustrialSectorOption, } from './types/edoc';
17
+ export declare function install(_app: App): void;
18
+ declare const _default: {
19
+ install: typeof install;
20
+ };
21
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare function cn(...classes: Array<any>): string;
@@ -0,0 +1,73 @@
1
+ export interface EdocBank {
2
+ bankId: number;
3
+ name: string;
4
+ icon?: string;
5
+ bankCode: string;
6
+ code?: string;
7
+ enabled?: boolean;
8
+ mandateEnabled?: boolean;
9
+ bankInstructions?: string[];
10
+ }
11
+ export interface BankStatementRecord {
12
+ id: number;
13
+ loan_application_id?: number;
14
+ bank: string;
15
+ account_number: string;
16
+ account_name?: string;
17
+ account_type?: string;
18
+ bvn?: string;
19
+ email: string;
20
+ bank_statement?: string;
21
+ /**
22
+ * Client-only: S3 key for the uploaded PDF used for “View document”.
23
+ * Kept when API/poll sets `bank_statement` to the EDOC CSV object key.
24
+ */
25
+ uploaded_statement_path?: string;
26
+ /** Presigned or public URL from API (Boi BankStatement $appends) */
27
+ bank_statement_view_url?: string | null;
28
+ csv_url?: string;
29
+ csv_view_url?: string | null;
30
+ consent_id?: string;
31
+ edoc_status: 'pending' | 'processing' | 'completed' | 'failed';
32
+ statement_generated: boolean;
33
+ otp?: string;
34
+ showOtpInput?: boolean;
35
+ }
36
+ export interface EdocConsentInitializePayload {
37
+ email: string;
38
+ firstName: string;
39
+ lastName: string;
40
+ statementDuration?: string;
41
+ redirectionUrl?: string;
42
+ referenceId?: string;
43
+ state?: string;
44
+ fundType?: string;
45
+ industrialSector?: string;
46
+ }
47
+ export interface EdocAttachAccountPayload {
48
+ consentId: string;
49
+ bankId: number;
50
+ accountNumber: string;
51
+ accountType?: string;
52
+ statementDuration?: string;
53
+ monthType?: string;
54
+ uploadType?: string;
55
+ }
56
+ export interface EdocGetTransactionsPayload {
57
+ consentId: string;
58
+ verificationCode?: string;
59
+ bankStatementId?: number;
60
+ }
61
+ export interface BankOption {
62
+ value: string;
63
+ label: string;
64
+ /** Shown in search (e.g. FCMB); also include in searchKeywords if you only pass one */
65
+ shortName?: string;
66
+ searchKeywords?: string[];
67
+ }
68
+ export interface IndustrialSectorOption {
69
+ value: string | number;
70
+ label?: string;
71
+ name?: string;
72
+ id?: string | number;
73
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@buzztech/boi-ui",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "0.2.0",
7
+ "description": "BOI Vue 3 TypeScript UI package",
8
+ "type": "module",
9
+ "keywords": [
10
+ "vue",
11
+ "vue3",
12
+ "typescript",
13
+ "boi",
14
+ "edoc",
15
+ "bank-statements"
16
+ ],
17
+ "homepage": "https://github.com/BuzzTechnics/boi-ui#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/BuzzTechnics/boi-ui/issues"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/BuzzTechnics/boi-ui.git"
24
+ },
25
+ "main": "./dist/boi-ui.umd.cjs",
26
+ "module": "./dist/boi-ui.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/boi-ui.js",
32
+ "require": "./dist/boi-ui.umd.cjs"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "scripts": {
39
+ "dev": "vite",
40
+ "prepublishOnly": "npm run build",
41
+ "build": "vue-tsc -b && vite build",
42
+ "type-check": "vue-tsc --noEmit",
43
+ "test": "vitest run",
44
+ "test:watch": "vitest"
45
+ },
46
+ "peerDependencies": {
47
+ "vue": "^3.4.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^22.0.0",
51
+ "@vitejs/plugin-vue": "^5.0.0",
52
+ "@vue/test-utils": "^2.4.0",
53
+ "happy-dom": "^15.11.0",
54
+ "typescript": "~5.6.0",
55
+ "vite": "^6.0.0",
56
+ "vite-plugin-dts": "^4.0.0",
57
+ "vitest": "^2.0.0",
58
+ "vue": "^3.4.0",
59
+ "vue-tsc": "^2.0.0"
60
+ }
61
+ }