@forge/util 1.4.1-next.0 → 1.4.1

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/packages/analytics-node-client/README.md +65 -1
  4. package/packages/analytics-node-client/package.json +10 -5
  5. package/packages/analytics-node-client/src/index.js +1 -1
  6. package/packages/ari/_tsup-dts-rollup.d.ts +111 -0
  7. package/packages/ari/chunk-A5KZESJG.mjs +76 -0
  8. package/packages/ari/chunk-GHVFX7QU.mjs +80 -0
  9. package/packages/ari/chunk-IQPZXRAE.mjs +69 -0
  10. package/packages/ari/chunk-PF3FHNQU.mjs +7 -0
  11. package/packages/ari/chunk-QO2BQQRK.mjs +7 -0
  12. package/packages/ari/chunk-RYGO66NC.mjs +7 -0
  13. package/packages/ari/index.js +1 -1
  14. package/packages/ari/index.mjs +197 -191
  15. package/packages/ari/jira/index.d.ts +2 -0
  16. package/packages/ari/jira/index.js +131 -0
  17. package/packages/ari/jira/index.mjs +79 -69
  18. package/packages/ari/jira/issue-remote-link/index.d.ts +3 -0
  19. package/packages/ari/jira/issue-remote-link/index.js +353 -0
  20. package/packages/ari/jira/issue-remote-link/index.mjs +17 -0
  21. package/packages/ari/jira/issue-remote-link/types.d.ts +3 -0
  22. package/packages/ari/jira/issue-remote-link/types.js +29 -0
  23. package/packages/ari/jira/issue-remote-link/types.mjs +8 -0
  24. package/packages/ari/jira/notification-user-preference/index.d.ts +3 -0
  25. package/packages/ari/jira/notification-user-preference/index.js +342 -0
  26. package/packages/ari/jira/notification-user-preference/index.mjs +17 -0
  27. package/packages/ari/jira/notification-user-preference/types.d.ts +3 -0
  28. package/packages/ari/jira/notification-user-preference/types.js +29 -0
  29. package/packages/ari/jira/notification-user-preference/types.mjs +8 -0
  30. package/packages/ari/measurement/index.mjs +4 -4
  31. package/packages/ari/mercury/index.mjs +8 -8
  32. package/packages/ari/opsgenie/index.mjs +38 -38
  33. package/packages/ari/package.json +1 -1
  34. package/packages/ari/papi/index.mjs +4 -4
  35. package/packages/ari/people-perftool/index.mjs +4 -4
  36. package/packages/ari/platform/index.mjs +16 -16
  37. package/packages/ari/resource-types/epic.d.ts +1 -0
  38. package/packages/ari/resource-types/epic.js +27 -0
  39. package/packages/ari/resource-types/epic.mjs +5 -0
  40. package/packages/ari/resource-types/issue-remote-link.d.ts +1 -0
  41. package/packages/ari/resource-types/issue-remote-link.js +27 -0
  42. package/packages/ari/resource-types/issue-remote-link.mjs +5 -0
  43. package/packages/ari/statuspage/index.mjs +4 -4
  44. package/packages/ari/townsquare/index.mjs +11 -11
  45. package/packages/ari/trello/index.mjs +4 -4
  46. package/packages/ari/unified-help/index.mjs +4 -4
  47. package/packages/ari/virtual-agent/conversation/index.d.ts +3 -0
  48. package/packages/ari/virtual-agent/conversation/index.js +349 -0
  49. package/packages/ari/virtual-agent/conversation/index.mjs +17 -0
  50. package/packages/ari/virtual-agent/conversation/types.d.ts +3 -0
  51. package/packages/ari/virtual-agent/conversation/types.js +29 -0
  52. package/packages/ari/virtual-agent/conversation/types.mjs +8 -0
  53. package/packages/ari/virtual-agent/index.d.ts +1 -0
  54. package/packages/ari/virtual-agent/index.js +67 -0
  55. package/packages/ari/virtual-agent/index.mjs +6 -1
  56. package/packages/metrics-interface/CHANGELOG.md +42 -0
  57. package/packages/metrics-interface/README.md +13 -15
  58. package/packages/metrics-interface/dist/metrics.d.ts +2 -0
  59. package/packages/metrics-interface/dist/metrics.d.ts.map +1 -1
  60. package/packages/metrics-interface/dist/metrics.js +11 -1
  61. package/packages/metrics-interface/dist/metrics.js.map +1 -1
  62. package/packages/metrics-interface/dist/mocks/index.d.ts +3 -1
  63. package/packages/metrics-interface/dist/mocks/index.d.ts.map +1 -1
  64. package/packages/metrics-interface/dist/mocks/index.js +3 -1
  65. package/packages/metrics-interface/dist/mocks/index.js.map +1 -1
  66. package/packages/metrics-interface/package.json +3 -2
  67. /package/packages/ari/{chunk-VZUAPXXZ.mjs → chunk-GH4RGVNE.mjs} +0 -0
  68. /package/packages/ari/{chunk-WRVV7GZO.mjs → chunk-NZ5QEVUV.mjs} +0 -0
