@ama-sdk/core 11.0.0-next.2 → 11.0.0-prerelease.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/README.md +13 -0
- package/cjs/fwk/index.js +1 -0
- package/cjs/fwk/open-api-tools-configuration.js +4 -0
- package/cjs/plugins/abort/abort.fetch.js +80 -0
- package/cjs/plugins/abort/abort.spec.js +204 -0
- package/cjs/plugins/abort/index.js +18 -0
- package/cjs/plugins/index.js +3 -2
- package/cli/clear-index.cjs +9 -0
- package/cli/files-pack.cjs +14 -3
- package/cli/update-spec-from-npm.cjs +69 -0
- package/cli/update-spec-from-npm.d.cts +3 -0
- package/cli/update-spec-from-npm.d.cts.map +1 -0
- package/esm2015/fwk/index.js +1 -0
- package/esm2015/fwk/open-api-tools-configuration.js +1 -0
- package/esm2015/plugins/abort/abort.fetch.js +70 -0
- package/esm2015/plugins/abort/abort.spec.js +200 -0
- package/esm2015/plugins/abort/index.js +1 -0
- package/esm2015/plugins/index.js +3 -2
- package/package.json +8 -7
- package/src/fwk/index.d.ts +1 -0
- package/src/fwk/index.d.ts.map +1 -1
- package/src/fwk/index.js +1 -0
- package/src/fwk/index.js.map +1 -1
- package/src/fwk/open-api-tools-configuration.d.ts +28 -0
- package/src/fwk/open-api-tools-configuration.d.ts.map +1 -0
- package/src/fwk/open-api-tools-configuration.js +2 -0
- package/src/fwk/open-api-tools-configuration.js.map +1 -0
- package/src/plugins/abort/abort.fetch.d.ts +66 -0
- package/src/plugins/abort/abort.fetch.d.ts.map +1 -0
- package/src/plugins/abort/abort.fetch.js +32 -0
- package/src/plugins/abort/abort.fetch.js.map +1 -0
- package/src/plugins/abort/index.d.ts +2 -0
- package/src/plugins/abort/index.d.ts.map +1 -0
- package/src/plugins/abort/index.js +2 -0
- package/src/plugins/abort/index.js.map +1 -0
- package/src/plugins/index.d.ts +3 -2
- package/src/plugins/index.d.ts.map +1 -1
- package/src/plugins/index.js +3 -2
- package/src/plugins/index.js.map +1 -1
- package/cli/clear-index.cjs.map +0 -1
- package/cli/files-pack.cjs.map +0 -1
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Please refer to the [ama-sdk-schematics](../schematics/README.md) package for ge
|
|
|
9
9
|
|
|
10
10
|
## Available plugins
|
|
11
11
|
|
|
12
|
+
- [abort](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/core/src/plugins/abort)
|
|
12
13
|
- [additional-params](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/core/src/plugins/additional-params)
|
|
13
14
|
- [api-configuration-override](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/core/src/plugins/api-configuration-override)
|
|
14
15
|
- [api-key](https://github.com/AmadeusITGroup/otter/tree/main/packages/%40ama-sdk/core/src/plugins/api-key)
|
|
@@ -69,3 +70,15 @@ function petApiFactory() {
|
|
|
69
70
|
```
|
|
70
71
|
|
|
71
72
|
> *Note*: Adding a third-party logging service is optional. If undefined, the fallback is the console logger.
|
|
73
|
+
|
|
74
|
+
### CLI
|
|
75
|
+
|
|
76
|
+
This package also comes with CLI scripts that can facilitate the upgrade and publication of an SDK.
|
|
77
|
+
Use --help on each command for more information
|
|
78
|
+
|
|
79
|
+
| Script | Description |
|
|
80
|
+
|-----------------------------|------------------------------------------------------------------------------------------------|
|
|
81
|
+
| amasdk-clear-index | Remove the index files that are no longer necessary after the deletion of the associated model |
|
|
82
|
+
| amasdk-files-pack | Prepare the dist folder for publication |
|
|
83
|
+
| amasdk-update-spec-from-npm | Update the OpenAPI spec from an NPM package |
|
|
84
|
+
|
package/cjs/fwk/index.js
CHANGED
|
@@ -11,6 +11,7 @@ _export_star(require("./errors"), exports);
|
|
|
11
11
|
_export_star(require("./ignore-enum.type"), exports);
|
|
12
12
|
_export_star(require("./logger"), exports);
|
|
13
13
|
_export_star(require("./mocks/index"), exports);
|
|
14
|
+
_export_star(require("./open-api-tools-configuration"), exports);
|
|
14
15
|
_export_star(require("./Reviver"), exports);
|
|
15
16
|
function _export_star(from, to) {
|
|
16
17
|
Object.keys(from).forEach(function(k) {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AbortFetch", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AbortFetch;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _class_call_check(instance, Constructor) {
|
|
12
|
+
if (!(instance instanceof Constructor)) {
|
|
13
|
+
throw new TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function _defineProperties(target, props) {
|
|
17
|
+
for(var i = 0; i < props.length; i++){
|
|
18
|
+
var descriptor = props[i];
|
|
19
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
+
descriptor.configurable = true;
|
|
21
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
return Constructor;
|
|
29
|
+
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
var isPromise = function(result) {
|
|
44
|
+
if (typeof result !== 'object') {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
var AbortFetch = /*#__PURE__*/ function() {
|
|
50
|
+
"use strict";
|
|
51
|
+
function AbortFetch(abortCallback) {
|
|
52
|
+
_class_call_check(this, AbortFetch);
|
|
53
|
+
_define_property(this, "abortCallback", void 0);
|
|
54
|
+
this.abortCallback = abortCallback;
|
|
55
|
+
}
|
|
56
|
+
_create_class(AbortFetch, [
|
|
57
|
+
{
|
|
58
|
+
key: "load",
|
|
59
|
+
value: /** @inheritDoc */ function load(context) {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return {
|
|
62
|
+
transform: function(fetchCall) {
|
|
63
|
+
var abortCallbackResult = _this.abortCallback();
|
|
64
|
+
if (isPromise(abortCallbackResult)) {
|
|
65
|
+
void abortCallbackResult.then(function(res) {
|
|
66
|
+
var _context_controller;
|
|
67
|
+
return res && ((_context_controller = context.controller) === null || _context_controller === void 0 ? void 0 : _context_controller.abort());
|
|
68
|
+
});
|
|
69
|
+
} else if (abortCallbackResult) {
|
|
70
|
+
var _context_controller;
|
|
71
|
+
(_context_controller = context.controller) === null || _context_controller === void 0 ? void 0 : _context_controller.abort();
|
|
72
|
+
}
|
|
73
|
+
return fetchCall;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]);
|
|
79
|
+
return AbortFetch;
|
|
80
|
+
}();
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
var _abortfetch = require("./abort.fetch");
|
|
6
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
7
|
+
try {
|
|
8
|
+
var info = gen[key](arg);
|
|
9
|
+
var value = info.value;
|
|
10
|
+
} catch (error) {
|
|
11
|
+
reject(error);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (info.done) {
|
|
15
|
+
resolve(value);
|
|
16
|
+
} else {
|
|
17
|
+
Promise.resolve(value).then(_next, _throw);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function _async_to_generator(fn) {
|
|
21
|
+
return function() {
|
|
22
|
+
var self = this, args = arguments;
|
|
23
|
+
return new Promise(function(resolve, reject) {
|
|
24
|
+
var gen = fn.apply(self, args);
|
|
25
|
+
function _next(value) {
|
|
26
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
27
|
+
}
|
|
28
|
+
function _throw(err) {
|
|
29
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
30
|
+
}
|
|
31
|
+
_next(undefined);
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function _ts_generator(thisArg, body) {
|
|
36
|
+
var f, y, t, g, _ = {
|
|
37
|
+
label: 0,
|
|
38
|
+
sent: function() {
|
|
39
|
+
if (t[0] & 1) throw t[1];
|
|
40
|
+
return t[1];
|
|
41
|
+
},
|
|
42
|
+
trys: [],
|
|
43
|
+
ops: []
|
|
44
|
+
};
|
|
45
|
+
return g = {
|
|
46
|
+
next: verb(0),
|
|
47
|
+
"throw": verb(1),
|
|
48
|
+
"return": verb(2)
|
|
49
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
50
|
+
return this;
|
|
51
|
+
}), g;
|
|
52
|
+
function verb(n) {
|
|
53
|
+
return function(v) {
|
|
54
|
+
return step([
|
|
55
|
+
n,
|
|
56
|
+
v
|
|
57
|
+
]);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function step(op) {
|
|
61
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
62
|
+
while(_)try {
|
|
63
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
64
|
+
if (y = 0, t) op = [
|
|
65
|
+
op[0] & 2,
|
|
66
|
+
t.value
|
|
67
|
+
];
|
|
68
|
+
switch(op[0]){
|
|
69
|
+
case 0:
|
|
70
|
+
case 1:
|
|
71
|
+
t = op;
|
|
72
|
+
break;
|
|
73
|
+
case 4:
|
|
74
|
+
_.label++;
|
|
75
|
+
return {
|
|
76
|
+
value: op[1],
|
|
77
|
+
done: false
|
|
78
|
+
};
|
|
79
|
+
case 5:
|
|
80
|
+
_.label++;
|
|
81
|
+
y = op[1];
|
|
82
|
+
op = [
|
|
83
|
+
0
|
|
84
|
+
];
|
|
85
|
+
continue;
|
|
86
|
+
case 7:
|
|
87
|
+
op = _.ops.pop();
|
|
88
|
+
_.trys.pop();
|
|
89
|
+
continue;
|
|
90
|
+
default:
|
|
91
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
92
|
+
_ = 0;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
96
|
+
_.label = op[1];
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
100
|
+
_.label = t[1];
|
|
101
|
+
t = op;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t && _.label < t[2]) {
|
|
105
|
+
_.label = t[2];
|
|
106
|
+
_.ops.push(op);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (t[2]) _.ops.pop();
|
|
110
|
+
_.trys.pop();
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
op = body.call(thisArg, _);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
op = [
|
|
116
|
+
6,
|
|
117
|
+
e
|
|
118
|
+
];
|
|
119
|
+
y = 0;
|
|
120
|
+
} finally{
|
|
121
|
+
f = t = 0;
|
|
122
|
+
}
|
|
123
|
+
if (op[0] & 5) throw op[1];
|
|
124
|
+
return {
|
|
125
|
+
value: op[0] ? op[1] : void 0,
|
|
126
|
+
done: true
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
describe('Abort Plugin', function() {
|
|
131
|
+
it('should trigger the callback', /*#__PURE__*/ _async_to_generator(function() {
|
|
132
|
+
var fn, plugin, runner;
|
|
133
|
+
return _ts_generator(this, function(_state) {
|
|
134
|
+
switch(_state.label){
|
|
135
|
+
case 0:
|
|
136
|
+
fn = jest.fn();
|
|
137
|
+
plugin = new _abortfetch.AbortFetch(fn);
|
|
138
|
+
runner = plugin.load({});
|
|
139
|
+
return [
|
|
140
|
+
4,
|
|
141
|
+
runner.transform(Promise.resolve())
|
|
142
|
+
];
|
|
143
|
+
case 1:
|
|
144
|
+
_state.sent();
|
|
145
|
+
expect(fn).toHaveBeenCalled();
|
|
146
|
+
return [
|
|
147
|
+
2
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}));
|
|
152
|
+
it('should trigger abort signal if true', /*#__PURE__*/ _async_to_generator(function() {
|
|
153
|
+
var defaultContext, fn, plugin, runner;
|
|
154
|
+
return _ts_generator(this, function(_state) {
|
|
155
|
+
switch(_state.label){
|
|
156
|
+
case 0:
|
|
157
|
+
defaultContext = {
|
|
158
|
+
controller: {
|
|
159
|
+
abort: jest.fn()
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
fn = jest.fn().mockResolvedValue(true);
|
|
163
|
+
plugin = new _abortfetch.AbortFetch(fn);
|
|
164
|
+
runner = plugin.load(defaultContext);
|
|
165
|
+
return [
|
|
166
|
+
4,
|
|
167
|
+
runner.transform(Promise.resolve())
|
|
168
|
+
];
|
|
169
|
+
case 1:
|
|
170
|
+
_state.sent();
|
|
171
|
+
expect(defaultContext.controller.abort).toHaveBeenCalled();
|
|
172
|
+
return [
|
|
173
|
+
2
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}));
|
|
178
|
+
it('should not trigger abort signal if false', /*#__PURE__*/ _async_to_generator(function() {
|
|
179
|
+
var defaultContext, fn, plugin, runner;
|
|
180
|
+
return _ts_generator(this, function(_state) {
|
|
181
|
+
switch(_state.label){
|
|
182
|
+
case 0:
|
|
183
|
+
defaultContext = {
|
|
184
|
+
controller: {
|
|
185
|
+
abort: jest.fn()
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
fn = jest.fn().mockResolvedValue(false);
|
|
189
|
+
plugin = new _abortfetch.AbortFetch(fn);
|
|
190
|
+
runner = plugin.load(defaultContext);
|
|
191
|
+
return [
|
|
192
|
+
4,
|
|
193
|
+
runner.transform(Promise.resolve())
|
|
194
|
+
];
|
|
195
|
+
case 1:
|
|
196
|
+
_state.sent();
|
|
197
|
+
expect(defaultContext.controller.abort).not.toHaveBeenCalled();
|
|
198
|
+
return [
|
|
199
|
+
2
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}));
|
|
204
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./abort.fetch"), exports);
|
|
6
|
+
function _export_star(from, to) {
|
|
7
|
+
Object.keys(from).forEach(function(k) {
|
|
8
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
+
Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return from;
|
|
18
|
+
}
|
package/cjs/plugins/index.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
_export_star(require("./abort/index"), exports);
|
|
5
6
|
_export_star(require("./additional-params/index"), exports);
|
|
6
7
|
_export_star(require("./api-configuration-override/index"), exports);
|
|
7
8
|
_export_star(require("./api-key/index"), exports);
|
|
8
9
|
_export_star(require("./bot-protection-fingerprint/index"), exports);
|
|
10
|
+
_export_star(require("./client-facts/index"), exports);
|
|
9
11
|
_export_star(require("./concurrent/index"), exports);
|
|
10
12
|
_export_star(require("./core/index"), exports);
|
|
11
|
-
_export_star(require("./client-facts/index"), exports);
|
|
12
13
|
_export_star(require("./custom-info/index"), exports);
|
|
13
14
|
_export_star(require("./exception/index"), exports);
|
|
14
15
|
_export_star(require("./fetch-cache/index"), exports);
|
|
@@ -24,9 +25,9 @@ _export_star(require("./reviver/index"), exports);
|
|
|
24
25
|
_export_star(require("./session-id/index"), exports);
|
|
25
26
|
_export_star(require("./si-token/index"), exports);
|
|
26
27
|
_export_star(require("./simple-api-key-authentication/index"), exports);
|
|
28
|
+
_export_star(require("./timeout/index"), exports);
|
|
27
29
|
_export_star(require("./url-rewrite/index"), exports);
|
|
28
30
|
_export_star(require("./wait-for/index"), exports);
|
|
29
|
-
_export_star(require("./timeout/index"), exports);
|
|
30
31
|
function _export_star(from, to) {
|
|
31
32
|
Object.keys(from).forEach(function(k) {
|
|
32
33
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
package/cli/clear-index.cjs
CHANGED
|
@@ -4,9 +4,18 @@
|
|
|
4
4
|
* Remove deleted models' exports
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const minimist = require("minimist");
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
10
|
+
const argv = minimist(process.argv.slice(2));
|
|
11
|
+
const { help } = argv;
|
|
9
12
|
const baseDir = (0, node_path_1.resolve)(process.cwd(), 'src', 'models', 'base');
|
|
13
|
+
if (help) {
|
|
14
|
+
console.log(`Remove the index files that are no longer necessary after the deletion of the associated model.
|
|
15
|
+
Usage: amasdk-clear-index
|
|
16
|
+
`);
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
10
19
|
void (async () => {
|
|
11
20
|
const models = await node_fs_1.promises.readdir(baseDir);
|
|
12
21
|
const shouldRemoveModels = (await Promise.all(models
|
package/cli/files-pack.cjs
CHANGED
|
@@ -12,7 +12,16 @@ const globby = require("globby");
|
|
|
12
12
|
const argv = minimist(process.argv.slice(2));
|
|
13
13
|
const distFolder = argv.dist || 'dist';
|
|
14
14
|
const baseDir = argv.cwd && path.resolve(process.cwd(), argv.cwd) || process.cwd();
|
|
15
|
-
const { watch, noExports } = argv;
|
|
15
|
+
const { help, watch, noExports } = argv;
|
|
16
|
+
if (help) {
|
|
17
|
+
console.log(`Prepare the dist folder for publication. This will copy necessary files from src and update the exports in package.json.
|
|
18
|
+
Usage: amasdk-files-pack [--exports] [--watch]
|
|
19
|
+
|
|
20
|
+
--exports Update the exports in package.json. (Default: true)
|
|
21
|
+
--watch Watch for files changes and run the updates
|
|
22
|
+
`);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
16
25
|
const files = [
|
|
17
26
|
{ glob: 'README.md', cwdForCopy: baseDir },
|
|
18
27
|
{ glob: 'LICENSE', cwdForCopy: baseDir },
|
|
@@ -66,10 +75,12 @@ void (async () => {
|
|
|
66
75
|
const copies = files.map(async ({ glob, cwdForCopy }) => {
|
|
67
76
|
return watch ?
|
|
68
77
|
Promise.resolve().then(() => require('chokidar')).then((chokidar) => chokidar.watch(glob, { cwd: baseDir }))
|
|
69
|
-
.then((watcher) => watcher.on('all', (event, file) => {
|
|
78
|
+
.then((watcher) => watcher.on('all', async (event, file) => {
|
|
70
79
|
if (event !== 'unlink' && event !== 'unlinkDir') {
|
|
71
80
|
copyToDist(file, cwdForCopy);
|
|
72
|
-
|
|
81
|
+
if (!noExports) {
|
|
82
|
+
await updateExports();
|
|
83
|
+
}
|
|
73
84
|
}
|
|
74
85
|
})) :
|
|
75
86
|
globby.sync(glob)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/*
|
|
4
|
+
* Update the OpenAPI spec from an NPM package
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const minimist = require("minimist");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_module_1 = require("node:module");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
12
|
+
const argv = minimist(process.argv.slice(2));
|
|
13
|
+
const packageName = argv._[0];
|
|
14
|
+
const { help, output, 'package-path': packagePath, quiet } = argv;
|
|
15
|
+
const openApiConfigDefaultPath = './openapitools.json';
|
|
16
|
+
const supportedExtensions = ['json', 'yaml', 'yml'];
|
|
17
|
+
const noop = () => undefined;
|
|
18
|
+
const logger = quiet ? { error: noop, warn: noop, log: noop, info: noop, debug: noop } : console;
|
|
19
|
+
if (help) {
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.log(`This script can be used to update your local spec file from a given locally installed npm package.
|
|
22
|
+
Usage: amasdk-update-spec-from-npm <package-name> [--package-path] [--output] [--quiet]
|
|
23
|
+
|
|
24
|
+
package-name The full identifier of the npm package (e.g. @my-scope/my-package)
|
|
25
|
+
--package-path The relative path inside the npm package where to find the spec file (default: './openapi.yml')
|
|
26
|
+
--output The path where the spec file should be copied (default: './openapi.yml')
|
|
27
|
+
--quiet Don't log anything
|
|
28
|
+
`);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
if (!packageName) {
|
|
32
|
+
logger.error('Need to provide packageName, use `amasdk-update-spec-from-npm --help` for more information');
|
|
33
|
+
process.exit(-1);
|
|
34
|
+
}
|
|
35
|
+
void (async () => {
|
|
36
|
+
let specSourcePath;
|
|
37
|
+
const appRequire = (0, node_module_1.createRequire)((0, node_path_1.join)(process.cwd(), 'package.json'));
|
|
38
|
+
const packageJsonPath = appRequire.resolve(`${packageName}/package.json`);
|
|
39
|
+
if (!packagePath) {
|
|
40
|
+
const packageJson = JSON.parse(await (0, promises_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
|
|
41
|
+
const exportMatcher = new RegExp(`openapi\\.(?:${supportedExtensions.join('|')})$`);
|
|
42
|
+
const matchingExport = packageJson.exports && Object.keys(packageJson.exports).find((exportPath) => exportMatcher.test(exportPath));
|
|
43
|
+
if (matchingExport) {
|
|
44
|
+
specSourcePath = appRequire.resolve(`${packageName}/${matchingExport}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
specSourcePath = packageJsonPath.replace(/package.json$/, packagePath);
|
|
49
|
+
}
|
|
50
|
+
if (!specSourcePath || !(0, node_fs_1.existsSync)(specSourcePath)) {
|
|
51
|
+
logger.error(`Unable to find source spec from ${packageName}, please make sure it is correctly exported in package.json`);
|
|
52
|
+
process.exit(-2);
|
|
53
|
+
}
|
|
54
|
+
let specDestinationPath = output;
|
|
55
|
+
if (!specDestinationPath) {
|
|
56
|
+
const specSourceExtension = (0, node_path_1.extname)(specSourcePath);
|
|
57
|
+
specDestinationPath = `./openapi${specSourceExtension}`;
|
|
58
|
+
if ((0, node_fs_1.existsSync)(openApiConfigDefaultPath)) {
|
|
59
|
+
const openApiConfig = JSON.parse(await (0, promises_1.readFile)(openApiConfigDefaultPath, { encoding: 'utf8' }));
|
|
60
|
+
const generators = Object.values(openApiConfig['generator-cli']?.generators ?? {});
|
|
61
|
+
if (generators.length === 1 && generators[0].inputSpec && (0, node_path_1.extname)(generators[0].inputSpec) === specSourceExtension) {
|
|
62
|
+
specDestinationPath = generators[0].inputSpec;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
logger.info(`Updating spec file from "${specSourcePath}" to "${specDestinationPath}" (CWD: "${process.cwd()}")`);
|
|
67
|
+
await (0, promises_1.copyFile)(specSourcePath, specDestinationPath);
|
|
68
|
+
})();
|
|
69
|
+
//# sourceMappingURL=update-spec-from-npm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-spec-from-npm.d.cts","sourceRoot":"","sources":["../../cli/update-spec-from-npm.cts"],"names":[],"mappings":""}
|
package/esm2015/fwk/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** Configuration of an Open API generator */ /** Global configuration of Open API Tools */ export { };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
var isPromise = function(result) {
|
|
34
|
+
if (typeof result !== 'object') {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
};
|
|
39
|
+
/** Plugin to abort a Fetch request */ export var AbortFetch = /*#__PURE__*/ function() {
|
|
40
|
+
"use strict";
|
|
41
|
+
function AbortFetch(abortCallback) {
|
|
42
|
+
_class_call_check(this, AbortFetch);
|
|
43
|
+
_define_property(this, "abortCallback", void 0);
|
|
44
|
+
this.abortCallback = abortCallback;
|
|
45
|
+
}
|
|
46
|
+
_create_class(AbortFetch, [
|
|
47
|
+
{
|
|
48
|
+
key: "load",
|
|
49
|
+
value: /** @inheritDoc */ function load(context) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
return {
|
|
52
|
+
transform: function(fetchCall) {
|
|
53
|
+
var abortCallbackResult = _this.abortCallback();
|
|
54
|
+
if (isPromise(abortCallbackResult)) {
|
|
55
|
+
void abortCallbackResult.then(function(res) {
|
|
56
|
+
var _context_controller;
|
|
57
|
+
return res && ((_context_controller = context.controller) === null || _context_controller === void 0 ? void 0 : _context_controller.abort());
|
|
58
|
+
});
|
|
59
|
+
} else if (abortCallbackResult) {
|
|
60
|
+
var _context_controller;
|
|
61
|
+
(_context_controller = context.controller) === null || _context_controller === void 0 ? void 0 : _context_controller.abort();
|
|
62
|
+
}
|
|
63
|
+
return fetchCall;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
return AbortFetch;
|
|
70
|
+
}();
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _async_to_generator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _ts_generator(thisArg, body) {
|
|
31
|
+
var f, y, t, g, _ = {
|
|
32
|
+
label: 0,
|
|
33
|
+
sent: function() {
|
|
34
|
+
if (t[0] & 1) throw t[1];
|
|
35
|
+
return t[1];
|
|
36
|
+
},
|
|
37
|
+
trys: [],
|
|
38
|
+
ops: []
|
|
39
|
+
};
|
|
40
|
+
return g = {
|
|
41
|
+
next: verb(0),
|
|
42
|
+
"throw": verb(1),
|
|
43
|
+
"return": verb(2)
|
|
44
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
|
+
return this;
|
|
46
|
+
}), g;
|
|
47
|
+
function verb(n) {
|
|
48
|
+
return function(v) {
|
|
49
|
+
return step([
|
|
50
|
+
n,
|
|
51
|
+
v
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function step(op) {
|
|
56
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
+
while(_)try {
|
|
58
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
59
|
+
if (y = 0, t) op = [
|
|
60
|
+
op[0] & 2,
|
|
61
|
+
t.value
|
|
62
|
+
];
|
|
63
|
+
switch(op[0]){
|
|
64
|
+
case 0:
|
|
65
|
+
case 1:
|
|
66
|
+
t = op;
|
|
67
|
+
break;
|
|
68
|
+
case 4:
|
|
69
|
+
_.label++;
|
|
70
|
+
return {
|
|
71
|
+
value: op[1],
|
|
72
|
+
done: false
|
|
73
|
+
};
|
|
74
|
+
case 5:
|
|
75
|
+
_.label++;
|
|
76
|
+
y = op[1];
|
|
77
|
+
op = [
|
|
78
|
+
0
|
|
79
|
+
];
|
|
80
|
+
continue;
|
|
81
|
+
case 7:
|
|
82
|
+
op = _.ops.pop();
|
|
83
|
+
_.trys.pop();
|
|
84
|
+
continue;
|
|
85
|
+
default:
|
|
86
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
+
_ = 0;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
+
_.label = op[1];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
+
_.label = t[1];
|
|
96
|
+
t = op;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
if (t && _.label < t[2]) {
|
|
100
|
+
_.label = t[2];
|
|
101
|
+
_.ops.push(op);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (t[2]) _.ops.pop();
|
|
105
|
+
_.trys.pop();
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
op = body.call(thisArg, _);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
op = [
|
|
111
|
+
6,
|
|
112
|
+
e
|
|
113
|
+
];
|
|
114
|
+
y = 0;
|
|
115
|
+
} finally{
|
|
116
|
+
f = t = 0;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] & 5) throw op[1];
|
|
119
|
+
return {
|
|
120
|
+
value: op[0] ? op[1] : void 0,
|
|
121
|
+
done: true
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
import { AbortFetch } from './abort.fetch';
|
|
126
|
+
describe('Abort Plugin', function() {
|
|
127
|
+
it('should trigger the callback', /*#__PURE__*/ _async_to_generator(function() {
|
|
128
|
+
var fn, plugin, runner;
|
|
129
|
+
return _ts_generator(this, function(_state) {
|
|
130
|
+
switch(_state.label){
|
|
131
|
+
case 0:
|
|
132
|
+
fn = jest.fn();
|
|
133
|
+
plugin = new AbortFetch(fn);
|
|
134
|
+
runner = plugin.load({});
|
|
135
|
+
return [
|
|
136
|
+
4,
|
|
137
|
+
runner.transform(Promise.resolve())
|
|
138
|
+
];
|
|
139
|
+
case 1:
|
|
140
|
+
_state.sent();
|
|
141
|
+
expect(fn).toHaveBeenCalled();
|
|
142
|
+
return [
|
|
143
|
+
2
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}));
|
|
148
|
+
it('should trigger abort signal if true', /*#__PURE__*/ _async_to_generator(function() {
|
|
149
|
+
var defaultContext, fn, plugin, runner;
|
|
150
|
+
return _ts_generator(this, function(_state) {
|
|
151
|
+
switch(_state.label){
|
|
152
|
+
case 0:
|
|
153
|
+
defaultContext = {
|
|
154
|
+
controller: {
|
|
155
|
+
abort: jest.fn()
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
fn = jest.fn().mockResolvedValue(true);
|
|
159
|
+
plugin = new AbortFetch(fn);
|
|
160
|
+
runner = plugin.load(defaultContext);
|
|
161
|
+
return [
|
|
162
|
+
4,
|
|
163
|
+
runner.transform(Promise.resolve())
|
|
164
|
+
];
|
|
165
|
+
case 1:
|
|
166
|
+
_state.sent();
|
|
167
|
+
expect(defaultContext.controller.abort).toHaveBeenCalled();
|
|
168
|
+
return [
|
|
169
|
+
2
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}));
|
|
174
|
+
it('should not trigger abort signal if false', /*#__PURE__*/ _async_to_generator(function() {
|
|
175
|
+
var defaultContext, fn, plugin, runner;
|
|
176
|
+
return _ts_generator(this, function(_state) {
|
|
177
|
+
switch(_state.label){
|
|
178
|
+
case 0:
|
|
179
|
+
defaultContext = {
|
|
180
|
+
controller: {
|
|
181
|
+
abort: jest.fn()
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
fn = jest.fn().mockResolvedValue(false);
|
|
185
|
+
plugin = new AbortFetch(fn);
|
|
186
|
+
runner = plugin.load(defaultContext);
|
|
187
|
+
return [
|
|
188
|
+
4,
|
|
189
|
+
runner.transform(Promise.resolve())
|
|
190
|
+
];
|
|
191
|
+
case 1:
|
|
192
|
+
_state.sent();
|
|
193
|
+
expect(defaultContext.controller.abort).not.toHaveBeenCalled();
|
|
194
|
+
return [
|
|
195
|
+
2
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}));
|
|
200
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './abort.fetch';
|
package/esm2015/plugins/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export * from './abort/index';
|
|
1
2
|
export * from './additional-params/index';
|
|
2
3
|
export * from './api-configuration-override/index';
|
|
3
4
|
export * from './api-key/index';
|
|
4
5
|
export * from './bot-protection-fingerprint/index';
|
|
6
|
+
export * from './client-facts/index';
|
|
5
7
|
export * from './concurrent/index';
|
|
6
8
|
export * from './core/index';
|
|
7
|
-
export * from './client-facts/index';
|
|
8
9
|
export * from './custom-info/index';
|
|
9
10
|
export * from './exception/index';
|
|
10
11
|
export * from './fetch-cache/index';
|
|
@@ -20,6 +21,6 @@ export * from './reviver/index';
|
|
|
20
21
|
export * from './session-id/index';
|
|
21
22
|
export * from './si-token/index';
|
|
22
23
|
export * from './simple-api-key-authentication/index';
|
|
24
|
+
export * from './timeout/index';
|
|
23
25
|
export * from './url-rewrite/index';
|
|
24
26
|
export * from './wait-for/index';
|
|
25
|
-
export * from './timeout/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-sdk/core",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-prerelease.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@angular-devkit/schematics": "~17.3.0",
|
|
81
81
|
"@angular/cli": "~17.3.0",
|
|
82
82
|
"@angular/common": "~17.3.0",
|
|
83
|
-
"@o3r/schematics": "^11.0.0-
|
|
83
|
+
"@o3r/schematics": "^11.0.0-prerelease.2",
|
|
84
84
|
"@schematics/angular": "~17.3.0",
|
|
85
85
|
"chokidar": "^3.5.2",
|
|
86
86
|
"globby": "^11.1.0",
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
"@angular/core": "~17.3.0",
|
|
127
127
|
"@nx/eslint-plugin": "~18.3.0",
|
|
128
128
|
"@nx/jest": "~18.3.0",
|
|
129
|
-
"@o3r/build-helpers": "^11.0.0-
|
|
130
|
-
"@o3r/eslint-plugin": "^11.0.0-
|
|
131
|
-
"@o3r/test-helpers": "^11.0.0-
|
|
129
|
+
"@o3r/build-helpers": "^11.0.0-prerelease.2",
|
|
130
|
+
"@o3r/eslint-plugin": "^11.0.0-prerelease.2",
|
|
131
|
+
"@o3r/test-helpers": "^11.0.0-prerelease.2",
|
|
132
132
|
"@schematics/angular": "~17.3.0",
|
|
133
133
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
134
134
|
"@swc/cli": "^0.3.0",
|
|
135
|
-
"@swc/core": "
|
|
135
|
+
"@swc/core": "1.5.7",
|
|
136
136
|
"@types/jest": "~29.5.2",
|
|
137
137
|
"@types/minimist": "^1.2.2",
|
|
138
138
|
"@types/node": "^20.0.0",
|
|
@@ -168,7 +168,8 @@
|
|
|
168
168
|
"schematics": "./collection.json",
|
|
169
169
|
"bin": {
|
|
170
170
|
"amasdk-clear-index": "./cli/clear-index.cjs",
|
|
171
|
-
"amasdk-files-pack": "./cli/files-pack.cjs"
|
|
171
|
+
"amasdk-files-pack": "./cli/files-pack.cjs",
|
|
172
|
+
"amasdk-update-spec-from-npm": "./cli/update-spec-from-npm.cjs"
|
|
172
173
|
},
|
|
173
174
|
"contributors": [
|
|
174
175
|
{
|
package/src/fwk/index.d.ts
CHANGED
package/src/fwk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fwk/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fwk/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC"}
|
package/src/fwk/index.js
CHANGED
package/src/fwk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fwk/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fwk/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Configuration of an Open API generator */
|
|
2
|
+
export interface OpenApiToolsGenerator {
|
|
3
|
+
/** Location of the OpenAPI spec, as URL or file */
|
|
4
|
+
inputSpec: string;
|
|
5
|
+
/** Output path for the generated SDK */
|
|
6
|
+
output: string;
|
|
7
|
+
/** Generator to use */
|
|
8
|
+
generatorName: string;
|
|
9
|
+
/** Path to configuration file. It can be JSON or YAML */
|
|
10
|
+
config?: string;
|
|
11
|
+
/** Sets specified global properties */
|
|
12
|
+
globalProperty?: string | Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
/** Global configuration of Open API generators */
|
|
15
|
+
export interface OpenApiToolsGeneratorCli {
|
|
16
|
+
/** Open API version */
|
|
17
|
+
version: string;
|
|
18
|
+
/** Location of the generator JAR file */
|
|
19
|
+
storageDir?: string;
|
|
20
|
+
/** Generators configuration */
|
|
21
|
+
generators: Record<string, OpenApiToolsGenerator>;
|
|
22
|
+
}
|
|
23
|
+
/** Global configuration of Open API Tools */
|
|
24
|
+
export interface OpenApiToolsConfiguration {
|
|
25
|
+
/** Generators CLI configuration */
|
|
26
|
+
'generator-cli': OpenApiToolsGeneratorCli;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=open-api-tools-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-api-tools-configuration.d.ts","sourceRoot":"","sources":["../../../src/fwk/open-api-tools-configuration.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/C;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACnD;AAED,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IAEnC,eAAe,EAAE,wBAAwB,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-api-tools-configuration.js","sourceRoot":"","sources":["../../../src/fwk/open-api-tools-configuration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { FetchCall, FetchPlugin, FetchPluginContext, RequestOptions } from '../core';
|
|
2
|
+
interface AbortCallbackParameters {
|
|
3
|
+
/** URL targeted */
|
|
4
|
+
url: string;
|
|
5
|
+
/** Fetch call options */
|
|
6
|
+
options: RequestInit | RequestOptions;
|
|
7
|
+
/** Abort controller to abort fetch call */
|
|
8
|
+
controller?: AbortController;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Abort callback
|
|
12
|
+
* Returns `true` to abort a request (or access directly to the controller to cancel fetch request)
|
|
13
|
+
* @example Immediate abort on URL match
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const abortCondition: AbortCallback = ({url}) => url.endsWith('pet');
|
|
16
|
+
*
|
|
17
|
+
* const client = new ApiFetchClient(
|
|
18
|
+
* {
|
|
19
|
+
* basePath: 'https://petstore3.swagger.io/api/v3',
|
|
20
|
+
* fetchPlugins: [new AbortFetch(abortCondition)]
|
|
21
|
+
* }
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
* @example Abort on external event
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { firstValueFrom } from 'rxjs';
|
|
27
|
+
* import { myObservable } from 'somewhere';
|
|
28
|
+
*
|
|
29
|
+
* const abortCondition: AbortCallback = ((observable: any) => () => firstValueFrom(observable).then((value) => !!value))(myObservable);
|
|
30
|
+
*
|
|
31
|
+
* const client = new ApiFetchClient(
|
|
32
|
+
* {
|
|
33
|
+
* basePath: 'https://petstore3.swagger.io/api/v3',
|
|
34
|
+
* fetchPlugins: [new AbortFetch(abortCondition)]
|
|
35
|
+
* }
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Abort on Timeout
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const abortCondition: AbortCallback = ({controller}) => { setTimeout(() => controller?.abort(), 3000); };
|
|
42
|
+
*
|
|
43
|
+
* const client = new ApiFetchClient(
|
|
44
|
+
* {
|
|
45
|
+
* basePath: 'https://petstore3.swagger.io/api/v3',
|
|
46
|
+
* fetchPlugins: [new AbortFetch(abortCondition)]
|
|
47
|
+
* }
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export type AbortCallback = (controller?: AbortCallbackParameters) => void | boolean | Promise<void> | Promise<boolean>;
|
|
52
|
+
/** Plugin to abort a Fetch request */
|
|
53
|
+
export declare class AbortFetch implements FetchPlugin {
|
|
54
|
+
abortCallback: AbortCallback;
|
|
55
|
+
/**
|
|
56
|
+
* Abort Fetch plugin
|
|
57
|
+
* @param abortCallback Condition that should be passed to start the call
|
|
58
|
+
*/
|
|
59
|
+
constructor(abortCallback: AbortCallback);
|
|
60
|
+
/** @inheritDoc */
|
|
61
|
+
load(context: FetchPluginContext): {
|
|
62
|
+
transform: (fetchCall: FetchCall) => FetchCall;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=abort.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/abort/abort.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE1F,UAAU,uBAAuB;IAC/B,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAC;IAEZ,yBAAyB;IACzB,OAAO,EAAE,WAAW,GAAG,cAAc,CAAC;IAGtC,2CAA2C;IAC3C,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,UAAU,CAAC,EAAE,uBAAuB,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAExH,sCAAsC;AACtC,qBAAa,UAAW,YAAW,WAAW;IAMzB,aAAa,EAAE,aAAa;IAJ/C;;;OAGG;gBACgB,aAAa,EAAE,aAAa;IAI/C,kBAAkB;IACX,IAAI,CAAC,OAAO,EAAE,kBAAkB;;;CAaxC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const isPromise = (result) => {
|
|
2
|
+
if (typeof result !== 'object') {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
return true;
|
|
6
|
+
};
|
|
7
|
+
/** Plugin to abort a Fetch request */
|
|
8
|
+
export class AbortFetch {
|
|
9
|
+
/**
|
|
10
|
+
* Abort Fetch plugin
|
|
11
|
+
* @param abortCallback Condition that should be passed to start the call
|
|
12
|
+
*/
|
|
13
|
+
constructor(abortCallback) {
|
|
14
|
+
this.abortCallback = abortCallback;
|
|
15
|
+
}
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
load(context) {
|
|
18
|
+
return {
|
|
19
|
+
transform: (fetchCall) => {
|
|
20
|
+
const abortCallbackResult = this.abortCallback();
|
|
21
|
+
if (isPromise(abortCallbackResult)) {
|
|
22
|
+
void abortCallbackResult.then((res) => res && context.controller?.abort());
|
|
23
|
+
}
|
|
24
|
+
else if (abortCallbackResult) {
|
|
25
|
+
context.controller?.abort();
|
|
26
|
+
}
|
|
27
|
+
return fetchCall;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=abort.fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort.fetch.js","sourceRoot":"","sources":["../../../../src/plugins/abort/abort.fetch.ts"],"names":[],"mappings":"AAcA,MAAM,SAAS,GAAG,CAAC,MAAyD,EAAgD,EAAE;IAC5H,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA6CF,sCAAsC;AACtC,MAAM,OAAO,UAAU;IAErB;;;OAGG;IACH,YAAmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC/C,CAAC;IAGD,kBAAkB;IACX,IAAI,CAAC,OAA2B;QACrC,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;gBACjD,IAAI,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;oBACnC,KAAK,mBAAmB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;gBAC7E,CAAC;qBAAM,IAAI,mBAAmB,EAAE,CAAC;oBAC/B,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;gBAC9B,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/abort/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/abort/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/src/plugins/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export * from './abort/index';
|
|
1
2
|
export * from './additional-params/index';
|
|
2
3
|
export * from './api-configuration-override/index';
|
|
3
4
|
export * from './api-key/index';
|
|
4
5
|
export * from './bot-protection-fingerprint/index';
|
|
6
|
+
export * from './client-facts/index';
|
|
5
7
|
export * from './concurrent/index';
|
|
6
8
|
export * from './core/index';
|
|
7
|
-
export * from './client-facts/index';
|
|
8
9
|
export * from './custom-info/index';
|
|
9
10
|
export * from './exception/index';
|
|
10
11
|
export * from './fetch-cache/index';
|
|
@@ -20,7 +21,7 @@ export * from './reviver/index';
|
|
|
20
21
|
export * from './session-id/index';
|
|
21
22
|
export * from './si-token/index';
|
|
22
23
|
export * from './simple-api-key-authentication/index';
|
|
24
|
+
export * from './timeout/index';
|
|
23
25
|
export * from './url-rewrite/index';
|
|
24
26
|
export * from './wait-for/index';
|
|
25
|
-
export * from './timeout/index';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uCAAuC,CAAC;AACtD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
|
package/src/plugins/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export * from './abort/index';
|
|
1
2
|
export * from './additional-params/index';
|
|
2
3
|
export * from './api-configuration-override/index';
|
|
3
4
|
export * from './api-key/index';
|
|
4
5
|
export * from './bot-protection-fingerprint/index';
|
|
6
|
+
export * from './client-facts/index';
|
|
5
7
|
export * from './concurrent/index';
|
|
6
8
|
export * from './core/index';
|
|
7
|
-
export * from './client-facts/index';
|
|
8
9
|
export * from './custom-info/index';
|
|
9
10
|
export * from './exception/index';
|
|
10
11
|
export * from './fetch-cache/index';
|
|
@@ -20,7 +21,7 @@ export * from './reviver/index';
|
|
|
20
21
|
export * from './session-id/index';
|
|
21
22
|
export * from './si-token/index';
|
|
22
23
|
export * from './simple-api-key-authentication/index';
|
|
24
|
+
export * from './timeout/index';
|
|
23
25
|
export * from './url-rewrite/index';
|
|
24
26
|
export * from './wait-for/index';
|
|
25
|
-
export * from './timeout/index';
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
package/src/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAA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