@smartlyio/oats-nock-adapter 3.5.0 → 4.0.2
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/package.json +16 -16
- package/dist/src/nock.d.ts +0 -24
- package/dist/src/nock.js +0 -225
- package/dist/src/nock.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartlyio/oats-nock-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "nock server adapter for smartlyio/oats s",
|
|
6
6
|
"private": false,
|
|
@@ -38,27 +38,27 @@
|
|
|
38
38
|
"client"
|
|
39
39
|
],
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@smartlyio/oats": "^
|
|
42
|
-
"@smartlyio/oats-axios-adapter": "^
|
|
43
|
-
"@smartlyio/oats-runtime": "^
|
|
44
|
-
"@types/jest": "27.0.
|
|
45
|
-
"@types/lodash": "4.14.
|
|
46
|
-
"@types/node": "16.11.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
48
|
-
"@typescript-eslint/parser": "5.
|
|
41
|
+
"@smartlyio/oats": "^4.0.2",
|
|
42
|
+
"@smartlyio/oats-axios-adapter": "^4.0.2",
|
|
43
|
+
"@smartlyio/oats-runtime": "^4.0.2",
|
|
44
|
+
"@types/jest": "27.0.3",
|
|
45
|
+
"@types/lodash": "4.14.178",
|
|
46
|
+
"@types/node": "16.11.14",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "5.6.0",
|
|
48
|
+
"@typescript-eslint/parser": "5.6.0",
|
|
49
49
|
"axios": "0.24.0",
|
|
50
|
-
"eslint": "8.
|
|
50
|
+
"eslint": "8.4.1",
|
|
51
51
|
"eslint-config-prettier": "8.3.0",
|
|
52
52
|
"eslint-plugin-import": "2.25.3",
|
|
53
|
-
"eslint-plugin-jest": "25.
|
|
53
|
+
"eslint-plugin-jest": "25.3.0",
|
|
54
54
|
"eslint-plugin-prettier": "4.0.0",
|
|
55
|
-
"jest": "27.
|
|
55
|
+
"jest": "27.4.5",
|
|
56
56
|
"jsverify": "0.8.4",
|
|
57
57
|
"nock": "13.2.1",
|
|
58
|
-
"prettier": "2.
|
|
59
|
-
"ts-jest": "27.
|
|
58
|
+
"prettier": "2.5.1",
|
|
59
|
+
"ts-jest": "27.1.2",
|
|
60
60
|
"ts-node": "10.4.0",
|
|
61
|
-
"typescript": "4.
|
|
61
|
+
"typescript": "4.5.4"
|
|
62
62
|
},
|
|
63
63
|
"jest": {
|
|
64
64
|
"testEnvironment": "node",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"preset": "ts-jest",
|
|
74
74
|
"testMatch": null
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "140ea78c4bb8bd34c7959941d4f9d771c289c30c"
|
|
77
77
|
}
|
package/dist/src/nock.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as nock from 'nock';
|
|
2
|
-
import * as runtime from '@smartlyio/oats-runtime';
|
|
3
|
-
export declare class Server<Spec> {
|
|
4
|
-
private readonly handler;
|
|
5
|
-
private readonly scopes;
|
|
6
|
-
private routes;
|
|
7
|
-
private handlers;
|
|
8
|
-
private readonly mocks;
|
|
9
|
-
constructor(handler: runtime.server.HandlerFactory<Spec>);
|
|
10
|
-
addHandler(method: string, path: string, handler: runtime.server.SafeEndpoint): void;
|
|
11
|
-
private getKey;
|
|
12
|
-
private getMockKey;
|
|
13
|
-
isMocked(server: string, method: string, path: string): boolean;
|
|
14
|
-
setMocked(server: string, method: string, path: string): void;
|
|
15
|
-
getNock(server: string, method: string, path: string): runtime.server.SafeEndpoint;
|
|
16
|
-
mock(spec: Spec): this;
|
|
17
|
-
addNock(scope: nock.Scope): void;
|
|
18
|
-
private adapter;
|
|
19
|
-
private adapterForServer;
|
|
20
|
-
}
|
|
21
|
-
export declare class Next extends Error {
|
|
22
|
-
constructor();
|
|
23
|
-
}
|
|
24
|
-
export declare function bind<Spec>(handler: runtime.server.HandlerFactory<Spec>, spec?: Spec): Server<Spec>;
|
package/dist/src/nock.js
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bind = exports.Next = exports.Server = void 0;
|
|
4
|
-
const nock = require("nock");
|
|
5
|
-
const runtime = require("@smartlyio/oats-runtime");
|
|
6
|
-
const assert = require("assert");
|
|
7
|
-
function parseContentDisposition(contentDispositionValue) {
|
|
8
|
-
return contentDispositionValue
|
|
9
|
-
.split(';')
|
|
10
|
-
.map(part => part.trim())
|
|
11
|
-
.map(part => {
|
|
12
|
-
const [key, ...values] = part.split('=');
|
|
13
|
-
return [key, values.join('=').replace(/^"/g, '').replace(/"$/, '')];
|
|
14
|
-
})
|
|
15
|
-
.reduce((memo, [key, value]) => (Object.assign(Object.assign({}, memo), { [key]: value })), {});
|
|
16
|
-
}
|
|
17
|
-
function parseFormItem(item) {
|
|
18
|
-
const headers = {};
|
|
19
|
-
const lines = item.split('\r\n');
|
|
20
|
-
let data;
|
|
21
|
-
for (let i = 0; i < lines.length; i++) {
|
|
22
|
-
if (lines[i] === '') {
|
|
23
|
-
data = lines.slice(i + 1).join('\n');
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
const [header, ...headerValues] = lines[i].split(':');
|
|
27
|
-
headers[header.toLowerCase()] = headerValues.join(':').trim();
|
|
28
|
-
}
|
|
29
|
-
if (headers['content-disposition']) {
|
|
30
|
-
const contentDisposition = parseContentDisposition(headers['content-disposition']);
|
|
31
|
-
if (contentDisposition.filename) {
|
|
32
|
-
return {
|
|
33
|
-
key: contentDisposition.name,
|
|
34
|
-
value: new runtime.make.FormBinary(Buffer.from(data || ''), contentDisposition.filename)
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
key: contentDisposition.name,
|
|
39
|
-
value: data
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function parseFormData(boundary, value) {
|
|
44
|
-
if (typeof value !== 'string') {
|
|
45
|
-
return assert.fail('form-data value is not a string');
|
|
46
|
-
}
|
|
47
|
-
return value.split(boundary).reduce((memo, item) => {
|
|
48
|
-
if (item === '') {
|
|
49
|
-
return memo;
|
|
50
|
-
}
|
|
51
|
-
const parsed = parseFormItem(item);
|
|
52
|
-
if (!parsed) {
|
|
53
|
-
return memo;
|
|
54
|
-
}
|
|
55
|
-
return Object.assign(Object.assign({}, memo), { [parsed.key]: parsed.value });
|
|
56
|
-
}, {});
|
|
57
|
-
}
|
|
58
|
-
function getBody(contentType, value) {
|
|
59
|
-
if (!contentType) {
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
|
-
if (/application\/json/.test(contentType)) {
|
|
63
|
-
return { contentType: 'application/json', value };
|
|
64
|
-
}
|
|
65
|
-
const formData = contentType.match(/^multipart\/form-data.*; boundary=([^;]+)/);
|
|
66
|
-
if (formData) {
|
|
67
|
-
const boundary = new RegExp('(?:\r\n)?[^\r\n]*' + formData[1] + '[^\r\n]*(?:\r\n)?');
|
|
68
|
-
return { contentType: 'multipart/form-data', value: parseFormData(boundary, value) };
|
|
69
|
-
}
|
|
70
|
-
const multipartRelatedData = contentType.match(/^multipart\/related.*; boundary=([^;]+)/);
|
|
71
|
-
if (multipartRelatedData) {
|
|
72
|
-
return { contentType: 'multipart/related', value: value };
|
|
73
|
-
}
|
|
74
|
-
return value;
|
|
75
|
-
}
|
|
76
|
-
function getQuery(url) {
|
|
77
|
-
const query = {};
|
|
78
|
-
url.searchParams.forEach((value, key) => {
|
|
79
|
-
query[key] = value;
|
|
80
|
-
});
|
|
81
|
-
return Object.keys(query).length > 0 ? query : undefined;
|
|
82
|
-
}
|
|
83
|
-
function getParams(pathTemplate, actualPath) {
|
|
84
|
-
const pathRegex = getPathRegex(pathTemplate);
|
|
85
|
-
const match = actualPath.match(pathRegex);
|
|
86
|
-
if (!match) {
|
|
87
|
-
return assert.fail('path regex did not match given path: ' + actualPath);
|
|
88
|
-
}
|
|
89
|
-
const params = {};
|
|
90
|
-
getPathParamNames(pathTemplate).forEach((key, index) => {
|
|
91
|
-
params[stripCurlies(key)] = match[index + 1];
|
|
92
|
-
});
|
|
93
|
-
return Object.keys(params).length > 0 ? params : undefined;
|
|
94
|
-
}
|
|
95
|
-
function stripCurlies(param) {
|
|
96
|
-
return param.replace(/}|{/g, '');
|
|
97
|
-
}
|
|
98
|
-
function getPathParamNames(pathTemplate) {
|
|
99
|
-
return pathTemplate.match(/{([^}]+)}/g) || [];
|
|
100
|
-
}
|
|
101
|
-
function getPathRegex(pathTemplate) {
|
|
102
|
-
const pathWithParams = pathTemplate.replace(/{([^}]+)}/g, (m, param) => ' ' + param + ' ');
|
|
103
|
-
const escapedPath = pathWithParams.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
104
|
-
return new RegExp(escapedPath.replace(/ ([^ ]+) /g, '([^?/]+)'));
|
|
105
|
-
}
|
|
106
|
-
function normalizeHeaderValue(value) {
|
|
107
|
-
if (Array.isArray(value)) {
|
|
108
|
-
assert(value.length === 1, 'unexpected length of header array');
|
|
109
|
-
value = value[0];
|
|
110
|
-
}
|
|
111
|
-
if (typeof value === 'string') {
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
if (typeof value === 'number') {
|
|
115
|
-
return `${value}`;
|
|
116
|
-
}
|
|
117
|
-
assert.fail(`Unknown header value ${value}`);
|
|
118
|
-
}
|
|
119
|
-
function normalizeHeaders(headers) {
|
|
120
|
-
headers = headers || {};
|
|
121
|
-
return Object.entries(headers).reduce((memo, [key, value]) => {
|
|
122
|
-
return Object.assign(Object.assign({}, memo), { [key]: normalizeHeaderValue(value) });
|
|
123
|
-
}, {});
|
|
124
|
-
}
|
|
125
|
-
class Server {
|
|
126
|
-
constructor(handler) {
|
|
127
|
-
this.handler = handler;
|
|
128
|
-
this.scopes = [];
|
|
129
|
-
this.routes = {};
|
|
130
|
-
this.handlers = {};
|
|
131
|
-
this.mocks = {};
|
|
132
|
-
this.adapter = (path, op, method, handler, servers) => {
|
|
133
|
-
servers.map(server => this.adapterForServer(path, op, method, handler, server));
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
addHandler(method, path, handler) {
|
|
137
|
-
const key = this.getKey(method, path);
|
|
138
|
-
if (!this.handlers[key]) {
|
|
139
|
-
this.handlers[key] = [handler];
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
this.handlers[key].unshift(handler);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
getKey(method, path) {
|
|
146
|
-
return method + ' ' + path;
|
|
147
|
-
}
|
|
148
|
-
getMockKey(server, method, path) {
|
|
149
|
-
return [server, method, path].join(' ');
|
|
150
|
-
}
|
|
151
|
-
isMocked(server, method, path) {
|
|
152
|
-
return this.mocks[this.getMockKey(server, method, path)];
|
|
153
|
-
}
|
|
154
|
-
setMocked(server, method, path) {
|
|
155
|
-
this.mocks[this.getMockKey(server, method, path)] = true;
|
|
156
|
-
}
|
|
157
|
-
getNock(server, method, path) {
|
|
158
|
-
this.setMocked(server, method, path);
|
|
159
|
-
return async (ctx) => {
|
|
160
|
-
for (const handler of this.handlers[this.getKey(ctx.method, ctx.path)]) {
|
|
161
|
-
try {
|
|
162
|
-
return await handler(ctx);
|
|
163
|
-
}
|
|
164
|
-
catch (e) {
|
|
165
|
-
if (!(e instanceof Next)) {
|
|
166
|
-
throw e;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
throw new Error('no nock handler matched');
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
mock(spec) {
|
|
174
|
-
this.handler(this.adapter)(spec);
|
|
175
|
-
return this;
|
|
176
|
-
}
|
|
177
|
-
addNock(scope) {
|
|
178
|
-
this.scopes.push(scope);
|
|
179
|
-
}
|
|
180
|
-
adapterForServer(path, op, method, handler, server) {
|
|
181
|
-
this.addHandler(method, path, handler);
|
|
182
|
-
if (this.isMocked(server, method, path)) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const nocked = this.getNock(server, method, path);
|
|
186
|
-
nock(server)[method](getPathRegex(path))
|
|
187
|
-
.reply(async function (uri, requestBody, cb) {
|
|
188
|
-
const headers = normalizeHeaders(this.req.headers);
|
|
189
|
-
const body = getBody(headers['content-type'], requestBody);
|
|
190
|
-
const url = new URL('http://host-for-nock' + uri);
|
|
191
|
-
try {
|
|
192
|
-
const result = await nocked({
|
|
193
|
-
path,
|
|
194
|
-
method,
|
|
195
|
-
servers: [server],
|
|
196
|
-
op,
|
|
197
|
-
headers,
|
|
198
|
-
params: getParams(path, uri),
|
|
199
|
-
query: getQuery(url),
|
|
200
|
-
body,
|
|
201
|
-
requestContext: null
|
|
202
|
-
});
|
|
203
|
-
const status = result.status;
|
|
204
|
-
const responseBody = result.value.value;
|
|
205
|
-
cb(null, [status, responseBody]);
|
|
206
|
-
}
|
|
207
|
-
catch (e) {
|
|
208
|
-
cb(e, [400, e.message]);
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
.persist(true);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
exports.Server = Server;
|
|
215
|
-
class Next extends Error {
|
|
216
|
-
constructor() {
|
|
217
|
-
super('Next nock handler requested');
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
exports.Next = Next;
|
|
221
|
-
function bind(handler, spec) {
|
|
222
|
-
return new Server(handler).mock(spec || {});
|
|
223
|
-
}
|
|
224
|
-
exports.bind = bind;
|
|
225
|
-
//# sourceMappingURL=nock.js.map
|
package/dist/src/nock.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nock.js","sourceRoot":"","sources":["../../src/nock.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,mDAAmD;AACnD,iCAAi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