@@ -0,0 +1,27 @@
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/resource-types/epic.ts
18
+ var epic_exports = {};
19
+ __export(epic_exports, {
20
+ EpicType: () => EpicType
21
+ });
22
+ module.exports = __toCommonJS(epic_exports);
23
+ var EpicType = "epic";
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ EpicType
27
+ });
@@ -0,0 +1,5 @@
1
+ // src/resource-types/epic.ts
2
+ var EpicType = "epic";
3
+ export {
4
+ EpicType
5
+ };
@@ -0,0 +1 @@
1
+ export { IssueRemoteLinkType } from '../_tsup-dts-rollup';
@@ -0,0 +1,27 @@
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/resource-types/issue-remote-link.ts
18
+ var issue_remote_link_exports = {};
19
+ __export(issue_remote_link_exports, {
20
+ IssueRemoteLinkType: () => IssueRemoteLinkType
21
+ });
22
+ module.exports = __toCommonJS(issue_remote_link_exports);
23
+ var IssueRemoteLinkType = "issue-remote-link";
24
+ // Annotate the CommonJS export names for ESM import in node:
25
+ 0 && (module.exports = {
26
+ IssueRemoteLinkType
27
+ });
@@ -0,0 +1,5 @@
1
+ // src/resource-types/issue-remote-link.ts
2
+ var IssueRemoteLinkType = "issue-remote-link";
3
+ export {
4
+ IssueRemoteLinkType
5
+ };
@@ -1,12 +1,12 @@
1
1
  import "../chunk-TYQPBEKA.mjs";
2
- import {
3
- StatuspageSiteAri
4
- } from "../chunk-UR55BUGU.mjs";
5
- import "../chunk-6IR7P2SS.mjs";
6
2
  import {
7
3
  StatuspageRoleAri
8
4
  } from "../chunk-U74IDWBR.mjs";
9
5
  import "../chunk-BT2GYN5W.mjs";
6
+ import {
7
+ StatuspageSiteAri
8
+ } from "../chunk-UR55BUGU.mjs";
9
+ import "../chunk-6IR7P2SS.mjs";
10
10
  import "../chunk-PA4Y7TWI.mjs";
11
11
  import "../chunk-NCC2UXNN.mjs";
12
12
  import "../chunk-2UUYVBKT.mjs";
@@ -1,12 +1,4 @@
1
1
  import "../chunk-D3TDYNKN.mjs";
2
- import {
3
- TownsquareTagAri
4
- } from "../chunk-4ASWZ6G6.mjs";
5
- import "../chunk-7QVDZS4D.mjs";
6
- import {
7
- TownsquareProjectAri
8
- } from "../chunk-2A5PTN2K.mjs";
9
- import "../chunk-ICBJW6N7.mjs";
10
2
  import {
11
3
  TownsquareQuestionAri
12
4
  } from "../chunk-BMHAMW43.mjs";
@@ -20,9 +12,9 @@ import {
20
12
  } from "../chunk-VLO2J5Y6.mjs";
21
13
  import "../chunk-MC7VKTYC.mjs";
22
14
  import {
23
- TownsquareCommentAri
24
- } from "../chunk-4EFKXCDP.mjs";
25
- import "../chunk-GVAPRDNZ.mjs";
15
+ TownsquareTagAri
16
+ } from "../chunk-4ASWZ6G6.mjs";
17
+ import "../chunk-7QVDZS4D.mjs";
26
18
  import {
27
19
  TownsquareGoalAri
28
20
  } from "../chunk-ZAOTSBFG.mjs";
@@ -35,6 +27,14 @@ import {
35
27
  TownsquareLearningAri
36
28
  } from "../chunk-ORH5L6OW.mjs";
37
29
  import "../chunk-4J5O222V.mjs";
30
+ import {
31
+ TownsquareProjectAri
32
+ } from "../chunk-2A5PTN2K.mjs";
33
+ import "../chunk-ICBJW6N7.mjs";
34
+ import {
35
+ TownsquareCommentAri
36
+ } from "../chunk-4EFKXCDP.mjs";
37
+ import "../chunk-GVAPRDNZ.mjs";
38
38
  import "../chunk-PA4Y7TWI.mjs";
