@quantcdn/quant-client 2.0.5 → 2.0.7

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.
@@ -91,6 +91,7 @@ class HttpClient {
91
91
  }
92
92
  class QuantClient {
93
93
  constructor(config, Client) {
94
+ var _a, _b;
94
95
  this.project = {
95
96
  /**
96
97
  * Ping and ensure the API credentials are valid.
@@ -158,6 +159,9 @@ class QuantClient {
158
159
  if (typeof payload.skipPurge !== 'undefined') {
159
160
  headers['Quant-Skip-Purge'] = 'true';
160
161
  }
162
+ if (typeof payload.headers !== 'undefined') {
163
+ headers['Quant-File-Headers'] = payload.headers;
164
+ }
161
165
  const formData = {
162
166
  file: {
163
167
  value: payload.data,
@@ -328,14 +332,14 @@ class QuantClient {
328
332
  if (typeof Client === 'undefined') {
329
333
  Client = HttpClient;
330
334
  }
331
- this._project = new Client('https://api.quantcdn.io/v1', {
335
+ this._project = new Client((_a = config.endpoint) !== null && _a !== void 0 ? _a : 'https://api.quantcdn.io/v1', {
332
336
  'User-Agent': 'Quant (+http://api.quantcdn.io)',
333
337
  'Quant-Token': config.token,
334
338
  'Quant-Customer': config.organization,
335
339
  'Quant-Project': config.project,
336
340
  'Content-Type': 'application/json'
337
341
  });
338
- this._search = new Client('https://api.quantcdn.io/v1', {
342
+ this._search = new Client((_b = config.endpoint) !== null && _b !== void 0 ? _b : 'https://api.quantcdn.io/v1', {
339
343
  'User-Agent': 'Quant (+http://api.quantcdn.io)',
340
344
  'Quant-Token': config.token,
341
345
  'Quant-Customer': config.organization,
@@ -4,6 +4,7 @@ export interface Config {
4
4
  token?: string;
5
5
  project?: string;
6
6
  bearer?: string;
7
+ endpoint?: string;
7
8
  }
8
9
  export interface ProxyPayload {
9
10
  url: string;
@@ -21,6 +22,7 @@ export interface FilePayload {
21
22
  data: Buffer;
22
23
  url: string;
23
24
  skipPurge?: boolean;
25
+ headers?: string;
24
26
  }
25
27
  export interface PublishPayload {
26
28
  location: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantcdn/quant-client",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Client library for API connectivity",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",