npm package diff
Package: @forge/util
Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31
File: package/packages/ari/chunk-MRFTVGA2.mjs
Index: package/packages/ari/chunk-MRFTVGA2.mjs
===================================================================
--- package/packages/ari/chunk-MRFTVGA2.mjs
+++ package/packages/ari/chunk-MRFTVGA2.mjs
@@ -0,0 +1,70 @@
+import {
+ GithubGithubCommitAriResourceOwner,
+ GithubGithubCommitAriResourceType
+} from "./chunk-HONW3GHX.mjs";
+import {
+ RegisteredAri
+} from "./chunk-AB4PPISI.mjs";
+import {
+ AriParser
+} from "./chunk-S7RIZVFI.mjs";
+
+// 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
+ };
+ }
+};
+
+export {
+ GithubGithubCommitAri
+};