@forge/util 1.4.0-next.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/packages/ari/_tsup-dts-rollup.d.ts +38 -0
- package/packages/ari/chunk-K2XTPA47.mjs +73 -0
- package/packages/ari/chunk-N5UKNFK5.mjs +7 -0
- package/packages/ari/confluence/embed/index.d.ts +3 -0
- package/packages/ari/confluence/embed/index.js +346 -0
- package/packages/ari/confluence/embed/index.mjs +17 -0
- package/packages/ari/confluence/embed/types.d.ts +3 -0
- package/packages/ari/confluence/embed/types.js +29 -0
- package/packages/ari/confluence/embed/types.mjs +8 -0
- package/packages/ari/confluence/index.d.ts +1 -0
- package/packages/ari/confluence/index.js +64 -0
- package/packages/ari/confluence/index.mjs +17 -12
- package/packages/ari/devops/index.mjs +4 -4
- package/packages/ari/ecosystem/index.mjs +8 -8
- package/packages/ari/elements/index.mjs +4 -4
- package/packages/ari/google/index.mjs +8 -8
- package/packages/ari/graph/index.mjs +29 -29
- package/packages/ari/help/index.mjs +8 -8
- package/packages/ari/identity/index.mjs +11 -11
- package/packages/ari/index.js +1 -1
- package/packages/ari/index.mjs +255 -253
- package/packages/ari/jira/index.mjs +59 -59
- package/packages/ari/jira-core/index.mjs +4 -4
- package/packages/ari/jira-servicedesk/index.mjs +8 -8
- package/packages/ari/jira-software/index.mjs +11 -11
- package/packages/ari/mercury/index.mjs +4 -4
- package/packages/ari/opsgenie/index.mjs +20 -20
- package/packages/ari/package.json +1 -1
- package/packages/ari/people-perftool/index.mjs +4 -4
- package/packages/ari/platform/index.mjs +8 -8
- package/packages/ari/townsquare/index.mjs +11 -11
- package/packages/ari/trello/index.mjs +8 -8
- package/packages/ari/unified-help/index.mjs +4 -4
- package/packages/ari/virtual-agent/index.mjs +4 -4
- /package/packages/ari/{chunk-B5G4UGB5.mjs → chunk-VZG2Z6DB.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @forge/util
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b3245a7: - Add environmentType, invocationId, installationId in runtime V2 context
|
|
8
|
+
- Rename getRuntime to \_\_getRuntime in @forge/api
|
|
9
|
+
- Add new method getAppContext in @forge/api to retrieve app context data
|
|
10
|
+
- Replace @atlassian/cs-ari package with @atlassian/ari
|
|
11
|
+
|
|
3
12
|
## 1.4.0-next.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -2927,6 +2927,41 @@ export { ConfluenceDatabaseAriResourceType as ConfluenceDatabaseAriResourceType_
|
|
|
2927
2927
|
|
|
2928
2928
|
export declare const confluenceDatabaseAriStaticOpts: AriStaticProperties;
|
|
2929
2929
|
|
|
2930
|
+
declare class ConfluenceEmbedAri extends RegisteredAri {
|
|
2931
|
+
private constructor();
|
|
2932
|
+
private readonly _siteId;
|
|
2933
|
+
private readonly _activationId;
|
|
2934
|
+
private readonly _embedId;
|
|
2935
|
+
get siteId(): string;
|
|
2936
|
+
get activationId(): string;
|
|
2937
|
+
get embedId(): string;
|
|
2938
|
+
static create(opts: ConfluenceEmbedAriOpts): ConfluenceEmbedAri;
|
|
2939
|
+
static parse(maybeAri: string): ConfluenceEmbedAri;
|
|
2940
|
+
getVariables(): {
|
|
2941
|
+
siteId: string;
|
|
2942
|
+
activationId: string;
|
|
2943
|
+
embedId: string;
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2946
|
+
export { ConfluenceEmbedAri }
|
|
2947
|
+
export { ConfluenceEmbedAri as ConfluenceEmbedAri_alias_1 }
|
|
2948
|
+
|
|
2949
|
+
export declare interface ConfluenceEmbedAriOpts {
|
|
2950
|
+
siteId: string;
|
|
2951
|
+
activationId: string;
|
|
2952
|
+
embedId: string;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
declare const ConfluenceEmbedAriResourceOwner = "confluence";
|
|
2956
|
+
export { ConfluenceEmbedAriResourceOwner }
|
|
2957
|
+
export { ConfluenceEmbedAriResourceOwner as ConfluenceEmbedAriResourceOwner_alias_1 }
|
|
2958
|
+
|
|
2959
|
+
declare const ConfluenceEmbedAriResourceType = "embed";
|
|
2960
|
+
export { ConfluenceEmbedAriResourceType }
|
|
2961
|
+
export { ConfluenceEmbedAriResourceType as ConfluenceEmbedAriResourceType_alias_1 }
|
|
2962
|
+
|
|
2963
|
+
export declare const confluenceEmbedAriStaticOpts: AriStaticProperties;
|
|
2964
|
+
|
|
2930
2965
|
declare class ConfluenceEventAri extends RegisteredAri {
|
|
2931
2966
|
private constructor();
|
|
2932
2967
|
private readonly _siteId;
|
|
@@ -3887,6 +3922,8 @@ export declare const elementsWorkspaceAriStaticOpts: AriStaticProperties;
|
|
|
3887
3922
|
|
|
3888
3923
|
export declare const EmailUuidType: "email-uuid";
|
|
3889
3924
|
|
|
3925
|
+
export declare const EmbedType: "embed";
|
|
3926
|
+
|
|
3890
3927
|
export declare const EnterpriseType: "enterprise";
|
|
3891
3928
|
|
|
3892
3929
|
export declare const EntitlementTemplateType: "entitlement-template";
|
|
@@ -11597,6 +11634,7 @@ declare enum ResourceTypeEnum {
|
|
|
11597
11634
|
DocumentHistory = "document-history",
|
|
11598
11635
|
Domain = "domain",
|
|
11599
11636
|
EmailUuid = "email-uuid",
|
|
11637
|
+
Embed = "embed",
|
|
11600
11638
|
Enterprise = "enterprise",
|
|
11601
11639
|
Entitlement = "entitlement",
|
|
11602
11640
|
EntitlementTemplate = "entitlement-template",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfluenceEmbedAriResourceOwner,
|
|
3
|
+
ConfluenceEmbedAriResourceType
|
|
4
|
+
} from "./chunk-N5UKNFK5.mjs";
|
|
5
|
+
import {
|
|
6
|
+
RegisteredAri
|
|
7
|
+
} from "./chunk-PA4Y7TWI.mjs";
|
|
8
|
+
import {
|
|
9
|
+
AriParser
|
|
10
|
+
} from "./chunk-2UUYVBKT.mjs";
|
|
11
|
+
|
|
12
|
+
// src/confluence/embed/manifest.ts
|
|
13
|
+
var confluenceEmbedAriStaticOpts = {
|
|
14
|
+
qualifier: "ari",
|
|
15
|
+
platformQualifier: "cloud",
|
|
16
|
+
cloudId: new RegExp("^[a-zA-Z0-9-]+$"),
|
|
17
|
+
resourceOwner: ConfluenceEmbedAriResourceOwner,
|
|
18
|
+
resourceType: ConfluenceEmbedAriResourceType,
|
|
19
|
+
resourceIdSlug: "activation/{activationId}/{embedId}",
|
|
20
|
+
resourceIdSegmentFormats: {
|
|
21
|
+
activationId: /[a-zA-Z0-9\-]+/,
|
|
22
|
+
// eslint-disable-line no-useless-escape
|
|
23
|
+
embedId: /[0-9]+/
|
|
24
|
+
// eslint-disable-line no-useless-escape
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/confluence/embed/index.ts
|
|
29
|
+
var ConfluenceEmbedAri = class _ConfluenceEmbedAri extends RegisteredAri {
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
super(opts);
|
|
32
|
+
this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._embedId = opts.resourceIdSegmentValues.embedId;
|
|
33
|
+
}
|
|
34
|
+
get siteId() {
|
|
35
|
+
return this._siteId;
|
|
36
|
+
}
|
|
37
|
+
get activationId() {
|
|
38
|
+
return this._activationId;
|
|
39
|
+
}
|
|
40
|
+
get embedId() {
|
|
41
|
+
return this._embedId;
|
|
42
|
+
}
|
|
43
|
+
static create(opts) {
|
|
44
|
+
let derivedOpts = {
|
|
45
|
+
qualifier: confluenceEmbedAriStaticOpts.qualifier,
|
|
46
|
+
platformQualifier: confluenceEmbedAriStaticOpts.platformQualifier,
|
|
47
|
+
cloudId: opts.siteId,
|
|
48
|
+
resourceOwner: confluenceEmbedAriStaticOpts.resourceOwner,
|
|
49
|
+
resourceType: confluenceEmbedAriStaticOpts.resourceType,
|
|
50
|
+
resourceId: `activation/${opts.activationId}/${opts.embedId}`,
|
|
51
|
+
resourceIdSegmentValues: {
|
|
52
|
+
activationId: opts.activationId,
|
|
53
|
+
embedId: opts.embedId
|
|
54
|
+
}
|
|
55
|
+
}, ariOpts = AriParser.fromOpts(derivedOpts, confluenceEmbedAriStaticOpts);
|
|
56
|
+
return new _ConfluenceEmbedAri(ariOpts);
|
|
57
|
+
}
|
|
58
|
+
static parse(maybeAri) {
|
|
59
|
+
let opts = AriParser.fromString(maybeAri, confluenceEmbedAriStaticOpts);
|
|
60
|
+
return new _ConfluenceEmbedAri(opts);
|
|
61
|
+
}
|
|
62
|
+
getVariables() {
|
|
63
|
+
return {
|
|
64
|
+
siteId: this.siteId,
|
|
65
|
+
activationId: this.activationId,
|
|
66
|
+
embedId: this.embedId
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
ConfluenceEmbedAri
|
|
73
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
|
|
17
|
+
// src/confluence/embed/index.ts
|
|
18
|
+
var embed_exports = {};
|
|
19
|
+
__export(embed_exports, {
|
|
20
|
+
ConfluenceEmbedAri: () => ConfluenceEmbedAri,
|
|
21
|
+
ConfluenceEmbedAriResourceOwner: () => ConfluenceEmbedAriResourceOwner,
|
|
22
|
+
ConfluenceEmbedAriResourceType: () => ConfluenceEmbedAriResourceType
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(embed_exports);
|
|
25
|
+
|
|
26
|
+
// src/errors.ts
|
|
27
|
+
var ValidationError = class extends Error {
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/core/rules/cloud-id.ts
|
|
31
|
+
function validateCloudId(cloudId, format = new RegExp("^[a-zA-Z0-9\\-]*$")) {
|
|
32
|
+
if (!cloudId.match(format))
|
|
33
|
+
throw new ValidationError(`Invalid cloud ID, expected ID of format ${format}.`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/core/rules/platform-qualifier.ts
|
|
37
|
+
function validatePlatformQualifier(qualifier) {
|
|
38
|
+
if (qualifier !== "cloud")
|
|
39
|
+
throw new ValidationError(`Identifier must have a qualifier of 'cloud'. Received: ${qualifier}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/core/rules/qualifier.ts
|
|
43
|
+
function validateAtiQualifier(qualifier) {
|
|
44
|
+
if (qualifier !== "ati")
|
|
45
|
+
throw new ValidationError(`ATI must have a qualifier of 'ati'. Received: ${qualifier}`);
|
|
46
|
+
}
|
|
47
|
+
function validateAriQualifier(qualifier) {
|
|
48
|
+
if (qualifier !== "ari")
|
|
49
|
+
throw new ValidationError(`ARI must have a qualifier of 'ari'. Received: ${qualifier}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/core/rules/resource-id.ts
|
|
53
|
+
function validateResourceId(id, format = new RegExp("[a-zA-Z0-9\\-_.~@:{}=]+(/[a-zA-Z0-9\\-_.~@:{}=]+)*" /* ANY_RESOURCE_ID */), key = "resourceId") {
|
|
54
|
+
let formatWithCarets = new RegExp(`^${format.source}$`);
|
|
55
|
+
if (!id.match(formatWithCarets))
|
|
56
|
+
throw new ValidationError(`Invalid ${key} - ${id}, expected ID of format ${formatWithCarets}.`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/core/rules/resource-id-segments.ts
|
|
60
|
+
function validateResourceIdSegments(resourceIdSegmentValues, resourceIdSegmentFormats) {
|
|
61
|
+
Object.entries(resourceIdSegmentValues).forEach(([resourceIdKey, resourceIdValue]) => {
|
|
62
|
+
validateResourceId(resourceIdValue, resourceIdSegmentFormats == null ? void 0 : resourceIdSegmentFormats[resourceIdKey], resourceIdKey);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/core/rules/resource-owner.ts
|
|
67
|
+
function validateResourceOwner(owner, expectedResourceOwner) {
|
|
68
|
+
if (expectedResourceOwner && owner !== expectedResourceOwner)
|
|
69
|
+
throw new ValidationError(`Invalid resource owner - ${owner}, expected ${expectedResourceOwner}.`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/core/rules/resource-type.ts
|
|
73
|
+
function validateResourceType(type, expectedResourceType) {
|
|
74
|
+
if (expectedResourceType && type !== expectedResourceType)
|
|
75
|
+
throw new ValidationError(`Invalid resource type - ${type}, expected ${expectedResourceType}.`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/core/parser/base.ts
|
|
79
|
+
var NUMBER_OF_BASE_SEGMENTS = 5, SEGMENT_SEPARATOR = ":", BaseParser = class {
|
|
80
|
+
static getIdentifierSegments(inputStr, numberOfSegmentsRequired) {
|
|
81
|
+
let allSegments = inputStr.split(SEGMENT_SEPARATOR);
|
|
82
|
+
if (allSegments.length < numberOfSegmentsRequired)
|
|
83
|
+
throw new ValidationError(`Input string must have ${numberOfSegmentsRequired} segments.`);
|
|
84
|
+
if (allSegments.length > numberOfSegmentsRequired) {
|
|
85
|
+
let segments = allSegments.slice(0, NUMBER_OF_BASE_SEGMENTS - 1), segmentsForResourceId = allSegments.slice(NUMBER_OF_BASE_SEGMENTS - 1, allSegments.length);
|
|
86
|
+
return [...segments, segmentsForResourceId.join(SEGMENT_SEPARATOR)];
|
|
87
|
+
}
|
|
88
|
+
return allSegments;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/core/parser/ari.ts
|
|
93
|
+
var NUMBER_OF_ARI_SEGMENTS = 5, AriParser = class extends BaseParser {
|
|
94
|
+
static fromString(maybeAri, ariProperties) {
|
|
95
|
+
let segments = this.getIdentifierSegments(maybeAri, NUMBER_OF_ARI_SEGMENTS), [qualifier, platformQualifier, resourceOwner, cloudId, resourceTypeAndId] = segments, [resourceType, ...resourceIdSegments] = resourceTypeAndId.split("/"), maybeAriDerivedProperties = {
|
|
96
|
+
qualifier,
|
|
97
|
+
platformQualifier,
|
|
98
|
+
cloudId,
|
|
99
|
+
resourceOwner,
|
|
100
|
+
resourceType,
|
|
101
|
+
resourceId: resourceIdSegments.join("/"),
|
|
102
|
+
resourceIdSegmentValues: ariProperties != null && ariProperties.resourceIdSlug ? this.ariSegmentValuesFromSlug(
|
|
103
|
+
ariProperties.resourceIdSlug,
|
|
104
|
+
resourceIdSegments.join("/"),
|
|
105
|
+
Object.keys(ariProperties.resourceIdSegmentFormats)
|
|
106
|
+
) : {}
|
|
107
|
+
};
|
|
108
|
+
return this.fromOpts(maybeAriDerivedProperties, ariProperties);
|
|
109
|
+
}
|
|
110
|
+
static fromOpts(maybeAriOpts, ariProperties) {
|
|
111
|
+
let {
|
|
112
|
+
qualifier = "ari",
|
|
113
|
+
platformQualifier = "cloud",
|
|
114
|
+
resourceOwner,
|
|
115
|
+
cloudId,
|
|
116
|
+
resourceId,
|
|
117
|
+
resourceIdSegmentValues,
|
|
118
|
+
resourceType
|
|
119
|
+
} = maybeAriOpts;
|
|
120
|
+
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), {
|
|
121
|
+
qualifier,
|
|
122
|
+
resourceOwner,
|
|
123
|
+
resourceType,
|
|
124
|
+
platformQualifier,
|
|
125
|
+
cloudId,
|
|
126
|
+
resourceId,
|
|
127
|
+
resourceIdSegmentValues
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static ariSegmentValuesFromSlug(slug, incomingSegments, expectedKeys) {
|
|
131
|
+
let regexpResult = new RegExp("^" + slug.replace(/\{(.*?)\}/g, "(?<$1>.*?)") + "$").exec(incomingSegments);
|
|
132
|
+
if (!regexpResult)
|
|
133
|
+
throw new ValidationError(`Segment '${incomingSegments}' don't match expected slug: ${slug}`);
|
|
134
|
+
return expectedKeys.forEach((expectedKey) => {
|
|
135
|
+
var _a;
|
|
136
|
+
if (!((_a = regexpResult.groups) != null && _a[expectedKey]))
|
|
137
|
+
throw new ValidationError(`No value supplied for '${expectedKey}' based on slug ${slug}`);
|
|
138
|
+
}), regexpResult.groups || {};
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// src/core/parser/ati.ts
|
|
143
|
+
var NUMBER_OF_ATI_SEGMENTS = 4, AtiParser = class extends BaseParser {
|
|
144
|
+
static fromString(inputStr, atiOpts) {
|
|
145
|
+
let segments = this.getIdentifierSegments(inputStr, NUMBER_OF_ATI_SEGMENTS), [qualifier = "ati", platformQualifier = "cloud", resourceOwner, resourceType] = segments;
|
|
146
|
+
return validateAtiQualifier(qualifier), validatePlatformQualifier(platformQualifier), validateResourceOwner(resourceOwner, atiOpts == null ? void 0 : atiOpts.resourceOwner), validateResourceType(resourceType, atiOpts == null ? void 0 : atiOpts.resourceType), { platformQualifier, resourceOwner, resourceType };
|
|
147
|
+
}
|
|
148
|
+
static fromOpts(maybeAtiOpts, atiOpts) {
|
|
149
|
+
let { qualifier, platformQualifier, resourceOwner, resourceType } = maybeAtiOpts;
|
|
150
|
+
return validateAtiQualifier(qualifier), validatePlatformQualifier(platformQualifier), validateResourceOwner(resourceOwner, atiOpts == null ? void 0 : atiOpts.resourceOwner), validateResourceType(resourceType, atiOpts == null ? void 0 : atiOpts.resourceType), {
|
|
151
|
+
platformQualifier,
|
|
152
|
+
resourceOwner,
|
|
153
|
+
resourceType
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/ati.ts
|
|
159
|
+
var Ati = class _Ati {
|
|
160
|
+
constructor(platformQualifier, resourceOwner, resourceType) {
|
|
161
|
+
this._platformQualifier = platformQualifier, this._resourceOwner = resourceOwner, this._resourceType = resourceType;
|
|
162
|
+
}
|
|
163
|
+
get platformQualifier() {
|
|
164
|
+
return this._platformQualifier;
|
|
165
|
+
}
|
|
166
|
+
get resourceOwner() {
|
|
167
|
+
return this._resourceOwner;
|
|
168
|
+
}
|
|
169
|
+
get resourceType() {
|
|
170
|
+
return this._resourceType;
|
|
171
|
+
}
|
|
172
|
+
static create(opts) {
|
|
173
|
+
return new _Ati(opts.platformQualifier || "cloud", opts.resourceOwner, opts.resourceType);
|
|
174
|
+
}
|
|
175
|
+
static parse(maybeAti, atiOpts) {
|
|
176
|
+
let opts = AtiParser.fromString(maybeAti, atiOpts);
|
|
177
|
+
return new _Ati(opts.platformQualifier, opts.resourceOwner, opts.resourceType);
|
|
178
|
+
}
|
|
179
|
+
toString() {
|
|
180
|
+
return `ati:${this.platformQualifier}:${this.resourceOwner}:${this.resourceType}`;
|
|
181
|
+
}
|
|
182
|
+
toJSON() {
|
|
183
|
+
return this.toString();
|
|
184
|
+
}
|
|
185
|
+
toOpts() {
|
|
186
|
+
return {
|
|
187
|
+
platformQualifier: this._platformQualifier,
|
|
188
|
+
resourceOwner: this._resourceOwner,
|
|
189
|
+
resourceType: this._resourceType
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/core/ari.ts
|
|
195
|
+
var Ari = class {
|
|
196
|
+
constructor(opts) {
|
|
197
|
+
this._ati = Ati.create({
|
|
198
|
+
platformQualifier: "cloud",
|
|
199
|
+
resourceOwner: opts.resourceOwner,
|
|
200
|
+
resourceType: opts.resourceType
|
|
201
|
+
}), this._cloudId = opts.cloudId !== "" ? opts.cloudId : void 0, this._resourceId = opts.resourceId;
|
|
202
|
+
}
|
|
203
|
+
get platformQualifier() {
|
|
204
|
+
return this._ati.platformQualifier;
|
|
205
|
+
}
|
|
206
|
+
get cloudId() {
|
|
207
|
+
return this._cloudId;
|
|
208
|
+
}
|
|
209
|
+
get resourceOwner() {
|
|
210
|
+
return this._ati.resourceOwner;
|
|
211
|
+
}
|
|
212
|
+
get resourceType() {
|
|
213
|
+
return this._ati.resourceType;
|
|
214
|
+
}
|
|
215
|
+
get resourceId() {
|
|
216
|
+
return this._resourceId;
|
|
217
|
+
}
|
|
218
|
+
get ati() {
|
|
219
|
+
return this._ati;
|
|
220
|
+
}
|
|
221
|
+
equals(other) {
|
|
222
|
+
return this.toString() === other.toString();
|
|
223
|
+
}
|
|
224
|
+
toString() {
|
|
225
|
+
return `ari:${this.platformQualifier}:${this.resourceOwner}:${this.cloudId || ""}:${this.resourceType}/${this.resourceId}`;
|
|
226
|
+
}
|
|
227
|
+
toJSON() {
|
|
228
|
+
return this.toString();
|
|
229
|
+
}
|
|
230
|
+
toOpts() {
|
|
231
|
+
return {
|
|
232
|
+
platformQualifier: this.platformQualifier,
|
|
233
|
+
resourceOwner: this.resourceOwner,
|
|
234
|
+
cloudId: this.cloudId,
|
|
235
|
+
resourceType: this.resourceType,
|
|
236
|
+
resourceId: this.resourceId
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// src/any-ari.ts
|
|
242
|
+
var AnyAri = class _AnyAri extends Ari {
|
|
243
|
+
constructor(opts) {
|
|
244
|
+
super(opts);
|
|
245
|
+
}
|
|
246
|
+
static create(ariOpts, ariStaticOpts) {
|
|
247
|
+
let ariOptsWithDefaults = { ...ariOpts, resourceIdSegmentValues: {} }, validatedOpts = AriParser.fromOpts(ariOptsWithDefaults, ariStaticOpts);
|
|
248
|
+
return new _AnyAri(validatedOpts);
|
|
249
|
+
}
|
|
250
|
+
static parse(maybeAri, ariStaticOpts) {
|
|
251
|
+
let validatedOpts = AriParser.fromString(maybeAri, ariStaticOpts);
|
|
252
|
+
return new _AnyAri(validatedOpts);
|
|
253
|
+
}
|
|
254
|
+
static check(maybeAri) {
|
|
255
|
+
try {
|
|
256
|
+
return _AnyAri.parse(maybeAri.toString()), !0;
|
|
257
|
+
} catch (err) {
|
|
258
|
+
return !1;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
asAnyAri() {
|
|
262
|
+
return this;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// src/core/registered-ari.ts
|
|
267
|
+
var RegisteredAri = class extends Ari {
|
|
268
|
+
static check(maybeAri) {
|
|
269
|
+
try {
|
|
270
|
+
return this.parse(maybeAri.toString()), !0;
|
|
271
|
+
} catch (err) {
|
|
272
|
+
return !1;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
asAnyAri() {
|
|
276
|
+
return AnyAri.parse(this.toString());
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
// src/confluence/embed/types.ts
|
|
281
|
+
var ConfluenceEmbedAriResourceOwner = "confluence", ConfluenceEmbedAriResourceType = "embed";
|
|
282
|
+
|
|
283
|
+
// src/confluence/embed/manifest.ts
|
|
284
|
+
var confluenceEmbedAriStaticOpts = {
|
|
285
|
+
qualifier: "ari",
|
|
286
|
+
platformQualifier: "cloud",
|
|
287
|
+
cloudId: new RegExp("^[a-zA-Z0-9-]+$"),
|
|
288
|
+
resourceOwner: ConfluenceEmbedAriResourceOwner,
|
|
289
|
+
resourceType: ConfluenceEmbedAriResourceType,
|
|
290
|
+
resourceIdSlug: "activation/{activationId}/{embedId}",
|
|
291
|
+
resourceIdSegmentFormats: {
|
|
292
|
+
activationId: /[a-zA-Z0-9\-]+/,
|
|
293
|
+
// eslint-disable-line no-useless-escape
|
|
294
|
+
embedId: /[0-9]+/
|
|
295
|
+
// eslint-disable-line no-useless-escape
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// src/confluence/embed/index.ts
|
|
300
|
+
var ConfluenceEmbedAri = class _ConfluenceEmbedAri extends RegisteredAri {
|
|
301
|
+
constructor(opts) {
|
|
302
|
+
super(opts);
|
|
303
|
+
this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._embedId = opts.resourceIdSegmentValues.embedId;
|
|
304
|
+
}
|
|
305
|
+
get siteId() {
|
|
306
|
+
return this._siteId;
|
|
307
|
+
}
|
|
308
|
+
get activationId() {
|
|
309
|
+
return this._activationId;
|
|
310
|
+
}
|
|
311
|
+
get embedId() {
|
|
312
|
+
return this._embedId;
|
|
313
|
+
}
|
|
314
|
+
static create(opts) {
|
|
315
|
+
let derivedOpts = {
|
|
316
|
+
qualifier: confluenceEmbedAriStaticOpts.qualifier,
|
|
317
|
+
platformQualifier: confluenceEmbedAriStaticOpts.platformQualifier,
|
|
318
|
+
cloudId: opts.siteId,
|
|
319
|
+
resourceOwner: confluenceEmbedAriStaticOpts.resourceOwner,
|
|
320
|
+
resourceType: confluenceEmbedAriStaticOpts.resourceType,
|
|
321
|
+
resourceId: `activation/${opts.activationId}/${opts.embedId}`,
|
|
322
|
+
resourceIdSegmentValues: {
|
|
323
|
+
activationId: opts.activationId,
|
|
324
|
+
embedId: opts.embedId
|
|
325
|
+
}
|
|
326
|
+
}, ariOpts = AriParser.fromOpts(derivedOpts, confluenceEmbedAriStaticOpts);
|
|
327
|
+
return new _ConfluenceEmbedAri(ariOpts);
|
|
328
|
+
}
|
|
329
|
+
static parse(maybeAri) {
|
|
330
|
+
let opts = AriParser.fromString(maybeAri, confluenceEmbedAriStaticOpts);
|
|
331
|
+
return new _ConfluenceEmbedAri(opts);
|
|
332
|
+
}
|
|
333
|
+
getVariables() {
|
|
334
|
+
return {
|
|
335
|
+
siteId: this.siteId,
|
|
336
|
+
activationId: this.activationId,
|
|
337
|
+
embedId: this.embedId
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
342
|
+
0 && (module.exports = {
|
|
343
|
+
ConfluenceEmbedAri,
|
|
344
|
+
ConfluenceEmbedAriResourceOwner,
|
|
345
|
+
ConfluenceEmbedAriResourceType
|
|
346
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfluenceEmbedAri
|
|
3
|
+
} from "../../chunk-K2XTPA47.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ConfluenceEmbedAriResourceOwner,
|
|
6
|
+
ConfluenceEmbedAriResourceType
|
|
7
|
+
} from "../../chunk-N5UKNFK5.mjs";
|
|
8
|
+
import "../../chunk-PA4Y7TWI.mjs";
|
|
9
|
+
import "../../chunk-NCC2UXNN.mjs";
|
|
10
|
+
import "../../chunk-2UUYVBKT.mjs";
|
|
11
|
+
import "../../chunk-GDQPXUOZ.mjs";
|
|
12
|
+
import "../../chunk-FAZYALZ2.mjs";
|
|
13
|
+
export {
|
|
14
|
+
ConfluenceEmbedAri,
|
|
15
|
+
ConfluenceEmbedAriResourceOwner,
|
|
16
|
+
ConfluenceEmbedAriResourceType
|
|
17
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ConfluenceEmbedAriOpts } from '../../_tsup-dts-rollup';
|
|
2
|
+
export { ConfluenceEmbedAriResourceOwner_alias_1 as ConfluenceEmbedAriResourceOwner } from '../../_tsup-dts-rollup';
|
|
3
|
+
export { ConfluenceEmbedAriResourceType_alias_1 as ConfluenceEmbedAriResourceType } from '../../_tsup-dts-rollup';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
|
|
17
|
+
// src/confluence/embed/types.ts
|
|
18
|
+
var types_exports = {};
|
|
19
|
+
__export(types_exports, {
|
|
20
|
+
ConfluenceEmbedAriResourceOwner: () => ConfluenceEmbedAriResourceOwner,
|
|
21
|
+
ConfluenceEmbedAriResourceType: () => ConfluenceEmbedAriResourceType
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(types_exports);
|
|
24
|
+
var ConfluenceEmbedAriResourceOwner = "confluence", ConfluenceEmbedAriResourceType = "embed";
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
ConfluenceEmbedAriResourceOwner,
|
|
28
|
+
ConfluenceEmbedAriResourceType
|
|
29
|
+
});
|
|
@@ -4,6 +4,7 @@ export { ConfluenceBlogpostAri_alias_1 as ConfluenceBlogpostAri } from '../_tsup
|
|
|
4
4
|
export { ConfluenceCommentAri_alias_1 as ConfluenceCommentAri } from '../_tsup-dts-rollup';
|
|
5
5
|
export { ConfluenceContentAri_alias_1 as ConfluenceContentAri } from '../_tsup-dts-rollup';
|
|
6
6
|
export { ConfluenceDatabaseAri_alias_1 as ConfluenceDatabaseAri } from '../_tsup-dts-rollup';
|
|
7
|
+
export { ConfluenceEmbedAri } from '../_tsup-dts-rollup';
|
|
7
8
|
export { ConfluenceEventAri_alias_1 as ConfluenceEventAri } from '../_tsup-dts-rollup';
|
|
8
9
|
export { ConfluenceLongRunningTaskAri_alias_1 as ConfluenceLongRunningTaskAri } from '../_tsup-dts-rollup';
|
|
9
10
|
export { ConfluenceNoteAri_alias_1 as ConfluenceNoteAri } from '../_tsup-dts-rollup';
|
|
@@ -23,6 +23,7 @@ __export(confluence_exports, {
|
|
|
23
23
|
ConfluenceCommentAri: () => ConfluenceCommentAri,
|
|
24
24
|
ConfluenceContentAri: () => ConfluenceContentAri,
|
|
25
25
|
ConfluenceDatabaseAri: () => ConfluenceDatabaseAri,
|
|
26
|
+
ConfluenceEmbedAri: () => ConfluenceEmbedAri,
|
|
26
27
|
ConfluenceEventAri: () => ConfluenceEventAri,
|
|
27
28
|
ConfluenceLongRunningTaskAri: () => ConfluenceLongRunningTaskAri,
|
|
28
29
|
ConfluenceNoteAri: () => ConfluenceNoteAri,
|
|
@@ -636,6 +637,68 @@ var ConfluenceDatabaseAri = class _ConfluenceDatabaseAri extends RegisteredAri {
|
|
|
636
637
|
}
|
|
637
638
|
};
|
|
638
639
|
|
|
640
|
+
// src/confluence/embed/types.ts
|
|
641
|
+
var ConfluenceEmbedAriResourceOwner = "confluence", ConfluenceEmbedAriResourceType = "embed";
|
|
642
|
+
|
|
643
|
+
// src/confluence/embed/manifest.ts
|
|
644
|
+
var confluenceEmbedAriStaticOpts = {
|
|
645
|
+
qualifier: "ari",
|
|
646
|
+
platformQualifier: "cloud",
|
|
647
|
+
cloudId: new RegExp("^[a-zA-Z0-9-]+$"),
|
|
648
|
+
resourceOwner: ConfluenceEmbedAriResourceOwner,
|
|
649
|
+
resourceType: ConfluenceEmbedAriResourceType,
|
|
650
|
+
resourceIdSlug: "activation/{activationId}/{embedId}",
|
|
651
|
+
resourceIdSegmentFormats: {
|
|
652
|
+
activationId: /[a-zA-Z0-9\-]+/,
|
|
653
|
+
// eslint-disable-line no-useless-escape
|
|
654
|
+
embedId: /[0-9]+/
|
|
655
|
+
// eslint-disable-line no-useless-escape
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
// src/confluence/embed/index.ts
|
|
660
|
+
var ConfluenceEmbedAri = class _ConfluenceEmbedAri extends RegisteredAri {
|
|
661
|
+
constructor(opts) {
|
|
662
|
+
super(opts);
|
|
663
|
+
this._siteId = opts.cloudId || "", this._activationId = opts.resourceIdSegmentValues.activationId, this._embedId = opts.resourceIdSegmentValues.embedId;
|
|
664
|
+
}
|
|
665
|
+
get siteId() {
|
|
666
|
+
return this._siteId;
|
|
667
|
+
}
|
|
668
|
+
get activationId() {
|
|
669
|
+
return this._activationId;
|
|
670
|
+
}
|
|
671
|
+
get embedId() {
|
|
672
|
+
return this._embedId;
|
|
673
|
+
}
|
|
674
|
+
static create(opts) {
|
|
675
|
+
let derivedOpts = {
|
|
676
|
+
qualifier: confluenceEmbedAriStaticOpts.qualifier,
|
|
677
|
+
platformQualifier: confluenceEmbedAriStaticOpts.platformQualifier,
|
|
678
|
+
cloudId: opts.siteId,
|
|
679
|
+
resourceOwner: confluenceEmbedAriStaticOpts.resourceOwner,
|
|
680
|
+
resourceType: confluenceEmbedAriStaticOpts.resourceType,
|
|
681
|
+
resourceId: `activation/${opts.activationId}/${opts.embedId}`,
|
|
682
|
+
resourceIdSegmentValues: {
|
|
683
|
+
activationId: opts.activationId,
|
|
684
|
+
embedId: opts.embedId
|
|
685
|
+
}
|
|
686
|
+
}, ariOpts = AriParser.fromOpts(derivedOpts, confluenceEmbedAriStaticOpts);
|
|
687
|
+
return new _ConfluenceEmbedAri(ariOpts);
|
|
688
|
+
}
|
|
689
|
+
static parse(maybeAri) {
|
|
690
|
+
let opts = AriParser.fromString(maybeAri, confluenceEmbedAriStaticOpts);
|
|
691
|
+
return new _ConfluenceEmbedAri(opts);
|
|
692
|
+
}
|
|
693
|
+
getVariables() {
|
|
694
|
+
return {
|
|
695
|
+
siteId: this.siteId,
|
|
696
|
+
activationId: this.activationId,
|
|
697
|
+
embedId: this.embedId
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
|
|
639
702
|
// src/confluence/event/types.ts
|
|
640
703
|
var ConfluenceEventAriResourceOwner = "confluence", ConfluenceEventAriResourceType = "event";
|
|
641
704
|
|
|
@@ -1334,6 +1397,7 @@ var ConfluenceWorkspaceAri = class _ConfluenceWorkspaceAri extends RegisteredAri
|
|
|
1334
1397
|
ConfluenceCommentAri,
|
|
1335
1398
|
ConfluenceContentAri,
|
|
1336
1399
|
ConfluenceDatabaseAri,
|
|
1400
|
+
ConfluenceEmbedAri,
|
|
1337
1401
|
ConfluenceEventAri,
|
|
1338
1402
|
ConfluenceLongRunningTaskAri,
|
|
1339
1403
|
ConfluenceNoteAri,
|