@bloque/sdk-accounts 0.0.4 → 0.0.6
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/api-types.d.ts +0 -6
- package/dist/card/types.d.ts +0 -4
- package/dist/client.d.ts +0 -2
- package/dist/index.cjs +1 -39
- package/dist/index.js +1 -39
- package/package.json +7 -6
- package/dist/bancolombia/client.d.ts +0 -21
- package/dist/bancolombia/types.d.ts +0 -63
package/dist/api-types.d.ts
CHANGED
package/dist/card/types.d.ts
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { HttpClient } from '@bloque/sdk-core';
|
|
2
|
-
import { BancolombiaClient } from './bancolombia/client';
|
|
3
2
|
import { CardClient } from './card/client';
|
|
4
3
|
/**
|
|
5
4
|
* Accounts client for managing financial accounts and payment methods
|
|
@@ -13,7 +12,6 @@ import { CardClient } from './card/client';
|
|
|
13
12
|
*/
|
|
14
13
|
export declare class AccountsClient {
|
|
15
14
|
private readonly httpClient;
|
|
16
|
-
readonly bancolombia: BancolombiaClient;
|
|
17
15
|
readonly card: CardClient;
|
|
18
16
|
constructor(httpClient: HttpClient);
|
|
19
17
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -42,8 +42,7 @@ class CardClient {
|
|
|
42
42
|
},
|
|
43
43
|
metadata: {
|
|
44
44
|
source: "sdk-typescript",
|
|
45
|
-
name: params.name
|
|
46
|
-
...params.metadata
|
|
45
|
+
name: params.name
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
const response = await this.httpClient.request({
|
|
@@ -68,48 +67,11 @@ class CardClient {
|
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
|
-
class BancolombiaClient {
|
|
72
|
-
httpClient;
|
|
73
|
-
constructor(httpClient){
|
|
74
|
-
this.httpClient = httpClient;
|
|
75
|
-
}
|
|
76
|
-
async create(params) {
|
|
77
|
-
const request = {
|
|
78
|
-
holder_urn: params.urn,
|
|
79
|
-
input: {},
|
|
80
|
-
metadata: {
|
|
81
|
-
source: "sdk-typescript",
|
|
82
|
-
name: params.name,
|
|
83
|
-
card_urn: params.cardUrn,
|
|
84
|
-
...params.metadata
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const response = await this.httpClient.request({
|
|
88
|
-
method: 'POST',
|
|
89
|
-
path: '/api/mediums/bancolombia',
|
|
90
|
-
body: request
|
|
91
|
-
});
|
|
92
|
-
const account = response.result.account;
|
|
93
|
-
return {
|
|
94
|
-
urn: account.urn,
|
|
95
|
-
id: account.id,
|
|
96
|
-
referenceCode: account.details.reference_code,
|
|
97
|
-
status: account.status,
|
|
98
|
-
ownerUrn: account.owner_urn,
|
|
99
|
-
webhookUrl: account.webhook_url,
|
|
100
|
-
metadata: account.metadata,
|
|
101
|
-
createdAt: account.created_at,
|
|
102
|
-
updatedAt: account.updated_at
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
70
|
class AccountsClient {
|
|
107
71
|
httpClient;
|
|
108
|
-
bancolombia;
|
|
109
72
|
card;
|
|
110
73
|
constructor(httpClient){
|
|
111
74
|
this.httpClient = httpClient;
|
|
112
|
-
this.bancolombia = new BancolombiaClient(this.httpClient);
|
|
113
75
|
this.card = new CardClient(this.httpClient);
|
|
114
76
|
}
|
|
115
77
|
}
|
package/dist/index.js
CHANGED
|
@@ -13,8 +13,7 @@ class CardClient {
|
|
|
13
13
|
},
|
|
14
14
|
metadata: {
|
|
15
15
|
source: "sdk-typescript",
|
|
16
|
-
name: params.name
|
|
17
|
-
...params.metadata
|
|
16
|
+
name: params.name
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
const response = await this.httpClient.request({
|
|
@@ -39,48 +38,11 @@ class CardClient {
|
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
class BancolombiaClient {
|
|
43
|
-
httpClient;
|
|
44
|
-
constructor(httpClient){
|
|
45
|
-
this.httpClient = httpClient;
|
|
46
|
-
}
|
|
47
|
-
async create(params) {
|
|
48
|
-
const request = {
|
|
49
|
-
holder_urn: params.urn,
|
|
50
|
-
input: {},
|
|
51
|
-
metadata: {
|
|
52
|
-
source: "sdk-typescript",
|
|
53
|
-
name: params.name,
|
|
54
|
-
card_urn: params.cardUrn,
|
|
55
|
-
...params.metadata
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const response = await this.httpClient.request({
|
|
59
|
-
method: 'POST',
|
|
60
|
-
path: '/api/mediums/bancolombia',
|
|
61
|
-
body: request
|
|
62
|
-
});
|
|
63
|
-
const account = response.result.account;
|
|
64
|
-
return {
|
|
65
|
-
urn: account.urn,
|
|
66
|
-
id: account.id,
|
|
67
|
-
referenceCode: account.details.reference_code,
|
|
68
|
-
status: account.status,
|
|
69
|
-
ownerUrn: account.owner_urn,
|
|
70
|
-
webhookUrl: account.webhook_url,
|
|
71
|
-
metadata: account.metadata,
|
|
72
|
-
createdAt: account.created_at,
|
|
73
|
-
updatedAt: account.updated_at
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
41
|
class AccountsClient {
|
|
78
42
|
httpClient;
|
|
79
|
-
bancolombia;
|
|
80
43
|
card;
|
|
81
44
|
constructor(httpClient){
|
|
82
45
|
this.httpClient = httpClient;
|
|
83
|
-
this.bancolombia = new BancolombiaClient(this.httpClient);
|
|
84
46
|
this.card = new CardClient(this.httpClient);
|
|
85
47
|
}
|
|
86
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloque/sdk-accounts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bloque",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
+
"publish": "bun publish",
|
|
39
40
|
"build": "rslib build",
|
|
40
41
|
"dev": "rslib build --watch",
|
|
41
42
|
"clean": "rm -rf node_modules && rm -rf dist",
|
|
@@ -43,12 +44,12 @@
|
|
|
43
44
|
"typecheck": "tsgo --noEmit"
|
|
44
45
|
},
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@bloque/sdk-core": "
|
|
47
|
+
"@bloque/sdk-core": "0.0.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@rslib/core": "
|
|
50
|
-
"@types/node": "
|
|
51
|
-
"@typescript/native-preview": "
|
|
52
|
-
"typescript": "
|
|
50
|
+
"@rslib/core": "^0.18.4",
|
|
51
|
+
"@types/node": "^24.10.1",
|
|
52
|
+
"@typescript/native-preview": "latest",
|
|
53
|
+
"typescript": "^5.9.3"
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { HttpClient } from '@bloque/sdk-core';
|
|
2
|
-
import type { BancolombiaAccount, CreateBancolombiaAccountParams } from './types';
|
|
3
|
-
export declare class BancolombiaClient {
|
|
4
|
-
private readonly httpClient;
|
|
5
|
-
constructor(httpClient: HttpClient);
|
|
6
|
-
/**
|
|
7
|
-
* Create a new Bancolombia account
|
|
8
|
-
*
|
|
9
|
-
* @param params - Bancolombia account creation parameters
|
|
10
|
-
* @returns Promise resolving to the created Bancolombia account
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const account = await bloque.accounts.bancolombia.create({
|
|
15
|
-
* urn: 'did:bloque:user:123',
|
|
16
|
-
* name: 'Main Account'
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
create(params: CreateBancolombiaAccountParams): Promise<BancolombiaAccount>;
|
|
21
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export interface CreateBancolombiaAccountParams {
|
|
2
|
-
/**
|
|
3
|
-
* URN of the account holder (user or organization)
|
|
4
|
-
*
|
|
5
|
-
* @example "did:bloque:user:123e4567"
|
|
6
|
-
*/
|
|
7
|
-
urn: string;
|
|
8
|
-
/**
|
|
9
|
-
* Display name for the card
|
|
10
|
-
*/
|
|
11
|
-
name?: string;
|
|
12
|
-
/**
|
|
13
|
-
* URN of an existing card to link with the Bancolombia account
|
|
14
|
-
*
|
|
15
|
-
* @example "did:bloque:card:123e4567"
|
|
16
|
-
*/
|
|
17
|
-
cardUrn?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Custom metadata to attach to the Bancolombia account
|
|
20
|
-
*/
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Bancolombia account response
|
|
25
|
-
*/
|
|
26
|
-
export interface BancolombiaAccount {
|
|
27
|
-
/**
|
|
28
|
-
* Unique resource name for the Bancolombia account
|
|
29
|
-
*/
|
|
30
|
-
urn: string;
|
|
31
|
-
/**
|
|
32
|
-
* Account ID
|
|
33
|
-
*/
|
|
34
|
-
id: string;
|
|
35
|
-
/**
|
|
36
|
-
* Reference code for the Bancolombia account
|
|
37
|
-
*/
|
|
38
|
-
referenceCode: string;
|
|
39
|
-
/**
|
|
40
|
-
* Account status
|
|
41
|
-
*/
|
|
42
|
-
status: 'creation_in_progress' | 'active' | 'disabled' | 'frozen' | 'deleted' | 'creation_failed';
|
|
43
|
-
/**
|
|
44
|
-
* Owner URN
|
|
45
|
-
*/
|
|
46
|
-
ownerUrn: string;
|
|
47
|
-
/**
|
|
48
|
-
* Webhook URL (if configured)
|
|
49
|
-
*/
|
|
50
|
-
webhookUrl: string | null;
|
|
51
|
-
/**
|
|
52
|
-
* Custom metadata
|
|
53
|
-
*/
|
|
54
|
-
metadata?: Record<string, unknown>;
|
|
55
|
-
/**
|
|
56
|
-
* Creation timestamp
|
|
57
|
-
*/
|
|
58
|
-
createdAt: string;
|
|
59
|
-
/**
|
|
60
|
-
* Last update timestamp
|
|
61
|
-
*/
|
|
62
|
-
updatedAt: string;
|
|
63
|
-
}
|