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