39
39
  import "../chunk-NCC2UXNN.mjs";
40
40
  import "../chunk-2UUYVBKT.mjs";
@@ -1,8 +1,4 @@
1
1
  import "../chunk-4MWZBX5W.mjs";
2
- import {
3
- TrelloUserAri
4
- } from "../chunk-EUOBS3S7.mjs";
5
- import "../chunk-OZFY5Y6K.mjs";
6
2
  import {
7
3
  TrelloWorkspaceAri
8
4
  } from "../chunk-ZPFQVODV.mjs";
@@ -19,6 +15,10 @@ import {
19
15
  TrelloSiteAri
20
16
  } from "../chunk-FZCR5GBW.mjs";
21
17
  import "../chunk-P3FZABZE.mjs";
18
+ import {
19
+ TrelloUserAri
20
+ } from "../chunk-EUOBS3S7.mjs";
21
+ import "../chunk-OZFY5Y6K.mjs";
22
22
  import {
23
23
  TrelloBoardAri
24
24
  } from "../chunk-LV5I2AUV.mjs";
@@ -1,8 +1,4 @@
1
1
  import "../chunk-ATN7NKOC.mjs";
2
- import {
3
- UnifiedHelpWorkspaceAri
4
- } from "../chunk-RNKQKQA7.mjs";
5
- import "../chunk-GXNUL5AQ.mjs";
6
2
  import {
7
3
  UnifiedHelpRoleAri
8
4
  } from "../chunk-Y2GMHCDM.mjs";
@@ -11,6 +7,10 @@ import {
11
7
  UnifiedHelpSiteAri
12
8
  } from "../chunk-5SEALRQ7.mjs";
13
9
  import "../chunk-OKKAA5RV.mjs";
10
+ import {
11
+ UnifiedHelpWorkspaceAri
12
+ } from "../chunk-RNKQKQA7.mjs";
13
+ import "../chunk-GXNUL5AQ.mjs";
14
14
  import "../chunk-PA4Y7TWI.mjs";
15
15
  import "../chunk-NCC2UXNN.mjs";
16
16
  import "../chunk-2UUYVBKT.mjs";
