@c8y/client 1018.486.4 → 1018.487.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundles/client.umd.js +13 -2
- package/lib/bundles/client.umd.js.map +1 -1
- package/lib/bundles/client.umd.min.js +1 -1
- package/lib/bundles/client.umd.min.js.map +1 -1
- package/lib/cjs/src/application/ApplicationService.js +13 -2
- package/lib/cjs/src/application/ApplicationService.js.map +1 -1
- package/lib/esm2015/src/application/ApplicationService.js +13 -2
- package/lib/esm2015/src/application/ApplicationService.js.map +1 -1
- package/lib/src/application/ApplicationService.d.ts +8 -1
- package/package.json +1 -1
|
@@ -8139,13 +8139,24 @@
|
|
|
8139
8139
|
return _super.create.call(this, entity);
|
|
8140
8140
|
});
|
|
8141
8141
|
}
|
|
8142
|
-
|
|
8142
|
+
/**
|
|
8143
|
+
* Clones a given application. The application name, key, and context-path will be
|
|
8144
|
+
* prefixed with `clone` and if necessary a number.
|
|
8145
|
+
* @param entity The application to clone.
|
|
8146
|
+
* @param version If a blueprint, you can define which version to clone. If not provided, it will always clone the latest version.
|
|
8147
|
+
* @returns The application entity.
|
|
8148
|
+
*/
|
|
8149
|
+
clone(entity, version) {
|
|
8143
8150
|
return __awaiter$f(this, void 0, void 0, function* () {
|
|
8144
8151
|
const url = `${this.getDetailUrl(entity)}/clone`;
|
|
8145
8152
|
const method = 'POST';
|
|
8146
8153
|
const body = '';
|
|
8147
8154
|
const headers = { 'content-type': 'application/json', accept: 'application/json' };
|
|
8148
|
-
|
|
8155
|
+
let params = undefined;
|
|
8156
|
+
if (version) {
|
|
8157
|
+
params = { version };
|
|
8158
|
+
}
|
|
8159
|
+
const res = yield this.fetch(url, { method, body, headers, params });
|
|
8149
8160
|
const data = yield res.json();
|
|
8150
8161
|
return { res, data };
|
|
8151
8162
|
});
|