@owneraio/finp2p-sdk-js 0.28.26 → 0.28.41
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/README.md +71 -1
- package/lib/OwneraAPI/__tests__/apiErrorShape.test.d.ts +1 -0
- package/lib/OwneraAPI/__tests__/apiErrorShape.test.js +264 -0
- package/lib/OwneraAPI/__tests__/apiErrorShape.test.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js +5 -12
- package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.d.ts +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js +56 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.d.ts +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js +75 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.d.ts +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js +348 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.d.ts +1 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js +97 -0
- package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/certificates.js +15 -6
- package/lib/OwneraAPI/finp2p-node-api/certificates.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/custodies.js +13 -2
- package/lib/OwneraAPI/finp2p-node-api/custodies.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/documents.js +22 -9
- package/lib/OwneraAPI/finp2p-node-api/documents.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/investorAccounts.d.ts +13 -0
- package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js +71 -0
- package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js.map +1 -0
- package/lib/OwneraAPI/finp2p-node-api/ledgers.js +13 -2
- package/lib/OwneraAPI/finp2p-node-api/ledgers.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/messages.js +12 -3
- package/lib/OwneraAPI/finp2p-node-api/messages.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/operations.js +37 -15
- package/lib/OwneraAPI/finp2p-node-api/operations.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/policies.js +14 -5
- package/lib/OwneraAPI/finp2p-node-api/policies.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/profiles.js +82 -45
- package/lib/OwneraAPI/finp2p-node-api/profiles.js.map +1 -1
- package/lib/OwneraAPI/finp2p-node-api/tokens.js +20 -0
- package/lib/OwneraAPI/finp2p-node-api/tokens.js.map +1 -1
- package/lib/OwneraAPI/index.js +2 -0
- package/lib/OwneraAPI/index.js.map +1 -1
- package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.d.ts +1 -0
- package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js +253 -0
- package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js.map +1 -0
- package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js +52 -0
- package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js.map +1 -1
- package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.d.ts +1 -0
- package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js +347 -0
- package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js.map +1 -0
- package/lib/OwneraAPI/oss-api/filterUtils.d.ts +20 -0
- package/lib/OwneraAPI/oss-api/filterUtils.js +57 -5
- package/lib/OwneraAPI/oss-api/filterUtils.js.map +1 -1
- package/lib/OwneraAPI/oss-api/oss.js +155 -75
- package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
- package/lib/OwneraAPI/oss-api/queryUtils.d.ts +1 -0
- package/lib/OwneraAPI/oss-api/queryUtils.js +6 -5
- package/lib/OwneraAPI/oss-api/queryUtils.js.map +1 -1
- package/lib/OwneraAPI/oss-api/queryValidation.d.ts +3 -1
- package/lib/OwneraAPI/oss-api/queryValidation.js +21 -2
- package/lib/OwneraAPI/oss-api/queryValidation.js.map +1 -1
- package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.d.ts +1 -0
- package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js +42 -0
- package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js.map +1 -0
- package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.d.ts +1 -0
- package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js +73 -0
- package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js.map +1 -0
- package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js +23 -11
- package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js.map +1 -1
- package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.d.ts +1 -1
- package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js +3 -1
- package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js.map +1 -1
- package/lib/OwneraAPI/utils.d.ts +39 -0
- package/lib/OwneraAPI/utils.js +125 -73
- package/lib/OwneraAPI/utils.js.map +1 -1
- package/lib/core/__tests__/consoleLogger.test.d.ts +1 -0
- package/lib/core/__tests__/consoleLogger.test.js +269 -0
- package/lib/core/__tests__/consoleLogger.test.js.map +1 -0
- package/lib/core/__tests__/createAssetNameUniqueness.test.d.ts +1 -0
- package/lib/core/__tests__/createAssetNameUniqueness.test.js +95 -0
- package/lib/core/__tests__/createAssetNameUniqueness.test.js.map +1 -0
- package/lib/core/__tests__/custodianPrecedence.test.d.ts +1 -0
- package/lib/core/__tests__/custodianPrecedence.test.js +683 -0
- package/lib/core/__tests__/custodianPrecedence.test.js.map +1 -0
- package/lib/core/__tests__/executeIntentSettlementAssets.test.d.ts +1 -0
- package/lib/core/__tests__/executeIntentSettlementAssets.test.js +128 -0
- package/lib/core/__tests__/executeIntentSettlementAssets.test.js.map +1 -0
- package/lib/core/__tests__/logException.test.d.ts +1 -0
- package/lib/core/__tests__/logException.test.js +49 -0
- package/lib/core/__tests__/logException.test.js.map +1 -0
- package/lib/core/__tests__/multiplyDecimalStrings.test.d.ts +1 -0
- package/lib/core/__tests__/multiplyDecimalStrings.test.js +37 -0
- package/lib/core/__tests__/multiplyDecimalStrings.test.js.map +1 -0
- package/lib/core/__tests__/settlementExecutionAmount.test.d.ts +1 -0
- package/lib/core/__tests__/settlementExecutionAmount.test.js +300 -0
- package/lib/core/__tests__/settlementExecutionAmount.test.js.map +1 -0
- package/lib/core/asset.js +21 -27
- package/lib/core/asset.js.map +1 -1
- package/lib/core/custodian.d.ts +30 -0
- package/lib/core/custodian.js +49 -0
- package/lib/core/custodian.js.map +1 -0
- package/lib/core/index.d.ts +1 -0
- package/lib/core/index.js +3 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/intents/__tests__/intentErrorCode.test.d.ts +1 -0
- package/lib/core/intents/__tests__/intentErrorCode.test.js +111 -0
- package/lib/core/intents/__tests__/intentErrorCode.test.js.map +1 -0
- package/lib/core/intents/__tests__/intentHandleReject.test.d.ts +1 -0
- package/lib/core/intents/__tests__/intentHandleReject.test.js +50 -0
- package/lib/core/intents/__tests__/intentHandleReject.test.js.map +1 -0
- package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.d.ts +1 -0
- package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js +185 -0
- package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js.map +1 -0
- package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.d.ts +1 -0
- package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js +85 -0
- package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js.map +1 -0
- package/lib/core/intents/__tests__/loanIntentMetadata.test.d.ts +1 -0
- package/lib/core/intents/__tests__/loanIntentMetadata.test.js +81 -0
- package/lib/core/intents/__tests__/loanIntentMetadata.test.js.map +1 -0
- package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.d.ts +1 -0
- package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js +203 -0
- package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js.map +1 -0
- package/lib/core/intents/createIntent/createIntent.js +4 -3
- package/lib/core/intents/createIntent/createIntent.js.map +1 -1
- package/lib/core/intents/createIntent/createMoveIntentReq.d.ts +0 -1
- package/lib/core/intents/createIntent/createMoveIntentReq.js +15 -8
- package/lib/core/intents/createIntent/createMoveIntentReq.js.map +1 -1
- package/lib/core/intents/createIntent/helpers.d.ts +6 -2
- package/lib/core/intents/createIntent/helpers.js +27 -17
- package/lib/core/intents/createIntent/helpers.js.map +1 -1
- package/lib/core/intents/createLoanIntent.js +64 -19
- package/lib/core/intents/createLoanIntent.js.map +1 -1
- package/lib/core/intents/executeIntent.js +102 -41
- package/lib/core/intents/executeIntent.js.map +1 -1
- package/lib/core/intents/executeLoanIntent.js +48 -23
- package/lib/core/intents/executeLoanIntent.js.map +1 -1
- package/lib/core/intents/executeMoveIntent.js.map +1 -1
- package/lib/core/intents/executePrivateIntent.js +46 -13
- package/lib/core/intents/executePrivateIntent.js.map +1 -1
- package/lib/core/intents/executeRedemptionIntent.d.ts +1 -0
- package/lib/core/intents/executeRedemptionIntent.js +23 -9
- package/lib/core/intents/executeRedemptionIntent.js.map +1 -1
- package/lib/core/intents/executeTransferRequest.d.ts +5 -0
- package/lib/core/intents/executeTransferRequest.js +14 -3
- package/lib/core/intents/executeTransferRequest.js.map +1 -1
- package/lib/core/intents/getIntent.js +9 -0
- package/lib/core/intents/getIntent.js.map +1 -1
- package/lib/core/intents/transfer.js +7 -2
- package/lib/core/intents/transfer.js.map +1 -1
- package/lib/core/intents/updateMoveIntentReq.d.ts +4 -3
- package/lib/core/intents/updateMoveIntentReq.js +14 -12
- package/lib/core/intents/updateMoveIntentReq.js.map +1 -1
- package/lib/core/intents/utils.d.ts +15 -7
- package/lib/core/intents/utils.js +35 -26
- package/lib/core/intents/utils.js.map +1 -1
- package/lib/core/logger.js +128 -22
- package/lib/core/logger.js.map +1 -1
- package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.d.ts +1 -0
- package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js +60 -0
- package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js.map +1 -0
- package/lib/core/normalizers/normalizeOperationResponse.d.ts +6 -0
- package/lib/core/normalizers/normalizeOperationResponse.js +4 -5
- package/lib/core/normalizers/normalizeOperationResponse.js.map +1 -1
- package/lib/core/sdk.d.ts +4 -0
- package/lib/core/sdk.js +2 -2
- package/lib/core/sdk.js.map +1 -1
- package/lib/core/user.d.ts +2 -2
- package/lib/core/user.js +6 -3
- package/lib/core/user.js.map +1 -1
- package/lib/core/utils.d.ts +17 -1
- package/lib/core/utils.js +75 -16
- package/lib/core/utils.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/types/Core/Intents.d.ts +115 -3
- package/lib/types/Core/Intents.js +9 -0
- package/lib/types/Core/Intents.js.map +1 -1
- package/lib/types/Core/OwneraAPI.d.ts +21 -1
- package/lib/types/Core/User.d.ts +28 -3
- package/lib/types/InvestorAccounts/InvestorAccounts.d.ts +171 -0
- package/lib/types/InvestorAccounts/InvestorAccounts.js +35 -0
- package/lib/types/InvestorAccounts/InvestorAccounts.js.map +1 -0
- package/lib/types/InvestorAccounts/index.d.ts +1 -0
- package/lib/types/InvestorAccounts/index.js +18 -0
- package/lib/types/InvestorAccounts/index.js.map +1 -0
- package/lib/types/Operations/Operations.d.ts +11 -0
- package/lib/types/Oss/Oss.d.ts +18 -1
- package/lib/types/Oss/OssSchemas.d.ts +50 -0
- package/lib/types/Oss/OssSchemas.js.map +1 -1
- package/lib/types/Oss/utils.d.ts +32 -0
- package/lib/types/PaymentAdapter/PaymentAdapter.d.ts +7 -0
- package/lib/types/PaymentAdapter/index.d.ts +33 -1
- package/lib/types/Profiles/Intents.d.ts +24 -12
- package/lib/types/Profiles/Profiles.d.ts +46 -1
- package/lib/types/Tokens/Tokens.d.ts +109 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
const utils_1 = require("../utils");
|
|
4
13
|
const documents = (connector, logger) => ({
|
|
@@ -11,10 +20,10 @@ const documents = (connector, logger) => ({
|
|
|
11
20
|
* @returns
|
|
12
21
|
*
|
|
13
22
|
*/
|
|
14
|
-
create: (request, options) => {
|
|
23
|
+
create: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
24
|
const { profileId, certificateId, files } = request;
|
|
16
|
-
return (0, utils_1.docPost)(`/profiles/${profileId}/certificates/${certificateId}/docs`, files, connector, logger, options);
|
|
17
|
-
},
|
|
25
|
+
return (0, utils_1.docPost)((0, utils_1.urlPath) `/profiles/${profileId}/certificates/${certificateId}/docs`, files, connector, logger, options);
|
|
26
|
+
}),
|
|
18
27
|
/**
|
|
19
28
|
* Get Document (streaming download).
|
|
20
29
|
*
|
|
@@ -29,9 +38,13 @@ const documents = (connector, logger) => ({
|
|
|
29
38
|
* @returns
|
|
30
39
|
*
|
|
31
40
|
*/
|
|
32
|
-
get: (request, options) => {
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
get: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
// A doc uri is `profileId/certificateId/documentId` (or `dataprovider/data/<id>`): its
|
|
43
|
+
// slashes are part of the route, so each part is encoded as its own segment. Pass it
|
|
44
|
+
// unencoded: `%` is rejected.
|
|
45
|
+
const parts = typeof request.uri === 'string' ? request.uri.split('/') : [request.uri];
|
|
46
|
+
return (0, utils_1.docGetFile)(`/docs/${parts.map(utils_1.pathSegment).join('/')}`, connector, logger, options);
|
|
47
|
+
}),
|
|
35
48
|
/**
|
|
36
49
|
* Update Document
|
|
37
50
|
*
|
|
@@ -41,10 +54,10 @@ const documents = (connector, logger) => ({
|
|
|
41
54
|
* @returns
|
|
42
55
|
*
|
|
43
56
|
*/
|
|
44
|
-
update: (request, options) => {
|
|
57
|
+
update: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
58
|
const { profileId, certificateId, id, file } = request;
|
|
46
|
-
return (0, utils_1.docPut)(`/profiles/${profileId}/certificates/${certificateId}/docs/${id}`, { file }, connector, logger, options);
|
|
47
|
-
},
|
|
59
|
+
return (0, utils_1.docPut)((0, utils_1.urlPath) `/profiles/${profileId}/certificates/${certificateId}/docs/${id}`, { file }, connector, logger, options);
|
|
60
|
+
}),
|
|
48
61
|
});
|
|
49
62
|
exports.default = documents;
|
|
50
63
|
//# sourceMappingURL=documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/documents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/documents.ts"],"names":[],"mappings":";;;;;;;;;;;AAQA,oCAA6E;AAI7E,MAAM,SAAS,GAAG,CAAC,SAAwB,EAAE,MAAc,EAAa,EAAE,CAAC,CAAC;IAC1E;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAO,OAA+B,EAAE,OAAwB,EAA6B,EAAE;QACrG,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QACpD,OAAO,IAAA,eAAO,EACZ,IAAA,eAAO,EAAA,aAAa,SAAS,iBAAiB,aAAa,OAAO,EAClE,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;IACJ,CAAC,CAAA;IAED;;;;;;;;;;;;;OAaG;IACH,GAAG,EAAE,CAAO,OAA2B,EAAE,OAAwB,EAAkC,EAAE;QACnG,uFAAuF;QACvF,qFAAqF;QACrF,8BAA8B;QAC9B,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvF,OAAO,IAAA,kBAAU,EAAC,SAAS,KAAK,CAAC,GAAG,CAAC,mBAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7F,CAAC,CAAA;IAED;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAO,OAA+B,EAAE,OAAwB,EAAiB,EAAE;QACzF,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACvD,OAAO,IAAA,cAAM,EACX,IAAA,eAAO,EAAA,aAAa,SAAS,iBAAiB,aAAa,SAAS,EAAE,EAAE,EACxE,EAAE,IAAI,EAAE,EACR,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEH,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Logger } from '../../types';
|
|
3
|
+
import { InvestorAccounts } from '../../types/InvestorAccounts';
|
|
4
|
+
/**
|
|
5
|
+
* Investor network-account onboarding (`/profiles/investor/{investorId}/account/*`).
|
|
6
|
+
*
|
|
7
|
+
* Every call is async (`202 { cid }`) and requires an `Idempotency-Key` — the
|
|
8
|
+
* platform rejects requests without one, so `options` (with `idempotency`) is a
|
|
9
|
+
* required parameter on all four methods, mirroring the retry/reset/cancel
|
|
10
|
+
* workflow precedent in `profiles.ts`.
|
|
11
|
+
*/
|
|
12
|
+
declare const investorAccounts: (connector: AxiosInstance, logger: Logger) => InvestorAccounts;
|
|
13
|
+
export default investorAccounts;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
const utils_1 = require("../utils");
|
|
24
|
+
/**
|
|
25
|
+
* Investor network-account onboarding (`/profiles/investor/{investorId}/account/*`).
|
|
26
|
+
*
|
|
27
|
+
* Every call is async (`202 { cid }`) and requires an `Idempotency-Key` — the
|
|
28
|
+
* platform rejects requests without one, so `options` (with `idempotency`) is a
|
|
29
|
+
* required parameter on all four methods, mirroring the retry/reset/cancel
|
|
30
|
+
* workflow precedent in `profiles.ts`.
|
|
31
|
+
*/
|
|
32
|
+
const investorAccounts = (connector, logger) => ({
|
|
33
|
+
createAccount(request, options) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const { investorId } = request, body = __rest(request, ["investorId"]);
|
|
36
|
+
logger.debug(`CreateInvestorAccount: POST /profiles/investor/${investorId}/account/create`, body);
|
|
37
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/investor/${investorId}/account/create`, body, connector, logger, options);
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
bindAccount(request, options) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
// Strict platform decoding: never send an explicit undefined/null signature —
|
|
43
|
+
// the canonical flow omits it and proves ownership via the LA challenge.
|
|
44
|
+
const { investorId, ownershipSignature } = request, rest = __rest(request, ["investorId", "ownershipSignature"]);
|
|
45
|
+
const body = Object.assign(Object.assign({}, rest), (ownershipSignature ? { ownershipSignature } : {}));
|
|
46
|
+
logger.debug(`BindInvestorAccount: POST /profiles/investor/${investorId}/account/bind`, {
|
|
47
|
+
organizationId: body.organizationId,
|
|
48
|
+
assetId: body.assetId,
|
|
49
|
+
});
|
|
50
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/investor/${investorId}/account/bind`, body, connector, logger, options);
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
submitProof(request, options) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const { investorId } = request, body = __rest(request, ["investorId"]);
|
|
56
|
+
logger.debug(`SubmitInvestorAccountProof: POST /profiles/investor/${investorId}/account/proof`, {
|
|
57
|
+
cid: body.cid,
|
|
58
|
+
});
|
|
59
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/investor/${investorId}/account/proof`, body, connector, logger, options);
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
removeAccount(request, options) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const { investorId, accountId } = request;
|
|
65
|
+
logger.debug(`RemoveInvestorAccount: DELETE /profiles/investor/${investorId}/account/${accountId}`);
|
|
66
|
+
return (0, utils_1.apiDelete)((0, utils_1.urlPath) `/profiles/investor/${investorId}/account/${accountId}`, connector, logger, options);
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
exports.default = investorAccounts;
|
|
71
|
+
//# sourceMappingURL=investorAccounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"investorAccounts.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/investorAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWA,oCAAuD;AAEvD;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,CAA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CAAC;YACH,OAAO,IAAA,eAAO,EACZ,IAAA,eAAO,EAAA,sBAAsB,UAAU,gBAAgB,EACvD,IAAI,EACJ,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;IAEK,aAAa,CAAC,OAAqC,EAAE,OAAuB;;YAChF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;YAC1C,MAAM,CAAC,KAAK,CAAC,oDAAoD,UAAU,YAAY,SAAS,EAAE,CAAC,CAAC;YACpG,OAAO,IAAA,iBAAS,EACd,IAAA,eAAO,EAAA,sBAAsB,UAAU,YAAY,SAAS,EAAE,EAC9D,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
const utils_1 = require("../utils");
|
|
4
13
|
const ledgers = (connector, logger) => ({
|
|
@@ -22,8 +31,10 @@ const ledgers = (connector, logger) => ({
|
|
|
22
31
|
* @returns Promise<Ledger>
|
|
23
32
|
*/
|
|
24
33
|
update(name, request, options) {
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
logger.debug(`UpdateLedger: PATCH /ledger/${name}/update`, request);
|
|
36
|
+
return (0, utils_1.apiPatch)((0, utils_1.urlPath) `/ledger/${name}/update`, request, connector, logger, options);
|
|
37
|
+
});
|
|
27
38
|
},
|
|
28
39
|
});
|
|
29
40
|
exports.default = ledgers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ledgers.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/ledgers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ledgers.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/ledgers.ts"],"names":[],"mappings":";;;;;;;;;;;AAIA,oCAAsD;AAEtD,MAAM,OAAO,GAAG,CAAC,SAAwB,EAAE,MAAc,EAAW,EAAE,CAAC,CAAC;IACtE;;;;;;OAMG;IACH,IAAI,CAAC,OAA0B,EAAE,OAAwB;QACvD,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;QACvD,OAAO,IAAA,eAAO,EAA4B,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;;OAOG;IACG,MAAM,CAAC,IAAY,EAAE,OAAmC,EAAE,OAAwB;;YACtF,MAAM,CAAC,KAAK,CAAC,+BAA+B,IAAI,SAAS,EAAE,OAAO,CAAC,CAAC;YACpE,OAAO,IAAA,gBAAQ,EACb,IAAA,eAAO,EAAA,WAAW,IAAI,SAAS,EAC/B,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC;AAEH,kBAAe,OAAO,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
@@ -57,9 +66,9 @@ const messages = (connector, logger) => ({
|
|
|
57
66
|
* @returns
|
|
58
67
|
*
|
|
59
68
|
*/
|
|
60
|
-
getAttachment: (request, options) => {
|
|
61
|
-
return (0, utils_1.docGetFile)(`/messages/attachments/${request.uuid}`, connector, logger, options);
|
|
62
|
-
},
|
|
69
|
+
getAttachment: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
+
return (0, utils_1.docGetFile)((0, utils_1.urlPath) `/messages/attachments/${request.uuid}`, connector, logger, options);
|
|
71
|
+
}),
|
|
63
72
|
});
|
|
64
73
|
exports.default = messages;
|
|
65
74
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oCAAwD;AAKxD,0DAAiC;AAGjC,MAAM,QAAQ,GAAG,CAAC,SAAwB,EAAE,MAAc,EAAY,EAAE,CAAC,CAAC;IACxE;;;;;;;;OAQG;IACH,WAAW,EAAE,CAAC,OAA2B,EAAE,OAAwB,EAA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,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;QAE1D,OAAO,IAAA,eAAO,EAAwB,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kCAC9E,OAAO,KACV,SAAS,EAAE,IAAI,IACf,CAAC;IACL,CAAC;IACD;;;;;;;;;;;;;OAaG;IACH,aAAa,EAAE,CAAO,OAA6B,EAAE,OAAwB,EAAkC,EAAE;QAC/G,OAAO,IAAA,kBAAU,EAAC,IAAA,eAAO,EAAA,yBAAyB,OAAO,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC,CAAA;CACF,CAAC,CAAC;AAEH,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
const utils_1 = require("../utils");
|
|
4
13
|
const operations = (connector, logger) => ({
|
|
@@ -10,9 +19,9 @@ const operations = (connector, logger) => ({
|
|
|
10
19
|
* @returns
|
|
11
20
|
*
|
|
12
21
|
*/
|
|
13
|
-
addAccountOperationStatus: (request) => {
|
|
14
|
-
return (0, utils_1.apiGet)(`/operations/status/${request.cid}`, connector, logger);
|
|
15
|
-
},
|
|
22
|
+
addAccountOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
24
|
+
}),
|
|
16
25
|
/**
|
|
17
26
|
* Get execution operation status
|
|
18
27
|
*
|
|
@@ -21,9 +30,9 @@ const operations = (connector, logger) => ({
|
|
|
21
30
|
* @returns
|
|
22
31
|
*
|
|
23
32
|
*/
|
|
24
|
-
executionOperationStatus: (request) => {
|
|
25
|
-
return (0, utils_1.apiGet)(`/operations/status/${request.cid}`, connector, logger);
|
|
26
|
-
},
|
|
33
|
+
executionOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
35
|
+
}),
|
|
27
36
|
/**
|
|
28
37
|
* Get profile operation status
|
|
29
38
|
*
|
|
@@ -32,9 +41,9 @@ const operations = (connector, logger) => ({
|
|
|
32
41
|
* @returns
|
|
33
42
|
*
|
|
34
43
|
*/
|
|
35
|
-
profileOperationStatus: (request) => {
|
|
36
|
-
return (0, utils_1.apiGet)(`/operations/status/${request.cid}`, connector, logger);
|
|
37
|
-
},
|
|
44
|
+
profileOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
46
|
+
}),
|
|
38
47
|
/**
|
|
39
48
|
* Get deposit operation status
|
|
40
49
|
*
|
|
@@ -43,9 +52,9 @@ const operations = (connector, logger) => ({
|
|
|
43
52
|
* @returns
|
|
44
53
|
*
|
|
45
54
|
*/
|
|
46
|
-
depositOperationStatus: (request) => {
|
|
47
|
-
return (0, utils_1.apiGet)(`/operations/status/${request.cid}`, connector, logger);
|
|
48
|
-
},
|
|
55
|
+
depositOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
57
|
+
}),
|
|
49
58
|
/**
|
|
50
59
|
* Get withdraw operation status
|
|
51
60
|
*
|
|
@@ -54,9 +63,22 @@ const operations = (connector, logger) => ({
|
|
|
54
63
|
* @returns
|
|
55
64
|
*
|
|
56
65
|
*/
|
|
57
|
-
withdrawOperationStatus: (request) => {
|
|
58
|
-
return (0, utils_1.apiGet)(`/operations/status/${request.cid}`, connector, logger);
|
|
59
|
-
},
|
|
66
|
+
withdrawOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
68
|
+
}),
|
|
69
|
+
/**
|
|
70
|
+
* Get investor network-account operation status. Unlike waitOperationCompletion,
|
|
71
|
+
* a single fetch — the operation may be parked on a ledger-adapter `challenge`
|
|
72
|
+
* (isCompleted: false) that the caller must surface, not wait through.
|
|
73
|
+
*
|
|
74
|
+
* @param request
|
|
75
|
+
*
|
|
76
|
+
* @returns
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
79
|
+
investorAccountOperationStatus: (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/operations/status/${request.cid}`, connector, logger);
|
|
81
|
+
}),
|
|
60
82
|
/**
|
|
61
83
|
* Wait operation completion
|
|
62
84
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/operations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/operations.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,oCAA0D;AAM1D,MAAM,UAAU,GAAG,CAAC,SAAwB,EAAE,MAAc,EAAc,EAAE,CAAC,CAAC;IAC5E;;;;;;;OAO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B,OAAqC,EAAc,EAAE;QAClG,OAAO,IAAA,qBAAa,EAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAClG,CAAC;CACF,CAAC,CAAC;AAEH,kBAAe,UAAU,CAAC"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
const utils_1 = require("../utils");
|
|
4
13
|
const policies = (connector, logger) => ({
|
|
5
14
|
getAll: (request) => {
|
|
6
15
|
var _a;
|
|
7
|
-
const
|
|
8
|
-
return (0, utils_1.apiGet)(`/policies
|
|
9
|
-
},
|
|
10
|
-
getByAssetId: (assetId) => {
|
|
11
|
-
return (0, utils_1.apiGet)(`/assets/${assetId}/policies`, connector, logger);
|
|
16
|
+
const query = new URLSearchParams({ assetMatchingType: (_a = request === null || request === void 0 ? void 0 : request.assetMatchingType) !== null && _a !== void 0 ? _a : 'finp2p' });
|
|
17
|
+
return (0, utils_1.apiGet)(`/policies?${query}`, connector, logger);
|
|
12
18
|
},
|
|
19
|
+
getByAssetId: (assetId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
return (0, utils_1.apiGet)((0, utils_1.urlPath) `/assets/${assetId}/policies`, connector, logger);
|
|
21
|
+
}),
|
|
13
22
|
});
|
|
14
23
|
exports.default = policies;
|
|
15
24
|
//# sourceMappingURL=policies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/policies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policies.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/policies.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,oCAA2C;AAG3C,MAAM,QAAQ,GAAG,CAAC,SAAwB,EAAE,MAAc,EAAY,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,CAAC,OAA+B,EAAmC,EAAE;;QAC3E,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,EAAE,iBAAiB,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,QAAQ,EAAE,CAAC,CAAC;QACjG,OAAO,IAAA,cAAM,EAAyB,aAAa,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACjF,CAAC;IAED,YAAY,EAAE,CAAO,OAAe,EAAmC,EAAE;QACvE,OAAO,IAAA,cAAM,EAAyB,IAAA,eAAO,EAAA,WAAW,OAAO,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACjG,CAAC,CAAA;CACF,CAAC,CAAC;AAEH,kBAAe,QAAQ,CAAC"}
|
|
@@ -134,7 +134,7 @@ const profiles = (connector, logger) => ({
|
|
|
134
134
|
var _a;
|
|
135
135
|
const { ownerId, orgId } = request;
|
|
136
136
|
logger.debug(`AddAccount: POST /profiles/owner`, request);
|
|
137
|
-
const raw = yield (0, utils_1.apiPost)(`/profiles/owner/${ownerId}/account`, { orgId }, connector, logger, options);
|
|
137
|
+
const raw = yield (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/owner/${ownerId}/account`, { orgId }, connector, logger, options);
|
|
138
138
|
let result = (0, normalizeOperationResponse_1.normalizeOperationResponse)(raw);
|
|
139
139
|
if (!result.isCompleted) {
|
|
140
140
|
const ops = (0, operations_1.default)(connector, logger);
|
|
@@ -177,7 +177,7 @@ const profiles = (connector, logger) => ({
|
|
|
177
177
|
* @returns
|
|
178
178
|
*
|
|
179
179
|
*/
|
|
180
|
-
updateAsset: (request, options) => {
|
|
180
|
+
updateAsset: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
181
|
const { profileId, name, metadata, symbol, financialIdentifier } = request;
|
|
182
182
|
const req = {};
|
|
183
183
|
if (!!name) {
|
|
@@ -192,8 +192,8 @@ const profiles = (connector, logger) => ({
|
|
|
192
192
|
if (financialIdentifier) {
|
|
193
193
|
req.financialIdentifier = financialIdentifier;
|
|
194
194
|
}
|
|
195
|
-
return (0, utils_1.apiPatch)(`/profiles/asset/${profileId}`, req, connector, logger, options);
|
|
196
|
-
},
|
|
195
|
+
return (0, utils_1.apiPatch)((0, utils_1.urlPath) `/profiles/asset/${profileId}`, req, connector, logger, options);
|
|
196
|
+
}),
|
|
197
197
|
/**
|
|
198
198
|
* Share profile
|
|
199
199
|
*
|
|
@@ -204,13 +204,15 @@ const profiles = (connector, logger) => ({
|
|
|
204
204
|
*
|
|
205
205
|
*/
|
|
206
206
|
shareProfile(request, options) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
const { profileId, organizations, dataAccess } = request;
|
|
209
|
+
const body = { organizations };
|
|
210
|
+
if (dataAccess) {
|
|
211
|
+
body.dataAccess = dataAccess;
|
|
212
|
+
}
|
|
213
|
+
logger.info(`ShareProfile: POST /profiles/${profileId}/share`, body);
|
|
214
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/${profileId}/share`, body, connector, logger, options);
|
|
215
|
+
});
|
|
214
216
|
},
|
|
215
217
|
/**
|
|
216
218
|
* Create intent
|
|
@@ -225,9 +227,9 @@ const profiles = (connector, logger) => ({
|
|
|
225
227
|
var _a;
|
|
226
228
|
const { assetId, start, end, intent, intentId, metadata } = request;
|
|
227
229
|
const req = Object.assign({ start: Math.floor(start / 1000), end: Math.floor(end / 1000), intent,
|
|
228
|
-
intentId }, (metadata ? { metadata } : {}));
|
|
230
|
+
intentId }, (metadata && Object.keys(metadata).length ? { metadata } : {}));
|
|
229
231
|
logger.debug(`POST /profiles/asset/${assetId}/intent > ${JSON.stringify(req)}`);
|
|
230
|
-
const raw = yield (0, utils_1.apiPost)(`/profiles/asset/${assetId}/intent`, req, connector, logger, options);
|
|
232
|
+
const raw = yield (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent`, req, connector, logger, options);
|
|
231
233
|
logger.debug(`POST /profiles/asset/${assetId}/intent < ${JSON.stringify(raw)}`);
|
|
232
234
|
let result = (0, normalizeOperationResponse_1.normalizeOperationResponse)(raw);
|
|
233
235
|
if (!result.isCompleted) {
|
|
@@ -272,22 +274,24 @@ const profiles = (connector, logger) => ({
|
|
|
272
274
|
*
|
|
273
275
|
*/
|
|
274
276
|
updateIntent(r, options) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
const { assetId, intentId, start, end, intent, status } = r;
|
|
279
|
+
const req = {};
|
|
280
|
+
if (!!start) {
|
|
281
|
+
req.start = Math.floor(start / 1000);
|
|
282
|
+
}
|
|
283
|
+
if (!!end) {
|
|
284
|
+
req.end = Math.floor(end / 1000);
|
|
285
|
+
}
|
|
286
|
+
if (!!intent) {
|
|
287
|
+
req.intent = intent;
|
|
288
|
+
}
|
|
289
|
+
if (!!status) {
|
|
290
|
+
req.status = status;
|
|
291
|
+
}
|
|
292
|
+
logger.debug(`UpdateIntent: POST /profiles/asset/${assetId}/intent/${intentId}`, req);
|
|
293
|
+
return (0, utils_1.apiPatch)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}`, req, connector, logger, options);
|
|
294
|
+
});
|
|
291
295
|
},
|
|
292
296
|
/**
|
|
293
297
|
* Enable Intent
|
|
@@ -299,8 +303,10 @@ const profiles = (connector, logger) => ({
|
|
|
299
303
|
*
|
|
300
304
|
*/
|
|
301
305
|
enableIntent(r, options) {
|
|
302
|
-
|
|
303
|
-
|
|
306
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
307
|
+
const { assetId, intentId } = r;
|
|
308
|
+
return (0, utils_1.apiPut)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}/enable`, {}, connector, logger, options);
|
|
309
|
+
});
|
|
304
310
|
},
|
|
305
311
|
/**
|
|
306
312
|
* Disable Intent
|
|
@@ -312,8 +318,10 @@ const profiles = (connector, logger) => ({
|
|
|
312
318
|
*
|
|
313
319
|
*/
|
|
314
320
|
disableIntent(r, options) {
|
|
315
|
-
|
|
316
|
-
|
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
const { assetId, intentId } = r;
|
|
323
|
+
return (0, utils_1.apiPut)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}/disable`, {}, connector, logger, options);
|
|
324
|
+
});
|
|
317
325
|
},
|
|
318
326
|
/**
|
|
319
327
|
* Cancel Intent
|
|
@@ -325,16 +333,45 @@ const profiles = (connector, logger) => ({
|
|
|
325
333
|
*
|
|
326
334
|
*/
|
|
327
335
|
cancelIntent(r, options) {
|
|
328
|
-
|
|
329
|
-
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
const { assetId, intentId } = r;
|
|
338
|
+
return (0, utils_1.apiPut)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}/cancel`, {}, connector, logger, options);
|
|
339
|
+
});
|
|
340
|
+
},
|
|
341
|
+
/**
|
|
342
|
+
* Reject Intent
|
|
343
|
+
*
|
|
344
|
+
* `POST /profiles/asset/{assetId}/intent/{intentId}/reject` (finp2p-core#2649). The
|
|
345
|
+
* body is sent only when a non-blank `rejectReason` is given: the router refuses a
|
|
346
|
+
* blank one (`pattern: \S`) and accepts no body at all. No fallback to the legacy
|
|
347
|
+
* `PATCH { status: 'Rejected' }` on a 404 — see the interface docblock for why.
|
|
348
|
+
*
|
|
349
|
+
* @param r
|
|
350
|
+
* @param options
|
|
351
|
+
*
|
|
352
|
+
* @returns
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
355
|
+
rejectIntent(r, options) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
const { assetId, intentId, rejectReason } = r;
|
|
358
|
+
const reason = rejectReason === null || rejectReason === void 0 ? void 0 : rejectReason.trim();
|
|
359
|
+
const body = reason ? { rejectReason: reason } : {};
|
|
360
|
+
logger.debug(`RejectIntent: POST /profiles/asset/${assetId}/intent/${intentId}/reject`, body);
|
|
361
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}/reject`, body, connector, logger, options);
|
|
362
|
+
});
|
|
330
363
|
},
|
|
331
364
|
disableIntentTypes(r, options) {
|
|
332
|
-
|
|
333
|
-
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
const { assetId, intentTypes } = r;
|
|
367
|
+
return (0, utils_1.apiPut)((0, utils_1.urlPath) `profiles/asset/${assetId}/intents/disable`, { intentTypes }, connector, logger, options);
|
|
368
|
+
});
|
|
334
369
|
},
|
|
335
370
|
enableIntentTypes(r, options) {
|
|
336
|
-
|
|
337
|
-
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
const { assetId, intentTypes } = r;
|
|
373
|
+
return (0, utils_1.apiPut)((0, utils_1.urlPath) `profiles/asset/${assetId}/intents/enable`, { intentTypes }, connector, logger, options);
|
|
374
|
+
});
|
|
338
375
|
},
|
|
339
376
|
syncBalance(request, options) {
|
|
340
377
|
const { account, asset } = request;
|
|
@@ -348,7 +385,7 @@ const profiles = (connector, logger) => ({
|
|
|
348
385
|
const req = Object.assign({ start: Math.floor(start / 1000), end: Math.floor(end / 1000), intent: Object.assign(Object.assign({}, intentInfo), { senderId,
|
|
349
386
|
receiverId }), intentId }, rest);
|
|
350
387
|
logger.debug(`POST /profiles/asset/${assetId}/intent > ${JSON.stringify(req)}`);
|
|
351
|
-
const raw = yield (0, utils_1.apiPost)(`/profiles/asset/${assetId}/intent`, req, connector, logger, options);
|
|
388
|
+
const raw = yield (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent`, req, connector, logger, options);
|
|
352
389
|
logger.debug(`POST /profiles/asset/${assetId}/intent < ${JSON.stringify(raw)}`);
|
|
353
390
|
let result = (0, normalizeOperationResponse_1.normalizeOperationResponse)(raw);
|
|
354
391
|
if (!result.isCompleted) {
|
|
@@ -386,7 +423,7 @@ const profiles = (connector, logger) => ({
|
|
|
386
423
|
executeTransferRequest: (intentId, request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
387
424
|
var _a;
|
|
388
425
|
logger.debug(`ExecuteTransferRequest: POST /profiles/asset/intent/transfer/execute/${intentId}`, request);
|
|
389
|
-
const raw = yield (0, utils_1.apiPost)(`/profiles/asset/intent/transfer/execute/${intentId}`, request, connector, logger, options);
|
|
426
|
+
const raw = yield (0, utils_1.apiPost)((0, utils_1.urlPath) `/profiles/asset/intent/transfer/execute/${intentId}`, request, connector, logger, options);
|
|
390
427
|
let result = (0, normalizeOperationResponse_1.normalizeOperationResponse)(raw);
|
|
391
428
|
if (!result.isCompleted) {
|
|
392
429
|
const ops = (0, operations_1.default)(connector, logger);
|
|
@@ -423,7 +460,7 @@ const profiles = (connector, logger) => ({
|
|
|
423
460
|
var _a;
|
|
424
461
|
const { assetId } = request, rest = __rest(request, ["assetId"]);
|
|
425
462
|
logger.debug(`UpdateTransferRequestIntent: PATCH /profiles/asset/${assetId}/intent/${intentId}`, rest);
|
|
426
|
-
const raw = yield (0, utils_1.apiPatch)(`/profiles/asset/${assetId}/intent/${intentId}`, rest, connector, logger, options);
|
|
463
|
+
const raw = yield (0, utils_1.apiPatch)((0, utils_1.urlPath) `/profiles/asset/${assetId}/intent/${intentId}`, rest, connector, logger, options);
|
|
427
464
|
let result = (0, normalizeOperationResponse_1.normalizeOperationResponse)(raw);
|
|
428
465
|
if (!result.isCompleted) {
|
|
429
466
|
const ops = (0, operations_1.default)(connector, logger);
|
|
@@ -467,7 +504,7 @@ const profiles = (connector, logger) => ({
|
|
|
467
504
|
retryWorkflow: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
468
505
|
const { workflowId, reason } = request;
|
|
469
506
|
logger.debug(`RetryWorkflow: POST /workflow/${workflowId}/retry`, { reason });
|
|
470
|
-
return (0, utils_1.apiPost)(`/workflow/${
|
|
507
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/workflow/${workflowId}/retry`, { reason }, connector, logger, options);
|
|
471
508
|
}),
|
|
472
509
|
/**
|
|
473
510
|
* Reset a router workflow (EP Manual Intervention).
|
|
@@ -479,7 +516,7 @@ const profiles = (connector, logger) => ({
|
|
|
479
516
|
resetWorkflow: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
480
517
|
const { workflowId, reason } = request;
|
|
481
518
|
logger.debug(`ResetWorkflow: POST /workflow/${workflowId}/reset`, { reason });
|
|
482
|
-
return (0, utils_1.apiPost)(`/workflow/${
|
|
519
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/workflow/${workflowId}/reset`, { reason }, connector, logger, options);
|
|
483
520
|
}),
|
|
484
521
|
/**
|
|
485
522
|
* Cancel a router workflow (EP Manual Intervention).
|
|
@@ -490,7 +527,7 @@ const profiles = (connector, logger) => ({
|
|
|
490
527
|
cancelWorkflow: (request, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
491
528
|
const { workflowId, reason } = request;
|
|
492
529
|
logger.debug(`CancelWorkflow: POST /workflow/${workflowId}/cancel`, { reason });
|
|
493
|
-
return (0, utils_1.apiPost)(`/workflow/${
|
|
530
|
+
return (0, utils_1.apiPost)((0, utils_1.urlPath) `/workflow/${workflowId}/cancel`, { reason }, connector, logger, options);
|
|
494
531
|
}),
|
|
495
532
|
});
|
|
496
533
|
exports.default = profiles;
|