@forge/util
2.0.12.0.1-experimental-7890858
packages/ari/chunk-6TESFTPS.mjs+
packages/ari/chunk-6TESFTPS.mjsNew file+71
Index: package/packages/ari/chunk-6TESFTPS.mjs
===================================================================
--- package/packages/ari/chunk-6TESFTPS.mjs
+++ package/packages/ari/chunk-6TESFTPS.mjs
@@ -0,0 +1,71 @@
+import {
+ BeaconCustomDetectionAriResourceOwner,
+ BeaconCustomDetectionAriResourceType
+} from "./chunk-6YGOGAWM.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// src/beacon/custom-detection/manifest.ts
+var beaconCustomDetectionAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+ 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\-_.~@:;{}=]+)*/
+ }
+};
+
+// 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;
+ }
+ get siteId() {
+ return this._siteId;
+ }
+ get workspaceId() {
+ return this._workspaceId;
+ }
+ get customDetectionId() {
+ return this._customDetectionId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: beaconCustomDetectionAriStaticOpts.qualifier,
+ platformQualifier: beaconCustomDetectionAriStaticOpts.platformQualifier,
+ cloudId: opts.siteId,
+ resourceOwner: beaconCustomDetectionAriStaticOpts.resourceOwner,
+ resourceType: beaconCustomDetectionAriStaticOpts.resourceType,
+ resourceId: `${opts.workspaceId}/${opts.customDetectionId}`,
+ resourceIdSegmentValues: {
+ workspaceId: opts.workspaceId,
+ customDetectionId: opts.customDetectionId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, beaconCustomDetectionAriStaticOpts);
+ return new _BeaconCustomDetectionAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, beaconCustomDetectionAriStaticOpts);
+ return new _BeaconCustomDetectionAri(opts);
+ }
+ getVariables() {
+ return {
+ siteId: this.siteId,
+ workspaceId: this.workspaceId,
+ customDetectionId: this.customDetectionId
+ };
+ }
+};
+
+export {
+ BeaconCustomDetectionAri
+};