@forge/util
2.0.1-experimental-78908582.0.1-experimental-04cc2b9
packages/ari/beacon/index.js~
packages/ari/beacon/index.jsModified+34−71
Index: package/packages/ari/beacon/index.js
===================================================================
--- package/packages/ari/beacon/index.js
+++ package/packages/ari/beacon/index.js
@@ -20,9 +20,8 @@
BeaconAlertAri: () => BeaconAlertAri,
BeaconCustomDetectionAri: () => BeaconCustomDetectionAri,
BeaconDetectionAri: () => BeaconDetectionAri,
BeaconDetectionSettingAri: () => BeaconDetectionSettingAri,
- BeaconRedactionTaskAri: () => BeaconRedactionTaskAri,
BeaconRoleAri: () => BeaconRoleAri,
BeaconSiteAri: () => BeaconSiteAri,
BeaconSubscriptionAri: () => BeaconSubscriptionAri,
BeaconWorkspaceAri: () => BeaconWorkspaceAri
@@ -290,22 +289,25 @@
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;
}
@@ -350,22 +352,25 @@
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: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+ 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
}
};
// 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;
}
@@ -410,22 +415,25 @@
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;
}
@@ -466,24 +474,29 @@
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;
}
@@ -530,88 +543,31 @@
};
}
};
-// 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;
}
@@ -647,20 +603,23 @@
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;
}
@@ -696,22 +655,25 @@
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;
}
@@ -756,8 +718,9 @@
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: {
@@ -768,9 +731,10 @@
// 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;
}
@@ -807,9 +771,8 @@
BeaconAlertAri,
BeaconCustomDetectionAri,
BeaconDetectionAri,
BeaconDetectionSettingAri,
- BeaconRedactionTaskAri,
BeaconRoleAri,
BeaconSiteAri,
BeaconSubscriptionAri,
BeaconWorkspaceAri