npm package diff

Package: @forge/util

Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31

File: package/packages/ari/github.github/index.js

Index: package/packages/ari/github.github/index.js
===================================================================
--- package/packages/ari/github.github/index.js
+++ package/packages/ari/github.github/index.js
@@ -0,0 +1,820 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+  for (var name in all)
+    __defProp(target, name, { get: all[name], enumerable: !0 });
+}, __copyProps = (to, from, except, desc) => {
+  if (from && typeof from == "object" || typeof from == "function")
+    for (let key of __getOwnPropNames(from))
+      !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+  return to;
+};
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
+
+// src/github.github/index.ts
+var github_exports = {};
+__export(github_exports, {
+  GithubGithubBranchAri: () => GithubGithubBranchAri,
+  GithubGithubBuildAri: () => GithubGithubBuildAri,
+  GithubGithubCommentAri: () => GithubGithubCommentAri,
+  GithubGithubCommitAri: () => GithubGithubCommitAri,
+  GithubGithubDeploymentAri: () => GithubGithubDeploymentAri,
+  GithubGithubPullRequestAri: () => GithubGithubPullRequestAri,
+  GithubGithubRemoteLinkAri: () => GithubGithubRemoteLinkAri,
+  GithubGithubRepositoryAri: () => GithubGithubRepositoryAri,
+  GithubGithubVulnerabilityAri: () => GithubGithubVulnerabilityAri
+});
+module.exports = __toCommonJS(github_exports);
+
+// src/errors.ts
+var ValidationError = class extends Error {
+};
+
+// src/core/rules/cloud-id.ts
+function validateCloudId(cloudId, format = new RegExp("^[a-zA-Z0-9_\\-.]{0,255}$")) {
+  if (!cloudId.match(format))
+    throw new ValidationError(`Invalid cloud ID, expected ID of format ${format}.`);
+}
+
+// src/core/rules/platform-qualifier.ts
+function validatePlatformQualifier(qualifier) {
+  if (qualifier !== "cloud" && qualifier !== "third-party")
+    throw new ValidationError(`Identifier must have a qualifier of 'cloud' or 'third-party'. Received: ${qualifier}`);
+}
+
+// src/core/rules/qualifier.ts
+function validateAtiQualifier(qualifier) {
+  if (qualifier !== "ati")
+    throw new ValidationError(`ATI must have a qualifier of 'ati'. Received: ${qualifier}`);
+}
+function validateAriQualifier(qualifier) {
+  if (qualifier !== "ari")
+    throw new ValidationError(`ARI must have a qualifier of 'ari'. Received: ${qualifier}`);
+}
+
+// src/core/rules/resource-id.ts
+function validateResourceId(id, format = new RegExp("[!a-zA-Z0-9\\-_.~@:;{}=]+(/[!a-zA-Z0-9\\-_.~@:;{}=]+)*" /* ANY_RESOURCE_ID */), key = "resourceId") {
+  let formatWithCarets = new RegExp(`^${format.source}$`);
+  if (!id.match(formatWithCarets))
+    throw new ValidationError(`Invalid ${key} - ${id}, expected ID of format ${formatWithCarets}.`);
+}
+
+// src/core/rules/resource-id-segments.ts
+function validateResourceIdSegments(resourceIdSegmentValues, resourceIdSegmentFormats) {
+  Object.entries(resourceIdSegmentValues).forEach(([resourceIdKey, resourceIdValue]) => {
+    validateResourceId(resourceIdValue, resourceIdSegmentFormats == null ? void 0 : resourceIdSegmentFormats[resourceIdKey], resourceIdKey);
+  });
+}
+
+// src/core/rules/resource-owner.ts
+function validateResourceOwner(owner, expectedResourceOwner) {
+  if (expectedResourceOwner && owner !== expectedResourceOwner)
+    throw new ValidationError(`Invalid resource owner - ${owner}, expected ${expectedResourceOwner}.`);
+}
+
+// src/core/rules/resource-type.ts
+function validateResourceType(type, expectedResourceType) {
+  if (expectedResourceType && type !== expectedResourceType)
+    throw new ValidationError(`Invalid resource type - ${type}, expected ${expectedResourceType}.`);
+}
+
+// src/core/parser/base.ts
+var NUMBER_OF_BASE_SEGMENTS = 5, SEGMENT_SEPARATOR = ":", BaseParser = class {
+  static getIdentifierSegments(inputStr, numberOfSegmentsRequired) {
+    let allSegments = inputStr.split(SEGMENT_SEPARATOR);
+    if (allSegments.length < numberOfSegmentsRequired)
+      throw new ValidationError(`Input string must have ${numberOfSegmentsRequired} segments.`);
+    if (allSegments.length > numberOfSegmentsRequired) {
+      let segments = allSegments.slice(0, NUMBER_OF_BASE_SEGMENTS - 1), segmentsForResourceId = allSegments.slice(NUMBER_OF_BASE_SEGMENTS - 1, allSegments.length);
+      return [...segments, segmentsForResourceId.join(SEGMENT_SEPARATOR)];
+    }
+    return allSegments;
+  }
+};
+
+// src/core/parser/ari.ts
+var NUMBER_OF_ARI_SEGMENTS = 5, AriParser = class extends BaseParser {
+  static fromString(maybeAri, ariProperties) {
+    let segments = this.getIdentifierSegments(maybeAri, NUMBER_OF_ARI_SEGMENTS), [qualifier, platformQualifier, resourceOwner, cloudId, resourceTypeAndId] = segments, [resourceType, ...resourceIdSegments] = resourceTypeAndId.split("/"), maybeAriDerivedProperties = {
+      qualifier,
+      platformQualifier,
+      cloudId,
+      resourceOwner,
+      resourceType,
+      resourceId: resourceIdSegments.join("/"),
+      resourceIdSegmentValues: ariProperties != null && ariProperties.resourceIdSlug ? this.ariSegmentValuesFromSlug(
+        ariProperties.resourceIdSlug,
+        resourceIdSegments.join("/"),
+        Object.keys(ariProperties.resourceIdSegmentFormats)
+      ) : {}
+    };
+    return this.fromOpts(maybeAriDerivedProperties, ariProperties);
+  }
+  static fromOpts(maybeAriOpts, ariProperties) {
+    let {
+      qualifier = "ari",
+      platformQualifier = "cloud",
+      resourceOwner,
+      cloudId,
+      resourceId,
+      resourceIdSegmentValues,
+      resourceType
+    } = maybeAriOpts;
+    return validateAriQualifier(qualifier), validatePlatformQualifier(platformQualifier), validateCloudId(maybeAriOpts.cloudId || "", ariProperties == null ? void 0 : ariProperties.cloudId), validateResourceOwner(resourceOwner, ariProperties == null ? void 0 : ariProperties.resourceOwner), validateResourceType(resourceType, ariProperties == null ? void 0 : ariProperties.resourceType), validateResourceIdSegments(resourceIdSegmentValues, ariProperties == null ? void 0 : ariProperties.resourceIdSegmentFormats), {
+      qualifier,
+      resourceOwner,
+      resourceType,
+      platformQualifier,
+      cloudId,
+      resourceId,
+      resourceIdSegmentValues
+    };
+  }
+  static ariSegmentValuesFromSlug(slug, incomingSegments, expectedKeys) {
+    let regexpResult = new RegExp("^" + slug.replace(/\{(.*?)\}/g, "(?<$1>.*?)") + "$").exec(incomingSegments);
+    if (!regexpResult)
+      throw new ValidationError(`Segment '${incomingSegments}' don't match expected slug: ${slug}`);
+    return expectedKeys.forEach((expectedKey) => {
+      var _a;
+      if (!((_a = regexpResult.groups) != null && _a[expectedKey]))
+        throw new ValidationError(`No value supplied for '${expectedKey}' based on slug ${slug}`);
+    }), regexpResult.groups || {};
+  }
+};
+
+// src/core/parser/ati.ts
+var NUMBER_OF_ATI_SEGMENTS = 4, AtiParser = class extends BaseParser {
+  static fromString(inputStr, atiOpts) {
+    let segments = this.getIdentifierSegments(inputStr, NUMBER_OF_ATI_SEGMENTS), [qualifier = "ati", platformQualifier = "cloud", resourceOwner, resourceType] = segments;
+    return validateAtiQualifier(qualifier), validatePlatformQualifier(platformQualifier), validateResourceOwner(resourceOwner, atiOpts == null ? void 0 : atiOpts.resourceOwner), validateResourceType(resourceType, atiOpts == null ? void 0 : atiOpts.resourceType), { platformQualifier, resourceOwner, resourceType };
+  }
+  static fromOpts(maybeAtiOpts, atiOpts) {
+    let { qualifier, platformQualifier, resourceOwner, resourceType } = maybeAtiOpts;
+    return validateAtiQualifier(qualifier), validatePlatformQualifier(platformQualifier), validateResourceOwner(resourceOwner, atiOpts == null ? void 0 : atiOpts.resourceOwner), validateResourceType(resourceType, atiOpts == null ? void 0 : atiOpts.resourceType), {
+      platformQualifier,
+      resourceOwner,
+      resourceType
+    };
+  }
+};
+
+// src/ati.ts
+var Ati = class _Ati {
+  constructor(platformQualifier, resourceOwner, resourceType) {
+    this._platformQualifier = platformQualifier, this._resourceOwner = resourceOwner, this._resourceType = resourceType;
+  }
+  get platformQualifier() {
+    return this._platformQualifier;
+  }
+  get resourceOwner() {
+    return this._resourceOwner;
+  }
+  get resourceType() {
+    return this._resourceType;
+  }
+  static create(opts) {
+    return new _Ati(opts.platformQualifier || "cloud", opts.resourceOwner, opts.resourceType);
+  }
+  static parse(maybeAti, atiOpts) {
+    let opts = AtiParser.fromString(maybeAti, atiOpts);
+    return new _Ati(opts.platformQualifier, opts.resourceOwner, opts.resourceType);
+  }
+  toString() {
+    return `ati:${this.platformQualifier}:${this.resourceOwner}:${this.resourceType}`;
+  }
+  toJSON() {
+    return this.toString();
+  }
+  toOpts() {
+    return {
+      platformQualifier: this._platformQualifier,
+      resourceOwner: this._resourceOwner,
+      resourceType: this._resourceType
+    };
+  }
+};
+
+// src/core/ari.ts
+var Ari = class {
+  constructor(opts) {
+    this._ati = Ati.create({
+      platformQualifier: opts.platformQualifier || "cloud",
+      resourceOwner: opts.resourceOwner,
+      resourceType: opts.resourceType
+    }), this._cloudId = opts.cloudId !== "" ? opts.cloudId : void 0, this._resourceId = opts.resourceId;
+  }
+  get platformQualifier() {
+    return this._ati.platformQualifier;
+  }
+  get cloudId() {
+    return this._cloudId;
+  }
+  get resourceOwner() {
+    return this._ati.resourceOwner;
+  }
+  get resourceType() {
+    return this._ati.resourceType;
+  }
+  get resourceId() {
+    return this._resourceId;
+  }
+  get ati() {
+    return this._ati;
+  }
+  equals(other) {
+    return this.toString() === other.toString();
+  }
+  toString() {
+    return `ari:${this.platformQualifier}:${this.resourceOwner}:${this.cloudId || ""}:${this.resourceType}/${this.resourceId}`;
+  }
+  toJSON() {
+    return this.toString();
+  }
+  toOpts() {
+    return {
+      platformQualifier: this.platformQualifier,
+      resourceOwner: this.resourceOwner,
+      cloudId: this.cloudId,
+      resourceType: this.resourceType,
+      resourceId: this.resourceId
+    };
+  }
+};
+
+// src/any-ari.ts
+var AnyAri = class _AnyAri extends Ari {
+  constructor(opts) {
+    super(opts);
+  }
+  static create(ariOpts, ariStaticOpts) {
+    let ariOptsWithDefaults = { ...ariOpts, resourceIdSegmentValues: {} }, validatedOpts = AriParser.fromOpts(ariOptsWithDefaults, ariStaticOpts);
+    return new _AnyAri(validatedOpts);
+  }
+  static parse(maybeAri, ariStaticOpts) {
+    let validatedOpts = AriParser.fromString(maybeAri, ariStaticOpts);
+    return new _AnyAri(validatedOpts);
+  }
+  static check(maybeAri) {
+    try {
+      return _AnyAri.parse(maybeAri.toString()), !0;
+    } catch (err) {
+      return !1;
+    }
+  }
+  asAnyAri() {
+    return this;
+  }
+};
+
+// src/core/registered-ari.ts
+var RegisteredAri = class extends Ari {
+  static check(maybeAri) {
+    try {
+      return this.parse(maybeAri.toString()), !0;
+    } catch (err) {
+      return !1;
+    }
+  }
+  asAnyAri() {
+    return AnyAri.parse(this.toString());
+  }
+};
+
+// src/github.github/branch/types.ts
+var GithubGithubBranchAriResourceOwner = "github.github", GithubGithubBranchAriResourceType = "branch";
+
+// src/github.github/branch/manifest.ts
+var githubGithubBranchAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubBranchAriResourceOwner,
+  resourceType: GithubGithubBranchAriResourceType,
+  resourceIdSlug: "repositoryId/{repositoryId}/branchId/{branchId}",
+  resourceIdSegmentFormats: {
+    repositoryId: /[0-9]+/,
+    // eslint-disable-line no-useless-escape
+    branchId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/branch/index.ts
+var GithubGithubBranchAri = class _GithubGithubBranchAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._repositoryId = opts.resourceIdSegmentValues.repositoryId, this._branchId = opts.resourceIdSegmentValues.branchId;
+  }
+  get repositoryId() {
+    return this._repositoryId;
+  }
+  get branchId() {
+    return this._branchId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubBranchAriStaticOpts.qualifier,
+      platformQualifier: githubGithubBranchAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubBranchAriStaticOpts.resourceOwner,
+      resourceType: githubGithubBranchAriStaticOpts.resourceType,
+      resourceId: `repositoryId/${opts.repositoryId}/branchId/${opts.branchId}`,
+      resourceIdSegmentValues: {
+        repositoryId: opts.repositoryId,
+        branchId: opts.branchId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubBranchAriStaticOpts);
+    return new _GithubGithubBranchAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubBranchAriStaticOpts);
+    return new _GithubGithubBranchAri(opts);
+  }
+  getVariables() {
+    return {
+      repositoryId: this.repositoryId,
+      branchId: this.branchId
+    };
+  }
+};
+
+// src/github.github/build/types.ts
+var GithubGithubBuildAriResourceOwner = "github.github", GithubGithubBuildAriResourceType = "build";
+
+// src/github.github/build/manifest.ts
+var githubGithubBuildAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubBuildAriResourceOwner,
+  resourceType: GithubGithubBuildAriResourceType,
+  resourceIdSlug: "pipelineId/{pipelineId}/buildId/{buildId}",
+  resourceIdSegmentFormats: {
+    pipelineId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    // eslint-disable-line no-useless-escape
+    buildId: /[0-9]+/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/build/index.ts
+var GithubGithubBuildAri = class _GithubGithubBuildAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._pipelineId = opts.resourceIdSegmentValues.pipelineId, this._buildId = opts.resourceIdSegmentValues.buildId;
+  }
+  get pipelineId() {
+    return this._pipelineId;
+  }
+  get buildId() {
+    return this._buildId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubBuildAriStaticOpts.qualifier,
+      platformQualifier: githubGithubBuildAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubBuildAriStaticOpts.resourceOwner,
+      resourceType: githubGithubBuildAriStaticOpts.resourceType,
+      resourceId: `pipelineId/${opts.pipelineId}/buildId/${opts.buildId}`,
+      resourceIdSegmentValues: {
+        pipelineId: opts.pipelineId,
+        buildId: opts.buildId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubBuildAriStaticOpts);
+    return new _GithubGithubBuildAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubBuildAriStaticOpts);
+    return new _GithubGithubBuildAri(opts);
+  }
+  getVariables() {
+    return {
+      pipelineId: this.pipelineId,
+      buildId: this.buildId
+    };
+  }
+};
+
+// src/github.github/comment/types.ts
+var GithubGithubCommentAriResourceOwner = "github.github", GithubGithubCommentAriResourceType = "comment";
+
+// src/github.github/comment/manifest.ts
+var githubGithubCommentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubCommentAriResourceOwner,
+  resourceType: GithubGithubCommentAriResourceType,
+  resourceIdSlug: "repositoryId/{repositoryId}/pullRequestId/{pullRequestId}/comment/{commentId}",
+  resourceIdSegmentFormats: {
+    repositoryId: /[0-9]+/,
+    // eslint-disable-line no-useless-escape
+    pullRequestId: /[0-9]+/,
+    // eslint-disable-line no-useless-escape
+    commentId: /[0-9]+/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/comment/index.ts
+var GithubGithubCommentAri = class _GithubGithubCommentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._repositoryId = opts.resourceIdSegmentValues.repositoryId, this._pullRequestId = opts.resourceIdSegmentValues.pullRequestId, this._commentId = opts.resourceIdSegmentValues.commentId;
+  }
+  get repositoryId() {
+    return this._repositoryId;
+  }
+  get pullRequestId() {
+    return this._pullRequestId;
+  }
+  get commentId() {
+    return this._commentId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubCommentAriStaticOpts.qualifier,
+      platformQualifier: githubGithubCommentAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubCommentAriStaticOpts.resourceOwner,
+      resourceType: githubGithubCommentAriStaticOpts.resourceType,
+      resourceId: `repositoryId/${opts.repositoryId}/pullRequestId/${opts.pullRequestId}/comment/${opts.commentId}`,
+      resourceIdSegmentValues: {
+        repositoryId: opts.repositoryId,
+        pullRequestId: opts.pullRequestId,
+        commentId: opts.commentId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubCommentAriStaticOpts);
+    return new _GithubGithubCommentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubCommentAriStaticOpts);
+    return new _GithubGithubCommentAri(opts);
+  }
+  getVariables() {
+    return {
+      repositoryId: this.repositoryId,
+      pullRequestId: this.pullRequestId,
+      commentId: this.commentId
+    };
+  }
+};
+
+// src/github.github/commit/types.ts
+var GithubGithubCommitAriResourceOwner = "github.github", GithubGithubCommitAriResourceType = "commit";
+
+// src/github.github/commit/manifest.ts
+var githubGithubCommitAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubCommitAriResourceOwner,
+  resourceType: GithubGithubCommitAriResourceType,
+  resourceIdSlug: "repositoryId/{repositoryId}/commitId/{commitId}",
+  resourceIdSegmentFormats: {
+    repositoryId: /[0-9]+/,
+    // eslint-disable-line no-useless-escape
+    commitId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/commit/index.ts
+var GithubGithubCommitAri = class _GithubGithubCommitAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._repositoryId = opts.resourceIdSegmentValues.repositoryId, this._commitId = opts.resourceIdSegmentValues.commitId;
+  }
+  get repositoryId() {
+    return this._repositoryId;
+  }
+  get commitId() {
+    return this._commitId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubCommitAriStaticOpts.qualifier,
+      platformQualifier: githubGithubCommitAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubCommitAriStaticOpts.resourceOwner,
+      resourceType: githubGithubCommitAriStaticOpts.resourceType,
+      resourceId: `repositoryId/${opts.repositoryId}/commitId/${opts.commitId}`,
+      resourceIdSegmentValues: {
+        repositoryId: opts.repositoryId,
+        commitId: opts.commitId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubCommitAriStaticOpts);
+    return new _GithubGithubCommitAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubCommitAriStaticOpts);
+    return new _GithubGithubCommitAri(opts);
+  }
+  getVariables() {
+    return {
+      repositoryId: this.repositoryId,
+      commitId: this.commitId
+    };
+  }
+};
+
+// src/github.github/deployment/types.ts
+var GithubGithubDeploymentAriResourceOwner = "github.github", GithubGithubDeploymentAriResourceType = "deployment";
+
+// src/github.github/deployment/manifest.ts
+var githubGithubDeploymentAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubDeploymentAriResourceOwner,
+  resourceType: GithubGithubDeploymentAriResourceType,
+  resourceIdSlug: "pipelineId/{pipelineId}/environmentId/{environmentId}/deploymentSequenceNumber/{deploymentSequenceNumber}",
+  resourceIdSegmentFormats: {
+    pipelineId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    // eslint-disable-line no-useless-escape
+    environmentId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+    // eslint-disable-line no-useless-escape
+    deploymentSequenceNumber: /[0-9]+/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/deployment/index.ts
+var GithubGithubDeploymentAri = class _GithubGithubDeploymentAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._pipelineId = opts.resourceIdSegmentValues.pipelineId, this._environmentId = opts.resourceIdSegmentValues.environmentId, this._deploymentSequenceNumber = opts.resourceIdSegmentValues.deploymentSequenceNumber;
+  }
+  get pipelineId() {
+    return this._pipelineId;
+  }
+  get environmentId() {
+    return this._environmentId;
+  }
+  get deploymentSequenceNumber() {
+    return this._deploymentSequenceNumber;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubDeploymentAriStaticOpts.qualifier,
+      platformQualifier: githubGithubDeploymentAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubDeploymentAriStaticOpts.resourceOwner,
+      resourceType: githubGithubDeploymentAriStaticOpts.resourceType,
+      resourceId: `pipelineId/${opts.pipelineId}/environmentId/${opts.environmentId}/deploymentSequenceNumber/${opts.deploymentSequenceNumber}`,
+      resourceIdSegmentValues: {
+        pipelineId: opts.pipelineId,
+        environmentId: opts.environmentId,
+        deploymentSequenceNumber: opts.deploymentSequenceNumber
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubDeploymentAriStaticOpts);
+    return new _GithubGithubDeploymentAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubDeploymentAriStaticOpts);
+    return new _GithubGithubDeploymentAri(opts);
+  }
+  getVariables() {
+    return {
+      pipelineId: this.pipelineId,
+      environmentId: this.environmentId,
+      deploymentSequenceNumber: this.deploymentSequenceNumber
+    };
+  }
+};
+
+// src/github.github/pull-request/types.ts
+var GithubGithubPullRequestAriResourceOwner = "github.github", GithubGithubPullRequestAriResourceType = "pull-request";
+
+// src/github.github/pull-request/manifest.ts
+var githubGithubPullRequestAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubPullRequestAriResourceOwner,
+  resourceType: GithubGithubPullRequestAriResourceType,
+  resourceIdSlug: "repositoryId/{repositoryId}/pullRequestId/{pullRequestId}",
+  resourceIdSegmentFormats: {
+    repositoryId: /[0-9]+/,
+    // eslint-disable-line no-useless-escape
+    pullRequestId: /[0-9]+/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/pull-request/index.ts
+var GithubGithubPullRequestAri = class _GithubGithubPullRequestAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._repositoryId = opts.resourceIdSegmentValues.repositoryId, this._pullRequestId = opts.resourceIdSegmentValues.pullRequestId;
+  }
+  get repositoryId() {
+    return this._repositoryId;
+  }
+  get pullRequestId() {
+    return this._pullRequestId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubPullRequestAriStaticOpts.qualifier,
+      platformQualifier: githubGithubPullRequestAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubPullRequestAriStaticOpts.resourceOwner,
+      resourceType: githubGithubPullRequestAriStaticOpts.resourceType,
+      resourceId: `repositoryId/${opts.repositoryId}/pullRequestId/${opts.pullRequestId}`,
+      resourceIdSegmentValues: {
+        repositoryId: opts.repositoryId,
+        pullRequestId: opts.pullRequestId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubPullRequestAriStaticOpts);
+    return new _GithubGithubPullRequestAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubPullRequestAriStaticOpts);
+    return new _GithubGithubPullRequestAri(opts);
+  }
+  getVariables() {
+    return {
+      repositoryId: this.repositoryId,
+      pullRequestId: this.pullRequestId
+    };
+  }
+};
+
+// src/github.github/remote-link/types.ts
+var GithubGithubRemoteLinkAriResourceOwner = "github.github", GithubGithubRemoteLinkAriResourceType = "remote-link";
+
+// src/github.github/remote-link/manifest.ts
+var githubGithubRemoteLinkAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubRemoteLinkAriResourceOwner,
+  resourceType: GithubGithubRemoteLinkAriResourceType,
+  resourceIdSlug: "{remoteLinkId}",
+  resourceIdSegmentFormats: {
+    remoteLinkId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/remote-link/index.ts
+var GithubGithubRemoteLinkAri = class _GithubGithubRemoteLinkAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._remoteLinkId = opts.resourceIdSegmentValues.remoteLinkId;
+  }
+  get remoteLinkId() {
+    return this._remoteLinkId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubRemoteLinkAriStaticOpts.qualifier,
+      platformQualifier: githubGithubRemoteLinkAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubRemoteLinkAriStaticOpts.resourceOwner,
+      resourceType: githubGithubRemoteLinkAriStaticOpts.resourceType,
+      resourceId: `${opts.remoteLinkId}`,
+      resourceIdSegmentValues: {
+        remoteLinkId: opts.remoteLinkId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubRemoteLinkAriStaticOpts);
+    return new _GithubGithubRemoteLinkAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubRemoteLinkAriStaticOpts);
+    return new _GithubGithubRemoteLinkAri(opts);
+  }
+  getVariables() {
+    return {
+      remoteLinkId: this.remoteLinkId
+    };
+  }
+};
+
+// src/github.github/repository/types.ts
+var GithubGithubRepositoryAriResourceOwner = "github.github", GithubGithubRepositoryAriResourceType = "repository";
+
+// src/github.github/repository/manifest.ts
+var githubGithubRepositoryAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubRepositoryAriResourceOwner,
+  resourceType: GithubGithubRepositoryAriResourceType,
+  resourceIdSlug: "{repositoryId}",
+  resourceIdSegmentFormats: {
+    repositoryId: /[0-9]+/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/repository/index.ts
+var GithubGithubRepositoryAri = class _GithubGithubRepositoryAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._repositoryId = opts.resourceIdSegmentValues.repositoryId;
+  }
+  get repositoryId() {
+    return this._repositoryId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubRepositoryAriStaticOpts.qualifier,
+      platformQualifier: githubGithubRepositoryAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubRepositoryAriStaticOpts.resourceOwner,
+      resourceType: githubGithubRepositoryAriStaticOpts.resourceType,
+      resourceId: `${opts.repositoryId}`,
+      resourceIdSegmentValues: {
+        repositoryId: opts.repositoryId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubRepositoryAriStaticOpts);
+    return new _GithubGithubRepositoryAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubRepositoryAriStaticOpts);
+    return new _GithubGithubRepositoryAri(opts);
+  }
+  getVariables() {
+    return {
+      repositoryId: this.repositoryId
+    };
+  }
+};
+
+// src/github.github/vulnerability/types.ts
+var GithubGithubVulnerabilityAriResourceOwner = "github.github", GithubGithubVulnerabilityAriResourceType = "vulnerability";
+
+// src/github.github/vulnerability/manifest.ts
+var githubGithubVulnerabilityAriStaticOpts = {
+  qualifier: "ari",
+  platformQualifier: "third-party",
+  cloudId: new RegExp("^$"),
+  // eslint-disable-line no-useless-escape
+  resourceOwner: GithubGithubVulnerabilityAriResourceOwner,
+  resourceType: GithubGithubVulnerabilityAriResourceType,
+  resourceIdSlug: "{vulnerabilityId}",
+  resourceIdSegmentFormats: {
+    vulnerabilityId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+    // eslint-disable-line no-useless-escape
+  }
+};
+
+// src/github.github/vulnerability/index.ts
+var GithubGithubVulnerabilityAri = class _GithubGithubVulnerabilityAri extends RegisteredAri {
+  constructor(opts) {
+    super(opts);
+    this._vulnerabilityId = opts.resourceIdSegmentValues.vulnerabilityId;
+  }
+  get vulnerabilityId() {
+    return this._vulnerabilityId;
+  }
+  static create(opts) {
+    let derivedOpts = {
+      qualifier: githubGithubVulnerabilityAriStaticOpts.qualifier,
+      platformQualifier: githubGithubVulnerabilityAriStaticOpts.platformQualifier,
+      cloudId: void 0,
+      resourceOwner: githubGithubVulnerabilityAriStaticOpts.resourceOwner,
+      resourceType: githubGithubVulnerabilityAriStaticOpts.resourceType,
+      resourceId: `${opts.vulnerabilityId}`,
+      resourceIdSegmentValues: {
+        vulnerabilityId: opts.vulnerabilityId
+      }
+    }, ariOpts = AriParser.fromOpts(derivedOpts, githubGithubVulnerabilityAriStaticOpts);
+    return new _GithubGithubVulnerabilityAri(ariOpts);
+  }
+  static parse(maybeAri) {
+    let opts = AriParser.fromString(maybeAri, githubGithubVulnerabilityAriStaticOpts);
+    return new _GithubGithubVulnerabilityAri(opts);
+  }
+  getVariables() {
+    return {
+      vulnerabilityId: this.vulnerabilityId
+    };
+  }
+};
+// Annotate the CommonJS export names for ESM import in node:
+0 && (module.exports = {
+  GithubGithubBranchAri,
+  GithubGithubBuildAri,
+  GithubGithubCommentAri,
+  GithubGithubCommitAri,
+  GithubGithubDeploymentAri,
+  GithubGithubPullRequestAri,
+  GithubGithubRemoteLinkAri,
+  GithubGithubRepositoryAri,
+  GithubGithubVulnerabilityAri
+});