@quantcdn/quant-client 2.0.2 → 2.0.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/dist/{client.js → src/client.js} +14 -5
- package/dist/src/index.js +42 -0
- package/dist/{types.d.ts → src/types.d.ts} +1 -1
- package/dist/tests/client.test.d.ts +1 -0
- package/dist/tests/client.test.js +191 -0
- package/dist/tests/response.test.d.ts +1 -0
- package/dist/tests/response.test.js +133 -0
- package/package.json +11 -5
- package/dist/index.js +0 -20
- /package/dist/{client.d.ts → src/client.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{interfaces.d.ts → src/interfaces.d.ts} +0 -0
- /package/dist/{interfaces.js → src/interfaces.js} +0 -0
- /package/dist/{response.d.ts → src/response.d.ts} +0 -0
- /package/dist/{response.js → src/response.js} +0 -0
- /package/dist/{types.js → src/types.js} +0 -0
|
@@ -99,6 +99,8 @@ class QuantClient {
|
|
|
99
99
|
* The response object.
|
|
100
100
|
*/
|
|
101
101
|
ping: () => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
console.log('ping');
|
|
103
|
+
console.log(this._project);
|
|
102
104
|
return yield this._project.get('ping');
|
|
103
105
|
}),
|
|
104
106
|
/**
|
|
@@ -138,7 +140,7 @@ class QuantClient {
|
|
|
138
140
|
headers['Quant-Skip-Purge'] = true;
|
|
139
141
|
}
|
|
140
142
|
if (typeof payload.findAttachments !== 'undefined') {
|
|
141
|
-
body.find_attachments =
|
|
143
|
+
body.find_attachments = payload.findAttachments;
|
|
142
144
|
}
|
|
143
145
|
return yield this._project.post('markup', body, headers);
|
|
144
146
|
}),
|
|
@@ -153,14 +155,21 @@ class QuantClient {
|
|
|
153
155
|
*/
|
|
154
156
|
file: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
155
157
|
const headers = {
|
|
156
|
-
'
|
|
157
|
-
'Quant-File-Url': payload.location
|
|
158
|
+
'Quant-File-Url': payload.url
|
|
158
159
|
};
|
|
159
|
-
const formData = { data: payload.data };
|
|
160
160
|
if (typeof payload.skipPurge !== 'undefined') {
|
|
161
161
|
headers['Quant-Skip-Purge'] = 'true';
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
const formData = {
|
|
164
|
+
file: {
|
|
165
|
+
value: payload.data,
|
|
166
|
+
options: {
|
|
167
|
+
filename: 'file',
|
|
168
|
+
contentType: 'application/octet-stream'
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
return yield this._project.post('file', undefined, headers, formData);
|
|
164
173
|
}),
|
|
165
174
|
/**
|
|
166
175
|
* Publish a revision.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.types = void 0;
|
|
40
|
+
// export { QuantClient } from './quant-client'
|
|
41
|
+
__exportStar(require("./client"), exports);
|
|
42
|
+
exports.types = __importStar(require("./types"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const src_1 = require("../src");
|
|
13
|
+
const buffer_1 = require("buffer");
|
|
14
|
+
const chai_1 = require("chai");
|
|
15
|
+
class TestClient {
|
|
16
|
+
constructor(baseUrl, headers) {
|
|
17
|
+
this.reject = false;
|
|
18
|
+
this.baseUrl = baseUrl;
|
|
19
|
+
this.headers = headers;
|
|
20
|
+
this.reject = false;
|
|
21
|
+
}
|
|
22
|
+
do(options) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
return yield Promise.resolve('okay!');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
get(path, qs, headers) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
return yield Promise.resolve({});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
post(path, body, headers, formData, qs) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return yield Promise.resolve({});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
delete(path, body, headers) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
return yield Promise.resolve({});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
patch(path, body, headers) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return yield Promise.resolve({});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Create a singleton mock client that all tests will use
|
|
49
|
+
const mockClient = new TestClient('https://api.quantcdn.io/v1', {});
|
|
50
|
+
// Create a constructor function that returns our singleton
|
|
51
|
+
function MockClientConstructor(baseUrl, headers) {
|
|
52
|
+
return mockClient;
|
|
53
|
+
}
|
|
54
|
+
describe('file()', () => {
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
// Reset the mock client's post method before each test
|
|
57
|
+
mockClient.post = () => __awaiter(void 0, void 0, void 0, function* () { return ({}); });
|
|
58
|
+
});
|
|
59
|
+
it('should successfully upload a file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
const testData = buffer_1.Buffer.from('test file content');
|
|
61
|
+
const payload = {
|
|
62
|
+
data: testData,
|
|
63
|
+
url: '/test/file.txt'
|
|
64
|
+
};
|
|
65
|
+
mockClient.post = () => __awaiter(void 0, void 0, void 0, function* () { return ({ status: 'success' }); });
|
|
66
|
+
const client = new src_1.QuantClient({
|
|
67
|
+
organization: 'test-org',
|
|
68
|
+
project: 'test-project',
|
|
69
|
+
token: 'test-token'
|
|
70
|
+
}, MockClientConstructor);
|
|
71
|
+
const response = yield client.project.file(payload);
|
|
72
|
+
(0, chai_1.expect)(response.status).to.equal('success');
|
|
73
|
+
}));
|
|
74
|
+
it('should handle file upload with skipPurge option', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
+
const testData = buffer_1.Buffer.from('test file content');
|
|
76
|
+
const payload = {
|
|
77
|
+
data: testData,
|
|
78
|
+
url: '/test/file.txt',
|
|
79
|
+
skipPurge: true
|
|
80
|
+
};
|
|
81
|
+
mockClient.post = (path_1, body_1, ...args_1) => __awaiter(void 0, [path_1, body_1, ...args_1], void 0, function* (path, body, headers = {}) {
|
|
82
|
+
(0, chai_1.expect)(headers['Quant-Skip-Purge']).to.equal('true');
|
|
83
|
+
return { status: 'success' };
|
|
84
|
+
});
|
|
85
|
+
const client = new src_1.QuantClient({
|
|
86
|
+
organization: 'test-org',
|
|
87
|
+
project: 'test-project',
|
|
88
|
+
token: 'test-token'
|
|
89
|
+
}, MockClientConstructor);
|
|
90
|
+
const response = yield client.project.file(payload);
|
|
91
|
+
(0, chai_1.expect)(response.status).to.equal('success');
|
|
92
|
+
}));
|
|
93
|
+
it('should handle API errors appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
const testData = buffer_1.Buffer.from('test file content');
|
|
95
|
+
const payload = {
|
|
96
|
+
data: testData,
|
|
97
|
+
url: '/test/file.txt'
|
|
98
|
+
};
|
|
99
|
+
mockClient.post = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
100
|
+
throw new Error('Invalid file format');
|
|
101
|
+
});
|
|
102
|
+
const client = new src_1.QuantClient({
|
|
103
|
+
organization: 'test-org',
|
|
104
|
+
project: 'test-project',
|
|
105
|
+
token: 'test-token'
|
|
106
|
+
}, MockClientConstructor);
|
|
107
|
+
try {
|
|
108
|
+
yield client.project.file(payload);
|
|
109
|
+
chai_1.expect.fail('Should have thrown an error');
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
(0, chai_1.expect)(error.message).to.equal('Invalid file format');
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
it('should handle large files correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
+
const testData = buffer_1.Buffer.alloc(1024 * 1024, 'x');
|
|
117
|
+
const payload = {
|
|
118
|
+
data: testData,
|
|
119
|
+
url: '/test/large-file.txt'
|
|
120
|
+
};
|
|
121
|
+
mockClient.post = () => __awaiter(void 0, void 0, void 0, function* () { return ({ status: 'success' }); });
|
|
122
|
+
const client = new src_1.QuantClient({
|
|
123
|
+
organization: 'test-org',
|
|
124
|
+
project: 'test-project',
|
|
125
|
+
token: 'test-token'
|
|
126
|
+
}, MockClientConstructor);
|
|
127
|
+
const response = yield client.project.file(payload);
|
|
128
|
+
(0, chai_1.expect)(response.status).to.equal('success');
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
describe('markup', () => {
|
|
132
|
+
beforeEach(() => {
|
|
133
|
+
mockClient.post = () => __awaiter(void 0, void 0, void 0, function* () { return ({}); });
|
|
134
|
+
});
|
|
135
|
+
it('should respect findAttachments when false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
+
const testData = buffer_1.Buffer.from('test content');
|
|
137
|
+
const payload = {
|
|
138
|
+
data: testData,
|
|
139
|
+
url: '/test/markup',
|
|
140
|
+
published: true,
|
|
141
|
+
findAttachments: false
|
|
142
|
+
};
|
|
143
|
+
mockClient.post = (path, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
+
(0, chai_1.expect)(body.find_attachments).to.equal(false);
|
|
145
|
+
return { status: 'success' };
|
|
146
|
+
});
|
|
147
|
+
const client = new src_1.QuantClient({
|
|
148
|
+
organization: 'test-org',
|
|
149
|
+
project: 'test-project',
|
|
150
|
+
token: 'test-token'
|
|
151
|
+
}, MockClientConstructor);
|
|
152
|
+
yield client.project.markup(payload);
|
|
153
|
+
}));
|
|
154
|
+
it('should respect findAttachments when true', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
155
|
+
const testData = buffer_1.Buffer.from('test content');
|
|
156
|
+
const payload = {
|
|
157
|
+
data: testData,
|
|
158
|
+
url: '/test/markup',
|
|
159
|
+
published: true,
|
|
160
|
+
findAttachments: true
|
|
161
|
+
};
|
|
162
|
+
mockClient.post = (path, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
163
|
+
(0, chai_1.expect)(body.find_attachments).to.equal(true);
|
|
164
|
+
return { status: 'success' };
|
|
165
|
+
});
|
|
166
|
+
const client = new src_1.QuantClient({
|
|
167
|
+
organization: 'test-org',
|
|
168
|
+
project: 'test-project',
|
|
169
|
+
token: 'test-token'
|
|
170
|
+
}, MockClientConstructor);
|
|
171
|
+
yield client.project.markup(payload);
|
|
172
|
+
}));
|
|
173
|
+
it('should default findAttachments to false when not specified', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
|
+
const testData = buffer_1.Buffer.from('test content');
|
|
175
|
+
const payload = {
|
|
176
|
+
data: testData,
|
|
177
|
+
url: '/test/markup',
|
|
178
|
+
published: true
|
|
179
|
+
};
|
|
180
|
+
mockClient.post = (path, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
|
+
(0, chai_1.expect)(body.find_attachments).to.equal(false);
|
|
182
|
+
return { status: 'success' };
|
|
183
|
+
});
|
|
184
|
+
const client = new src_1.QuantClient({
|
|
185
|
+
organization: 'test-org',
|
|
186
|
+
project: 'test-project',
|
|
187
|
+
token: 'test-token'
|
|
188
|
+
}, MockClientConstructor);
|
|
189
|
+
yield client.project.markup(payload);
|
|
190
|
+
}));
|
|
191
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
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 __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const response_1 = require("../src/response");
|
|
20
|
+
const chai_1 = require("chai");
|
|
21
|
+
class TestClient {
|
|
22
|
+
constructor(baseUrl, headers, testData) {
|
|
23
|
+
this.baseUrl = baseUrl;
|
|
24
|
+
this.headers = headers;
|
|
25
|
+
this.testData = testData || {
|
|
26
|
+
data: [1, 2, 3],
|
|
27
|
+
pagination: {
|
|
28
|
+
current_page: 1,
|
|
29
|
+
from: 1,
|
|
30
|
+
total_pages: 1,
|
|
31
|
+
per_page: 3,
|
|
32
|
+
to: 3,
|
|
33
|
+
total: 3
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
do(options) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
return yield Promise.resolve(this.testData);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
get(path, qs, headers) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return yield Promise.resolve({});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
post(path, body, headers, formData, qs) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
return yield Promise.resolve({});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
delete(path, body, headers) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
return yield Promise.resolve({});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
patch(path, body, headers) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
return yield Promise.resolve({});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
describe('PaginatedResponse', () => {
|
|
64
|
+
const client = new TestClient('https://api.quantcdn.io/v1', {});
|
|
65
|
+
const options = {
|
|
66
|
+
url: 'https://api.quantcdn.io/v1/test',
|
|
67
|
+
method: 'GET'
|
|
68
|
+
};
|
|
69
|
+
it('should paginate through results', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
+
var _a, e_1, _b, _c;
|
|
71
|
+
const response = new response_1.PaginatedResponse(client, options);
|
|
72
|
+
let results = [];
|
|
73
|
+
try {
|
|
74
|
+
for (var _d = true, response_2 = __asyncValues(response), response_2_1; response_2_1 = yield response_2.next(), _a = response_2_1.done, !_a; _d = true) {
|
|
75
|
+
_c = response_2_1.value;
|
|
76
|
+
_d = false;
|
|
77
|
+
const items = _c;
|
|
78
|
+
if (Array.isArray(items)) {
|
|
79
|
+
results = results.concat(items);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
results.push(items);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
87
|
+
finally {
|
|
88
|
+
try {
|
|
89
|
+
if (!_d && !_a && (_b = response_2.return)) yield _b.call(response_2);
|
|
90
|
+
}
|
|
91
|
+
finally { if (e_1) throw e_1.error; }
|
|
92
|
+
}
|
|
93
|
+
(0, chai_1.expect)(results).to.deep.equal([1, 2, 3]);
|
|
94
|
+
}));
|
|
95
|
+
it('should handle empty responses', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
|
+
var _a, e_2, _b, _c;
|
|
97
|
+
const emptyData = {
|
|
98
|
+
data: [],
|
|
99
|
+
pagination: {
|
|
100
|
+
current_page: 1,
|
|
101
|
+
from: null,
|
|
102
|
+
total_pages: 1,
|
|
103
|
+
per_page: 10,
|
|
104
|
+
to: null,
|
|
105
|
+
total: 0
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const emptyClient = new TestClient('https://api.quantcdn.io/v1', {}, emptyData);
|
|
109
|
+
const response = new response_1.PaginatedResponse(emptyClient, options);
|
|
110
|
+
let results = [];
|
|
111
|
+
try {
|
|
112
|
+
for (var _d = true, response_3 = __asyncValues(response), response_3_1; response_3_1 = yield response_3.next(), _a = response_3_1.done, !_a; _d = true) {
|
|
113
|
+
_c = response_3_1.value;
|
|
114
|
+
_d = false;
|
|
115
|
+
const items = _c;
|
|
116
|
+
if (Array.isArray(items)) {
|
|
117
|
+
results = results.concat(items);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
results.push(items);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
125
|
+
finally {
|
|
126
|
+
try {
|
|
127
|
+
if (!_d && !_a && (_b = response_3.return)) yield _b.call(response_3);
|
|
128
|
+
}
|
|
129
|
+
finally { if (e_2) throw e_2.error; }
|
|
130
|
+
}
|
|
131
|
+
(0, chai_1.expect)(results).to.deep.equal([]);
|
|
132
|
+
}));
|
|
133
|
+
});
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantcdn/quant-client",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Client library for API connectivity",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "mocha --require ts-node/register --require source-map-support/register --recursive 'tests/**/*.test.ts'",
|
|
13
13
|
"lint:src": "eslint --ext .ts ./src"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
"eslint-plugin-promise": "^6.1.1",
|
|
40
40
|
"jest": "^29.5.0",
|
|
41
41
|
"ts-jest": "^29.1.0",
|
|
42
|
-
"typescript": "^5.2.2"
|
|
42
|
+
"typescript": "^5.2.2",
|
|
43
|
+
"chai": "^4.3.7",
|
|
44
|
+
"mocha": "^10.2.0",
|
|
45
|
+
"nock": "^13.3.1",
|
|
46
|
+
"ts-node": "^10.9.1",
|
|
47
|
+
"@types/mocha": "^10.0.1",
|
|
48
|
+
"@types/chai": "^4.3.5"
|
|
43
49
|
}
|
|
44
50
|
}
|
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.types = void 0;
|
|
18
|
-
// export { QuantClient } from './quant-client'
|
|
19
|
-
__exportStar(require("./client"), exports);
|
|
20
|
-
exports.types = require("./types");
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|