@ama-sdk/client-beacon 12.5.0-prerelease.6 → 12.5.0-prerelease.61
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/cjs/api-beacon-client.js +27 -25
- package/esm2015/api-beacon-client.js +27 -25
- package/package.json +19 -15
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +13 -11
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/migration/import-map.js.map +1 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/src/api-beacon-client.d.ts.map +1 -1
- package/src/api-beacon-client.js +13 -9
- package/src/api-beacon-client.js.map +1 -1
package/cjs/api-beacon-client.js
CHANGED
@@ -139,34 +139,36 @@ var ApiBeaconClient = /*#__PURE__*/ function() {
|
|
139
139
|
headers: new Headers((0, _core.filterUndefinedValues)(options.headers)),
|
140
140
|
queryParams: (0, _core.filterUndefinedValues)(options.queryParams)
|
141
141
|
});
|
142
|
-
|
143
|
-
|
142
|
+
var requestPlugins = typeof this.options.requestPlugins === 'function' ? this.options.requestPlugins(opts) : this.options.requestPlugins;
|
143
|
+
if (isPromise(requestPlugins)) {
|
144
|
+
throw new Error('Only a synchronous function is supported to return the list of Request Plugin for this Client');
|
145
|
+
}
|
146
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
147
|
+
try {
|
148
|
+
for(var _iterator = requestPlugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
149
|
+
var plugin = _step.value;
|
150
|
+
var _options_api;
|
151
|
+
var changedOpt = plugin.load({
|
152
|
+
logger: this.options.logger,
|
153
|
+
apiName: (_options_api = options.api) === null || _options_api === void 0 ? void 0 : _options_api.apiName
|
154
|
+
}).transform(opts);
|
155
|
+
if (isPromise(changedOpt)) {
|
156
|
+
throw new Error("Request plugin ".concat(plugin.constructor.name, " has async transform method. Only sync methods are supported with the Beacon client."));
|
157
|
+
} else {
|
158
|
+
opts = changedOpt;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
} catch (err) {
|
162
|
+
_didIteratorError = true;
|
163
|
+
_iteratorError = err;
|
164
|
+
} finally{
|
144
165
|
try {
|
145
|
-
|
146
|
-
|
147
|
-
var _options_api;
|
148
|
-
var changedOpt = plugin.load({
|
149
|
-
logger: this.options.logger,
|
150
|
-
apiName: (_options_api = options.api) === null || _options_api === void 0 ? void 0 : _options_api.apiName
|
151
|
-
}).transform(opts);
|
152
|
-
if (isPromise(changedOpt)) {
|
153
|
-
throw new Error("Request plugin ".concat(plugin.constructor.name, " has async transform method. Only sync methods are supported with the Beacon client."));
|
154
|
-
} else {
|
155
|
-
opts = changedOpt;
|
156
|
-
}
|
166
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
167
|
+
_iterator.return();
|
157
168
|
}
|
158
|
-
} catch (err) {
|
159
|
-
_didIteratorError = true;
|
160
|
-
_iteratorError = err;
|
161
169
|
} finally{
|
162
|
-
|
163
|
-
|
164
|
-
_iterator.return();
|
165
|
-
}
|
166
|
-
} finally{
|
167
|
-
if (_didIteratorError) {
|
168
|
-
throw _iteratorError;
|
169
|
-
}
|
170
|
+
if (_didIteratorError) {
|
171
|
+
throw _iteratorError;
|
170
172
|
}
|
171
173
|
}
|
172
174
|
}
|
@@ -132,34 +132,36 @@ var isPromise = function(value) {
|
|
132
132
|
headers: new Headers(filterUndefinedValues(options.headers)),
|
133
133
|
queryParams: filterUndefinedValues(options.queryParams)
|
134
134
|
});
|
135
|
-
|
136
|
-
|
135
|
+
var requestPlugins = typeof this.options.requestPlugins === 'function' ? this.options.requestPlugins(opts) : this.options.requestPlugins;
|
136
|
+
if (isPromise(requestPlugins)) {
|
137
|
+
throw new Error('Only a synchronous function is supported to return the list of Request Plugin for this Client');
|
138
|
+
}
|
139
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
140
|
+
try {
|
141
|
+
for(var _iterator = requestPlugins[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
142
|
+
var plugin = _step.value;
|
143
|
+
var _options_api;
|
144
|
+
var changedOpt = plugin.load({
|
145
|
+
logger: this.options.logger,
|
146
|
+
apiName: (_options_api = options.api) === null || _options_api === void 0 ? void 0 : _options_api.apiName
|
147
|
+
}).transform(opts);
|
148
|
+
if (isPromise(changedOpt)) {
|
149
|
+
throw new Error("Request plugin ".concat(plugin.constructor.name, " has async transform method. Only sync methods are supported with the Beacon client."));
|
150
|
+
} else {
|
151
|
+
opts = changedOpt;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
} catch (err) {
|
155
|
+
_didIteratorError = true;
|
156
|
+
_iteratorError = err;
|
157
|
+
} finally{
|
137
158
|
try {
|
138
|
-
|
139
|
-
|
140
|
-
var _options_api;
|
141
|
-
var changedOpt = plugin.load({
|
142
|
-
logger: this.options.logger,
|
143
|
-
apiName: (_options_api = options.api) === null || _options_api === void 0 ? void 0 : _options_api.apiName
|
144
|
-
}).transform(opts);
|
145
|
-
if (isPromise(changedOpt)) {
|
146
|
-
throw new Error("Request plugin ".concat(plugin.constructor.name, " has async transform method. Only sync methods are supported with the Beacon client."));
|
147
|
-
} else {
|
148
|
-
opts = changedOpt;
|
149
|
-
}
|
159
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
160
|
+
_iterator.return();
|
150
161
|
}
|
151
|
-
} catch (err) {
|
152
|
-
_didIteratorError = true;
|
153
|
-
_iteratorError = err;
|
154
162
|
} finally{
|
155
|
-
|
156
|
-
|
157
|
-
_iterator.return();
|
158
|
-
}
|
159
|
-
} finally{
|
160
|
-
if (_didIteratorError) {
|
161
|
-
throw _iteratorError;
|
162
|
-
}
|
163
|
+
if (_didIteratorError) {
|
164
|
+
throw _iteratorError;
|
163
165
|
}
|
164
166
|
}
|
165
167
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ama-sdk/client-beacon",
|
3
|
-
"version": "12.5.0-prerelease.
|
3
|
+
"version": "12.5.0-prerelease.61",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -38,18 +38,19 @@
|
|
38
38
|
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
41
|
+
"@o3r/schematics": "^12.5.0-prerelease.61",
|
42
42
|
"@swc/helpers": "~0.5.0",
|
43
43
|
"tslib": "^2.6.2",
|
44
44
|
"uuid": "^11.0.5"
|
45
45
|
},
|
46
46
|
"peerDependencies": {
|
47
|
-
"@ama-sdk/core": "^12.5.0-prerelease.
|
47
|
+
"@ama-sdk/core": "^12.5.0-prerelease.61",
|
48
48
|
"@angular-devkit/schematics": "^19.0.0",
|
49
49
|
"@angular/cli": "^19.0.0",
|
50
50
|
"@angular/common": "^19.0.0",
|
51
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
51
|
+
"@o3r/schematics": "^12.5.0-prerelease.61",
|
52
52
|
"@schematics/angular": "^19.0.0",
|
53
|
+
"type-fest": "^4.30.1",
|
53
54
|
"typescript": "^5.5.4"
|
54
55
|
},
|
55
56
|
"peerDependenciesMeta": {
|
@@ -68,12 +69,15 @@
|
|
68
69
|
"@schematics/angular": {
|
69
70
|
"optional": true
|
70
71
|
},
|
72
|
+
"type-fest": {
|
73
|
+
"optional": true
|
74
|
+
},
|
71
75
|
"typescript": {
|
72
76
|
"optional": true
|
73
77
|
}
|
74
78
|
},
|
75
79
|
"devDependencies": {
|
76
|
-
"@ama-sdk/core": "^12.5.0-prerelease.
|
80
|
+
"@ama-sdk/core": "^12.5.0-prerelease.61",
|
77
81
|
"@angular-devkit/core": "~19.2.0",
|
78
82
|
"@angular-devkit/schematics": "~19.2.0",
|
79
83
|
"@angular/common": "~19.2.0",
|
@@ -81,9 +85,9 @@
|
|
81
85
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
82
86
|
"@nx/eslint-plugin": "~20.8.0",
|
83
87
|
"@nx/jest": "~20.8.0",
|
84
|
-
"@o3r/build-helpers": "^12.5.0-prerelease.
|
85
|
-
"@o3r/eslint-plugin": "^12.5.0-prerelease.
|
86
|
-
"@o3r/test-helpers": "^12.5.0-prerelease.
|
88
|
+
"@o3r/build-helpers": "^12.5.0-prerelease.61",
|
89
|
+
"@o3r/eslint-plugin": "^12.5.0-prerelease.61",
|
90
|
+
"@o3r/test-helpers": "^12.5.0-prerelease.61",
|
87
91
|
"@schematics/angular": "~19.2.0",
|
88
92
|
"@stylistic/eslint-plugin": "~3.1.0",
|
89
93
|
"@stylistic/eslint-plugin-ts": "~3.1.0",
|
@@ -91,33 +95,33 @@
|
|
91
95
|
"@swc/core": "~1.12.0",
|
92
96
|
"@types/jest": "~29.5.2",
|
93
97
|
"@types/node": "^20.0.0",
|
94
|
-
"@
|
95
|
-
"@typescript-eslint/parser": "~8.34.0",
|
98
|
+
"@typescript-eslint/parser": "~8.39.0",
|
96
99
|
"angular-eslint": "~19.4.0",
|
97
100
|
"cpy-cli": "^5.0.0",
|
98
|
-
"eslint": "~9.
|
101
|
+
"eslint": "~9.33.0",
|
99
102
|
"eslint-import-resolver-node": "~0.3.9",
|
100
103
|
"eslint-import-resolver-typescript": "~3.10.0",
|
101
|
-
"eslint-plugin-import": "~2.
|
104
|
+
"eslint-plugin-import": "~2.32.0",
|
102
105
|
"eslint-plugin-import-newlines": "~1.4.0",
|
103
|
-
"eslint-plugin-jest": "~28.
|
106
|
+
"eslint-plugin-jest": "~28.14.0",
|
104
107
|
"eslint-plugin-jsdoc": "~50.8.0",
|
105
108
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
106
109
|
"eslint-plugin-unicorn": "~56.0.0",
|
107
110
|
"eslint-plugin-unused-imports": "~4.1.4",
|
108
111
|
"jest": "~29.7.0",
|
109
112
|
"jest-junit": "~16.0.0",
|
113
|
+
"jest-util": "~29.7.0",
|
110
114
|
"jsonc-eslint-parser": "~2.4.0",
|
111
115
|
"minimist": "^1.2.6",
|
112
116
|
"pid-from-port": "^1.1.3",
|
113
117
|
"rimraf": "^6.0.1",
|
114
118
|
"rxjs": "^7.8.1",
|
115
119
|
"semver": "^7.5.2",
|
116
|
-
"ts-jest": "~29.
|
120
|
+
"ts-jest": "~29.4.0",
|
117
121
|
"ts-node": "~10.9.2",
|
118
122
|
"type-fest": "^4.30.1",
|
119
123
|
"typescript": "~5.8.2",
|
120
|
-
"typescript-eslint": "~8.
|
124
|
+
"typescript-eslint": "~8.39.0",
|
121
125
|
"zone.js": "~0.15.0"
|
122
126
|
},
|
123
127
|
"engines": {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAyDlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
@@ -4,9 +4,9 @@ exports.ngAdd = void 0;
|
|
4
4
|
const path = require("node:path");
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
6
6
|
const schematics_2 = require("@o3r/schematics");
|
7
|
-
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
8
7
|
const import_map_1 = require("./migration/import-map");
|
9
8
|
const devDependenciesToInstall = [];
|
9
|
+
const dependenciesToInstall = [];
|
10
10
|
/**
|
11
11
|
* Add SDk Beacon Client to an Otter Project
|
12
12
|
* @param options
|
@@ -16,6 +16,7 @@ function ngAddFn(options) {
|
|
16
16
|
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
17
17
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
18
18
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(packageJsonPath);
|
19
|
+
const projectPackageJson = tree.readJson(path.posix.join(workspaceProject?.root || '.', 'package.json'));
|
19
20
|
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
20
21
|
acc[dep] = {
|
21
22
|
inManifest: [{
|
@@ -26,22 +27,23 @@ function ngAddFn(options) {
|
|
26
27
|
};
|
27
28
|
return acc;
|
28
29
|
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
};
|
37
|
-
});
|
30
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
31
|
+
devDependenciesToInstall,
|
32
|
+
dependenciesToInstall,
|
33
|
+
o3rPackageJsonPath: packageJsonPath,
|
34
|
+
projectPackageJson,
|
35
|
+
projectType: workspaceProject?.projectType
|
36
|
+
}, context.logger);
|
38
37
|
return (0, schematics_1.chain)([
|
39
38
|
// optional custom action dedicated to this module
|
40
39
|
options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)(),
|
41
40
|
// add the missing Otter modules in the current project
|
42
41
|
(0, schematics_2.setupDependencies)({
|
43
42
|
projectName: options.projectName,
|
44
|
-
dependencies
|
43
|
+
dependencies: {
|
44
|
+
...dependencies,
|
45
|
+
...externalDependenciesInfo
|
46
|
+
},
|
45
47
|
ngAddToRun: depsInfo.o3rPeerDeps
|
46
48
|
}),
|
47
49
|
(0, schematics_2.updateImports)(import_map_1.mapMigrationFromCoreImports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C3D,CAAC;YACF,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAA,oCAAuB,EAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;QAC1G,MAAM,wBAAwB,GAAG,IAAA,wCAA2B,EAC1D;YACE,wBAAwB;YACxB,qBAAqB;YACrB,kBAAkB,EAAE,eAAe;YACnC,kBAAkB;YAClB,WAAW,EAAE,gBAAgB,EAAE,WAAW;SAC3C,EACD,OAAO,CAAC,MAAM,CACf,CAAC;QACF,OAAO,IAAA,kBAAK,EAAC;YACX,kDAAkD;YAClD,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,2BAAc,GAAE;YAC9C,uDAAuD;YACvD,IAAA,8BAAiB,EAAC;gBAChB,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,YAAY,EAAE;oBACZ,GAAG,YAAY;oBACf,GAAG,wBAAwB;iBAC5B;gBACD,UAAU,EAAE,QAAQ,CAAC,WAAW;aACjC,CAAC;YAEF,IAAA,0BAAa,EAAC,wCAA2B,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,MAAM,KAAK,GAAG,CAAC,OAA8B,EAAE,EAAE,CAAC,IAAA,iCAAoB,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AAAnF,QAAA,KAAK,SAA8E"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"import-map.js","sourceRoot":"","sources":["../../../../schematics/ng-add/migration/import-map.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE,wBAAwB;CACrC,CAAC;AAEW,QAAA,2BAA2B,GAAG;IACzC,eAAe,EAAE;QACf,4BAA4B;QAC5B,gCAAgC;QAChC,iBAAiB;KAClB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAA2C,CAAC;CAC3G,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api-beacon-client.d.ts","sourceRoot":"","sources":["../../src/api-beacon-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAcvB,gCAAgC;AAChC,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,kBAAkB;IAClB,YAAY,EAAE,KAAK,EAAE,CAAC;CACvB;AAED,8BAA8B;AAC9B,MAAM,WAAW,8BAA+B,SAAQ,aAAa,CAAC,IAAI,CAAC,0BAA0B,EAAE,cAAc,CAAC,EAAE,UAAU,CAAC;CAClI;AAgBD;;;GAGG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAC/C,kBAAkB;IACX,OAAO,EAAE,0BAA0B,CAAC;IAE3C;;;OAGG;gBACS,OAAO,EAAE,8BAA8B;IAWnD,kBAAkB;IACX,kBAAkB,CAAC,CAAC,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG;SAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;KAAG;IAIrH,kBAAkB;IACX,qBAAqB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,E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AE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,IAAI,EAAE,GAAG,GAAG,gBAAgB,GAAG,SAAS;IAI1K,kBAAkB;IACX,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;IAI9C,kBAAkB;IACX,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;CAanK"}
|
package/src/api-beacon-client.js
CHANGED
@@ -51,15 +51,19 @@ export class ApiBeaconClient {
|
|
51
51
|
headers: new Headers(filterUndefinedValues(options.headers)),
|
52
52
|
queryParams: filterUndefinedValues(options.queryParams)
|
53
53
|
};
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
54
|
+
const requestPlugins = typeof this.options.requestPlugins === 'function'
|
55
|
+
? this.options.requestPlugins(opts)
|
56
|
+
: this.options.requestPlugins;
|
57
|
+
if (isPromise(requestPlugins)) {
|
58
|
+
throw new Error('Only a synchronous function is supported to return the list of Request Plugin for this Client');
|
59
|
+
}
|
60
|
+
for (const plugin of requestPlugins) {
|
61
|
+
const changedOpt = plugin.load({ logger: this.options.logger, apiName: options.api?.apiName }).transform(opts);
|
62
|
+
if (isPromise(changedOpt)) {
|
63
|
+
throw new Error(`Request plugin ${plugin.constructor.name} has async transform method. Only sync methods are supported with the Beacon client.`);
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
opts = changedOpt;
|
63
67
|
}
|
64
68
|
}
|
65
69
|
return Promise.resolve(opts);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api-beacon-client.js","sourceRoot":"","sources":["../../src/api-beacon-client.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAYvB,MAAM,eAAe,GAAG;IACtB,YAAY,EAAE,EAAa;IAC3B,cAAc,EAAE,EAAE;IAClB,kBAAkB,EAAE,KAAK;IACzB,4BAA4B,EAAE,KAAK;CAC4B,CAAC;AAElE;;;GAGG;AACH,yIAAyI;AACzI,MAAM,SAAS,GAAG,CAAoB,KAAqB,EAAuB,EAAE,CAAC,KAAK,YAAY,OAAO,CAAC;AAE9G;;;GAGG;AACH,MAAM,OAAO,eAAe;IAI1B;;;OAGG;IACH,YAAY,OAAuC;QACjD,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,eAAe;YAClB,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;IAED,kBAAkB;IACX,kBAAkB,CAAmC,IAAO,EAAE,KAAkB;QACrF,OAAO,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,kBAAkB;IACX,qBAAqB,CAAuB,IAAO,EAAE,IAAS;QACnE,OAAO,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,kBAAkB;IACX,oBAAoB,CAAkD,WAAc;QACzF,OAAO,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,kBAAkB;IACX,iBAAiB,CAAC,OAAiC;QACxD,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,KAA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