@forge/util

2.0.12.0.1-experimental-7890858
packages/ari/beacon/index.js
~packages/ari/beacon/index.jsModified
+71−34
Index: package/packages/ari/beacon/index.js
===================================================================
--- package/packages/ari/beacon/index.js
+++ package/packages/ari/beacon/index.js
@@ -20,8 +20,9 @@
   BeaconAlertAri: () => BeaconAlertAri,
   BeaconCustomDetectionAri: () => BeaconCustomDetectionAri,
   BeaconDetectionAri: () => BeaconDetectionAri,
   BeaconDetectionSettingAri: () => BeaconDetectionSettingAri,
+  BeaconRedactionTaskAri: () => BeaconRedactionTaskAri,
   BeaconRoleAri: () => BeaconRoleAri,
   BeaconSiteAri: () => BeaconSiteAri,
   BeaconSubscriptionAri: () => BeaconSubscriptionAri,
   BeaconWorkspaceAri: () => BeaconWorkspaceAri
@@ -289,25 +290,22 @@
 var beaconAlertAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconAlertAriResourceOwner,
   resourceType: BeaconAlertAriResourceType,
   resourceIdSlug: "{workspaceId}/{alertId}",
   resourceIdSegmentFormats: {
     workspaceId: /[a-zA-Z0-9\-]+/,
     // eslint-disable-line no-useless-escape
     alertId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/alert/index.ts
 var BeaconAlertAri = class _BeaconAlertAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._alertId = opts.resourceIdSegmentValues.alertId;
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._alertId = opts.resourceIdSegmentValues.alertId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -352,25 +350,22 @@
 var beaconCustomDetectionAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconCustomDetectionAriResourceOwner,
   resourceType: BeaconCustomDetectionAriResourceType,
   resourceIdSlug: "{workspaceId}/{customDetectionId}",
   resourceIdSegmentFormats: {
     workspaceId: /[a-zA-Z0-9\-]+/,
     // eslint-disable-line no-useless-escape
-    customDetectionId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
-    // eslint-disable-line no-useless-escape
+    customDetectionId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
   }
 };
 
 // src/beacon/custom-detection/index.ts
 var BeaconCustomDetectionAri = class _BeaconCustomDetectionAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._customDetectionId = opts.resourceIdSegmentValues.customDetectionId;
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._customDetectionId = opts.resourceIdSegmentValues.customDetectionId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -415,25 +410,22 @@
 var beaconDetectionAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconDetectionAriResourceOwner,
   resourceType: BeaconDetectionAriResourceType,
   resourceIdSlug: "{workspaceId}/{detectionId}",
   resourceIdSegmentFormats: {
     workspaceId: /[a-zA-Z0-9\-]+/,
     // eslint-disable-line no-useless-escape
     detectionId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/detection/index.ts
 var BeaconDetectionAri = class _BeaconDetectionAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._detectionId = opts.resourceIdSegmentValues.detectionId;
+    super(opts), this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._detectionId = opts.resourceIdSegmentValues.detectionId;
   }
   get workspaceId() {
     return this._workspaceId;
   }
@@ -474,29 +466,24 @@
 var beaconDetectionSettingAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconDetectionSettingAriResourceOwner,
   resourceType: BeaconDetectionSettingAriResourceType,
   resourceIdSlug: "{workspaceId}/{detectionType}/{detectionId}/{settingId}",
   resourceIdSegmentFormats: {
     workspaceId: /[a-zA-Z0-9\-]+/,
     // eslint-disable-line no-useless-escape
     detectionType: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
-    // eslint-disable-line no-useless-escape
     detectionId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
-    // eslint-disable-line no-useless-escape
     settingId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/detection-setting/index.ts
 var BeaconDetectionSettingAri = class _BeaconDetectionSettingAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._detectionType = opts.resourceIdSegmentValues.detectionType, this._detectionId = opts.resourceIdSegmentValues.detectionId, this._settingId = opts.resourceIdSegmentValues.settingId;
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._detectionType = opts.resourceIdSegmentValues.detectionType, this._detectionId = opts.resourceIdSegmentValues.detectionId, this._settingId = opts.resourceIdSegmentValues.settingId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -543,31 +530,88 @@
     };
   }
 };
 
