diff --git a/docs/requirements.txt b/docs/requirements.txt index 7f69988..d688016 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ -Sphinx==2.2.1 +Sphinx==1.8.5 sphinx-js==2.8 +sphinx_rtd_theme==0.4.3 \ No newline at end of file diff --git a/lib/connect/api/conversations.js b/lib/connect/api/conversations.js index 04e6ea4..999000d 100644 --- a/lib/connect/api/conversations.js +++ b/lib/connect/api/conversations.js @@ -4,7 +4,6 @@ * @copyright (c) 2019. Ingram Micro. All Rights Reserved. */ -// const _ = require('lodash'); const BaseService = require('./base'); /** @@ -17,7 +16,7 @@ class ConversationService extends BaseService { * * @param {string} id The unique request identifier for which retrieve the conversationId. * - * @returns {string} An array with the id. + * @returns {string} Conversation ID. */ async getConversationIdByRequest(id) { @@ -29,7 +28,6 @@ class ConversationService extends BaseService { return conv[0].id; } return null; - } } diff --git a/lib/connect/api/hubs.js b/lib/connect/api/hubs.js new file mode 100644 index 0000000..74c3463 --- /dev/null +++ b/lib/connect/api/hubs.js @@ -0,0 +1,26 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +const BaseService = require('./base'); + +/** + * The AccountService class provides methods to access the accounts + * endpoint of the Cloud Blue Connect API. + */ +class HubService extends BaseService { + /** + * Get a list of tier accounts. + * + * @return {Array} Returns an Array of the TierAccount object. + */ + async list() { + const response = await this.fetch('/hubs'); + await this.checkResponse(response); + return response.json(); + } +} + +module.exports = HubService; diff --git a/lib/connect/api/index.js b/lib/connect/api/index.js index 7a6d8fc..8bb2959 100644 --- a/lib/connect/api/index.js +++ b/lib/connect/api/index.js @@ -8,5 +8,14 @@ const RequestService = require('./requests'); const AccountService = require('./accounts'); const ProductService = require('./products'); const ConversationService = require('./conversations'); +const HubService = require('./hubs'); +const TierAccountService = require('./tierAccounts'); -module.exports = { AccountService, ProductService, RequestService, ConversationService }; +module.exports = { + AccountService, + ProductService, + RequestService, + ConversationService, + HubService, + TierAccountService, +}; diff --git a/lib/connect/api/products.js b/lib/connect/api/products.js index aa9fc06..e78c817 100644 --- a/lib/connect/api/products.js +++ b/lib/connect/api/products.js @@ -42,7 +42,8 @@ class ProductService extends BaseService { } /** - * Retrieves the list of parameters of scope asset and phase fulfillment configured for the product. + * Retrieves the list of parameters of scope asset and phase fulfillment configured for + * the product. * * @param {string} id The unique product identifier for which retrieve the parameters. * @@ -51,9 +52,7 @@ class ProductService extends BaseService { async getAssetParametersForFulfillmentByProduct(id) { const params = await this.getParametersByProduct(id); - return _.filter(params, param => { - return param.scope === 'asset' && param.phase === 'fulfillment'; - }); + return _.filter(params, (param) => param.scope === 'asset' && param.phase === 'fulfillment'); } /** @@ -78,9 +77,7 @@ class ProductService extends BaseService { */ async getProductAssetTemplates(id) { const templates = await this.getProductTemplates(id); - return _.filter(templates, template => { - return template.scope === 'asset' - }); + return _.filter(templates, (template) => template.scope === 'asset'); } } diff --git a/lib/connect/api/requests.js b/lib/connect/api/requests.js index c04b168..85341ee 100644 --- a/lib/connect/api/requests.js +++ b/lib/connect/api/requests.js @@ -13,13 +13,15 @@ const { addFilterParam } = require('./utils'); * endpoint of the Cloud Blue Connect API. */ class RequestService extends BaseService { + /* eslint-disable max-len */ /** * Get a list of requests that match all the filter values provided as input. * Some fields accept an array of values (search with the `in` operator). - * - * @param {Object} filter A filter object as described below. - * - * @param {string|Array} filter.type The request type (purchase|change|suspend|resume|renew|cancel). + * + * @param {Object} filter A filter object as described below. + * + * @param {string|Array} filter.type The request type + * (purchase|change|suspend|resume|renew|cancel). * @param {string|Array} filter.status The status of the request (pending|inquiring|failed|approved). * @param {string|Array} filter.id The id of the request. * @param {string|Array} filter.assetId The id of the asset that belongs to the request. @@ -34,9 +36,10 @@ class RequestService extends BaseService { * @param {string|Array} filter.assetTiersCustomerId The id of the customer account for this asset. * @param {string|Array} filter.assetTiersTier1Id The id of T1 account for this asset. * @param {string|Array} filter.assetTiersTier2Id The id of T2 account for this asset. - * + * * @return {Array} An array of Request objects that match the provided filters. */ + /* eslint-enable max-len */ async list({ type, status, @@ -109,7 +112,7 @@ class RequestService extends BaseService { * @param {sring} reason Description of the reason of inquire * @param {sring} templateId Activation Template ID * @param {Array} params An array of parameter objects ({id, value}) to update for Request. - * + * * @return {*} [Check return type]£ */ async inquireRequest(id, reason, templateId, params) { @@ -118,7 +121,7 @@ class RequestService extends BaseService { const options = { method: 'POST', body: { - 'template_id': templateId, + template_id: templateId, }, }; const response = await this.fetch(url, options); @@ -138,7 +141,7 @@ class RequestService extends BaseService { const url = `/requests/${id}`; const options = { method: 'PUT', - body: request + body: request, }; const response = await this.fetch(url, options); await this.checkResponse(response); @@ -160,8 +163,8 @@ class RequestService extends BaseService { method: 'PUT', body: { asset: { - params - } + params, + }, }, }; if (note !== undefined) { @@ -185,9 +188,9 @@ class RequestService extends BaseService { const options = { method: 'POST', body: { - template_id: templateId - } - } + template_id: templateId, + }, + }; const response = await this.fetch(url, options); await this.checkResponse(response); return response.json(); @@ -204,8 +207,8 @@ class RequestService extends BaseService { const url = '/requests'; const options = { method: 'POST', - body: req - } + body: req, + }; const response = await this.fetch(url, options); await this.checkResponse(response); return response.json(); diff --git a/lib/connect/api/tierAccounts.js b/lib/connect/api/tierAccounts.js new file mode 100644 index 0000000..b84f7e5 --- /dev/null +++ b/lib/connect/api/tierAccounts.js @@ -0,0 +1,26 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +const BaseService = require('./base'); + +/** + * The AccountService class provides methods to access the accounts + * endpoint of the Cloud Blue Connect API. + */ +class TierAccountService extends BaseService { + /** + * Get a list of tier accounts. + * + * @return {Array} Returns an Array of the TierAccount object. + */ + async list() { + const response = await this.fetch('/tier/accounts'); + await this.checkResponse(response); + return response.json(); + } +} + +module.exports = TierAccountService; diff --git a/lib/connect/client.js b/lib/connect/client.js index f33d3b5..1481da0 100644 --- a/lib/connect/client.js +++ b/lib/connect/client.js @@ -37,12 +37,14 @@ class ConnectClient { this._products = new api.ProductService(this._adapter); this._requests = new api.RequestService(this._adapter); this._conversations = new api.ConversationService(this._adapter); + this._hubs = new api.HubService(this._adapter); + this._tierAccounts = new api.TierAccountService(this._adapter); } /** - * Returns an instance of the `AccountService` class to access + * Returns an instance of the `AccountService` class to access * the `Account` resource endpoint. - * + * * @type {AccountService} */ get accounts() { @@ -50,19 +52,19 @@ class ConnectClient { } /** - * Returns an instance of the `ConversationService` class to access + * Returns an instance of the `ConversationService` class to access * the `Conversation` resource endpoint. - * + * * @type {ConversationService} */ get conversations() { return this._conversations; } - + /** - * Returns an instance of the `ProductService` class to access + * Returns an instance of the `ProductService` class to access * the `Product` resource endpoint. - * + * * @type {ProductService} */ get products() { @@ -70,15 +72,35 @@ class ConnectClient { } /** - * Returns an instance of the `RequestService` class to access + * Returns an instance of the `RequestService` class to access * the `Request` resource endpoint. - * + * * @type {RequestService} */ get requests() { return this._requests; } + /** + * Returns an instance of the `HubService` class to access + * the `Hub` resource endpoint. + * + * @type {HubService} + */ + get hubs() { + return this._hubs; + } + + /** + * Returns an instance of the `TierAccountService` class to access + * the `Hub` resource endpoint. + * + * @type {TierAccountService} + */ + get tierAccounts() { + return this._tierAccounts; + } + /** * beforeRequest hook that add the api key to the authorization header. * diff --git a/lib/connect/http/adapter.js b/lib/connect/http/adapter.js index e666de2..f77914a 100644 --- a/lib/connect/http/adapter.js +++ b/lib/connect/http/adapter.js @@ -85,6 +85,12 @@ class DefaultHttpAdapter extends AbstractHttpAdapter { } prepareRequest(url, options) { + if (options.body) { + if (_.isArray(options.body) || _.isPlainObject(options.body)) { + options.body = JSON.stringify(options.body); + options.headers = _.assign({}, options.headers, { 'Content-Type': 'application/json' }); + } + } return { url, options }; } diff --git a/test/connect/api/hubs.js b/test/connect/api/hubs.js new file mode 100644 index 0000000..c7c8c44 --- /dev/null +++ b/test/connect/api/hubs.js @@ -0,0 +1,25 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +const should = require('should'); +const nock = require('nock'); +const responses = require('./responses'); +const connect = require('../../../index'); +const ConnectClient = connect.ConnectClient; +const HttpError = connect.HttpError; + + +describe('Connect Javascript SDK - Hubs', () => { + afterEach(done => { nock.cleanAll(); done(); }); + it('returns a list of hubs', async () => { + nock('https://localhost') + .get('/hubs') + .reply(200, responses.hubs.hubs_list); + const client = new ConnectClient('https://localhost', '1234567890'); + const response = await client.hubs.list(); + response.should.be.an.Array(); + }); +}); diff --git a/test/connect/api/requests.js b/test/connect/api/requests.js index 3aadfaf..134d23d 100644 --- a/test/connect/api/requests.js +++ b/test/connect/api/requests.js @@ -164,7 +164,7 @@ describe('Connect Javascript SDK - Requests', () => { }); it('approve request', async () => { nock('https://localhost') - .post('/requests/PR-0000-0000-0000-000/approve') + .post('/requests/PR-0000-0000-0000-000/approve', {template_id: 'TL-000-000-000'}) .reply(200, responses.requests.approve_request); const client = new ConnectClient('https://localhost', '1234567890'); diff --git a/test/connect/api/responses/hubs/hubs_list.json b/test/connect/api/responses/hubs/hubs_list.json new file mode 100644 index 0000000..f143e76 --- /dev/null +++ b/test/connect/api/responses/hubs/hubs_list.json @@ -0,0 +1,60 @@ +[ + { + "id": "HB-1346-8670", + "name": "My Custom Hub", + "description": "This is a dummy hub", + "company": { + "id": "PA-781-184", + "name": "FF Test Provider" + }, + "instance": { + "type": "API", + "id": "0001" + }, + "events": { + "updated": { + "at": "2019-11-13T13:46:50+00:00" + }, + "created": { + "at": "2019-11-13T13:46:50+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + } + }, + "stats": { + "connections": 3, + "marketplaces": 0 + } + }, + { + "id": "HB-3985-8517", + "name": "My production HUB", + "description": "Prod", + "company": { + "id": "PA-781-184", + "name": "FF Test Provider" + }, + "instance": { + "type": "API", + "id": "1322" + }, + "events": { + "updated": { + "at": "2019-12-05T09:09:31+00:00" + }, + "created": { + "at": "2019-12-05T09:09:31+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + } + }, + "stats": { + "connections": 1, + "marketplaces": 2 + } + } +] \ No newline at end of file diff --git a/test/connect/api/responses/hubs/index.js b/test/connect/api/responses/hubs/index.js new file mode 100644 index 0000000..509d846 --- /dev/null +++ b/test/connect/api/responses/hubs/index.js @@ -0,0 +1,9 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +module.exports = { + hubs_list: require('./hubs_list.json'), +} \ No newline at end of file diff --git a/test/connect/api/responses/index.js b/test/connect/api/responses/index.js index a79e801..7d16617 100644 --- a/test/connect/api/responses/index.js +++ b/test/connect/api/responses/index.js @@ -8,6 +8,7 @@ module.exports = { requests: require('./requests'), products: require('./products'), accounts: require('./accounts'), - conversations: require('./conversations') - + conversations: require('./conversations'), + hubs: require('./hubs'), + tierAccounts: require('./tierAccounts') } diff --git a/test/connect/api/responses/tierAccounts/index.js b/test/connect/api/responses/tierAccounts/index.js new file mode 100644 index 0000000..a5b011f --- /dev/null +++ b/test/connect/api/responses/tierAccounts/index.js @@ -0,0 +1,9 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +module.exports = { + tier_accounts_list: require('./tier_accounts_list.json'), +} \ No newline at end of file diff --git a/test/connect/api/responses/tierAccounts/tier_accounts_list.json b/test/connect/api/responses/tierAccounts/tier_accounts_list.json new file mode 100644 index 0000000..a94064f --- /dev/null +++ b/test/connect/api/responses/tierAccounts/tier_accounts_list.json @@ -0,0 +1,1829 @@ +[ + { + "id": "TA-8851-5240-9579", + "environment": "preview", + "name": "Ebert, Zulauf and Littel", + "external_id": "54270", + "external_uid": "dc6f7d7a-4141-44a2-abf3-fd32c8c62e05", + "events": { + "updated": { + "at": "2019-11-15T11:47:55+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + }, + "created": { + "at": "2019-11-13T15:33:36+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + } + }, + "scopes": [ + "customer", + "tier1", + "tier2" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4487-1987-3778", + "environment": "preview", + "name": "Jacobson, Moore and Shields", + "external_id": "92979", + "external_uid": "e477f0e8-8590-4bf6-aa6b-e1c780a4c287", + "events": { + "updated": { + "at": "2019-11-15T11:47:55+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + }, + "created": { + "at": "2019-11-13T15:33:36+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + } + }, + "scopes": [ + "customer", + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-7835-9443-6165", + "environment": "preview", + "name": "McGlynn Inc", + "external_id": "16708", + "external_uid": "2911c9a7-f19e-4fe0-9bd1-11d4cf7ea8fa", + "events": { + "updated": { + "at": "2019-11-15T11:47:55+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + }, + "created": { + "at": "2019-11-15T11:47:55+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6877-3774-3365", + "environment": "preview", + "name": "Witting Inc", + "external_id": "27648", + "external_uid": "01f3020f-9a20-4f1e-9237-94974731731f", + "events": { + "updated": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + }, + "created": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + } + }, + "scopes": [ + "customer", + "tier1", + "tier2" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-7292-9691-1403", + "environment": "production", + "name": "Koelpin Inc", + "external_uid": "ffad29ed-8715-4104-8cc5-cab3b1cea16a", + "events": { + "updated": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "SU-769-717-535", + "name": "providerToken" + } + }, + "created": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + } + }, + "scopes": [ + "customer", + "tier1" + ], + "marketplace": { + "id": "MP-30756", + "name": "Spain Marketplace", + "icon": "/media/PA-325-330/marketplaces/MP-30756/icon.png" + }, + "hub": { + "id": "HB-7592-3331", + "name": "Hub01" + } + }, + { + "id": "TA-7259-2593-8257", + "environment": "production", + "name": "Veum LLC", + "external_uid": "e85a2231-0cca-47b2-8b16-d4e01df80d18", + "events": { + "updated": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "SU-769-717-535", + "name": "providerToken" + } + }, + "created": { + "at": "2019-11-18T09:26:25+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + } + }, + "scopes": [ + "customer", + "tier1", + "tier2" + ], + "marketplace": { + "id": "MP-30756", + "name": "Spain Marketplace", + "icon": "/media/PA-325-330/marketplaces/MP-30756/icon.png" + }, + "hub": { + "id": "HB-7592-3331", + "name": "Hub01" + } + }, + { + "id": "TA-4236-9541-0004", + "environment": "preview", + "name": "New Customer account", + "external_uid": "aaec4301-a8fc-4c6c-8bdf-aefd2ff147f5", + "events": { + "updated": { + "at": "2019-11-22T08:17:46+00:00" + }, + "created": { + "at": "2019-11-22T08:17:46+00:00", + "by": { + "id": "SU-321-380-460", + "name": "key_4_vendor" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-9243-2850-3036", + "environment": "preview", + "name": "New Tier1 account", + "external_uid": "aabb4301-a8fc-4c6c-8bdf-aefd2ff147f5", + "events": { + "updated": { + "at": "2019-11-22T08:17:46+00:00" + }, + "created": { + "at": "2019-11-22T08:17:46+00:00", + "by": { + "id": "SU-321-380-460", + "name": "key_4_vendor" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4393-4155-4801", + "environment": "preview", + "name": "CUST test company", + "external_uid": "022476e0-01b4-451b-b7f7-e4626553a6a4", + "events": { + "updated": { + "at": "2019-11-22T08:56:14+00:00" + }, + "created": { + "at": "2019-11-22T08:56:14+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-5308-8303-9918", + "environment": "preview", + "name": "T1 test company", + "external_uid": "bf749340-a881-4240-a8e1-daad72ea587d", + "events": { + "updated": { + "at": "2019-11-22T08:56:14+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + }, + "created": { + "at": "2019-11-22T08:56:14+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer", + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4835-7242-0420", + "environment": "preview", + "name": "CUST test company", + "external_uid": "eaa9a26a-95d5-44cd-b791-ec4e0bf24cd2", + "events": { + "updated": { + "at": "2019-11-22T11:11:53+00:00" + }, + "created": { + "at": "2019-11-22T11:11:53+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4431-9567-8648", + "environment": "preview", + "name": "T1 test company", + "external_uid": "855b11be-2c36-44e1-874a-825dff9d9b96", + "events": { + "updated": { + "at": "2019-11-22T11:11:53+00:00" + }, + "created": { + "at": "2019-11-22T11:11:53+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-2521-0455-4313", + "environment": "preview", + "name": "CUST test company", + "external_uid": "58960758-4ec7-48db-b8e7-336370ca73a5", + "events": { + "updated": { + "at": "2019-11-22T11:12:37+00:00" + }, + "created": { + "at": "2019-11-22T11:12:37+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6763-2574-8327", + "environment": "preview", + "name": "T1 test company", + "external_uid": "ab01c441-626b-4037-86d3-49f75977bedd", + "events": { + "updated": { + "at": "2019-11-22T11:12:37+00:00" + }, + "created": { + "at": "2019-11-22T11:12:37+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-5164-3787-4741", + "environment": "preview", + "name": "CUST test company", + "external_uid": "3f8b8540-b07c-4c2f-9d9e-e56329d08f6f", + "events": { + "updated": { + "at": "2019-11-22T11:16:11+00:00" + }, + "created": { + "at": "2019-11-22T11:16:11+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-2632-1846-0896", + "environment": "preview", + "name": "T1 test company", + "external_uid": "0469e7e8-bdc1-4c94-8c41-6837505221ab", + "events": { + "updated": { + "at": "2019-11-22T11:16:12+00:00" + }, + "created": { + "at": "2019-11-22T11:16:12+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6065-0694-5740", + "environment": "preview", + "name": "CUST test company", + "external_uid": "ef609420-f87e-4f28-a0c4-b6118810bee7", + "events": { + "updated": { + "at": "2019-11-22T11:20:31+00:00" + }, + "created": { + "at": "2019-11-22T11:20:31+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4135-2161-6853", + "environment": "preview", + "name": "T1 test company", + "external_uid": "4997da2d-e613-4d42-809b-f189bf3f306a", + "events": { + "updated": { + "at": "2019-11-22T11:20:31+00:00" + }, + "created": { + "at": "2019-11-22T11:20:31+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-8064-6299-4391", + "environment": "preview", + "name": "CUST test company", + "external_uid": "bd0eff86-a8c2-4474-a9d8-e3bb3c63c31f", + "events": { + "updated": { + "at": "2019-11-22T11:39:34+00:00" + }, + "created": { + "at": "2019-11-22T11:39:34+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6904-7081-7492", + "environment": "preview", + "name": "T1 test company", + "external_uid": "a04b3361-c219-4468-9367-a4bf11a50c8f", + "events": { + "updated": { + "at": "2019-11-22T11:39:35+00:00" + }, + "created": { + "at": "2019-11-22T11:39:35+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6181-5999-4088", + "environment": "preview", + "name": "CUST test company", + "external_uid": "329334e1-42ae-4b15-a480-303e48c1eaad", + "events": { + "updated": { + "at": "2019-11-25T08:16:42+00:00" + }, + "created": { + "at": "2019-11-25T08:16:42+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-6567-4422-4805", + "environment": "preview", + "name": "T1 test company", + "external_uid": "34146535-63a0-4c68-9e1f-1f4d52932457", + "events": { + "updated": { + "at": "2019-11-25T08:16:43+00:00" + }, + "created": { + "at": "2019-11-25T08:16:43+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-5622-9717-7529", + "environment": "preview", + "name": "Paucek LLC", + "external_id": "42984", + "external_uid": "71babf6d-f560-4c01-8c8d-f8eab39d526a", + "events": { + "updated": { + "at": "2019-11-27T14:15:35+00:00", + "by": { + "id": "UR-870-106-057", + "name": "Francesco Faraone Vendor" + } + }, + "created": { + "at": "2019-11-27T14:15:35+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + } + }, + "scopes": [ + "customer", + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-7774-5369-0989", + "environment": "preview", + "name": "Gusikowski Group", + "external_id": "20434", + "external_uid": "09c570ef-25a0-4973-9b9a-85c592e85ab7", + "events": { + "updated": { + "at": "2019-11-27T14:15:35+00:00" + }, + "created": { + "at": "2019-11-27T14:15:35+00:00", + "by": { + "id": "UR-322-877-822", + "name": "Francesco" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-0000-0000", + "name": "ACME Hub" + } + }, + { + "id": "TA-4377-6369-1584", + "environment": "production", + "name": "Customer", + "external_uid": "17359648-2b39-48fc-89c0-d3a138b78112", + "events": { + "updated": { + "at": "2019-12-05T14:15:52+00:00" + }, + "created": { + "at": "2019-12-05T14:15:52+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-0192-4517-2742", + "environment": "production", + "name": "T1 Company", + "external_uid": "5bc9b607-a451-40d3-bfca-a77e018740ef", + "events": { + "updated": { + "at": "2019-12-05T14:15:53+00:00" + }, + "created": { + "at": "2019-12-05T14:15:53+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-1920-4540-4065", + "environment": "production", + "name": "La casa del software S.R.L.", + "external_uid": "d2e0af9f-7b86-4751-bdb8-a7d7c78de640", + "events": { + "updated": { + "at": "2019-12-05T14:25:23+00:00" + }, + "created": { + "at": "2019-12-05T14:25:23+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2074-4915-6104", + "environment": "production", + "name": "1Password Reseller SL", + "external_uid": "84a99bf5-291b-4451-8017-7e994faf6369", + "events": { + "updated": { + "at": "2019-12-05T14:25:24+00:00" + }, + "created": { + "at": "2019-12-05T14:25:24+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2767-4173-8266", + "environment": "production", + "name": "La casa del software S.R.L.", + "external_uid": "2bf08068-26b3-4220-bd1c-898c150d6990", + "events": { + "updated": { + "at": "2019-12-05T14:28:05+00:00" + }, + "created": { + "at": "2019-12-05T14:28:05+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-1108-6648-2806", + "environment": "production", + "name": "1Password Reseller SL", + "external_uid": "2274281a-da02-4eb2-a98a-2d1bbdc8761d", + "events": { + "updated": { + "at": "2019-12-05T14:28:06+00:00" + }, + "created": { + "at": "2019-12-05T14:28:06+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-6136-4908-5951", + "environment": "production", + "name": "Cust Company", + "external_uid": "b8c6f68e-b416-421c-b64e-2e7a0df38af8", + "events": { + "updated": { + "at": "2019-12-05T15:01:38+00:00" + }, + "created": { + "at": "2019-12-05T15:01:38+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2633-5483-4147", + "environment": "production", + "name": "T1 Company", + "external_id": "2", + "external_uid": "9155be90-1528-4c66-b84f-7d57ba0ad7b4", + "events": { + "updated": { + "at": "2019-12-05T15:01:38+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + }, + "created": { + "at": "2019-12-05T15:01:38+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-5720-5567-0353", + "environment": "production", + "name": "Cust Company", + "external_uid": "b8c6f68e-b416-421c-1122-2e7a0df38af8", + "events": { + "updated": { + "at": "2019-12-05T15:08:58+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + }, + "created": { + "at": "2019-12-05T15:08:58+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-4459-6534-0354", + "environment": "production", + "name": "La casa del software S.R.L.", + "external_uid": "4b98859b-2f6e-4c40-87a0-7f12b87f709b", + "events": { + "updated": { + "at": "2019-12-05T18:44:21+00:00" + }, + "created": { + "at": "2019-12-05T18:44:21+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-5520-6571-5132", + "environment": "production", + "name": "1Password Reseller SL", + "external_uid": "7d341174-c3e2-4bd4-8f27-55ba67a826ed", + "events": { + "updated": { + "at": "2019-12-05T18:44:22+00:00" + }, + "created": { + "at": "2019-12-05T18:44:22+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-0370-2544-1921", + "environment": "production", + "name": "Mi tienda de barrio", + "external_uid": "4947476f-b213-4581-9666-0e4517c19f38", + "events": { + "updated": { + "at": "2019-12-05T18:51:10+00:00" + }, + "created": { + "at": "2019-12-05T18:51:10+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-7485-8424-1070", + "environment": "production", + "name": "Another Funny Reseller ", + "external_uid": "25a3251a-810c-4e0e-9f45-ca760851b061", + "events": { + "updated": { + "at": "2019-12-05T18:51:12+00:00" + }, + "created": { + "at": "2019-12-05T18:51:12+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-00000", + "name": "ACME Marketplace" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2728-4501-0129", + "environment": "production", + "name": "La casa del software S.R.L.", + "external_uid": "deb643b9-6d0f-4163-be3f-c8c4525b65fd", + "events": { + "updated": { + "at": "2019-12-06T19:27:11+00:00" + }, + "created": { + "at": "2019-12-06T19:27:11+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-3843-6651-0365", + "environment": "production", + "name": "Mi tienda de barrio", + "external_id": "2", + "external_uid": "b6545b57-ad09-4e65-bdf3-7dbb7c057c5f", + "events": { + "updated": { + "at": "2019-12-06T19:27:12+00:00" + }, + "created": { + "at": "2019-12-06T19:27:12+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2561-0818-7002", + "environment": "production", + "name": "La casa del software S.R.L.", + "external_uid": "412f2dcc-f0b3-41d9-b7dc-6d523029f2ac", + "events": { + "updated": { + "at": "2019-12-06T20:53:05+00:00" + }, + "created": { + "at": "2019-12-06T20:53:05+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-4104-7503-0066", + "environment": "production", + "name": "Another Funny Reseller", + "external_id": "2", + "external_uid": "7bffc401-0246-4e09-a1a2-f1a70b435c59", + "events": { + "updated": { + "at": "2019-12-06T20:53:06+00:00" + }, + "created": { + "at": "2019-12-06T20:53:06+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2984-7853-6149", + "environment": "production", + "name": "Customer", + "external_uid": "9b055d9d-c7ec-41f5-a7e2-809166640085", + "events": { + "updated": { + "at": "2019-12-06T20:56:55+00:00" + }, + "created": { + "at": "2019-12-06T20:56:55+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2271-0462-4492", + "environment": "production", + "name": "Test external id", + "external_id": "2", + "external_uid": "d17f15b8-3276-45d4-8f18-897d43ecdfbb", + "events": { + "updated": { + "at": "2019-12-06T20:56:55+00:00" + }, + "created": { + "at": "2019-12-06T20:56:55+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-4193-7601-5591", + "environment": "production", + "name": "Pierone Ltd", + "external_uid": "b513f511-d189-4dea-b6ed-83d68bde28a7", + "events": { + "updated": { + "at": "2019-12-06T21:25:11+00:00" + }, + "created": { + "at": "2019-12-06T21:25:11+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-9405-8076-7151", + "environment": "production", + "name": "Zappamelo SA", + "external_id": "2", + "external_uid": "3a7fc99d-2a95-49b6-bcf1-e2dee085be95", + "events": { + "updated": { + "at": "2019-12-06T21:25:11+00:00" + }, + "created": { + "at": "2019-12-06T21:25:11+00:00", + "by": { + "id": "SU-312-256-930", + "name": "cccc" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-8059-9936-3507", + "environment": "production", + "name": "Ennebi Computers", + "external_uid": "453d3029-8f61-4f63-90bd-f7f60b0f4ba5", + "events": { + "updated": { + "at": "2019-12-08T16:24:44+00:00" + }, + "created": { + "at": "2019-12-08T16:24:44+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-5570-1444-5352", + "environment": "production", + "name": "My Trusted Reseller", + "external_id": "2", + "external_uid": "3d0febc8-0eb1-412b-a5c3-37f4480f8c5e", + "events": { + "updated": { + "at": "2019-12-08T16:24:44+00:00" + }, + "created": { + "at": "2019-12-08T16:24:44+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2316-3178-3769", + "environment": "production", + "name": "Cristalería Santa Bárbara", + "external_uid": "f3a44fb2-b2b1-4b4a-8a28-166e83e2820c", + "events": { + "updated": { + "at": "2019-12-08T16:38:06+00:00" + }, + "created": { + "at": "2019-12-08T16:38:06+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2697-3697-2216", + "environment": "production", + "name": "Neo Computers S.L.", + "external_id": "2", + "external_uid": "6ffc5973-142e-4982-b8eb-b525f486d714", + "events": { + "updated": { + "at": "2019-12-08T16:38:06+00:00" + }, + "created": { + "at": "2019-12-08T16:38:06+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2122-1360-2431", + "environment": "production", + "name": "Cristalería Santa Bárbara", + "external_uid": "d78dff5a-da57-46c7-a99f-fcdf4e93294d", + "events": { + "updated": { + "at": "2019-12-09T07:54:13+00:00" + }, + "created": { + "at": "2019-12-09T07:54:13+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-9904-8632-3415", + "environment": "production", + "name": "Pierone Ltd", + "external_id": "2", + "external_uid": "02884ee5-a7b8-4fd6-bc14-bb1dc088b648", + "events": { + "updated": { + "at": "2019-12-09T07:54:13+00:00" + }, + "created": { + "at": "2019-12-09T07:54:13+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-5913-7369-5371", + "environment": "production", + "name": "Mi tienda de barrio", + "external_uid": "8edd9a75-3879-4fb1-b120-078df07f71fb", + "events": { + "updated": { + "at": "2019-12-09T08:04:56+00:00" + }, + "created": { + "at": "2019-12-09T08:04:56+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-1134-5513-9546", + "environment": "production", + "name": "1Password Reseller SL", + "external_id": "5", + "external_uid": "70b1882a-1ad6-4cae-a81d-ee1180f63246", + "events": { + "updated": { + "at": "2019-12-09T08:04:56+00:00" + }, + "created": { + "at": "2019-12-09T08:04:56+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-2957-8373-8941", + "environment": "production", + "name": "Ennebi Computers", + "external_uid": "2000425b-a304-4ca7-ab47-c4799e938074", + "events": { + "updated": { + "at": "2019-12-09T08:56:39+00:00" + }, + "created": { + "at": "2019-12-09T08:56:39+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-5418-2391-4014", + "environment": "production", + "name": "My Trusted Reseller", + "external_id": "5", + "external_uid": "08c4fae3-56fb-4c57-98c9-027c9fa46fb4", + "events": { + "updated": { + "at": "2019-12-09T08:56:39+00:00" + }, + "created": { + "at": "2019-12-09T08:56:39+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-3427-0823-9022", + "environment": "production", + "name": "Customer 201912091440", + "external_uid": "cd9ee562-bd69-4f89-b539-847ad2222367", + "events": { + "updated": { + "at": "2019-12-09T13:45:20+00:00" + }, + "created": { + "at": "2019-12-09T13:45:20+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-1124-4039-7303", + "environment": "production", + "name": "T1 Company 201912091440", + "external_id": "5", + "external_uid": "ebd94ca9-b861-49a1-95d0-c44a909a7c16", + "events": { + "updated": { + "at": "2019-12-09T13:45:20+00:00" + }, + "created": { + "at": "2019-12-09T13:45:20+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-06105", + "name": "ToItaly", + "icon": "/media/PA-781-184/marketplaces/MP-06105/icon.png" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-8505-8866-3649", + "environment": "production", + "name": "Customer 201912091440", + "external_uid": "f1b1d232-9771-4492-964e-99392b2e623c", + "events": { + "updated": { + "at": "2019-12-09T14:18:09+00:00" + }, + "created": { + "at": "2019-12-09T14:18:09+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "customer" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + }, + { + "id": "TA-8941-7989-2681", + "environment": "production", + "name": "My Trusted Reseller", + "external_id": "2", + "external_uid": "33916fc8-47df-4b5a-980f-36cdccabfc20", + "events": { + "updated": { + "at": "2019-12-09T14:18:10+00:00" + }, + "created": { + "at": "2019-12-09T14:18:10+00:00", + "by": { + "id": "SU-333-171-834", + "name": "new_4_zapier" + } + } + }, + "scopes": [ + "tier1" + ], + "marketplace": { + "id": "MP-74941", + "name": "Direct commerce", + "icon": "/media/PA-781-184/marketplaces/MP-74941/icon.jpg" + }, + "hub": { + "id": "HB-3985-8517", + "name": "My production HUB" + } + } +] \ No newline at end of file diff --git a/test/connect/api/tierAccounts.js b/test/connect/api/tierAccounts.js new file mode 100644 index 0000000..fa0a5f1 --- /dev/null +++ b/test/connect/api/tierAccounts.js @@ -0,0 +1,24 @@ +/** + * This file is part of the Ingram Micro Cloud Blue Connect SDK. + * + * @copyright (c) 2019. Ingram Micro. All Rights Reserved. + */ + +const should = require('should'); +const nock = require('nock'); +const responses = require('./responses'); +const connect = require('../../../index'); +const ConnectClient = connect.ConnectClient; + + +describe('Connect Javascript SDK - Tier Accounts', () => { + afterEach(done => { nock.cleanAll(); done(); }); + it('returns a list of tier accounts', async () => { + nock('https://localhost') + .get('/tier/accounts') + .reply(200, responses.tierAccounts.tier_accounts_list); + const client = new ConnectClient('https://localhost', '1234567890'); + const response = await client.tierAccounts.list(); + response.should.be.an.Array(); + }); +});