@owbase/node 2.0.3 → 2.1.0

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.
@@ -10,7 +10,7 @@ class Project {
10
10
  * Get a project.
11
11
  *
12
12
  * @throws {OwbaseException}
13
- * @returns {Promise<Models.Project>}
13
+ * @returns {Promise<Models.Project<Preferences>>}
14
14
  */
15
15
  get() {
16
16
  const apiPath = "/project";
@@ -2876,6 +2876,32 @@ class Project {
2876
2876
  };
2877
2877
  return this.client.call("patch", uri, apiHeaders, apiPayload);
2878
2878
  }
2879
+ updateDenyRealtimeGuestsPolicy(paramsOrFirst) {
2880
+ let params;
2881
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
2882
+ params = paramsOrFirst || {};
2883
+ } else {
2884
+ params = {
2885
+ enabled: paramsOrFirst
2886
+ };
2887
+ }
2888
+ const enabled = params.enabled;
2889
+ if (typeof enabled === "undefined") {
2890
+ throw new client.OwbaseException('Missing required parameter: "enabled"');
2891
+ }
2892
+ const apiPath = "/project/policies/deny-realtime-guests";
2893
+ const apiPayload = {};
2894
+ if (typeof enabled !== "undefined") {
2895
+ apiPayload["enabled"] = enabled;
2896
+ }
2897
+ const uri = new URL(this.client.config.endpoint + apiPath);
2898
+ const apiHeaders = {
2899
+ "X-Owbase-Project": this.client.config.project,
2900
+ "content-type": "application/json",
2901
+ accept: "application/json"
2902
+ };
2903
+ return this.client.call("patch", uri, apiHeaders, apiPayload);
2904
+ }
2879
2905
  updateMembershipPrivacyPolicy(paramsOrFirst, ...rest) {
2880
2906
  let params;
2881
2907
  if (typeof paramsOrFirst === "undefined" && rest.length === 0 || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -3335,6 +3361,48 @@ class Project {
3335
3361
  };
3336
3362
  return this.client.call("get", uri, apiHeaders, apiPayload);
3337
3363
  }
3364
+ /**
3365
+ * Get the project preferences. Preferences are a key-value object stored on the project for anyone working on it.
3366
+ *
3367
+ * @throws {OwbaseException}
3368
+ * @returns {Promise<Preferences>}
3369
+ */
3370
+ getPrefs() {
3371
+ const apiPath = "/project/prefs";
3372
+ const apiPayload = {};
3373
+ const uri = new URL(this.client.config.endpoint + apiPath);
3374
+ const apiHeaders = {
3375
+ "X-Owbase-Project": this.client.config.project,
3376
+ accept: "application/json"
3377
+ };
3378
+ return this.client.call("get", uri, apiHeaders, apiPayload);
3379
+ }
3380
+ updatePrefs(paramsOrFirst) {
3381
+ let params;
3382
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "prefs" in paramsOrFirst) {
3383
+ params = paramsOrFirst || {};
3384
+ } else {
3385
+ params = {
3386
+ prefs: paramsOrFirst
3387
+ };
3388
+ }
3389
+ const prefs = params.prefs;
3390
+ if (typeof prefs === "undefined") {
3391
+ throw new client.OwbaseException('Missing required parameter: "prefs"');
3392
+ }
3393
+ const apiPath = "/project/prefs";
3394
+ const apiPayload = {};
3395
+ if (typeof prefs !== "undefined") {
3396
+ apiPayload["prefs"] = prefs;
3397
+ }
3398
+ const uri = new URL(this.client.config.endpoint + apiPath);
3399
+ const apiHeaders = {
3400
+ "X-Owbase-Project": this.client.config.project,
3401
+ "content-type": "application/json",
3402
+ accept: "application/json"
3403
+ };
3404
+ return this.client.call("put", uri, apiHeaders, apiPayload);
3405
+ }
3338
3406
  updateProtocol(paramsOrFirst, ...rest) {
3339
3407
  let params;
3340
3408
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("protocolId" in paramsOrFirst || "enabled" in paramsOrFirst)) {
@@ -3407,6 +3475,23 @@ class Project {
3407
3475
  };
3408
3476
  return this.client.call("patch", uri, apiHeaders, apiPayload);
3409
3477
  }
3478
+ /**
3479
+ * Delete all sessions in the project. Any session created before this request will be invalidated immediately: users will be signed out of every active client (web, mobile, server SDKs, JWTs), and will be able to sign in again afterwards. API keys are not affected by this action.
3480
+ *
3481
+ * @throws {OwbaseException}
3482
+ * @returns {Promise<{}>}
3483
+ */
3484
+ deleteSessions() {
3485
+ const apiPath = "/project/sessions";
3486
+ const apiPayload = {};
3487
+ const uri = new URL(this.client.config.endpoint + apiPath);
3488
+ const apiHeaders = {
3489
+ "X-Owbase-Project": this.client.config.project,
3490
+ "content-type": "application/json",
3491
+ accept: "application/json"
3492
+ };
3493
+ return this.client.call("delete", uri, apiHeaders, apiPayload);
3494
+ }
3410
3495
  updateSMTP(paramsOrFirst, ...rest) {
3411
3496
  let params;
3412
3497
  if (typeof paramsOrFirst === "undefined" && rest.length === 0 || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {