@blockchyp/blockchyp-ts 1.0.0 → 2.18.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/README.md +8 -9
- package/_bundles/blockchyp.js +71404 -0
- package/_bundles/blockchyp.js.map +1 -0
- package/_bundles/blockchyp.min.js +3 -0
- package/_bundles/blockchyp.min.js.LICENSE.txt +16 -0
- package/_bundles/blockchyp.min.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/{index.js → lib/index.js} +1 -0
- package/lib/index.js.map +1 -0
- package/lib/spec/CryptoSpec.d.ts +1 -0
- package/{spec → lib/spec}/CryptoSpec.js +1 -0
- package/lib/spec/CryptoSpec.js.map +1 -0
- package/lib/spec/SanitySpec.d.ts +1 -0
- package/{spec → lib/spec}/SanitySpec.js +2 -1
- package/lib/spec/SanitySpec.js.map +1 -0
- package/lib/src/client.d.ts +463 -0
- package/{src → lib/src}/client.js +9 -7
- package/lib/src/client.js.map +1 -0
- package/lib/src/cryptoutils.d.ts +16 -0
- package/{src → lib/src}/cryptoutils.js +18 -13
- package/lib/src/cryptoutils.js.map +1 -0
- package/lib/src/global.d.ts +1 -0
- package/lib/src/global.js +30 -0
- package/lib/src/global.js.map +1 -0
- package/lib/src/models.d.ts +9591 -0
- package/{src → lib/src}/models.js +3 -1
- package/lib/src/models.js.map +1 -0
- package/package.json +23 -9
- package/spec/SanitySpec.ts +1 -1
- package/src/client.ts +9 -9
- package/src/cryptoutils.ts +7 -6
- package/src/global.ts +1 -1
- package/src/models.ts +7 -0
- package/itest/ActivateTerminalITestSpec.js +0 -87
- package/itest/ActivateTerminalITestSpec.ts +0 -58
- package/itest/AddTestMerchantITestSpec.js +0 -89
- package/itest/AddTestMerchantITestSpec.ts +0 -60
- package/itest/BatchHistoryITestSpec.js +0 -101
- package/itest/BatchHistoryITestSpec.ts +0 -73
- package/itest/BooleanPromptITestSpec.js +0 -104
- package/itest/BooleanPromptITestSpec.ts +0 -76
- package/itest/CancelPaymentLinkITestSpec.js +0 -116
- package/itest/CancelPaymentLinkITestSpec.ts +0 -93
- package/itest/CaptureSignatureITestSpec.js +0 -101
- package/itest/CaptureSignatureITestSpec.ts +0 -73
- package/itest/DeactivateTerminalITestSpec.js +0 -82
- package/itest/DeactivateTerminalITestSpec.ts +0 -52
- package/itest/DeleteBrandingAssetITestSpec.js +0 -96
- package/itest/DeleteBrandingAssetITestSpec.ts +0 -69
- package/itest/DeleteCustomerITestSpec.js +0 -102
- package/itest/DeleteCustomerITestSpec.ts +0 -75
- package/itest/DeleteMediaAssetITestSpec.js +0 -100
- package/itest/DeleteMediaAssetITestSpec.ts +0 -71
- package/itest/DeleteQueuedTransactionITestSpec.js +0 -117
- package/itest/DeleteQueuedTransactionITestSpec.ts +0 -89
- package/itest/DeleteSlideShowITestSpec.js +0 -96
- package/itest/DeleteSlideShowITestSpec.ts +0 -69
- package/itest/DeleteSurveyQuestionITestSpec.js +0 -97
- package/itest/DeleteSurveyQuestionITestSpec.ts +0 -70
- package/itest/DeleteTestMerchantITestSpec.js +0 -96
- package/itest/DeleteTestMerchantITestSpec.ts +0 -69
- package/itest/DeleteTokenITestSpec.js +0 -102
- package/itest/DeleteTokenITestSpec.ts +0 -75
- package/itest/EmptyBrandingAssetITestSpec.js +0 -85
- package/itest/EmptyBrandingAssetITestSpec.ts +0 -57
- package/itest/EmptySlideShowITestSpec.js +0 -87
- package/itest/EmptySlideShowITestSpec.ts +0 -58
- package/itest/GatewayTimeoutITestSpec.js +0 -103
- package/itest/GatewayTimeoutITestSpec.ts +0 -73
- package/itest/GetCustomerITestSpec.js +0 -102
- package/itest/GetCustomerITestSpec.ts +0 -75
- package/itest/GetMerchantsITestSpec.js +0 -84
- package/itest/GetMerchantsITestSpec.ts +0 -56
- package/itest/InviteMerchantUserITestSpec.js +0 -86
- package/itest/InviteMerchantUserITestSpec.ts +0 -58
- package/itest/LinkTokenITestSpec.js +0 -103
- package/itest/LinkTokenITestSpec.ts +0 -76
- package/itest/ListQueuedTransactionsITestSpec.js +0 -116
- package/itest/ListQueuedTransactionsITestSpec.ts +0 -88
- package/itest/ListTerminalsITestSpec.js +0 -83
- package/itest/ListTerminalsITestSpec.ts +0 -56
- package/itest/MediaAssetITestSpec.js +0 -105
- package/itest/MediaAssetITestSpec.ts +0 -75
- package/itest/MediaITestSpec.js +0 -83
- package/itest/MediaITestSpec.ts +0 -56
- package/itest/MediaUploadITestSpec.js +0 -94
- package/itest/MediaUploadITestSpec.ts +0 -63
- package/itest/MerchantCredentialGenerationITestSpec.js +0 -85
- package/itest/MerchantCredentialGenerationITestSpec.ts +0 -57
- package/itest/MerchantInvoiceDetailITestSpec.js +0 -84
- package/itest/MerchantInvoiceDetailITestSpec.ts +0 -56
- package/itest/MerchantInvoicesITestSpec.js +0 -84
- package/itest/MerchantInvoicesITestSpec.ts +0 -56
- package/itest/MerchantPlatformsITestSpec.js +0 -96
- package/itest/MerchantPlatformsITestSpec.ts +0 -69
- package/itest/MerchantProfileITestSpec.js +0 -84
- package/itest/MerchantProfileITestSpec.ts +0 -56
- package/itest/MerchantUsersITestSpec.js +0 -83
- package/itest/MerchantUsersITestSpec.ts +0 -56
- package/itest/NewTransactionDisplayITestSpec.js +0 -115
- package/itest/NewTransactionDisplayITestSpec.ts +0 -92
- package/itest/PANChargeITestSpec.js +0 -118
- package/itest/PANChargeITestSpec.ts +0 -88
- package/itest/PANEnrollITestSpec.js +0 -118
- package/itest/PANEnrollITestSpec.ts +0 -90
- package/itest/PANPreauthITestSpec.js +0 -116
- package/itest/PANPreauthITestSpec.ts +0 -87
- package/itest/PartialRefundITestSpec.js +0 -119
- package/itest/PartialRefundITestSpec.ts +0 -91
- package/itest/PartnerCommissionBreakdownITestSpec.js +0 -84
- package/itest/PartnerCommissionBreakdownITestSpec.ts +0 -56
- package/itest/PartnerStatementDetailITestSpec.js +0 -84
- package/itest/PartnerStatementDetailITestSpec.ts +0 -56
- package/itest/PartnerStatementsITestSpec.js +0 -84
- package/itest/PartnerStatementsITestSpec.ts +0 -56
- package/itest/PaymentLinkStatusITestSpec.js +0 -116
- package/itest/PaymentLinkStatusITestSpec.ts +0 -93
- package/itest/PricingPolicyITestSpec.js +0 -85
- package/itest/PricingPolicyITestSpec.ts +0 -57
- package/itest/ResendPaymentLinkITestSpec.js +0 -116
- package/itest/ResendPaymentLinkITestSpec.ts +0 -93
- package/itest/SearchCustomerITestSpec.js +0 -101
- package/itest/SearchCustomerITestSpec.ts +0 -75
- package/itest/SendPaymentLinkITestSpec.js +0 -107
- package/itest/SendPaymentLinkITestSpec.ts +0 -82
- package/itest/SimpleBatchCloseITestSpec.js +0 -101
- package/itest/SimpleBatchCloseITestSpec.ts +0 -73
- package/itest/SimpleCaptureITestSpec.js +0 -101
- package/itest/SimpleCaptureITestSpec.ts +0 -74
- package/itest/SimpleGiftActivateITestSpec.js +0 -104
- package/itest/SimpleGiftActivateITestSpec.ts +0 -75
- package/itest/SimpleLocateITestSpec.js +0 -85
- package/itest/SimpleLocateITestSpec.ts +0 -57
- package/itest/SimpleMessageITestSpec.js +0 -101
- package/itest/SimpleMessageITestSpec.ts +0 -73
- package/itest/SimplePingITestSpec.js +0 -100
- package/itest/SimplePingITestSpec.ts +0 -72
- package/itest/SimpleRefundITestSpec.js +0 -118
- package/itest/SimpleRefundITestSpec.ts +0 -90
- package/itest/SimpleReversalITestSpec.js +0 -103
- package/itest/SimpleReversalITestSpec.ts +0 -75
- package/itest/SimpleVoidITestSpec.js +0 -103
- package/itest/SimpleVoidITestSpec.ts +0 -75
- package/itest/SlideShowITestSpec.js +0 -98
- package/itest/SlideShowITestSpec.ts +0 -70
- package/itest/SlideShowsITestSpec.js +0 -95
- package/itest/SlideShowsITestSpec.ts +0 -69
- package/itest/SurveyQuestionITestSpec.js +0 -95
- package/itest/SurveyQuestionITestSpec.ts +0 -68
- package/itest/SurveyQuestionsITestSpec.js +0 -96
- package/itest/SurveyQuestionsITestSpec.ts +0 -70
- package/itest/SurveyResultsITestSpec.js +0 -95
- package/itest/SurveyResultsITestSpec.ts +0 -68
- package/itest/TCDeleteTemplateITestSpec.js +0 -98
- package/itest/TCDeleteTemplateITestSpec.ts +0 -70
- package/itest/TCEntryITestSpec.js +0 -103
- package/itest/TCEntryITestSpec.ts +0 -76
- package/itest/TCLogITestSpec.js +0 -83
- package/itest/TCLogITestSpec.ts +0 -56
- package/itest/TCTemplateITestSpec.js +0 -101
- package/itest/TCTemplateITestSpec.ts +0 -72
- package/itest/TCTemplateUpdateITestSpec.js +0 -91
- package/itest/TCTemplateUpdateITestSpec.ts +0 -61
- package/itest/TCTemplatesITestSpec.js +0 -83
- package/itest/TCTemplatesITestSpec.ts +0 -56
- package/itest/TerminalBrandingITestSpec.js +0 -83
- package/itest/TerminalBrandingITestSpec.ts +0 -56
- package/itest/TerminalChargeITestSpec.js +0 -113
- package/itest/TerminalChargeITestSpec.ts +0 -84
- package/itest/TerminalClearITestSpec.js +0 -100
- package/itest/TerminalClearITestSpec.ts +0 -72
- package/itest/TerminalEBTBalanceITestSpec.js +0 -103
- package/itest/TerminalEBTBalanceITestSpec.ts +0 -74
- package/itest/TerminalEBTChargeITestSpec.js +0 -115
- package/itest/TerminalEBTChargeITestSpec.ts +0 -86
- package/itest/TerminalEnrollITestSpec.js +0 -112
- package/itest/TerminalEnrollITestSpec.ts +0 -83
- package/itest/TerminalGiftCardBalanceITestSpec.js +0 -102
- package/itest/TerminalGiftCardBalanceITestSpec.ts +0 -73
- package/itest/TerminalKeyedChargeITestSpec.js +0 -114
- package/itest/TerminalKeyedChargeITestSpec.ts +0 -85
- package/itest/TerminalManualEBTChargeITestSpec.js +0 -116
- package/itest/TerminalManualEBTChargeITestSpec.ts +0 -87
- package/itest/TerminalPreauthITestSpec.js +0 -113
- package/itest/TerminalPreauthITestSpec.ts +0 -84
- package/itest/TerminalQueuedTransactionITestSpec.js +0 -108
- package/itest/TerminalQueuedTransactionITestSpec.ts +0 -78
- package/itest/TerminalStatusITestSpec.js +0 -100
- package/itest/TerminalStatusITestSpec.ts +0 -72
- package/itest/TerminalTimeoutITestSpec.js +0 -99
- package/itest/TerminalTimeoutITestSpec.ts +0 -70
- package/itest/TermsAndConditionsITestSpec.js +0 -105
- package/itest/TermsAndConditionsITestSpec.ts +0 -77
- package/itest/TextPromptITestSpec.js +0 -103
- package/itest/TextPromptITestSpec.ts +0 -74
- package/itest/TokenMetadataITestSpec.js +0 -102
- package/itest/TokenMetadataITestSpec.ts +0 -75
- package/itest/TransactionHistoryITestSpec.js +0 -101
- package/itest/TransactionHistoryITestSpec.ts +0 -73
- package/itest/UnlinkTokenITestSpec.js +0 -103
- package/itest/UnlinkTokenITestSpec.ts +0 -76
- package/itest/UpdateBrandingAssetITestSpec.js +0 -109
- package/itest/UpdateBrandingAssetITestSpec.ts +0 -80
- package/itest/UpdateCustomerITestSpec.js +0 -90
- package/itest/UpdateCustomerITestSpec.ts +0 -63
- package/itest/UpdateMerchantITestSpec.js +0 -92
- package/itest/UpdateMerchantITestSpec.ts +0 -65
- package/itest/UpdateMerchantPlatformsITestSpec.js +0 -98
- package/itest/UpdateMerchantPlatformsITestSpec.ts +0 -71
- package/itest/UpdateSlideShowITestSpec.js +0 -106
- package/itest/UpdateSlideShowITestSpec.ts +0 -78
- package/itest/UpdateSurveyQuestionITestSpec.js +0 -89
- package/itest/UpdateSurveyQuestionITestSpec.ts +0 -60
- package/itest/UpdateTransactionDisplayITestSpec.js +0 -115
- package/itest/UpdateTransactionDisplayITestSpec.ts +0 -92
- package/itest/UploadStatusITestSpec.js +0 -100
- package/itest/UploadStatusITestSpec.ts +0 -71
- package/itest/support/aviato.png +0 -0
- package/itest/support/config.js +0 -67
- package/itest/support/config.ts +0 -106
- package/itest/support/jasmine.json +0 -11
- package/spec/support/jasmine.json +0 -11
- package/src/global.js +0 -9
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2019-2024 BlockChyp, Inc. All rights reserved. Use of this code is governed
|
|
3
|
-
* by a license that can be found in the LICENSE file.
|
|
4
|
-
*
|
|
5
|
-
* This file was generated automatically by the BlockChyp SDK Generator. Changes to this
|
|
6
|
-
* file will be lost every time the code is regenerated.
|
|
7
|
-
*/
|
|
8
|
-
import * as fs from 'fs';
|
|
9
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
-
import { Config } from './support/config';
|
|
11
|
-
import * as BlockChyp from '../index';
|
|
12
|
-
|
|
13
|
-
describe('UploadStatus', function () {
|
|
14
|
-
let originalTimeout: number;
|
|
15
|
-
let client: typeof BlockChyp.BlockChypClient;
|
|
16
|
-
Config.load();
|
|
17
|
-
|
|
18
|
-
beforeEach(function () {
|
|
19
|
-
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
|
20
|
-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('checks the status of a file upload.', function (done) {
|
|
24
|
-
client = BlockChyp.newClient(Config.getCreds(""));
|
|
25
|
-
client.setGatewayHost(Config.getGatewayHost());
|
|
26
|
-
client.setTestGatewayHost(Config.getTestGatewayHost());
|
|
27
|
-
client.setDashboardHost(Config.getDashboardHost());
|
|
28
|
-
|
|
29
|
-
const testDelay = process.env.BC_TEST_DELAY;
|
|
30
|
-
let testDelayInt = 0;
|
|
31
|
-
if (testDelay) {
|
|
32
|
-
testDelayInt = parseInt(testDelay);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
console.log('Running uploadStatus...');
|
|
36
|
-
|
|
37
|
-
setTimeout(async function () {
|
|
38
|
-
try {
|
|
39
|
-
// setup request object
|
|
40
|
-
const setupRequest = new BlockChyp.UploadMetadata();
|
|
41
|
-
setupRequest.fileName = 'aviato.png';
|
|
42
|
-
setupRequest.fileSize = 18843;
|
|
43
|
-
setupRequest.uploadId = uuidv4();
|
|
44
|
-
let setupResponse: BlockChyp.MediaMetadata = new BlockChyp.MediaMetadata();
|
|
45
|
-
const content = fs.readFileSync('support/aviato.png');
|
|
46
|
-
const setupHttpResponse = await client.uploadMedia(setupRequest, content);
|
|
47
|
-
if (setupHttpResponse.status !== 200) {
|
|
48
|
-
console.log('Error:', setupHttpResponse.statusText);
|
|
49
|
-
fail(setupHttpResponse.statusText);
|
|
50
|
-
done();
|
|
51
|
-
}
|
|
52
|
-
setupResponse = setupHttpResponse.data
|
|
53
|
-
|
|
54
|
-
// setup request object
|
|
55
|
-
const request = new BlockChyp.UploadStatusRequest();
|
|
56
|
-
request.uploadId = setupResponse.id;
|
|
57
|
-
|
|
58
|
-
const httpResponse = await client.uploadStatus(request)
|
|
59
|
-
const response: BlockChyp.UploadStatus = httpResponse.data;
|
|
60
|
-
// response assertions
|
|
61
|
-
expect(response.success).toBe(true);
|
|
62
|
-
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.log('Error:', error);
|
|
65
|
-
fail(error);
|
|
66
|
-
} finally {
|
|
67
|
-
done();
|
|
68
|
-
}
|
|
69
|
-
}, testDelayInt * 1000);
|
|
70
|
-
});
|
|
71
|
-
});
|
package/itest/support/aviato.png
DELETED
|
Binary file
|
package/itest/support/config.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Config = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const is_windows_1 = __importDefault(require("is-windows"));
|
|
10
|
-
const ITestConfig = {
|
|
11
|
-
defaultTerminalAddress: '',
|
|
12
|
-
defaultTerminalName: '',
|
|
13
|
-
gatewayHost: '',
|
|
14
|
-
dashboardHost: '',
|
|
15
|
-
testGatewayHost: '',
|
|
16
|
-
apiKey: '',
|
|
17
|
-
bearerToken: '',
|
|
18
|
-
signingKey: '',
|
|
19
|
-
profiles: {},
|
|
20
|
-
load: function () {
|
|
21
|
-
let configHome = '';
|
|
22
|
-
if ((0, is_windows_1.default)()) {
|
|
23
|
-
configHome = process.env.userprofile || '';
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
configHome = process.env.XDG_CONFIG_HOME || path_1.default.join(require('os').homedir(), '/.config');
|
|
27
|
-
}
|
|
28
|
-
const fileLocation = path_1.default.join(configHome, 'blockchyp', 'sdk-itest-config.json');
|
|
29
|
-
const data = fs_1.default.readFileSync(fileLocation, 'utf-8');
|
|
30
|
-
Object.assign(ITestConfig, JSON.parse(data));
|
|
31
|
-
},
|
|
32
|
-
getTerminalAddress: function () {
|
|
33
|
-
return ITestConfig.defaultTerminalAddress;
|
|
34
|
-
},
|
|
35
|
-
getTerminalName: function () {
|
|
36
|
-
return ITestConfig.defaultTerminalName;
|
|
37
|
-
},
|
|
38
|
-
getGatewayHost: function () {
|
|
39
|
-
return ITestConfig.gatewayHost;
|
|
40
|
-
},
|
|
41
|
-
getDashboardHost: function () {
|
|
42
|
-
return ITestConfig.dashboardHost;
|
|
43
|
-
},
|
|
44
|
-
getTestGatewayHost: function () {
|
|
45
|
-
return ITestConfig.testGatewayHost;
|
|
46
|
-
},
|
|
47
|
-
getApiKey: function () {
|
|
48
|
-
return ITestConfig.apiKey;
|
|
49
|
-
},
|
|
50
|
-
getBearerToken: function () {
|
|
51
|
-
return ITestConfig.bearerToken;
|
|
52
|
-
},
|
|
53
|
-
getSigningKey: function () {
|
|
54
|
-
return ITestConfig.signingKey;
|
|
55
|
-
},
|
|
56
|
-
getCreds: function (profile) {
|
|
57
|
-
if (profile) {
|
|
58
|
-
return ITestConfig.profiles[profile];
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
apiKey: ITestConfig.apiKey,
|
|
62
|
-
bearerToken: ITestConfig.bearerToken,
|
|
63
|
-
signingKey: ITestConfig.signingKey,
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
exports.Config = ITestConfig;
|
package/itest/support/config.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import isWindows from 'is-windows';
|
|
4
|
-
|
|
5
|
-
interface ITestConfigData {
|
|
6
|
-
defaultTerminalAddress: string;
|
|
7
|
-
defaultTerminalName: string;
|
|
8
|
-
gatewayHost: string;
|
|
9
|
-
dashboardHost: string;
|
|
10
|
-
testGatewayHost: string;
|
|
11
|
-
apiKey: string;
|
|
12
|
-
bearerToken: string;
|
|
13
|
-
signingKey: string;
|
|
14
|
-
profiles: {
|
|
15
|
-
[key: string]: {
|
|
16
|
-
apiKey: string;
|
|
17
|
-
bearerToken: string;
|
|
18
|
-
signingKey: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface ITestConfigFunctions {
|
|
24
|
-
load: () => void;
|
|
25
|
-
getTerminalAddress: () => string;
|
|
26
|
-
getTerminalName: () => string;
|
|
27
|
-
getGatewayHost: () => string;
|
|
28
|
-
getDashboardHost: () => string;
|
|
29
|
-
getTestGatewayHost: () => string;
|
|
30
|
-
getApiKey: () => string;
|
|
31
|
-
getBearerToken: () => string;
|
|
32
|
-
getSigningKey: () => string;
|
|
33
|
-
getCreds: (profile?: string) => { apiKey: string; bearerToken: string; signingKey: string };
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
type ITestConfig = ITestConfigData & ITestConfigFunctions;
|
|
37
|
-
|
|
38
|
-
const ITestConfig: ITestConfig = {
|
|
39
|
-
defaultTerminalAddress: '',
|
|
40
|
-
defaultTerminalName: '',
|
|
41
|
-
gatewayHost: '',
|
|
42
|
-
dashboardHost: '',
|
|
43
|
-
testGatewayHost: '',
|
|
44
|
-
apiKey: '',
|
|
45
|
-
bearerToken: '',
|
|
46
|
-
signingKey: '',
|
|
47
|
-
profiles: {},
|
|
48
|
-
|
|
49
|
-
load: function () {
|
|
50
|
-
let configHome = '';
|
|
51
|
-
if (isWindows()) {
|
|
52
|
-
configHome = process.env.userprofile || '';
|
|
53
|
-
} else {
|
|
54
|
-
configHome = process.env.XDG_CONFIG_HOME || path.join(require('os').homedir(), '/.config');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const fileLocation = path.join(configHome, 'blockchyp', 'sdk-itest-config.json');
|
|
58
|
-
const data = fs.readFileSync(fileLocation, 'utf-8');
|
|
59
|
-
Object.assign(ITestConfig, JSON.parse(data));
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
getTerminalAddress: function () {
|
|
63
|
-
return ITestConfig.defaultTerminalAddress;
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
getTerminalName: function () {
|
|
67
|
-
return ITestConfig.defaultTerminalName;
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
getGatewayHost: function () {
|
|
71
|
-
return ITestConfig.gatewayHost;
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
getDashboardHost: function () {
|
|
75
|
-
return ITestConfig.dashboardHost;
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
getTestGatewayHost: function () {
|
|
79
|
-
return ITestConfig.testGatewayHost;
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
getApiKey: function () {
|
|
83
|
-
return ITestConfig.apiKey;
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
getBearerToken: function () {
|
|
87
|
-
return ITestConfig.bearerToken;
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
getSigningKey: function () {
|
|
91
|
-
return ITestConfig.signingKey;
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
getCreds: function (profile?: string) {
|
|
95
|
-
if (profile) {
|
|
96
|
-
return ITestConfig.profiles[profile];
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
apiKey: ITestConfig.apiKey,
|
|
100
|
-
bearerToken: ITestConfig.bearerToken,
|
|
101
|
-
signingKey: ITestConfig.signingKey,
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export const Config: ITestConfig = ITestConfig;
|
package/src/global.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const client_1 = __importDefault(require("./client"));
|
|
7
|
-
if (typeof window !== 'undefined') {
|
|
8
|
-
window.blockchyp = client_1.default;
|
|
9
|
-
}
|