@c8y/client 1018.0.147 → 1018.0.151

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.
@@ -8027,13 +8027,24 @@
8027
8027
  return _super.create.call(this, entity);
8028
8028
  });
8029
8029
  }
8030
- clone(entity) {
8030
+ /**
8031
+ * Clones a given application. The application name, key, and context-path will be
8032
+ * prefixed with `clone` and if necessary a number.
8033
+ * @param entity The application to clone.
8034
+ * @param version If a blueprint, you can define which version to clone. If not provided, it will always clone the latest version.
8035
+ * @returns The application entity.
8036
+ */
8037
+ clone(entity, version) {
8031
8038
  return __awaiter$f(this, void 0, void 0, function* () {
8032
8039
  const url = `${this.getDetailUrl(entity)}/clone`;
8033
8040
  const method = 'POST';
8034
8041
  const body = '';
8035
8042
  const headers = { 'content-type': 'application/json', accept: 'application/json' };
8036
- const res = yield this.fetch(url, { method, body, headers });
8043
+ let params = undefined;
8044
+ if (version) {
8045
+ params = { version };
8046
+ }
8047
+ const res = yield this.fetch(url, { method, body, headers, params });
8037
8048
  const data = yield res.json();
8038
8049
  return { res, data };
8039
8050
  });