@c8y/client 1019.22.0 → 1019.23.4

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.
@@ -7012,6 +7012,34 @@
7012
7012
  return tfaSettings;
7013
7013
  });
7014
7014
  }
7015
+ /**
7016
+ * Update TFA strategy for tenant.
7017
+ *
7018
+ * @param tenant The tenant object.
7019
+ * @param tfaStrategy The TFA strategy.
7020
+ *
7021
+ * @returns Returns promise object that is resolved with the IResult.
7022
+ *
7023
+ * **Example**
7024
+ * ```typescript
7025
+ * (async () => {
7026
+ * const currentTenant = (await tenantService.current()).data;
7027
+ *
7028
+ * const res = await tenantService.updateTfaStrategy(currentTenant, TfaStrategy.TOTP);
7029
+ * })();
7030
+ * ```
7031
+ */
7032
+ updateTfaStrategy(tenant, tfaStrategy) {
7033
+ return __awaiter(this, void 0, void 0, function* () {
7034
+ const entityOrId = this.getIdString(tenant);
7035
+ const url = `tenants/${entityOrId}/tfa`;
7036
+ const method = 'PUT';
7037
+ const body = JSON.stringify({ strategy: tfaStrategy });
7038
+ const headers = { 'content-type': 'application/json', accept: 'application/json' };
7039
+ const res = yield this.fetch(url, { method, body, headers });
7040
+ return { res, data: null };
7041
+ });
7042
+ }
7015
7043
  /**
7016
7044
  * Subscribes a given application to a given tenant.
7017
7045
  *