@@ -0,0 +1,3 @@
1
+ export { VirtualAgentConversationAriResourceOwner } from '../../_tsup-dts-rollup';
2
+ export { VirtualAgentConversationAriResourceType } from '../../_tsup-dts-rollup';
3
+ export { VirtualAgentConversationAri_alias_1 as VirtualAgentConversationAri } from '../../_tsup-dts-rollup';
@@ -0,0 +1,349 @@
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/virtual-agent/conversation/index.ts
18
+ var conversation_exports = {};
19
+ __export(conversation_exports, {
20
+ VirtualAgentConversationAri: () => VirtualAgentConversationAri,
21
+ VirtualAgentConversationAriResourceOwner: () => VirtualAgentConversationAriResourceOwner,
22
+ VirtualAgentConversationAriResourceType: () => VirtualAgentConversationAriResourceType
23
+ });
24
+ module.exports = __toCommonJS(conversation_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/virtual-agent/conversation/types.ts
281
+ var VirtualAgentConversationAriResourceOwner = "virtual-agent", VirtualAgentConversationAriResourceType = "conversation";
282
+
283
+ // src/virtual-agent/conversation/manifest.ts
284
+ var virtualAgentConversationAriStaticOpts = {
285
+ qualifier: "ari",
286
+ platformQualifier: "cloud",
287
+ cloudId: new RegExp("^$"),
288
+ resourceOwner: VirtualAgentConversationAriResourceOwner,
289
+ resourceType: VirtualAgentConversationAriResourceType,
290
+ resourceIdSlug: "{activationId}/{configurationId}/{conversationId}",
291
+ resourceIdSegmentFormats: {
292
+ activationId: /[a-zA-Z0-9\-]+/,
293
+ // eslint-disable-line no-useless-escape
294
+ configurationId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/,
295
+ // eslint-disable-line no-useless-escape
296
+ conversationId: /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/
297
+ // eslint-disable-line no-useless-escape
298
+ }
299
+ };
300
+
301
+ // src/virtual-agent/conversation/index.ts
302
+ var VirtualAgentConversationAri = class _VirtualAgentConversationAri extends RegisteredAri {
303
+ constructor(opts) {
304
+ super(opts);
305
+ this._activationId = opts.resourceIdSegmentValues.activationId, this._configurationId = opts.resourceIdSegmentValues.configurationId, this._conversationId = opts.resourceIdSegmentValues.conversationId;
306
+ }
307
+ get activationId() {
308
+ return this._activationId;
309
+ }
310
+ get configurationId() {
311
+ return this._configurationId;
312
+ }
313
+ get conversationId() {
314
+ return this._conversationId;
315
+ }
316
+ static create(opts) {
317
+ let derivedOpts = {
318
+ qualifier: virtualAgentConversationAriStaticOpts.qualifier,
319
+ platformQualifier: virtualAgentConversationAriStaticOpts.platformQualifier,
320
+ cloudId: void 0,
321
+ resourceOwner: virtualAgentConversationAriStaticOpts.resourceOwner,
322
+ resourceType: virtualAgentConversationAriStaticOpts.resourceType,
323
+ resourceId: `${opts.activationId}/${opts.configurationId}/${opts.conversationId}`,
324
+ resourceIdSegmentValues: {
325
+ activationId: opts.activationId,
326
+ configurationId: opts.configurationId,
327
+ conversationId: opts.conversationId
328
+ }
329
+ }, ariOpts = AriParser.fromOpts(derivedOpts, virtualAgentConversationAriStaticOpts);
330
+ return new _VirtualAgentConversationAri(ariOpts);
331
+ }
332
+ static parse(maybeAri) {
333
+ let opts = AriParser.fromString(maybeAri, virtualAgentConversationAriStaticOpts);
334
+ return new _VirtualAgentConversationAri(opts);
335
+ }
336
+ getVariables() {
337
+ return {
338
+ activationId: this.activationId,
339
+ configurationId: this.configurationId,
340
+ conversationId: this.conversationId
341
+ };
342
+ }
343
+ };
344
+ // Annotate the CommonJS export names for ESM import in node:
345
+ 0 && (module.exports = {
346
+ VirtualAgentConversationAri,
347
+ VirtualAgentConversationAriResourceOwner,
348
+ VirtualAgentConversationAriResourceType
349
+ });
@@ -0,0 +1,17 @@
1
+ import {
2
+ VirtualAgentConversationAri
3
+ } from "../../chunk-A5KZESJG.mjs";
4
+ import {
5
+ VirtualAgentConversationAriResourceOwner,
6
+ VirtualAgentConversationAriResourceType
7
+ } from "../../chunk-PF3FHNQU.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
+ VirtualAgentConversationAri,
15
+ VirtualAgentConversationAriResourceOwner,
16
+ VirtualAgentConversationAriResourceType
17
+ };
@@ -0,0 +1,3 @@
1
+ export { VirtualAgentConversationAriOpts } from '../../_tsup-dts-rollup';
2
+ export { VirtualAgentConversationAriResourceOwner_alias_1 as VirtualAgentConversationAriResourceOwner } from '../../_tsup-dts-rollup';
3
+ export { VirtualAgentConversationAriResourceType_alias_1 as VirtualAgentConversationAriResourceType } 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/virtual-agent/conversation/types.ts
18
+ var types_exports = {};
19
+ __export(types_exports, {
20
+ VirtualAgentConversationAriResourceOwner: () => VirtualAgentConversationAriResourceOwner,
21
+ VirtualAgentConversationAriResourceType: () => VirtualAgentConversationAriResourceType
22
+ });
23
+ module.exports = __toCommonJS(types_exports);
24
+ var VirtualAgentConversationAriResourceOwner = "virtual-agent", VirtualAgentConversationAriResourceType = "conversation";
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ VirtualAgentConversationAriResourceOwner,
28
+ VirtualAgentConversationAriResourceType
29
+ });
@@ -0,0 +1,8 @@
1
+ import {
2
+ VirtualAgentConversationAriResourceOwner,
3
+ VirtualAgentConversationAriResourceType
4
+ } from "../../chunk-PF3FHNQU.mjs";
5
+ export {
6
+ VirtualAgentConversationAriResourceOwner,
7
+ VirtualAgentConversationAriResourceType
8
+ };
@@ -1,4 +1,5 @@
1
1
  export { VirtualAgentConfigurationAri_alias_1 as VirtualAgentConfigurationAri } from '../_tsup-dts-rollup';
2
+ export { VirtualAgentConversationAri } from '../_tsup-dts-rollup';
2
3
  export { VirtualAgentFlowEditorAri_alias_1 as VirtualAgentFlowEditorAri } from '../_tsup-dts-rollup';
3
4
  export { VirtualAgentIntentProjectionAri_alias_1 as VirtualAgentIntentProjectionAri } from '../_tsup-dts-rollup';
4
5
  export { VirtualAgentIntentQuestionProjectionAri_alias_1 as VirtualAgentIntentQuestionProjectionAri } from '../_tsup-dts-rollup';