+// src/beacon/redaction-task/types.ts
+var BeaconRedactionTaskAriResourceOwner = "beacon", BeaconRedactionTaskAriResourceType = "redaction-task";
+
+// src/beacon/redaction-task/manifest.ts
+var beaconRedactionTaskAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "cloud",
+  cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+  resourceOwner: BeaconRedactionTaskAriResourceOwner,
+  resourceType: BeaconRedactionTaskAriResourceType,
+  resourceIdSlug: "{workspaceId}/{redactionTaskId}",
+  resourceIdSegmentFormats: {
+    workspaceId: /[a-zA-Z0-9\-]+/,
+    // eslint-disable-line no-useless-escape
+    redactionTaskId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+  }
+};
+
+// src/beacon/redaction-task/index.ts
+var BeaconRedactionTaskAri = class _BeaconRedactionTaskAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._redactionTaskId = opts.resourceIdSegmentValues.redactionTaskId;
+  }
+  get siteId() {
+    return this._siteId;
+  }
+  get workspaceId() {
+    return this._workspaceId;
+  }
+  get redactionTaskId() {
+    return this._redactionTaskId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: beaconRedactionTaskAriStaticOpts.qualifier,
+      platformQualifier: beaconRedactionTaskAriStaticOpts.platformQualifier,
+      cloudId: opts.siteId,
+      resourceOwner: beaconRedactionTaskAriStaticOpts.resourceOwner,
+      resourceType: beaconRedactionTaskAriStaticOpts.resourceType,
+      resourceId: `${opts.workspaceId}/${opts.redactionTaskId}`,
+      resourceIdSegmentValues: {
+        workspaceId: opts.workspaceId,
+        redactionTaskId: opts.redactionTaskId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, beaconRedactionTaskAriStaticOpts);
+    return new _BeaconRedactionTaskAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, beaconRedactionTaskAriStaticOpts);
+    return new _BeaconRedactionTaskAri(opts);
+  }
+  getVariables() {
+    return {
+      siteId: this.siteId,
+      workspaceId: this.workspaceId,
+      redactionTaskId: this.redactionTaskId
+    };
+  }
+};
+
 // src/beacon/role/types.ts
 var BeaconRoleAriResourceOwner = "beacon", BeaconRoleAriResourceType = "role";
 
 // src/beacon/role/manifest.ts
 var beaconRoleAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconRoleAriResourceOwner,
   resourceType: BeaconRoleAriResourceType,
   resourceIdSlug: "product/{roleType}",
   resourceIdSegmentFormats: {
     roleType: /(?:member|admin)/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/role/index.ts
 var BeaconRoleAri = class _BeaconRoleAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._roleType = opts.resourceIdSegmentValues.roleType;
+    super(opts), this._roleType = opts.resourceIdSegmentValues.roleType;
   }
   get roleType() {
     return this._roleType;
   }
@@ -603,23 +647,20 @@
 var beaconSiteAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconSiteAriResourceOwner,
   resourceType: BeaconSiteAriResourceType,
   resourceIdSlug: "{siteId}",
   resourceIdSegmentFormats: {
     siteId: /[a-zA-Z0-9_\-.]{1,255}/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/site/index.ts
 var BeaconSiteAri = class _BeaconSiteAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.resourceIdSegmentValues.siteId;
+    super(opts), this._siteId = opts.resourceIdSegmentValues.siteId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -655,25 +696,22 @@
 var beaconSubscriptionAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconSubscriptionAriResourceOwner,
   resourceType: BeaconSubscriptionAriResourceType,
   resourceIdSlug: "{workspaceId}/{subscriptionId}",
   resourceIdSegmentFormats: {
     workspaceId: /[a-zA-Z0-9\-]+/,
     // eslint-disable-line no-useless-escape
     subscriptionId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
-    // eslint-disable-line no-useless-escape
   }
 };
 
 // src/beacon/subscription/index.ts
 var BeaconSubscriptionAri = class _BeaconSubscriptionAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._subscriptionId = opts.resourceIdSegmentValues.subscriptionId;
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId, this._subscriptionId = opts.resourceIdSegmentValues.subscriptionId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -718,9 +756,8 @@
 var beaconWorkspaceAriStaticOpts = {
   qualifier: "ari",
   platformQualifier: "cloud",
   cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
-  // eslint-disable-line no-useless-escape
   resourceOwner: BeaconWorkspaceAriResourceOwner,
   resourceType: BeaconWorkspaceAriResourceType,
   resourceIdSlug: "{workspaceId}",
   resourceIdSegmentFormats: {
@@ -731,10 +768,9 @@
 
 // src/beacon/workspace/index.ts
 var BeaconWorkspaceAri = class _BeaconWorkspaceAri extends RegisteredAri {
   constructor(opts) {
-    super(opts);
-    this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId;
+    super(opts), this._siteId = opts.cloudId || "", this._workspaceId = opts.resourceIdSegmentValues.workspaceId;
   }
   get siteId() {
     return this._siteId;
   }
@@ -771,8 +807,9 @@
   BeaconAlertAri,
   BeaconCustomDetectionAri,
   BeaconDetectionAri,
   BeaconDetectionSettingAri,
+  BeaconRedactionTaskAri,
   BeaconRoleAri,
   BeaconSiteAri,
   BeaconSubscriptionAri,
   BeaconWorkspaceAri