@atlaskit/rovo-triggers 5.1.0 → 5.3.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/rovo-triggers
2
2
 
3
+ ## 5.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8ae7b09b07a1c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8ae7b09b07a1c) -
8
+ Add the ability to edit already published agents by adding support for a new tool called
9
+ UpdateAgentConfigurationTool and refetching agent information on success of the tool
10
+
11
+ ## 5.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`9a1069a9e2278`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a1069a9e2278) -
16
+ [ux] Add studio-automation-trigger-rule-build action to fetch automation rule in Studio
17
+
3
18
  ## 5.1.0
4
19
 
5
20
  ### Minor Changes
@@ -20,7 +20,7 @@ var isValidURL = function isValidURL(url) {
20
20
  try {
21
21
  new URL(url);
22
22
  return true;
23
- } catch (error) {
23
+ } catch (_unused) {
24
24
  return false;
25
25
  }
26
26
  };
@@ -80,7 +80,7 @@ var getRovoParams = exports.getRovoParams = function getRovoParams(url) {
80
80
  var search = url ? new URL(url).search : window.location.search;
81
81
  var q = new URLSearchParams(search);
82
82
  return processParams(q).rovoParams;
83
- } catch (error) {
83
+ } catch (_unused2) {
84
84
  return {};
85
85
  }
86
86
  };
@@ -111,18 +111,23 @@ var encodeRovoParams = exports.encodeRovoParams = function encodeRovoParams(para
111
111
  return acc;
112
112
  }, {});
113
113
  }
