@spritz-finance/service-client 0.4.2 → 0.4.4
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/lib/features/featuresServiceClient.d.ts +3 -3
- package/lib/features/featuresServiceClient.js +14 -14
- package/lib/features/types.d.ts +2 -0
- package/lib/features/types.js +2 -0
- package/lib/verification/verificationServiceClient.d.ts +3 -2
- package/lib/verification/verificationServiceClient.js +10 -5
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * as FeaturesClient from
|
|
2
|
-
import { ApiResponse } from
|
|
3
|
-
import { FeatureFlag, FeatureFlags, FlagSource } from
|
|
1
|
+
export * as FeaturesClient from "./featuresServiceClient";
|
|
2
|
+
import { ApiResponse } from "../types";
|
|
3
|
+
import { FeatureFlag, FeatureFlags, FlagSource } from "./types";
|
|
4
4
|
export declare function updateFeatureFlag(input: {
|
|
5
5
|
key: FeatureFlag;
|
|
6
6
|
value: boolean;
|
|
@@ -28,32 +28,32 @@ exports.FeaturesClient = __importStar(require("./featuresServiceClient"));
|
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const utils_1 = require("../utils");
|
|
30
30
|
const types_1 = require("./types");
|
|
31
|
-
const FEATURES_ENDPOINT =
|
|
31
|
+
const FEATURES_ENDPOINT = "/users";
|
|
32
32
|
const networkToFlag = (network) => {
|
|
33
33
|
switch (network) {
|
|
34
|
-
case
|
|
34
|
+
case "ethereum":
|
|
35
35
|
return types_1.FeatureFlag.EthereumPayments;
|
|
36
|
-
case
|
|
36
|
+
case "polygon":
|
|
37
37
|
return types_1.FeatureFlag.PolygonPayments;
|
|
38
|
-
case
|
|
38
|
+
case "optimism":
|
|
39
39
|
return types_1.FeatureFlag.OptimismPayments;
|
|
40
|
-
case
|
|
40
|
+
case "arbitrum":
|
|
41
41
|
return types_1.FeatureFlag.ArbitrumPayments;
|
|
42
|
-
case
|
|
42
|
+
case "base":
|
|
43
43
|
return types_1.FeatureFlag.BasePayments;
|
|
44
|
-
case
|
|
44
|
+
case "avalanche":
|
|
45
45
|
return types_1.FeatureFlag.AvalancePayments;
|
|
46
|
-
case
|
|
46
|
+
case "binance-smart-chain":
|
|
47
47
|
return types_1.FeatureFlag.BinancePayments;
|
|
48
|
-
case
|
|
48
|
+
case "solana":
|
|
49
49
|
return types_1.FeatureFlag.SolanaPayments;
|
|
50
|
-
case
|
|
50
|
+
case "tron":
|
|
51
51
|
return types_1.FeatureFlag.TronPayments;
|
|
52
|
-
case
|
|
52
|
+
case "bitcoin":
|
|
53
53
|
return types_1.FeatureFlag.BtcPayments;
|
|
54
|
-
case
|
|
54
|
+
case "dash":
|
|
55
55
|
return types_1.FeatureFlag.DashPayments;
|
|
56
|
-
case
|
|
56
|
+
case "sui":
|
|
57
57
|
return types_1.FeatureFlag.SuiPayments;
|
|
58
58
|
default:
|
|
59
59
|
return null;
|
|
@@ -100,7 +100,7 @@ async function isPaymentsEnabled(network, allFlags) {
|
|
|
100
100
|
return true;
|
|
101
101
|
const networkFlag = networkToFlag(network);
|
|
102
102
|
// this will default to true if we have not handled the network yet
|
|
103
|
-
return networkFlag ? (_c = (_b = flags[networkFlag]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : true : true;
|
|
103
|
+
return networkFlag ? ((_c = (_b = flags[networkFlag]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : true) : true;
|
|
104
104
|
}
|
|
105
105
|
exports.isPaymentsEnabled = isPaymentsEnabled;
|
|
106
106
|
/**
|
package/lib/features/types.d.ts
CHANGED
|
@@ -35,7 +35,9 @@ export declare enum FeatureFlag {
|
|
|
35
35
|
BridgeKycUpload = "bridge.kyc.upload",
|
|
36
36
|
BridgeWalletPayments = "bridge.wallet.payments",
|
|
37
37
|
RainCardEnabled = "rainCard.enabled",
|
|
38
|
+
RainCardOpsWalletPayouts = "rainCard.opsWalletPayouts",
|
|
38
39
|
RainCardDispatchWalletPayouts = "rainCard.dispatchWalletPayouts",
|
|
40
|
+
BridgeDispatchWalletPayouts = "bridge.dispatchWalletPayouts",
|
|
39
41
|
RainCardDeposits = "rainCard.deposits",
|
|
40
42
|
SpritzCardNoKycEnabled = "spritzCard.noKyc.enabled",
|
|
41
43
|
SpritzCardNoKycPayments = "spritzCard.noKyc.payments",
|
package/lib/features/types.js
CHANGED
|
@@ -35,7 +35,9 @@ var FeatureFlag;
|
|
|
35
35
|
// Features
|
|
36
36
|
FeatureFlag["BridgeWalletPayments"] = "bridge.wallet.payments";
|
|
37
37
|
FeatureFlag["RainCardEnabled"] = "rainCard.enabled";
|
|
38
|
+
FeatureFlag["RainCardOpsWalletPayouts"] = "rainCard.opsWalletPayouts";
|
|
38
39
|
FeatureFlag["RainCardDispatchWalletPayouts"] = "rainCard.dispatchWalletPayouts";
|
|
40
|
+
FeatureFlag["BridgeDispatchWalletPayouts"] = "bridge.dispatchWalletPayouts";
|
|
39
41
|
FeatureFlag["RainCardDeposits"] = "rainCard.deposits";
|
|
40
42
|
FeatureFlag["SpritzCardNoKycEnabled"] = "spritzCard.noKyc.enabled";
|
|
41
43
|
FeatureFlag["SpritzCardNoKycPayments"] = "spritzCard.noKyc.payments";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * as VerificationClient from
|
|
2
|
-
import { BasicIdentityData, IdentityData, Verification } from
|
|
1
|
+
export * as VerificationClient from "./verificationServiceClient";
|
|
2
|
+
import { BasicIdentityData, IdentityData, Verification } from "./types";
|
|
3
3
|
export declare function getUserVerification(userId: string): Promise<Verification>;
|
|
4
4
|
export declare function getUserIdentity(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<IdentityData>>;
|
|
5
5
|
export declare function getBasicUserIdentity(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BasicIdentityData>>;
|
|
6
|
+
export declare function disableUser(userId: string, note: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
7
|
export declare function createUserVerification(input: {
|
|
7
8
|
userId: string;
|
|
8
9
|
email?: string;
|
|
@@ -23,14 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deactivateBillsModule = exports.activateVirtualCardModule = exports.createUserVerification = exports.getBasicUserIdentity = exports.getUserIdentity = exports.getUserVerification = exports.VerificationClient = void 0;
|
|
26
|
+
exports.deactivateBillsModule = exports.activateVirtualCardModule = exports.createUserVerification = exports.disableUser = exports.getBasicUserIdentity = exports.getUserIdentity = exports.getUserVerification = exports.VerificationClient = void 0;
|
|
27
27
|
exports.VerificationClient = __importStar(require("./verificationServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
|
-
const VERIFICATION_ENDPOINT =
|
|
29
|
+
const VERIFICATION_ENDPOINT = "/verification";
|
|
30
30
|
async function getUserVerification(userId) {
|
|
31
|
-
return serviceClient_1.baseClient
|
|
32
|
-
.get(`${VERIFICATION_ENDPOINT}/user/${userId}`)
|
|
33
|
-
.then((res) => res.data);
|
|
31
|
+
return serviceClient_1.baseClient.get(`${VERIFICATION_ENDPOINT}/user/${userId}`).then((res) => res.data);
|
|
34
32
|
}
|
|
35
33
|
exports.getUserVerification = getUserVerification;
|
|
36
34
|
async function getUserIdentity(userId) {
|
|
@@ -45,6 +43,13 @@ async function getBasicUserIdentity(userId) {
|
|
|
45
43
|
.then((res) => res.data);
|
|
46
44
|
}
|
|
47
45
|
exports.getBasicUserIdentity = getBasicUserIdentity;
|
|
46
|
+
async function disableUser(userId, note) {
|
|
47
|
+
return serviceClient_1.baseClient.post(`${VERIFICATION_ENDPOINT}/users/disable`, {
|
|
48
|
+
userIds: [userId],
|
|
49
|
+
note,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.disableUser = disableUser;
|
|
48
53
|
async function createUserVerification(input) {
|
|
49
54
|
return serviceClient_1.baseClient
|
|
50
55
|
.post(`${VERIFICATION_ENDPOINT}/v2/users`, input)
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spritz-finance/service-client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
|
+
"gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8",
|
|
4
5
|
"description": "Service client",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"author": "",
|
|
7
8
|
"files": [
|
|
8
9
|
"lib/**/*"
|
|
9
10
|
],
|
|
11
|
+
"main": "lib/index.js",
|
|
12
|
+
"types": "lib/index.d.ts",
|
|
10
13
|
"scripts": {
|
|
11
14
|
"prebuild": "rimraf lib/*",
|
|
12
15
|
"prepare": "npm run build",
|
|
@@ -18,8 +21,6 @@
|
|
|
18
21
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
19
22
|
"gen:types": "graphql-codegen --config codegen.yml"
|
|
20
23
|
},
|
|
21
|
-
"author": "",
|
|
22
|
-
"license": "ISC",
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"axios": "^0.26.1",
|
|
25
26
|
"axios-oauth-client": "^1.4.4",
|
|
@@ -45,6 +46,5 @@
|
|
|
45
46
|
"@aws-sdk/client-ssm": "^3.549.0",
|
|
46
47
|
"@spritz-finance/config": "^0.1.6",
|
|
47
48
|
"@spritz-finance/logger": "^0.2.1"
|
|
48
|
-
}
|
|
49
|
-
"gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8"
|
|
49
|
+
}
|
|
50
50
|
}
|