fiberx-backend-toolkit 1.0.12 → 1.0.14
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/fibase/clients/base_fibase_app_client.d.ts +26 -0
- package/dist/fibase/clients/base_fibase_app_client.js +133 -0
- package/dist/fibase/clients/generated_fibase_registered_app_client.d.ts +10 -0
- package/dist/fibase/clients/generated_fibase_registered_app_client.js +16 -0
- package/dist/fibase/clients/v1/fibase_v1_client.d.ts +15 -0
- package/dist/fibase/clients/v1/fibase_v1_client.js +23 -0
- package/dist/fibase/clients/v1/fibase_v1_identity_client.d.ts +16 -0
- package/dist/fibase/clients/v1/fibase_v1_identity_client.js +28 -0
- package/dist/fibase/clients/v1/fibase_v1_identity_wallet_client.d.ts +18 -0
- package/dist/fibase/clients/v1/fibase_v1_identity_wallet_client.js +37 -0
- package/dist/fibase/clients/v1/fibase_v1_payment_config_client.d.ts +16 -0
- package/dist/fibase/clients/v1/fibase_v1_payment_config_client.js +31 -0
- package/dist/fibase/clients/v1/fibase_v1_transaction_client.d.ts +29 -0
- package/dist/fibase/clients/v1/fibase_v1_transaction_client.js +49 -0
- package/dist/fibase/clients/v1/main.d.ts +6 -0
- package/dist/fibase/clients/v1/main.js +17 -0
- package/dist/fibase/fibase_app_client.d.ts +8 -43
- package/dist/fibase/fibase_app_client.js +8 -134
- package/dist/fibase/main.d.ts +7 -2
- package/dist/fibase/main.js +25 -3
- package/dist/fibase/registered_app_api_routes.d.ts +87 -0
- package/dist/fibase/registered_app_api_routes.js +102 -0
- package/dist/mailer/processors/email_enqueue_processor.js +1 -1
- package/dist/types/fibase_registered_app_api_type.d.ts +393 -0
- package/dist/types/fibase_registered_app_api_type.js +2 -0
- package/dist/types/fibase_type.d.ts +2 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/main.js +1 -0
- package/package.json +19 -17
|
@@ -3,42 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const axios_1 = __importDefault(require("axios"));
|
|
7
6
|
const main_1 = require("../utils/main");
|
|
7
|
+
const generated_fibase_registered_app_client_1 = __importDefault(require("./clients/generated_fibase_registered_app_client"));
|
|
8
8
|
const app_event_payload_builder_1 = __importDefault(require("./app_event_payload_builder"));
|
|
9
|
-
|
|
9
|
+
/** Main Fibase client and entry point for versioned API clients. */
|
|
10
|
+
class FibaseAppClient extends generated_fibase_registered_app_client_1.default {
|
|
10
11
|
static instance = null;
|
|
11
|
-
name = "fibase_app_client";
|
|
12
|
-
logger = new main_1.LoggerUtil(this.name);
|
|
13
|
-
config;
|
|
14
|
-
headers;
|
|
15
|
-
static DEFAULT_HEADERS = {
|
|
16
|
-
app_id: "X-App-Id",
|
|
17
|
-
app_key_version: "X-Key-Version",
|
|
18
|
-
timestamp: "X-Timestamp",
|
|
19
|
-
nonce: "X-Nonce",
|
|
20
|
-
signature: "x-Signature",
|
|
21
|
-
request_id: "X-Request-Id",
|
|
22
|
-
content_type: "Content-Type",
|
|
23
|
-
};
|
|
24
12
|
static DEFAULT_BASE_URLS = {
|
|
25
13
|
development: "http://localhost:4000",
|
|
26
14
|
staging: "https://staging-api.fibase.app",
|
|
27
15
|
production: "https://api.fibase.app",
|
|
28
16
|
};
|
|
29
17
|
constructor(config) {
|
|
30
|
-
|
|
31
|
-
...config,
|
|
32
|
-
base_url: config.base_url.replace(/\/+$/, ""),
|
|
33
|
-
key_algorithm: config.key_algorithm ?? "sha256",
|
|
34
|
-
timeout_ms: config.timeout_ms ?? 30000,
|
|
35
|
-
};
|
|
36
|
-
this.headers = { ...FibaseAppClient.DEFAULT_HEADERS, ...(config.headers ?? {}) };
|
|
37
|
-
this.validateConfig();
|
|
18
|
+
super(config, "fibase_app_client");
|
|
38
19
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Create a singleton client for applications that prefer process-wide reuse.
|
|
41
|
-
*/
|
|
20
|
+
/** Create a process-wide Fibase client. */
|
|
42
21
|
static initialize(config) {
|
|
43
22
|
if (this.instance) {
|
|
44
23
|
throw new Error("FibaseAppClient already initialized.");
|
|
@@ -46,18 +25,14 @@ class FibaseAppClient {
|
|
|
46
25
|
this.instance = new FibaseAppClient(config);
|
|
47
26
|
return this.instance;
|
|
48
27
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Return the initialized singleton client.
|
|
51
|
-
*/
|
|
28
|
+
/** Return the initialized process-wide client. */
|
|
52
29
|
static getInstance() {
|
|
53
30
|
if (!this.instance) {
|
|
54
31
|
throw new Error("FibaseAppClient not initialized.");
|
|
55
32
|
}
|
|
56
33
|
return this.instance;
|
|
57
34
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Build a client from environment variables loaded by EnvManagerUtil.
|
|
60
|
-
*/
|
|
35
|
+
/** Build a client from Fibase environment variables. */
|
|
61
36
|
static fromEnv(options = {}) {
|
|
62
37
|
const env_manager = main_1.EnvManagerUtil.getInstance();
|
|
63
38
|
const mode = env_manager.getEnvVar("MODE", "development") ?? "development";
|
|
@@ -83,108 +58,7 @@ class FibaseAppClient {
|
|
|
83
58
|
timeout_ms: Number(env_manager.getEnvVar(options.timeout_ms_key ?? "FIBASE_TIMEOUT_MS", 30000)),
|
|
84
59
|
});
|
|
85
60
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Validate the minimum data required to sign Fibase app requests.
|
|
88
|
-
*/
|
|
89
|
-
validateConfig() {
|
|
90
|
-
if (!this.config.base_url) {
|
|
91
|
-
throw new Error("Fibase base_url is required");
|
|
92
|
-
}
|
|
93
|
-
if (!this.config.app_id) {
|
|
94
|
-
throw new Error("Fibase app_id is required");
|
|
95
|
-
}
|
|
96
|
-
if (!this.config.app_private_key) {
|
|
97
|
-
throw new Error("Fibase app_private_key is required");
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Normalize request paths so signature generation matches the server authenticator.
|
|
102
|
-
*/
|
|
103
|
-
normalizePath(path) {
|
|
104
|
-
const [pathname] = path.split("?");
|
|
105
|
-
return pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Build the same body hash format used by Fibase's RequestAuthenticatorUtil.
|
|
109
|
-
*/
|
|
110
|
-
hashBody(body) {
|
|
111
|
-
const json = JSON.stringify(body ?? {});
|
|
112
|
-
return main_1.CryptoKeyUtil.hash(json, "sha256", "hex");
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Build the canonical string signed by external apps and verified by Fibase.
|
|
116
|
-
*/
|
|
117
|
-
buildCanonicalString(method, path, timestamp, nonce, body) {
|
|
118
|
-
return [
|
|
119
|
-
method.toUpperCase(),
|
|
120
|
-
this.normalizePath(path),
|
|
121
|
-
timestamp,
|
|
122
|
-
nonce,
|
|
123
|
-
this.hashBody(body),
|
|
124
|
-
].join("\n");
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Build a signed request without sending it. Useful for tests and custom transports.
|
|
128
|
-
*/
|
|
129
|
-
buildSignedRequest(input) {
|
|
130
|
-
const method = input.method.toUpperCase();
|
|
131
|
-
const path = this.normalizePath(input.path);
|
|
132
|
-
const body = (input.body ?? {});
|
|
133
|
-
const timestamp = input.timestamp ?? Date.now().toString();
|
|
134
|
-
const nonce = input.nonce ?? main_1.UUIDGeneratorUtil.generateUUIDV2("NONCE");
|
|
135
|
-
const canonical = this.buildCanonicalString(method, path, timestamp, nonce, body);
|
|
136
|
-
const signature = main_1.CryptoKeyUtil.sign(canonical, this.config.app_private_key, this.config.key_algorithm, "base64");
|
|
137
|
-
return {
|
|
138
|
-
url: `${this.config.base_url}${path}`,
|
|
139
|
-
method,
|
|
140
|
-
path,
|
|
141
|
-
body,
|
|
142
|
-
canonical,
|
|
143
|
-
signature,
|
|
144
|
-
headers: {
|
|
145
|
-
[this.headers.content_type]: "application/json",
|
|
146
|
-
[this.headers.app_id]: this.config.app_id,
|
|
147
|
-
[this.headers.app_key_version]: String(this.config.app_key_version ?? 1),
|
|
148
|
-
[this.headers.timestamp]: timestamp,
|
|
149
|
-
[this.headers.nonce]: nonce,
|
|
150
|
-
[this.headers.signature]: signature,
|
|
151
|
-
[this.headers.request_id]: input.request_id ?? main_1.UUIDGeneratorUtil.generateUUIDV2("REQ"),
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Send a signed request to Fibase using the standard app-auth headers.
|
|
157
|
-
*/
|
|
158
|
-
async request(method, path, body, options = {}) {
|
|
159
|
-
const signed_request = this.buildSignedRequest({
|
|
160
|
-
method,
|
|
161
|
-
path,
|
|
162
|
-
body,
|
|
163
|
-
request_id: options.request_id,
|
|
164
|
-
});
|
|
165
|
-
const request_config = {
|
|
166
|
-
url: signed_request.url,
|
|
167
|
-
method: signed_request.method,
|
|
168
|
-
data: signed_request.body,
|
|
169
|
-
headers: { ...signed_request.headers, ...(options.headers ?? {}) },
|
|
170
|
-
timeout: this.config.timeout_ms,
|
|
171
|
-
};
|
|
172
|
-
this.logger.info("Sending signed Fibase app request", {
|
|
173
|
-
method: signed_request.method,
|
|
174
|
-
path: signed_request.path,
|
|
175
|
-
request_id: signed_request.headers[this.headers.request_id],
|
|
176
|
-
});
|
|
177
|
-
const response = await axios_1.default.request(request_config);
|
|
178
|
-
return {
|
|
179
|
-
status: response.status,
|
|
180
|
-
status_text: response.statusText,
|
|
181
|
-
data: response.data,
|
|
182
|
-
headers: response.headers,
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Build and send a standard app event to the Fibase central app.
|
|
187
|
-
*/
|
|
61
|
+
/** Build and send a standard app event to Fibase. */
|
|
188
62
|
async sendAppEvent(input, options = {}) {
|
|
189
63
|
const event_payload = app_event_payload_builder_1.default.build(input);
|
|
190
64
|
return this.request("POST", options.path ?? "/api/app-events", event_payload, options);
|
package/dist/fibase/main.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import FibaseAppEventPayloadBuilder from "./app_event_payload_builder";
|
|
2
1
|
import FibaseAppClient from "./fibase_app_client";
|
|
3
|
-
|
|
2
|
+
import BaseFibaseAppClient from "./clients/base_fibase_app_client";
|
|
3
|
+
import FibaseAppEventPayloadBuilder from "./app_event_payload_builder";
|
|
4
|
+
export { BaseFibaseAppClient, FibaseAppEventPayloadBuilder, FibaseAppClient };
|
|
5
|
+
export * from "./clients/v1/main";
|
|
6
|
+
export { default as FibaseRegisteredAppAPIRoutes, FibaseRegisteredAppAPIManifest, } from "./registered_app_api_routes";
|
|
7
|
+
export * from "../types/fibase_type";
|
|
8
|
+
export * from "../types/fibase_registered_app_api_type";
|
package/dist/fibase/main.js
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FibaseAppClient = exports.FibaseAppEventPayloadBuilder = void 0;
|
|
7
|
-
const app_event_payload_builder_1 = __importDefault(require("./app_event_payload_builder"));
|
|
8
|
-
exports.FibaseAppEventPayloadBuilder = app_event_payload_builder_1.default;
|
|
20
|
+
exports.FibaseRegisteredAppAPIManifest = exports.FibaseRegisteredAppAPIRoutes = exports.FibaseAppClient = exports.FibaseAppEventPayloadBuilder = exports.BaseFibaseAppClient = void 0;
|
|
9
21
|
const fibase_app_client_1 = __importDefault(require("./fibase_app_client"));
|
|
10
22
|
exports.FibaseAppClient = fibase_app_client_1.default;
|
|
23
|
+
const base_fibase_app_client_1 = __importDefault(require("./clients/base_fibase_app_client"));
|
|
24
|
+
exports.BaseFibaseAppClient = base_fibase_app_client_1.default;
|
|
25
|
+
const app_event_payload_builder_1 = __importDefault(require("./app_event_payload_builder"));
|
|
26
|
+
exports.FibaseAppEventPayloadBuilder = app_event_payload_builder_1.default;
|
|
27
|
+
__exportStar(require("./clients/v1/main"), exports);
|
|
28
|
+
var registered_app_api_routes_1 = require("./registered_app_api_routes");
|
|
29
|
+
Object.defineProperty(exports, "FibaseRegisteredAppAPIRoutes", { enumerable: true, get: function () { return __importDefault(registered_app_api_routes_1).default; } });
|
|
30
|
+
Object.defineProperty(exports, "FibaseRegisteredAppAPIManifest", { enumerable: true, get: function () { return registered_app_api_routes_1.FibaseRegisteredAppAPIManifest; } });
|
|
31
|
+
__exportStar(require("../types/fibase_type"), exports);
|
|
32
|
+
__exportStar(require("../types/fibase_registered_app_api_type"), exports);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/generate-fibase-registered-app-routes.js.
|
|
3
|
+
* Do not edit by hand; edit the Fibase routes and rerun the generator.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FibaseRegisteredAppAPIManifest: readonly [{
|
|
6
|
+
readonly name: "getOrCreateAppIdentityRecord";
|
|
7
|
+
readonly method: "POST";
|
|
8
|
+
readonly path: "/api/app/v1/identity/resolve";
|
|
9
|
+
readonly permission: "app_identity_module.get_or_create_identity_record";
|
|
10
|
+
readonly controller: "getOrCreateAppIdentityRecordController";
|
|
11
|
+
}, {
|
|
12
|
+
readonly name: "getAppIdentityRecord";
|
|
13
|
+
readonly method: "GET";
|
|
14
|
+
readonly path: "/api/app/v1/identity/:member_public_id";
|
|
15
|
+
readonly permission: "app_identity_module.get_identity_record";
|
|
16
|
+
readonly controller: "getAppIdentityRecordController";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "getAppIdentityWalletList";
|
|
19
|
+
readonly method: "GET";
|
|
20
|
+
readonly path: "/api/app/v1/identity/:identity_public_id/wallets";
|
|
21
|
+
readonly permission: "app_identity_wallet_module.get_identity_wallet_list";
|
|
22
|
+
readonly controller: "getAppIdentityWalletListController";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "getOrCreateAppIdentityCurrencyWallet";
|
|
25
|
+
readonly method: "POST";
|
|
26
|
+
readonly path: "/api/app/v1/identity/:identity_public_id/wallets/resolve";
|
|
27
|
+
readonly permission: "app_identity_wallet_module.get_or_create_identity_currency_wallet";
|
|
28
|
+
readonly controller: "getOrCreateAppIdentityCurrencyWalletController";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "getAppIdentityCurrencyWallet";
|
|
31
|
+
readonly method: "GET";
|
|
32
|
+
readonly path: "/api/app/v1/identity/:identity_public_id/wallets/:currency_id";
|
|
33
|
+
readonly permission: "app_identity_wallet_module.get_identity_currency_wallet";
|
|
34
|
+
readonly controller: "getAppIdentityCurrencyWalletController";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "getAppCurrencyList";
|
|
37
|
+
readonly method: "GET";
|
|
38
|
+
readonly path: "/api/app/v1/payment-config/currencies";
|
|
39
|
+
readonly permission: "app_payment_config_module.get_app_currency_list";
|
|
40
|
+
readonly controller: "getAppCurrencyListController";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "getAppCurrencyPaymentOptions";
|
|
43
|
+
readonly method: "GET";
|
|
44
|
+
readonly path: "/api/app/v1/payment-config/currencies/:currency_id/options";
|
|
45
|
+
readonly permission: "app_payment_config_module.get_app_currency_payment_options";
|
|
46
|
+
readonly controller: "getAppCurrencyPaymentOptionsController";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "initiateAppDepositTransaction";
|
|
49
|
+
readonly method: "POST";
|
|
50
|
+
readonly path: "/api/app/v1/transactions/deposits";
|
|
51
|
+
readonly permission: "app_transaction_module.initiate_deposit_transaction";
|
|
52
|
+
readonly controller: "initiateAppDepositTransactionController";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "getAppTransactionByReference";
|
|
55
|
+
readonly method: "GET";
|
|
56
|
+
readonly path: "/api/app/v1/transactions/reference/:app_reference";
|
|
57
|
+
readonly permission: "app_transaction_module.get_transaction_by_reference";
|
|
58
|
+
readonly controller: "getAppTransactionByReferenceController";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "verifyAppTransaction";
|
|
61
|
+
readonly method: "POST";
|
|
62
|
+
readonly path: "/api/app/v1/transactions/:transaction_public_id/verify";
|
|
63
|
+
readonly permission: "app_transaction_module.verify_transaction";
|
|
64
|
+
readonly controller: "verifyAppTransactionController";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "getAppTransactionRecord";
|
|
67
|
+
readonly method: "GET";
|
|
68
|
+
readonly path: "/api/app/v1/transactions/:transaction_public_id";
|
|
69
|
+
readonly permission: "app_transaction_module.get_transaction_record";
|
|
70
|
+
readonly controller: "getAppTransactionRecordController";
|
|
71
|
+
}];
|
|
72
|
+
declare const FibaseRegisteredAppAPIRoutes: {
|
|
73
|
+
readonly v1: {
|
|
74
|
+
readonly getOrCreateAppIdentityRecord: "/api/app/v1/identity/resolve";
|
|
75
|
+
readonly getAppIdentityRecord: "/api/app/v1/identity/:member_public_id";
|
|
76
|
+
readonly getAppIdentityWalletList: "/api/app/v1/identity/:identity_public_id/wallets";
|
|
77
|
+
readonly getOrCreateAppIdentityCurrencyWallet: "/api/app/v1/identity/:identity_public_id/wallets/resolve";
|
|
78
|
+
readonly getAppIdentityCurrencyWallet: "/api/app/v1/identity/:identity_public_id/wallets/:currency_id";
|
|
79
|
+
readonly getAppCurrencyList: "/api/app/v1/payment-config/currencies";
|
|
80
|
+
readonly getAppCurrencyPaymentOptions: "/api/app/v1/payment-config/currencies/:currency_id/options";
|
|
81
|
+
readonly initiateAppDepositTransaction: "/api/app/v1/transactions/deposits";
|
|
82
|
+
readonly getAppTransactionByReference: "/api/app/v1/transactions/reference/:app_reference";
|
|
83
|
+
readonly verifyAppTransaction: "/api/app/v1/transactions/:transaction_public_id/verify";
|
|
84
|
+
readonly getAppTransactionRecord: "/api/app/v1/transactions/:transaction_public_id";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export default FibaseRegisteredAppAPIRoutes;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FibaseRegisteredAppAPIManifest = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generated by scripts/generate-fibase-registered-app-routes.js.
|
|
6
|
+
* Do not edit by hand; edit the Fibase routes and rerun the generator.
|
|
7
|
+
*/
|
|
8
|
+
exports.FibaseRegisteredAppAPIManifest = [
|
|
9
|
+
{
|
|
10
|
+
name: "getOrCreateAppIdentityRecord",
|
|
11
|
+
method: "POST",
|
|
12
|
+
path: "/api/app/v1/identity/resolve",
|
|
13
|
+
permission: "app_identity_module.get_or_create_identity_record",
|
|
14
|
+
controller: "getOrCreateAppIdentityRecordController",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "getAppIdentityRecord",
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/api/app/v1/identity/:member_public_id",
|
|
20
|
+
permission: "app_identity_module.get_identity_record",
|
|
21
|
+
controller: "getAppIdentityRecordController",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "getAppIdentityWalletList",
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: "/api/app/v1/identity/:identity_public_id/wallets",
|
|
27
|
+
permission: "app_identity_wallet_module.get_identity_wallet_list",
|
|
28
|
+
controller: "getAppIdentityWalletListController",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "getOrCreateAppIdentityCurrencyWallet",
|
|
32
|
+
method: "POST",
|
|
33
|
+
path: "/api/app/v1/identity/:identity_public_id/wallets/resolve",
|
|
34
|
+
permission: "app_identity_wallet_module.get_or_create_identity_currency_wallet",
|
|
35
|
+
controller: "getOrCreateAppIdentityCurrencyWalletController",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "getAppIdentityCurrencyWallet",
|
|
39
|
+
method: "GET",
|
|
40
|
+
path: "/api/app/v1/identity/:identity_public_id/wallets/:currency_id",
|
|
41
|
+
permission: "app_identity_wallet_module.get_identity_currency_wallet",
|
|
42
|
+
controller: "getAppIdentityCurrencyWalletController",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "getAppCurrencyList",
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/api/app/v1/payment-config/currencies",
|
|
48
|
+
permission: "app_payment_config_module.get_app_currency_list",
|
|
49
|
+
controller: "getAppCurrencyListController",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "getAppCurrencyPaymentOptions",
|
|
53
|
+
method: "GET",
|
|
54
|
+
path: "/api/app/v1/payment-config/currencies/:currency_id/options",
|
|
55
|
+
permission: "app_payment_config_module.get_app_currency_payment_options",
|
|
56
|
+
controller: "getAppCurrencyPaymentOptionsController",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "initiateAppDepositTransaction",
|
|
60
|
+
method: "POST",
|
|
61
|
+
path: "/api/app/v1/transactions/deposits",
|
|
62
|
+
permission: "app_transaction_module.initiate_deposit_transaction",
|
|
63
|
+
controller: "initiateAppDepositTransactionController",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "getAppTransactionByReference",
|
|
67
|
+
method: "GET",
|
|
68
|
+
path: "/api/app/v1/transactions/reference/:app_reference",
|
|
69
|
+
permission: "app_transaction_module.get_transaction_by_reference",
|
|
70
|
+
controller: "getAppTransactionByReferenceController",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "verifyAppTransaction",
|
|
74
|
+
method: "POST",
|
|
75
|
+
path: "/api/app/v1/transactions/:transaction_public_id/verify",
|
|
76
|
+
permission: "app_transaction_module.verify_transaction",
|
|
77
|
+
controller: "verifyAppTransactionController",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "getAppTransactionRecord",
|
|
81
|
+
method: "GET",
|
|
82
|
+
path: "/api/app/v1/transactions/:transaction_public_id",
|
|
83
|
+
permission: "app_transaction_module.get_transaction_record",
|
|
84
|
+
controller: "getAppTransactionRecordController",
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
const FibaseRegisteredAppAPIRoutes = {
|
|
88
|
+
v1: {
|
|
89
|
+
getOrCreateAppIdentityRecord: "/api/app/v1/identity/resolve",
|
|
90
|
+
getAppIdentityRecord: "/api/app/v1/identity/:member_public_id",
|
|
91
|
+
getAppIdentityWalletList: "/api/app/v1/identity/:identity_public_id/wallets",
|
|
92
|
+
getOrCreateAppIdentityCurrencyWallet: "/api/app/v1/identity/:identity_public_id/wallets/resolve",
|
|
93
|
+
getAppIdentityCurrencyWallet: "/api/app/v1/identity/:identity_public_id/wallets/:currency_id",
|
|
94
|
+
getAppCurrencyList: "/api/app/v1/payment-config/currencies",
|
|
95
|
+
getAppCurrencyPaymentOptions: "/api/app/v1/payment-config/currencies/:currency_id/options",
|
|
96
|
+
initiateAppDepositTransaction: "/api/app/v1/transactions/deposits",
|
|
97
|
+
getAppTransactionByReference: "/api/app/v1/transactions/reference/:app_reference",
|
|
98
|
+
verifyAppTransaction: "/api/app/v1/transactions/:transaction_public_id/verify",
|
|
99
|
+
getAppTransactionRecord: "/api/app/v1/transactions/:transaction_public_id",
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
exports.default = FibaseRegisteredAppAPIRoutes;
|
|
@@ -43,7 +43,7 @@ class EmailEnqueueProcessor {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
if (missing.length) {
|
|
46
|
-
throw new Error(`Missing required email placeholders: ${missing.join(", ")}`);
|
|
46
|
+
throw new Error(`Missing required email placeholders: ${missing.join(", ")}, payload passed: ${payload}`);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
// ==============================
|