114
- return Object.entries(params).map(function (_ref3) {
114
+ return Object.entries(params).filter(function (_ref3) {
115
115
  var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
116
- key = _ref4[0],
116
+ _ = _ref4[0],
117
117
  value = _ref4[1];
118
+ return value !== undefined;
119
+ }).map(function (_ref5) {
120
+ var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
121
+ key = _ref6[0],
122
+ value = _ref6[1];
118
123
  return "".concat(addPrefix(key), "=").concat(encodeURIComponent(value));
119
124
  }).join('&');
120
125
  };
121
126
  var assertOnlySpecificFieldsDefined = exports.assertOnlySpecificFieldsDefined = function assertOnlySpecificFieldsDefined(params, fields) {
122
- return Object.entries(params).every(function (_ref5) {
123
- var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
124
- key = _ref6[0],
125
- value = _ref6[1];
127
+ return Object.entries(params).every(function (_ref7) {
128
+ var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
129
+ key = _ref8[0],
130
+ value = _ref8[1];
126
131
  var field = fields.find(function (field) {
127
132
  return field === key;
128
133
  });
@@ -134,9 +139,9 @@ var assertOnlySpecificFieldsDefined = exports.assertOnlySpecificFieldsDefined =
134
139
  });
135
140
  };
136
141
  var getListOfRovoParams = exports.getListOfRovoParams = function getListOfRovoParams() {
137
- var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
138
- _ref7$resourceRouterQ = _ref7.resourceRouterQuery,
139
- resourceRouterQuery = _ref7$resourceRouterQ === void 0 ? false : _ref7$resourceRouterQ;
142
+ var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
143
+ _ref9$resourceRouterQ = _ref9.resourceRouterQuery,
144
+ resourceRouterQuery = _ref9$resourceRouterQ === void 0 ? false : _ref9$resourceRouterQ;
140
145
  /*
141
146
  For products using react-resource-router (e.g Atlas) to
142
147
  pass as the value of `query` on the route definition. It ensures that our parameters
@@ -5,7 +5,7 @@ const isValidURL = url => {
5
5
  try {
6
6
  new URL(url);
7
7
  return true;
8
- } catch (error) {
8
+ } catch {
9
9
  return false;
10
10
  }
11
11
  };
@@ -58,7 +58,7 @@ export const getRovoParams = url => {
58
58
  const search = url ? new URL(url).search : window.location.search;
59
59
  const q = new URLSearchParams(search);
60
60
  return processParams(q).rovoParams;
61
- } catch (error) {
61
+ } catch {
62
62
  return {};
63
63
  }
64
64
  };
@@ -90,7 +90,7 @@ export const encodeRovoParams = (params, encodeAsObject) => {
90
90
  return acc;
91
91
  }, {});
92
92
  }
93
- return Object.entries(params).map(([key, value]) => {
93
+ return Object.entries(params).filter(([_, value]) => value !== undefined).map(([key, value]) => {
94
94
  return `${addPrefix(key)}=${encodeURIComponent(value)}`;
95
95
  }).join('&');
96
96
  };
@@ -13,7 +13,7 @@ var isValidURL = function isValidURL(url) {
13
13
  try {
14
14
  new URL(url);
15
15
  return true;
16
- } catch (error) {
16
+ } catch (_unused) {
17
17
  return false;
18
18
  }
19
19
  };
@@ -73,7 +73,7 @@ export var getRovoParams = function getRovoParams(url) {
73
73
  var search = url ? new URL(url).search : window.location.search;
74
74
  var q = new URLSearchParams(search);
75
75
  return processParams(q).rovoParams;
76
- } catch (error) {
76
+ } catch (_unused2) {
77
77
  return {};
78
78
  }
79
79
  };
@@ -104,18 +104,23 @@ export var encodeRovoParams = function encodeRovoParams(params, encodeAsObject)
104
104
  return acc;
105
105
  }, {});
106
106
  }
107
- return Object.entries(params).map(function (_ref3) {
107
+ return Object.entries(params).filter(function (_ref3) {
108
108
  var _ref4 = _slicedToArray(_ref3, 2),
109
- key = _ref4[0],
109
+ _ = _ref4[0],
110
110
  value = _ref4[1];
111
+ return value !== undefined;
112
+ }).map(function (_ref5) {
113
+ var _ref6 = _slicedToArray(_ref5, 2),
114
+ key = _ref6[0],
115
+ value = _ref6[1];
111
116
  return "".concat(addPrefix(key), "=").concat(encodeURIComponent(value));
112
117
  }).join('&');
113
118
  };
114
119
  export var assertOnlySpecificFieldsDefined = function assertOnlySpecificFieldsDefined(params, fields) {
115
- return Object.entries(params).every(function (_ref5) {
116
- var _ref6 = _slicedToArray(_ref5, 2),
117
- key = _ref6[0],
118
- value = _ref6[1];
120
+ return Object.entries(params).every(function (_ref7) {
121
+ var _ref8 = _slicedToArray(_ref7, 2),
122
+ key = _ref8[0],
123
+ value = _ref8[1];
119
124
  var field = fields.find(function (field) {
120
125
  return field === key;
121
126
  });
@@ -127,9 +132,9 @@ export var assertOnlySpecificFieldsDefined = function assertOnlySpecificFieldsDe
127
132
  });
128
133
  };
129
134
  export var getListOfRovoParams = function getListOfRovoParams() {
130
- var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
131
- _ref7$resourceRouterQ = _ref7.resourceRouterQuery,
132
- resourceRouterQuery = _ref7$resourceRouterQ === void 0 ? false : _ref7$resourceRouterQ;
135
+ var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
136
+ _ref9$resourceRouterQ = _ref9.resourceRouterQuery,
137
+ resourceRouterQuery = _ref9$resourceRouterQ === void 0 ? false : _ref9$resourceRouterQ;
133
138
  /*
134
139
  For products using react-resource-router (e.g Atlas) to
135
140
  pass as the value of `query` on the route definition. It ensures that our parameters
@@ -21,9 +21,17 @@ export type SolutionPlanStateUpdatePayload = PayloadCore<'solution-plan-state-up
21
21
  export type SolutionArchitectAgentActivationPayload = PayloadCore<'solution-architect-agent-activation', {
22
22
  draftBuildId: string;
23
23
  }>;
24
+ export type StudioAutomationBuildUpdatePayload = PayloadCore<'studio-automation-build-updated', {
25
+ buildId: string;
26
+ }>;
24
27
  export type AutomationRuleUpdatePayload = PayloadCore<'automation-rule-update'> & {
25
28
  data: {
26
29
  rule: string;
27
30
  };
28
31
  };
32
+ export type UpdateAgentConfigurationPayload = PayloadCore<'agent-configuration-update'> & {
33
+ data: {
34
+ ari: string;
35
+ };
36
+ };
29
37
  export {};
@@ -1,6 +1,6 @@
1
1
  export { usePublish, useSubscribe, useSubscribeAll, Subscriber } from './main';
2
2
  export type { Payload, Callback, Topic, WorkflowContextPayloadData, EditorContextPayloadData, WhiteboardContextPayloadData, BrowserContextPayloadData, DatabaseContextPayloadData, AddStatusRovoPayload, UpdateStatusRovoPayload, DeleteStatusRovoPayload, AddNewTransitionRovoPayload, UpdateTransitionRovoPayload, DeleteTransitionRovoPayload, DeleteTransitionRovoPayloadOld, AddRuleRovoPayload, UpdateRuleRovoPayload, DeleteRuleRovoPayload, JiraWorkflowWizardAction, DashboardInsightsActionsPayload, DashboardInsightsActionsPayloadData, OpenChatDebugModalPayload, OpenChatFeedbackModalPayload, } from './types';
3
- export type { SolutionArchitectHandoffPayload, NonAppHandoffPayload, AppHandoffPayload, SolutionArchitectAgentActivationPayload, AutomationRuleUpdatePayload, } from './common/types/solution-architect';
3
+ export type { SolutionArchitectHandoffPayload, NonAppHandoffPayload, AppHandoffPayload, SolutionArchitectAgentActivationPayload, StudioAutomationBuildUpdatePayload, } from './common/types/solution-architect';
4
4
  export type { JsmJourneyBuilderActionsPayload, JsmJourneyBuilderAgentAction, } from './common/types/jsm-journey-builder';
5
5
  export { getRovoParams, updatePageRovoParams, addRovoParamsToUrl, assertOnlySpecificFieldsDefined, encodeRovoParams, getListOfRovoParams, } from './common/utils/params';
6
6
  export type { RovoChatParams, RovoChatPathway } from './common/utils/params/types';
@@ -1,7 +1,7 @@
1
1
  import type { DocNode } from '@atlaskit/adf-schema';
2
2
  import type { SolutionDraftAgentUpdatePayload } from './common/types/agent';
3
3
  import type { JsmJourneyBuilderActionsPayload } from './common/types/jsm-journey-builder';
4
- import type { AutomationRuleUpdatePayload, SolutionArchitectAgentActivationPayload, SolutionArchitectHandoffPayload, SolutionPlanStateUpdatePayload } from './common/types/solution-architect';
4
+ import type { SolutionArchitectAgentActivationPayload, SolutionArchitectHandoffPayload, SolutionPlanStateUpdatePayload, StudioAutomationBuildUpdatePayload, UpdateAgentConfigurationPayload } from './common/types/solution-architect';
5
5
  import type { ChatContextPayload } from './common/utils/chat-context';
6
6
  export declare const Topics: {
7
7
  readonly AI_MATE: "ai-mate";
@@ -31,7 +31,7 @@ type TargetAgentParam = {
31
31
  agentExternalConfigReference: string;
32
32
  };
33
33
  type PlaceholderParam = {
34
- placeholderType?: 'person' | 'link' | 'generic';
34
+ placeholderType?: 'person' | 'link' | 'generic' | 'skill';
35
35
  };
36
36
  export type ChatNewPayload = PayloadCore<'chat-new', {
37
37
  name?: string;
@@ -274,7 +274,7 @@ export type OpenChatDebugModalPayload = PayloadCore<'open-chat-debug-modal'>;
274
274
  export type OpenChatFeedbackModalPayload = PayloadCore<'open-chat-feedback-modal', {
275
275
  answerQuality: 'good' | 'bad' | 'general';
276
276
  }>;
277
- export type Payload = MessageSendPayload | ChatClosePayload | ChatNewPayload | ChatDraftPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | AutomationRuleUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload;
277
+ export type Payload = MessageSendPayload | ChatClosePayload | ChatNewPayload | ChatDraftPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | UpdateAgentConfigurationPayload;
278
278
  export type Callback = (payload: Payload) => void;
279
279
  export type TopicEvents = {
280
280
  [key in Topic]?: Array<{
@@ -21,9 +21,17 @@ export type SolutionPlanStateUpdatePayload = PayloadCore<'solution-plan-state-up
21
21
  export type SolutionArchitectAgentActivationPayload = PayloadCore<'solution-architect-agent-activation', {
22
22
  draftBuildId: string;
23
23
  }>;
24
+ export type StudioAutomationBuildUpdatePayload = PayloadCore<'studio-automation-build-updated', {
25
+ buildId: string;
26
+ }>;
24
27
  export type AutomationRuleUpdatePayload = PayloadCore<'automation-rule-update'> & {
25
28
  data: {
26
29
  rule: string;
27
30
  };
28
31
  };
32
+ export type UpdateAgentConfigurationPayload = PayloadCore<'agent-configuration-update'> & {
33
+ data: {
34
+ ari: string;
35
+ };
36
+ };
29
37
  export {};
@@ -1,6 +1,6 @@
1
1
  export { usePublish, useSubscribe, useSubscribeAll, Subscriber } from './main';
2
2
  export type { Payload, Callback, Topic, WorkflowContextPayloadData, EditorContextPayloadData, WhiteboardContextPayloadData, BrowserContextPayloadData, DatabaseContextPayloadData, AddStatusRovoPayload, UpdateStatusRovoPayload, DeleteStatusRovoPayload, AddNewTransitionRovoPayload, UpdateTransitionRovoPayload, DeleteTransitionRovoPayload, DeleteTransitionRovoPayloadOld, AddRuleRovoPayload, UpdateRuleRovoPayload, DeleteRuleRovoPayload, JiraWorkflowWizardAction, DashboardInsightsActionsPayload, DashboardInsightsActionsPayloadData, OpenChatDebugModalPayload, OpenChatFeedbackModalPayload, } from './types';
3
- export type { SolutionArchitectHandoffPayload, NonAppHandoffPayload, AppHandoffPayload, SolutionArchitectAgentActivationPayload, AutomationRuleUpdatePayload, } from './common/types/solution-architect';
3
+ export type { SolutionArchitectHandoffPayload, NonAppHandoffPayload, AppHandoffPayload, SolutionArchitectAgentActivationPayload, StudioAutomationBuildUpdatePayload, } from './common/types/solution-architect';
4
4
  export type { JsmJourneyBuilderActionsPayload, JsmJourneyBuilderAgentAction, } from './common/types/jsm-journey-builder';
5
5
  export { getRovoParams, updatePageRovoParams, addRovoParamsToUrl, assertOnlySpecificFieldsDefined, encodeRovoParams, getListOfRovoParams, } from './common/utils/params';
6
6
  export type { RovoChatParams, RovoChatPathway } from './common/utils/params/types';
@@ -1,7 +1,7 @@
1
1
  import type { DocNode } from '@atlaskit/adf-schema';
2
2
  import type { SolutionDraftAgentUpdatePayload } from './common/types/agent';
3
3
  import type { JsmJourneyBuilderActionsPayload } from './common/types/jsm-journey-builder';
4
- import type { AutomationRuleUpdatePayload, SolutionArchitectAgentActivationPayload, SolutionArchitectHandoffPayload, SolutionPlanStateUpdatePayload } from './common/types/solution-architect';
4
+ import type { SolutionArchitectAgentActivationPayload, SolutionArchitectHandoffPayload, SolutionPlanStateUpdatePayload, StudioAutomationBuildUpdatePayload, UpdateAgentConfigurationPayload } from './common/types/solution-architect';
5
5
  import type { ChatContextPayload } from './common/utils/chat-context';
6
6
  export declare const Topics: {
7
7
  readonly AI_MATE: "ai-mate";
@@ -31,7 +31,7 @@ type TargetAgentParam = {
31
31
  agentExternalConfigReference: string;
32
32
  };
33
33
  type PlaceholderParam = {
34
- placeholderType?: 'person' | 'link' | 'generic';
34
+ placeholderType?: 'person' | 'link' | 'generic' | 'skill';
35
35
  };
36
36
  export type ChatNewPayload = PayloadCore<'chat-new', {
37
37
  name?: string;
@@ -274,7 +274,7 @@ export type OpenChatDebugModalPayload = PayloadCore<'open-chat-debug-modal'>;
274
274
  export type OpenChatFeedbackModalPayload = PayloadCore<'open-chat-feedback-modal', {
275
275
  answerQuality: 'good' | 'bad' | 'general';
276
276
  }>;
277
- export type Payload = MessageSendPayload | ChatClosePayload | ChatNewPayload | ChatDraftPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | AutomationRuleUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload;
277
+ export type Payload = MessageSendPayload | ChatClosePayload | ChatNewPayload | ChatDraftPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | UpdateAgentConfigurationPayload;
278
278
  export type Callback = (payload: Payload) => void;
279
279
  export type TopicEvents = {
280
280
  [key in Topic]?: Array<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-triggers",
3
- "version": "5.1.0",
3
+ "version": "5.3.0",
4
4
  "description": "Provides various trigger events to drive Rovo Chat functionality, such as a publish-subscribe and URL parameter hooks",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/adf-schema": "^51.5.1",
32
+ "@atlaskit/adf-schema": "^51.5.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "bind-event-listener": "^3.0.0"
35
35
  },
@@ -39,8 +39,8 @@
39
39
  "devDependencies": {
40
40
  "@af/integration-testing": "workspace:^",
41
41
  "@af/visual-regression": "workspace:^",
42
- "@atlaskit/css": "^0.17.0",
43
- "@atlaskit/primitives": "^16.4.0",
42
+ "@atlaskit/css": "^0.19.0",
43
+ "@atlaskit/primitives": "^17.0.0",
44
44
  "@atlaskit/ssr": "workspace:^",
45
45
  "@atlassian/feature-flags-test-utils": "^1.0.0",
46
46
  "@testing-library/react": "^13.4.0",