npm package diff
Package: @forge/util
Versions: 1.4.10-next.0 - 1.4.10-next.0-experimental-effab31
File: package/packages/ari/identity/index.js
Index: package/packages/ari/identity/index.js
===================================================================
--- package/packages/ari/identity/index.js
+++ package/packages/ari/identity/index.js
@@ -17,19 +17,23 @@
// src/identity/index.ts
var identity_exports = {};
__export(identity_exports, {
IdentityAppAri: () => IdentityAppAri,
+ IdentityAppGrantAri: () => IdentityAppGrantAri,
IdentityAuthPolicyAri: () => IdentityAuthPolicyAri,
IdentityCustomerDirectoryAri: () => IdentityCustomerDirectoryAri,
IdentityCustomerOrganizationAri: () => IdentityCustomerOrganizationAri,
IdentityDirectoryAri: () => IdentityDirectoryAri,
IdentityDomainAri: () => IdentityDomainAri,
+ IdentityForgeInstallationAri: () => IdentityForgeInstallationAri,
IdentityGroupAri: () => IdentityGroupAri,
IdentityOauthClientAri: () => IdentityOauthClientAri,
IdentityRoleAri: () => IdentityRoleAri,
+ IdentityScopedGroupAri: () => IdentityScopedGroupAri,
IdentitySiteAri: () => IdentitySiteAri,
IdentityTeamAri: () => IdentityTeamAri,
IdentityTeamMemberAri: () => IdentityTeamMemberAri,
+ IdentityThirdPartyDirectoryAri: () => IdentityThirdPartyDirectoryAri,
IdentityThirdPartyGroupAri: () => IdentityThirdPartyGroupAri,
IdentityThirdPartyUserAri: () => IdentityThirdPartyUserAri,
IdentityUserAri: () => IdentityUserAri,
IdentityUserGrantAri: () => IdentityUserGrantAri,
@@ -41,9 +45,9 @@
var ValidationError = class extends Error {
};
// src/core/rules/cloud-id.ts
-function validateCloudId(cloudId, format = new RegExp("^[a-zA-Z0-9\\-]*$")) {
+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}.`);
}
@@ -63,9 +67,9 @@
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") {
+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}.`);
}
@@ -298,8 +302,9 @@
var identityAppAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityAppAriResourceOwner,
resourceType: IdentityAppAriResourceType,
resourceIdSlug: "{platform}/{appId}",
resourceIdSegmentFormats: {
@@ -348,16 +353,76 @@
};
}
};
+// src/identity/app-grant/types.ts
+var IdentityAppGrantAriResourceOwner = "identity", IdentityAppGrantAriResourceType = "app-grant";
+
+// src/identity/app-grant/manifest.ts
+var identityAppGrantAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: IdentityAppGrantAriResourceOwner,
+ resourceType: IdentityAppGrantAriResourceType,
+ resourceIdSlug: "{userId}-{clientId}",
+ resourceIdSegmentFormats: {
+ userId: /[a-zA-Z0-9_\-\:]{1,128}/,
+ // eslint-disable-line no-useless-escape
+ clientId: /[0-9a-zA-Z-_]{5,50}/
+ // eslint-disable-line no-useless-escape
+ }
+};
+
+// src/identity/app-grant/index.ts
+var IdentityAppGrantAri = class _IdentityAppGrantAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._userId = opts.resourceIdSegmentValues.userId, this._clientId = opts.resourceIdSegmentValues.clientId;
+ }
+ get userId() {
+ return this._userId;
+ }
+ get clientId() {
+ return this._clientId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: identityAppGrantAriStaticOpts.qualifier,
+ platformQualifier: identityAppGrantAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: identityAppGrantAriStaticOpts.resourceOwner,
+ resourceType: identityAppGrantAriStaticOpts.resourceType,
+ resourceId: `${opts.userId}-${opts.clientId}`,
+ resourceIdSegmentValues: {
+ userId: opts.userId,
+ clientId: opts.clientId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, identityAppGrantAriStaticOpts);
+ return new _IdentityAppGrantAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, identityAppGrantAriStaticOpts);
+ return new _IdentityAppGrantAri(opts);
+ }
+ getVariables() {
+ return {
+ userId: this.userId,
+ clientId: this.clientId
+ };
+ }
+};
+
// src/identity/auth-policy/types.ts
var IdentityAuthPolicyAriResourceOwner = "identity", IdentityAuthPolicyAriResourceType = "auth-policy";
// src/identity/auth-policy/manifest.ts
var identityAuthPolicyAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityAuthPolicyAriResourceOwner,
resourceType: IdentityAuthPolicyAriResourceType,
resourceIdSlug: "{authPolicyId}",
resourceIdSegmentFormats: {
@@ -407,13 +472,14 @@
var identityCustomerDirectoryAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityCustomerDirectoryAriResourceOwner,
resourceType: IdentityCustomerDirectoryAriResourceType,
resourceIdSlug: "{customerDirectoryId}",
resourceIdSegmentFormats: {
- customerDirectoryId: /[!a-zA-Z0-9\-_.~@:{}=]+(\/[!a-zA-Z0-9\-_.~@:{}=]+)*/
+ customerDirectoryId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
// eslint-disable-line no-useless-escape
}
};
@@ -458,8 +524,9 @@
var identityCustomerOrganizationAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityCustomerOrganizationAriResourceOwner,
resourceType: IdentityCustomerOrganizationAriResourceType,
resourceIdSlug: "{customerOrganizationId}",
resourceIdSegmentFormats: {
@@ -509,8 +576,9 @@
var identityDirectoryAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityDirectoryAriResourceOwner,
resourceType: IdentityDirectoryAriResourceType,
resourceIdSlug: "{directoryId}",
resourceIdSegmentFormats: {
@@ -560,8 +628,9 @@
var identityDomainAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityDomainAriResourceOwner,
resourceType: IdentityDomainAriResourceType,
resourceIdSlug: "{base64Domain}",
resourceIdSegmentFormats: {
@@ -603,21 +672,85 @@
};
}
};
+// src/identity/forge-installation/types.ts
+var IdentityForgeInstallationAriResourceOwner = "identity", IdentityForgeInstallationAriResourceType = "forge-installation";
+
+// src/identity/forge-installation/manifest.ts
+var identityForgeInstallationAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{1,255}$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: IdentityForgeInstallationAriResourceOwner,
+ resourceType: IdentityForgeInstallationAriResourceType,
+ resourceIdSlug: "{appId}/{envId}",
+ resourceIdSegmentFormats: {
+ appId: /[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
+ envId: /[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/identity/forge-installation/index.ts
+var IdentityForgeInstallationAri = class _IdentityForgeInstallationAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._siteId = opts.cloudId || "", this._appId = opts.resourceIdSegmentValues.appId, this._envId = opts.resourceIdSegmentValues.envId;
+ }
+ get siteId() {
+ return this._siteId;
+ }
+ get appId() {
+ return this._appId;
+ }
+ get envId() {
+ return this._envId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: identityForgeInstallationAriStaticOpts.qualifier,
+ platformQualifier: identityForgeInstallationAriStaticOpts.platformQualifier,
+ cloudId: opts.siteId,
+ resourceOwner: identityForgeInstallationAriStaticOpts.resourceOwner,
+ resourceType: identityForgeInstallationAriStaticOpts.resourceType,
+ resourceId: `${opts.appId}/${opts.envId}`,
+ resourceIdSegmentValues: {
+ appId: opts.appId,
+ envId: opts.envId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, identityForgeInstallationAriStaticOpts);
+ return new _IdentityForgeInstallationAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, identityForgeInstallationAriStaticOpts);
+ return new _IdentityForgeInstallationAri(opts);
+ }
+ getVariables() {
+ return {
+ siteId: this.siteId,
+ appId: this.appId,
+ envId: this.envId
+ };
+ }
+};
+
// src/identity/group/types.ts
var IdentityGroupAriResourceOwner = "identity", IdentityGroupAriResourceType = "group";
// src/identity/group/manifest.ts
var identityGroupAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityGroupAriResourceOwner,
resourceType: IdentityGroupAriResourceType,
resourceIdSlug: "{groupId}",
resourceIdSegmentFormats: {
- groupId: /[!a-zA-Z0-9\-_.~@:{}=]+(\/[!a-zA-Z0-9\-_.~@:{}=]+)*/
+ groupId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
// eslint-disable-line no-useless-escape
}
};
@@ -662,8 +795,9 @@
var identityOauthClientAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityOauthClientAriResourceOwner,
resourceType: IdentityOauthClientAriResourceType,
resourceIdSlug: "{clientId}",
resourceIdSegmentFormats: {
@@ -712,14 +846,15 @@
// src/identity/role/manifest.ts
var identityRoleAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
- cloudId: new RegExp("^[a-zA-Z0-9-]*$"),
+ cloudId: new RegExp("^[a-zA-Z0-9_\\-.]{0,255}$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityRoleAriResourceOwner,
resourceType: IdentityRoleAriResourceType,
resourceIdSlug: "{roleId}",
resourceIdSegmentFormats: {
- roleId: /[!a-zA-Z0-9\-_.~@:{}=]+(\/[!a-zA-Z0-9\-_.~@:{}=]+)*/
+ roleId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
// eslint-disable-line no-useless-escape
}
};
@@ -760,21 +895,88 @@
};
}
};
+// src/identity/scoped-group/types.ts
+var IdentityScopedGroupAriResourceOwner = "identity", IdentityScopedGroupAriResourceType = "scoped-group";
+
+// src/identity/scoped-group/manifest.ts
+var identityScopedGroupAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: IdentityScopedGroupAriResourceOwner,
+ resourceType: IdentityScopedGroupAriResourceType,
+ resourceIdSlug: "{scopeType}/{scopeId}/{groupId}",
+ resourceIdSegmentFormats: {
+ scopeType: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+ // eslint-disable-line no-useless-escape
+ scopeId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/,
+ // eslint-disable-line no-useless-escape
+ groupId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
+ // eslint-disable-line no-useless-escape
+ }
+};
+
+// src/identity/scoped-group/index.ts
+var IdentityScopedGroupAri = class _IdentityScopedGroupAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._scopeType = opts.resourceIdSegmentValues.scopeType, this._scopeId = opts.resourceIdSegmentValues.scopeId, this._groupId = opts.resourceIdSegmentValues.groupId;
+ }
+ get scopeType() {
+ return this._scopeType;
+ }
+ get scopeId() {
+ return this._scopeId;
+ }
+ get groupId() {
+ return this._groupId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: identityScopedGroupAriStaticOpts.qualifier,
+ platformQualifier: identityScopedGroupAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: identityScopedGroupAriStaticOpts.resourceOwner,
+ resourceType: identityScopedGroupAriStaticOpts.resourceType,
+ resourceId: `${opts.scopeType}/${opts.scopeId}/${opts.groupId}`,
+ resourceIdSegmentValues: {
+ scopeType: opts.scopeType,
+ scopeId: opts.scopeId,
+ groupId: opts.groupId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, identityScopedGroupAriStaticOpts);
+ return new _IdentityScopedGroupAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, identityScopedGroupAriStaticOpts);
+ return new _IdentityScopedGroupAri(opts);
+ }
+ getVariables() {
+ return {
+ scopeType: this.scopeType,
+ scopeId: this.scopeId,
+ groupId: this.groupId
+ };
+ }
+};
+
// src/identity/site/types.ts
var IdentitySiteAriResourceOwner = "identity", IdentitySiteAriResourceType = "site";
// src/identity/site/manifest.ts
var identitySiteAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentitySiteAriResourceOwner,
resourceType: IdentitySiteAriResourceType,
resourceIdSlug: "{siteId}",
resourceIdSegmentFormats: {
- siteId: /[a-zA-Z0-9\-]+/
+ siteId: /[a-zA-Z0-9_\-.]{1,255}/
// eslint-disable-line no-useless-escape
}
};
@@ -819,8 +1021,9 @@
var identityTeamAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityTeamAriResourceOwner,
resourceType: IdentityTeamAriResourceType,
resourceIdSlug: "{teamId}",
resourceIdSegmentFormats: {
@@ -870,8 +1073,9 @@
var identityTeamMemberAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityTeamMemberAriResourceOwner,
resourceType: IdentityTeamMemberAriResourceType,
resourceIdSlug: "{teamId}/{userId}",
resourceIdSegmentFormats: {
@@ -920,23 +1124,76 @@
};
}
};
+// src/identity/third-party-directory/types.ts
+var IdentityThirdPartyDirectoryAriResourceOwner = "identity", IdentityThirdPartyDirectoryAriResourceType = "third-party-directory";
+
+// src/identity/third-party-directory/manifest.ts
+var identityThirdPartyDirectoryAriStaticOpts = {
+ qualifier: "ari",
+ platformQualifier: "cloud",
+ cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
+ resourceOwner: IdentityThirdPartyDirectoryAriResourceOwner,
+ resourceType: IdentityThirdPartyDirectoryAriResourceType,
+ resourceIdSlug: "{directoryId}",
+ resourceIdSegmentFormats: {
+ directoryId: /[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/identity/third-party-directory/index.ts
+var IdentityThirdPartyDirectoryAri = class _IdentityThirdPartyDirectoryAri extends RegisteredAri {
+ constructor(opts) {
+ super(opts);
+ this._directoryId = opts.resourceIdSegmentValues.directoryId;
+ }
+ get directoryId() {
+ return this._directoryId;
+ }
+ static create(opts) {
+ let derivedOpts = {
+ qualifier: identityThirdPartyDirectoryAriStaticOpts.qualifier,
+ platformQualifier: identityThirdPartyDirectoryAriStaticOpts.platformQualifier,
+ cloudId: void 0,
+ resourceOwner: identityThirdPartyDirectoryAriStaticOpts.resourceOwner,
+ resourceType: identityThirdPartyDirectoryAriStaticOpts.resourceType,
+ resourceId: `${opts.directoryId}`,
+ resourceIdSegmentValues: {
+ directoryId: opts.directoryId
+ }
+ }, ariOpts = AriParser.fromOpts(derivedOpts, identityThirdPartyDirectoryAriStaticOpts);
+ return new _IdentityThirdPartyDirectoryAri(ariOpts);
+ }
+ static parse(maybeAri) {
+ let opts = AriParser.fromString(maybeAri, identityThirdPartyDirectoryAriStaticOpts);
+ return new _IdentityThirdPartyDirectoryAri(opts);
+ }
+ getVariables() {
+ return {
+ directoryId: this.directoryId
+ };
+ }
+};
+
// src/identity/third-party-group/types.ts
var IdentityThirdPartyGroupAriResourceOwner = "identity", IdentityThirdPartyGroupAriResourceType = "third-party-group";
// src/identity/third-party-group/manifest.ts
var identityThirdPartyGroupAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityThirdPartyGroupAriResourceOwner,
resourceType: IdentityThirdPartyGroupAriResourceType,
resourceIdSlug: "{directoryId}/{groupId}",
resourceIdSegmentFormats: {
directoryId: /[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
- groupId: /[!a-zA-Z0-9\-_.~@:{}=]+(\/[!a-zA-Z0-9\-_.~@:{}=]+)*/
+ groupId: /[!a-zA-Z0-9\-_.~@:;{}=]+(\/[!a-zA-Z0-9\-_.~@:;{}=]+)*/
// eslint-disable-line no-useless-escape
}
};
@@ -986,8 +1243,9 @@
var identityThirdPartyUserAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityThirdPartyUserAriResourceOwner,
resourceType: IdentityThirdPartyUserAriResourceType,
resourceIdSlug: "{directoryId}/{userId}",
resourceIdSegmentFormats: {
@@ -1044,8 +1302,9 @@
var identityUserAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityUserAriResourceOwner,
resourceType: IdentityUserAriResourceType,
resourceIdSlug: "{userId}",
resourceIdSegmentFormats: {
@@ -1095,8 +1354,9 @@
var identityUserbaseAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityUserbaseAriResourceOwner,
resourceType: IdentityUserbaseAriResourceType,
resourceIdSlug: "{userbaseId}",
resourceIdSegmentFormats: {
@@ -1146,8 +1406,9 @@
var identityUserGrantAriStaticOpts = {
qualifier: "ari",
platformQualifier: "cloud",
cloudId: new RegExp("^$"),
+ // eslint-disable-line no-useless-escape
resourceOwner: IdentityUserGrantAriResourceOwner,
resourceType: IdentityUserGrantAriResourceType,
resourceIdSlug: "{userId}-{clientId}",
resourceIdSegmentFormats: {
@@ -1198,19 +1459,23 @@
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
IdentityAppAri,
+ IdentityAppGrantAri,
IdentityAuthPolicyAri,
IdentityCustomerDirectoryAri,
IdentityCustomerOrganizationAri,
IdentityDirectoryAri,
IdentityDomainAri,
+ IdentityForgeInstallationAri,
IdentityGroupAri,
IdentityOauthClientAri,
IdentityRoleAri,
+ IdentityScopedGroupAri,
IdentitySiteAri,
IdentityTeamAri,
IdentityTeamMemberAri,
+ IdentityThirdPartyDirectoryAri,
IdentityThirdPartyGroupAri,
IdentityThirdPartyUserAri,
IdentityUserAri,
IdentityUserGrantAri,