@rothenbergt/backstage-plugin-roadmap-common 0.4.1 → 1.1.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/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @rothenbergt/backstage-plugin-roadmap-common
2
2
 
3
- Welcome to the common package for the roadmap plugin!
3
+ Shared types and constants for the [Backstage Roadmap Plugin](https://github.com/rothenbergt/backstage-roadmap-plugin). You normally don't install this package directly; it comes along as a dependency of the frontend and backend packages.
4
4
 
5
- _This plugin was created through the Backstage CLI_
5
+ It contains:
6
+
7
+ - **Types**: `Feature`, `Comment`, `FeatureStatus`, and the board configuration types. API fields are camelCase with ISO 8601 UTC timestamps.
8
+ - **Permissions**: `roadmapCreatePermission` (`roadmap.create`), `roadmapAdminPermission` (`roadmap.admin`), and the `roadmapPermissions` list for policy authors.
9
+ - **Events and signals constants**: the `roadmap` events topic, action names for every mutation, the `roadmap:board` signals channel, and the `RoadmapSignal` payload type, for anyone subscribing to roadmap changes from their own modules.
10
+
11
+ See the [main README](https://github.com/rothenbergt/backstage-roadmap-plugin#readme) for plugin setup, and each package's `report.api.md` for the exact public API.
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ const EVENTS_TOPIC_ROADMAP = "roadmap";
4
+ const EVENTS_ACTION_CREATE_FEATURE = "create_feature";
5
+ const EVENTS_ACTION_UPDATE_FEATURE = "update_feature";
6
+ const EVENTS_ACTION_DELETE_FEATURE = "delete_feature";
7
+ const EVENTS_ACTION_CHANGE_FEATURE_STATUS = "change_feature_status";
8
+ const EVENTS_ACTION_TOGGLE_VOTE = "toggle_vote";
9
+ const EVENTS_ACTION_CREATE_COMMENT = "create_comment";
10
+ const EVENTS_ACTION_DELETE_COMMENT = "delete_comment";
11
+ const EVENTS_ACTION_REORDER_BOARD = "reorder_board";
12
+ const SIGNALS_CHANNEL_ROADMAP = "roadmap:board";
13
+
14
+ exports.EVENTS_ACTION_CHANGE_FEATURE_STATUS = EVENTS_ACTION_CHANGE_FEATURE_STATUS;
15
+ exports.EVENTS_ACTION_CREATE_COMMENT = EVENTS_ACTION_CREATE_COMMENT;
16
+ exports.EVENTS_ACTION_CREATE_FEATURE = EVENTS_ACTION_CREATE_FEATURE;
17
+ exports.EVENTS_ACTION_DELETE_COMMENT = EVENTS_ACTION_DELETE_COMMENT;
18
+ exports.EVENTS_ACTION_DELETE_FEATURE = EVENTS_ACTION_DELETE_FEATURE;
19
+ exports.EVENTS_ACTION_REORDER_BOARD = EVENTS_ACTION_REORDER_BOARD;
20
+ exports.EVENTS_ACTION_TOGGLE_VOTE = EVENTS_ACTION_TOGGLE_VOTE;
21
+ exports.EVENTS_ACTION_UPDATE_FEATURE = EVENTS_ACTION_UPDATE_FEATURE;
22
+ exports.EVENTS_TOPIC_ROADMAP = EVENTS_TOPIC_ROADMAP;
23
+ exports.SIGNALS_CHANNEL_ROADMAP = SIGNALS_CHANNEL_ROADMAP;
24
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/events/index.ts"],"sourcesContent":["import { Feature } from '../types';\n\n/**\n * Events service topic for all roadmap events.\n *\n * @public\n */\nexport const EVENTS_TOPIC_ROADMAP = 'roadmap';\n\n/**\n * Actions attached to roadmap events (in event metadata).\n *\n * @public\n */\nexport const EVENTS_ACTION_CREATE_FEATURE = 'create_feature';\n/** @public */\nexport const EVENTS_ACTION_UPDATE_FEATURE = 'update_feature';\n/** @public */\nexport const EVENTS_ACTION_DELETE_FEATURE = 'delete_feature';\n/** @public */\nexport const EVENTS_ACTION_CHANGE_FEATURE_STATUS = 'change_feature_status';\n/** @public */\nexport const EVENTS_ACTION_TOGGLE_VOTE = 'toggle_vote';\n/** @public */\nexport const EVENTS_ACTION_CREATE_COMMENT = 'create_comment';\n/** @public */\nexport const EVENTS_ACTION_DELETE_COMMENT = 'delete_comment';\n/** @public */\nexport const EVENTS_ACTION_REORDER_BOARD = 'reorder_board';\n\n/**\n * Signals channel the roadmap backend broadcasts board updates on.\n *\n * @public\n */\nexport const SIGNALS_CHANNEL_ROADMAP = 'roadmap:board';\n\n/**\n * Kinds of live board updates carried by {@link RoadmapSignal}.\n *\n * @public\n */\nexport type RoadmapSignalKind =\n | 'feature_created'\n | 'feature_updated'\n | 'feature_deleted'\n | 'status_changed'\n | 'vote_changed'\n | 'comment_added'\n | 'comment_deleted'\n | 'board_reordered';\n\n/**\n * Signal broadcast on {@link SIGNALS_CHANNEL_ROADMAP} whenever the board\n * changes, so open boards can refresh live instead of waiting for a refetch.\n *\n * @public\n */\nexport type RoadmapSignal = {\n kind: RoadmapSignalKind;\n /** Present for feature-scoped updates. */\n featureId?: string;\n /** Present when the full feature is cheap to include (create/update/status). */\n feature?: Feature;\n};\n"],"names":[],"mappings":";;AAOO,MAAM,oBAAA,GAAuB;AAO7B,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,mCAAA,GAAsC;AAE5C,MAAM,yBAAA,GAA4B;AAElC,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,2BAAA,GAA8B;AAOpC,MAAM,uBAAA,GAA0B;;;;;;;;;;;;;"}
@@ -0,0 +1,13 @@
1
+ const EVENTS_TOPIC_ROADMAP = "roadmap";
2
+ const EVENTS_ACTION_CREATE_FEATURE = "create_feature";
3
+ const EVENTS_ACTION_UPDATE_FEATURE = "update_feature";
4
+ const EVENTS_ACTION_DELETE_FEATURE = "delete_feature";
5
+ const EVENTS_ACTION_CHANGE_FEATURE_STATUS = "change_feature_status";
6
+ const EVENTS_ACTION_TOGGLE_VOTE = "toggle_vote";
7
+ const EVENTS_ACTION_CREATE_COMMENT = "create_comment";
8
+ const EVENTS_ACTION_DELETE_COMMENT = "delete_comment";
9
+ const EVENTS_ACTION_REORDER_BOARD = "reorder_board";
10
+ const SIGNALS_CHANNEL_ROADMAP = "roadmap:board";
11
+
12
+ export { EVENTS_ACTION_CHANGE_FEATURE_STATUS, EVENTS_ACTION_CREATE_COMMENT, EVENTS_ACTION_CREATE_FEATURE, EVENTS_ACTION_DELETE_COMMENT, EVENTS_ACTION_DELETE_FEATURE, EVENTS_ACTION_REORDER_BOARD, EVENTS_ACTION_TOGGLE_VOTE, EVENTS_ACTION_UPDATE_FEATURE, EVENTS_TOPIC_ROADMAP, SIGNALS_CHANNEL_ROADMAP };
13
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/events/index.ts"],"sourcesContent":["import { Feature } from '../types';\n\n/**\n * Events service topic for all roadmap events.\n *\n * @public\n */\nexport const EVENTS_TOPIC_ROADMAP = 'roadmap';\n\n/**\n * Actions attached to roadmap events (in event metadata).\n *\n * @public\n */\nexport const EVENTS_ACTION_CREATE_FEATURE = 'create_feature';\n/** @public */\nexport const EVENTS_ACTION_UPDATE_FEATURE = 'update_feature';\n/** @public */\nexport const EVENTS_ACTION_DELETE_FEATURE = 'delete_feature';\n/** @public */\nexport const EVENTS_ACTION_CHANGE_FEATURE_STATUS = 'change_feature_status';\n/** @public */\nexport const EVENTS_ACTION_TOGGLE_VOTE = 'toggle_vote';\n/** @public */\nexport const EVENTS_ACTION_CREATE_COMMENT = 'create_comment';\n/** @public */\nexport const EVENTS_ACTION_DELETE_COMMENT = 'delete_comment';\n/** @public */\nexport const EVENTS_ACTION_REORDER_BOARD = 'reorder_board';\n\n/**\n * Signals channel the roadmap backend broadcasts board updates on.\n *\n * @public\n */\nexport const SIGNALS_CHANNEL_ROADMAP = 'roadmap:board';\n\n/**\n * Kinds of live board updates carried by {@link RoadmapSignal}.\n *\n * @public\n */\nexport type RoadmapSignalKind =\n | 'feature_created'\n | 'feature_updated'\n | 'feature_deleted'\n | 'status_changed'\n | 'vote_changed'\n | 'comment_added'\n | 'comment_deleted'\n | 'board_reordered';\n\n/**\n * Signal broadcast on {@link SIGNALS_CHANNEL_ROADMAP} whenever the board\n * changes, so open boards can refresh live instead of waiting for a refetch.\n *\n * @public\n */\nexport type RoadmapSignal = {\n kind: RoadmapSignalKind;\n /** Present for feature-scoped updates. */\n featureId?: string;\n /** Present when the full feature is cheap to include (create/update/status). */\n feature?: Feature;\n};\n"],"names":[],"mappings":"AAOO,MAAM,oBAAA,GAAuB;AAO7B,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,mCAAA,GAAsC;AAE5C,MAAM,yBAAA,GAA4B;AAElC,MAAM,4BAAA,GAA+B;AAErC,MAAM,4BAAA,GAA+B;AAErC,MAAM,2BAAA,GAA8B;AAOpC,MAAM,uBAAA,GAA0B;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,12 +1,25 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./types/index.cjs.js');
4
- var index$1 = require('./permissions/index.cjs.js');
4
+ var index$2 = require('./permissions/index.cjs.js');
5
+ var index$1 = require('./events/index.cjs.js');
5
6
 
6
7
 
7
8
 
9
+ exports.DEFAULT_ROADMAP_PAGE_SUBTITLE = index.DEFAULT_ROADMAP_PAGE_SUBTITLE;
10
+ exports.DEFAULT_ROADMAP_PAGE_TITLE = index.DEFAULT_ROADMAP_PAGE_TITLE;
8
11
  exports.FeatureStatus = index.FeatureStatus;
9
- exports.roadmapAdminPermission = index$1.roadmapAdminPermission;
10
- exports.roadmapCreatePermission = index$1.roadmapCreatePermission;
11
- exports.roadmapPermissions = index$1.roadmapPermissions;
12
+ exports.roadmapAdminPermission = index$2.roadmapAdminPermission;
13
+ exports.roadmapCreatePermission = index$2.roadmapCreatePermission;
14
+ exports.roadmapPermissions = index$2.roadmapPermissions;
15
+ exports.EVENTS_ACTION_CHANGE_FEATURE_STATUS = index$1.EVENTS_ACTION_CHANGE_FEATURE_STATUS;
16
+ exports.EVENTS_ACTION_CREATE_COMMENT = index$1.EVENTS_ACTION_CREATE_COMMENT;
17
+ exports.EVENTS_ACTION_CREATE_FEATURE = index$1.EVENTS_ACTION_CREATE_FEATURE;
18
+ exports.EVENTS_ACTION_DELETE_COMMENT = index$1.EVENTS_ACTION_DELETE_COMMENT;
19
+ exports.EVENTS_ACTION_DELETE_FEATURE = index$1.EVENTS_ACTION_DELETE_FEATURE;
20
+ exports.EVENTS_ACTION_REORDER_BOARD = index$1.EVENTS_ACTION_REORDER_BOARD;
21
+ exports.EVENTS_ACTION_TOGGLE_VOTE = index$1.EVENTS_ACTION_TOGGLE_VOTE;
22
+ exports.EVENTS_ACTION_UPDATE_FEATURE = index$1.EVENTS_ACTION_UPDATE_FEATURE;
23
+ exports.EVENTS_TOPIC_ROADMAP = index$1.EVENTS_TOPIC_ROADMAP;
24
+ exports.SIGNALS_CHANNEL_ROADMAP = index$1.SIGNALS_CHANNEL_ROADMAP;
12
25
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import * as _backstage_plugin_permission_common from '@backstage/plugin-permission-common';
2
2
 
3
+ /**
4
+ * Lifecycle status of a roadmap feature.
5
+ *
6
+ * @public
7
+ */
3
8
  declare enum FeatureStatus {
4
9
  Suggested = "Suggested",
5
10
  Planned = "Planned",
@@ -7,55 +12,103 @@ declare enum FeatureStatus {
7
12
  Completed = "Completed",
8
13
  Declined = "Declined"
9
14
  }
10
- interface Feature {
15
+ /**
16
+ * A roadmap feature as returned by the roadmap API.
17
+ *
18
+ * Type alias (not interface) so it satisfies JsonObject for events/signals.
19
+ *
20
+ * @public
21
+ */
22
+ type Feature = {
11
23
  id: string;
12
24
  title: string;
13
25
  description: string;
14
26
  status: FeatureStatus;
15
27
  votes: number;
16
28
  author: string;
17
- created_at: string;
18
- updated_at: string;
29
+ /** ISO 8601 UTC timestamp. */
30
+ createdAt: string;
31
+ /** ISO 8601 UTC timestamp. */
32
+ updatedAt: string;
19
33
  /** Sort order within status (database datasource). */
20
- board_position?: number;
21
- }
34
+ boardPosition?: number;
35
+ };
36
+ /**
37
+ * Payload for suggesting a new feature.
38
+ *
39
+ * @public
40
+ */
22
41
  interface NewFeature {
23
42
  title: string;
24
43
  description: string;
25
44
  }
45
+ /**
46
+ * A comment on a roadmap feature.
47
+ *
48
+ * @public
49
+ */
26
50
  interface Comment {
27
51
  id: string;
28
52
  author: string;
29
53
  featureId: string;
30
54
  text: string;
31
- created_at: string;
32
- updated_at: string;
55
+ /** ISO 8601 UTC timestamp. */
56
+ createdAt: string;
57
+ /** ISO 8601 UTC timestamp. */
58
+ updatedAt: string;
33
59
  }
60
+ /**
61
+ * Payload for adding a comment to a feature.
62
+ *
63
+ * @public
64
+ */
34
65
  interface NewComment {
35
66
  text: string;
36
67
  featureId: string;
37
68
  author?: string;
38
69
  }
70
+ /**
71
+ * A board column with the features it contains.
72
+ *
73
+ * @public
74
+ */
39
75
  interface Column {
40
76
  title: string;
41
77
  features: Feature[];
42
78
  }
79
+ /**
80
+ * Result of toggling a vote on a feature.
81
+ *
82
+ * @public
83
+ */
43
84
  interface VoteResponse {
44
85
  voteAdded: boolean;
45
86
  voteCount: number;
46
87
  }
47
- /** Which timestamp drives retention for a column */
88
+ /**
89
+ * Which timestamp drives retention for a column.
90
+ *
91
+ * @public
92
+ */
48
93
  type RoadmapRetentionAnchor = 'created' | 'updated';
49
- /** One column entry after defaults are merged (used by API + UI). */
94
+ /**
95
+ * One column entry after defaults are merged (used by API + UI).
96
+ *
97
+ * @public
98
+ */
50
99
  interface RoadmapBoardColumnResolved {
51
100
  status: FeatureStatus;
52
101
  title: string;
53
102
  visible: boolean;
54
- /** When set (>0), items older than this many days are hidden from default list (database only). */
103
+ /** When set (positive), items older than this many days are hidden from the default list (database only). */
55
104
  retentionDays?: number;
56
105
  retentionAnchor: RoadmapRetentionAnchor;
57
106
  }
58
- /** Capabilities exposed to the frontend (GitLab = read-only extensions off). */
107
+ /**
108
+ * Capabilities exposed to the frontend (GitLab = read-only extensions off).
109
+ *
110
+ * @public
111
+ */
59
112
  interface RoadmapUiCapabilities {
60
113
  retentionFiltering: boolean;
61
114
  includeBeyondRetentionQuery: boolean;
@@ -65,14 +118,110 @@ interface RoadmapUiCapabilities {
65
118
  creatorEditDeleteSuggested: boolean;
66
119
  adminReorder: boolean;
67
120
  }
68
- /** Response for GET /features/board-config */
121
+ /**
122
+ * Roadmap page header title used when `roadmap.page.title` is not set.
123
+ *
124
+ * @public
125
+ */
126
+ declare const DEFAULT_ROADMAP_PAGE_TITLE = "Public Roadmap";
127
+ /**
128
+ * Roadmap page header subtitle used when `roadmap.page.subtitle` is not set.
129
+ *
130
+ * @public
131
+ */
132
+ declare const DEFAULT_ROADMAP_PAGE_SUBTITLE = "Shape the Future with Us";
133
+ /**
134
+ * Response for GET /features/board-config.
135
+ *
136
+ * @public
137
+ */
69
138
  interface RoadmapBoardConfigResponse {
139
+ /**
140
+ * Page header title from `roadmap.page.title`. Optional because backends
141
+ * older than this field do not send it; fall back to
142
+ * {@link DEFAULT_ROADMAP_PAGE_TITLE}.
143
+ */
144
+ title?: string;
145
+ /**
146
+ * Page header subtitle from `roadmap.page.subtitle`. Optional because
147
+ * backends older than this field do not send it; fall back to
148
+ * {@link DEFAULT_ROADMAP_PAGE_SUBTITLE}.
149
+ */
150
+ subtitle?: string;
70
151
  columns: RoadmapBoardColumnResolved[];
71
152
  capabilities: RoadmapUiCapabilities;
72
153
  }
73
154
 
155
+ /**
156
+ * Grants roadmap admin actions: changing status, editing and deleting
157
+ * features and comments, and reordering the board.
158
+ *
159
+ * @public
160
+ */
74
161
  declare const roadmapAdminPermission: _backstage_plugin_permission_common.BasicPermission;
162
+ /**
163
+ * Grants suggesting new features on the roadmap.
164
+ *
165
+ * @public
166
+ */
75
167
  declare const roadmapCreatePermission: _backstage_plugin_permission_common.BasicPermission;
168
+ /**
169
+ * All permissions defined by the roadmap plugin.
170
+ *
171
+ * @public
172
+ */
76
173
  declare const roadmapPermissions: _backstage_plugin_permission_common.BasicPermission[];
77
174
 
78
- export { type Column, type Comment, type Feature, FeatureStatus, type NewComment, type NewFeature, type RoadmapBoardColumnResolved, type RoadmapBoardConfigResponse, type RoadmapRetentionAnchor, type RoadmapUiCapabilities, type VoteResponse, roadmapAdminPermission, roadmapCreatePermission, roadmapPermissions };
175
+ /**
176
+ * Events service topic for all roadmap events.
177
+ *
178
+ * @public
179
+ */
180
+ declare const EVENTS_TOPIC_ROADMAP = "roadmap";
181
+ /**
182
+ * Actions attached to roadmap events (in event metadata).
183
+ *
184
+ * @public
185
+ */
186
+ declare const EVENTS_ACTION_CREATE_FEATURE = "create_feature";
187
+ /** @public */
188
+ declare const EVENTS_ACTION_UPDATE_FEATURE = "update_feature";
189
+ /** @public */
190
+ declare const EVENTS_ACTION_DELETE_FEATURE = "delete_feature";
191
+ /** @public */
192
+ declare const EVENTS_ACTION_CHANGE_FEATURE_STATUS = "change_feature_status";
193
+ /** @public */
194
+ declare const EVENTS_ACTION_TOGGLE_VOTE = "toggle_vote";
195
+ /** @public */
196
+ declare const EVENTS_ACTION_CREATE_COMMENT = "create_comment";
197
+ /** @public */
198
+ declare const EVENTS_ACTION_DELETE_COMMENT = "delete_comment";
199
+ /** @public */
200
+ declare const EVENTS_ACTION_REORDER_BOARD = "reorder_board";
201
+ /**
202
+ * Signals channel the roadmap backend broadcasts board updates on.
203
+ *
204
+ * @public
205
+ */
206
+ declare const SIGNALS_CHANNEL_ROADMAP = "roadmap:board";
207
+ /**
208
+ * Kinds of live board updates carried by {@link RoadmapSignal}.
209
+ *
210
+ * @public
211
+ */
212
+ type RoadmapSignalKind = 'feature_created' | 'feature_updated' | 'feature_deleted' | 'status_changed' | 'vote_changed' | 'comment_added' | 'comment_deleted' | 'board_reordered';
213
+ /**
214
+ * Signal broadcast on {@link SIGNALS_CHANNEL_ROADMAP} whenever the board
215
+ * changes, so open boards can refresh live instead of waiting for a refetch.
216
+ *
217
+ * @public
218
+ */
219
+ type RoadmapSignal = {
220
+ kind: RoadmapSignalKind;
221
+ /** Present for feature-scoped updates. */
222
+ featureId?: string;
223
+ /** Present when the full feature is cheap to include (create/update/status). */
224
+ feature?: Feature;
225
+ };
226
+
227
+ export { type Column, type Comment, DEFAULT_ROADMAP_PAGE_SUBTITLE, DEFAULT_ROADMAP_PAGE_TITLE, EVENTS_ACTION_CHANGE_FEATURE_STATUS, EVENTS_ACTION_CREATE_COMMENT, EVENTS_ACTION_CREATE_FEATURE, EVENTS_ACTION_DELETE_COMMENT, EVENTS_ACTION_DELETE_FEATURE, EVENTS_ACTION_REORDER_BOARD, EVENTS_ACTION_TOGGLE_VOTE, EVENTS_ACTION_UPDATE_FEATURE, EVENTS_TOPIC_ROADMAP, type Feature, FeatureStatus, type NewComment, type NewFeature, type RoadmapBoardColumnResolved, type RoadmapBoardConfigResponse, type RoadmapRetentionAnchor, type RoadmapSignal, type RoadmapSignalKind, type RoadmapUiCapabilities, SIGNALS_CHANNEL_ROADMAP, type VoteResponse, roadmapAdminPermission, roadmapCreatePermission, roadmapPermissions };
package/dist/index.esm.js CHANGED
@@ -1,3 +1,4 @@
1
- export { FeatureStatus } from './types/index.esm.js';
1
+ export { DEFAULT_ROADMAP_PAGE_SUBTITLE, DEFAULT_ROADMAP_PAGE_TITLE, FeatureStatus } from './types/index.esm.js';
2
2
  export { roadmapAdminPermission, roadmapCreatePermission, roadmapPermissions } from './permissions/index.esm.js';
3
+ export { EVENTS_ACTION_CHANGE_FEATURE_STATUS, EVENTS_ACTION_CREATE_COMMENT, EVENTS_ACTION_CREATE_FEATURE, EVENTS_ACTION_DELETE_COMMENT, EVENTS_ACTION_DELETE_FEATURE, EVENTS_ACTION_REORDER_BOARD, EVENTS_ACTION_TOGGLE_VOTE, EVENTS_ACTION_UPDATE_FEATURE, EVENTS_TOPIC_ROADMAP, SIGNALS_CHANNEL_ROADMAP } from './events/index.esm.js';
3
4
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../src/permissions/index.ts"],"sourcesContent":["import { createPermission } from '@backstage/plugin-permission-common';\n\nexport const roadmapAdminPermission = createPermission({\n name: 'roadmap.admin',\n attributes: { action: 'update' },\n});\n\nexport const roadmapCreatePermission = createPermission({\n name: 'roadmap.create',\n attributes: { action: 'create' },\n});\n\nexport const roadmapPermissions = [\n roadmapAdminPermission,\n roadmapCreatePermission,\n];\n"],"names":["createPermission"],"mappings":";;;;AAEO,MAAM,yBAAyBA,uCAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAEM,MAAM,0BAA0BA,uCAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAEM,MAAM,kBAAA,GAAqB;AAAA,EAChC,sBAAA;AAAA,EACA;AACF;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/permissions/index.ts"],"sourcesContent":["import { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Grants roadmap admin actions: changing status, editing and deleting\n * features and comments, and reordering the board.\n *\n * @public\n */\nexport const roadmapAdminPermission = createPermission({\n name: 'roadmap.admin',\n attributes: { action: 'update' },\n});\n\n/**\n * Grants suggesting new features on the roadmap.\n *\n * @public\n */\nexport const roadmapCreatePermission = createPermission({\n name: 'roadmap.create',\n attributes: { action: 'create' },\n});\n\n/**\n * All permissions defined by the roadmap plugin.\n *\n * @public\n */\nexport const roadmapPermissions = [\n roadmapAdminPermission,\n roadmapCreatePermission,\n];\n"],"names":["createPermission"],"mappings":";;;;AAQO,MAAM,yBAAyBA,uCAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAOM,MAAM,0BAA0BA,uCAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAOM,MAAM,kBAAA,GAAqB;AAAA,EAChC,sBAAA;AAAA,EACA;AACF;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/permissions/index.ts"],"sourcesContent":["import { createPermission } from '@backstage/plugin-permission-common';\n\nexport const roadmapAdminPermission = createPermission({\n name: 'roadmap.admin',\n attributes: { action: 'update' },\n});\n\nexport const roadmapCreatePermission = createPermission({\n name: 'roadmap.create',\n attributes: { action: 'create' },\n});\n\nexport const roadmapPermissions = [\n roadmapAdminPermission,\n roadmapCreatePermission,\n];\n"],"names":[],"mappings":";;AAEO,MAAM,yBAAyB,gBAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAEM,MAAM,0BAA0B,gBAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAEM,MAAM,kBAAA,GAAqB;AAAA,EAChC,sBAAA;AAAA,EACA;AACF;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/permissions/index.ts"],"sourcesContent":["import { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Grants roadmap admin actions: changing status, editing and deleting\n * features and comments, and reordering the board.\n *\n * @public\n */\nexport const roadmapAdminPermission = createPermission({\n name: 'roadmap.admin',\n attributes: { action: 'update' },\n});\n\n/**\n * Grants suggesting new features on the roadmap.\n *\n * @public\n */\nexport const roadmapCreatePermission = createPermission({\n name: 'roadmap.create',\n attributes: { action: 'create' },\n});\n\n/**\n * All permissions defined by the roadmap plugin.\n *\n * @public\n */\nexport const roadmapPermissions = [\n roadmapAdminPermission,\n roadmapCreatePermission,\n];\n"],"names":[],"mappings":";;AAQO,MAAM,yBAAyB,gBAAA,CAAiB;AAAA,EACrD,IAAA,EAAM,eAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAOM,MAAM,0BAA0B,gBAAA,CAAiB;AAAA,EACtD,IAAA,EAAM,gBAAA;AAAA,EACN,UAAA,EAAY,EAAE,MAAA,EAAQ,QAAA;AACxB,CAAC;AAOM,MAAM,kBAAA,GAAqB;AAAA,EAChC,sBAAA;AAAA,EACA;AACF;;;;"}
@@ -8,6 +8,10 @@ var FeatureStatus = /* @__PURE__ */ ((FeatureStatus2) => {
8
8
  FeatureStatus2["Declined"] = "Declined";
9
9
  return FeatureStatus2;
10
10
  })(FeatureStatus || {});
11
+ const DEFAULT_ROADMAP_PAGE_TITLE = "Public Roadmap";
12
+ const DEFAULT_ROADMAP_PAGE_SUBTITLE = "Shape the Future with Us";
11
13
 
14
+ exports.DEFAULT_ROADMAP_PAGE_SUBTITLE = DEFAULT_ROADMAP_PAGE_SUBTITLE;
15
+ exports.DEFAULT_ROADMAP_PAGE_TITLE = DEFAULT_ROADMAP_PAGE_TITLE;
12
16
  exports.FeatureStatus = FeatureStatus;
13
17
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../src/types/index.ts"],"sourcesContent":["export enum FeatureStatus {\n Suggested = 'Suggested',\n Planned = 'Planned',\n InProgress = 'In Progress',\n Completed = 'Completed',\n Declined = 'Declined',\n}\n\nexport interface Feature {\n id: string;\n title: string;\n description: string;\n status: FeatureStatus;\n votes: number;\n author: string;\n created_at: string;\n updated_at: string;\n /** Sort order within status (database datasource). */\n board_position?: number;\n}\n\nexport interface NewFeature {\n title: string;\n description: string;\n}\n\nexport interface Comment {\n id: string;\n author: string;\n featureId: string;\n text: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface NewComment {\n text: string;\n featureId: string;\n author?: string;\n}\n\nexport interface Column {\n title: string;\n features: Feature[];\n}\n\nexport interface VoteResponse {\n voteAdded: boolean;\n voteCount: number;\n}\n\n/** Which timestamp drives retention for a column */\nexport type RoadmapRetentionAnchor = 'created' | 'updated';\n\n/** One column entry after defaults are merged (used by API + UI). */\nexport interface RoadmapBoardColumnResolved {\n status: FeatureStatus;\n title: string;\n visible: boolean;\n /** When set (>0), items older than this many days are hidden from default list (database only). */\n retentionDays?: number;\n retentionAnchor: RoadmapRetentionAnchor;\n}\n\n/** Capabilities exposed to the frontend (GitLab = read-only extensions off). */\nexport interface RoadmapUiCapabilities {\n retentionFiltering: boolean;\n includeBeyondRetentionQuery: boolean;\n adminEditTitleDescription: boolean;\n adminDeleteFeature: boolean;\n adminDeleteComment: boolean;\n creatorEditDeleteSuggested: boolean;\n adminReorder: boolean;\n}\n\n/** Response for GET /features/board-config */\nexport interface RoadmapBoardConfigResponse {\n columns: RoadmapBoardColumnResolved[];\n capabilities: RoadmapUiCapabilities;\n}\n"],"names":["FeatureStatus"],"mappings":";;AAAO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,UAAA,CAAA,GAAW,UAAA;AALD,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Lifecycle status of a roadmap feature.\n *\n * @public\n */\nexport enum FeatureStatus {\n Suggested = 'Suggested',\n Planned = 'Planned',\n InProgress = 'In Progress',\n Completed = 'Completed',\n Declined = 'Declined',\n}\n\n/**\n * A roadmap feature as returned by the roadmap API.\n *\n * Type alias (not interface) so it satisfies JsonObject for events/signals.\n *\n * @public\n */\nexport type Feature = {\n id: string;\n title: string;\n description: string;\n status: FeatureStatus;\n votes: number;\n author: string;\n /** ISO 8601 UTC timestamp. */\n createdAt: string;\n /** ISO 8601 UTC timestamp. */\n updatedAt: string;\n /** Sort order within status (database datasource). */\n boardPosition?: number;\n};\n\n/**\n * Payload for suggesting a new feature.\n *\n * @public\n */\nexport interface NewFeature {\n title: string;\n description: string;\n}\n\n/**\n * A comment on a roadmap feature.\n *\n * @public\n */\nexport interface Comment {\n id: string;\n author: string;\n featureId: string;\n text: string;\n /** ISO 8601 UTC timestamp. */\n createdAt: string;\n /** ISO 8601 UTC timestamp. */\n updatedAt: string;\n}\n\n/**\n * Payload for adding a comment to a feature.\n *\n * @public\n */\nexport interface NewComment {\n text: string;\n featureId: string;\n author?: string;\n}\n\n/**\n * A board column with the features it contains.\n *\n * @public\n */\nexport interface Column {\n title: string;\n features: Feature[];\n}\n\n/**\n * Result of toggling a vote on a feature.\n *\n * @public\n */\nexport interface VoteResponse {\n voteAdded: boolean;\n voteCount: number;\n}\n\n/**\n * Which timestamp drives retention for a column.\n *\n * @public\n */\nexport type RoadmapRetentionAnchor = 'created' | 'updated';\n\n/**\n * One column entry after defaults are merged (used by API + UI).\n *\n * @public\n */\nexport interface RoadmapBoardColumnResolved {\n status: FeatureStatus;\n title: string;\n visible: boolean;\n /** When set (positive), items older than this many days are hidden from the default list (database only). */\n retentionDays?: number;\n retentionAnchor: RoadmapRetentionAnchor;\n}\n\n/**\n * Capabilities exposed to the frontend (GitLab = read-only extensions off).\n *\n * @public\n */\nexport interface RoadmapUiCapabilities {\n retentionFiltering: boolean;\n includeBeyondRetentionQuery: boolean;\n adminEditTitleDescription: boolean;\n adminDeleteFeature: boolean;\n adminDeleteComment: boolean;\n creatorEditDeleteSuggested: boolean;\n adminReorder: boolean;\n}\n\n/**\n * Roadmap page header title used when `roadmap.page.title` is not set.\n *\n * @public\n */\nexport const DEFAULT_ROADMAP_PAGE_TITLE = 'Public Roadmap';\n\n/**\n * Roadmap page header subtitle used when `roadmap.page.subtitle` is not set.\n *\n * @public\n */\nexport const DEFAULT_ROADMAP_PAGE_SUBTITLE = 'Shape the Future with Us';\n\n/**\n * Response for GET /features/board-config.\n *\n * @public\n */\nexport interface RoadmapBoardConfigResponse {\n /**\n * Page header title from `roadmap.page.title`. Optional because backends\n * older than this field do not send it; fall back to\n * {@link DEFAULT_ROADMAP_PAGE_TITLE}.\n */\n title?: string;\n /**\n * Page header subtitle from `roadmap.page.subtitle`. Optional because\n * backends older than this field do not send it; fall back to\n * {@link DEFAULT_ROADMAP_PAGE_SUBTITLE}.\n */\n subtitle?: string;\n columns: RoadmapBoardColumnResolved[];\n capabilities: RoadmapUiCapabilities;\n}\n"],"names":["FeatureStatus"],"mappings":";;AAKO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,UAAA,CAAA,GAAW,UAAA;AALD,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;AAgIL,MAAM,0BAAA,GAA6B;AAOnC,MAAM,6BAAA,GAAgC;;;;;;"}
@@ -6,6 +6,8 @@ var FeatureStatus = /* @__PURE__ */ ((FeatureStatus2) => {
6
6
  FeatureStatus2["Declined"] = "Declined";
7
7
  return FeatureStatus2;
8
8
  })(FeatureStatus || {});
9
+ const DEFAULT_ROADMAP_PAGE_TITLE = "Public Roadmap";
10
+ const DEFAULT_ROADMAP_PAGE_SUBTITLE = "Shape the Future with Us";
9
11
 
10
- export { FeatureStatus };
12
+ export { DEFAULT_ROADMAP_PAGE_SUBTITLE, DEFAULT_ROADMAP_PAGE_TITLE, FeatureStatus };
11
13
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/types/index.ts"],"sourcesContent":["export enum FeatureStatus {\n Suggested = 'Suggested',\n Planned = 'Planned',\n InProgress = 'In Progress',\n Completed = 'Completed',\n Declined = 'Declined',\n}\n\nexport interface Feature {\n id: string;\n title: string;\n description: string;\n status: FeatureStatus;\n votes: number;\n author: string;\n created_at: string;\n updated_at: string;\n /** Sort order within status (database datasource). */\n board_position?: number;\n}\n\nexport interface NewFeature {\n title: string;\n description: string;\n}\n\nexport interface Comment {\n id: string;\n author: string;\n featureId: string;\n text: string;\n created_at: string;\n updated_at: string;\n}\n\nexport interface NewComment {\n text: string;\n featureId: string;\n author?: string;\n}\n\nexport interface Column {\n title: string;\n features: Feature[];\n}\n\nexport interface VoteResponse {\n voteAdded: boolean;\n voteCount: number;\n}\n\n/** Which timestamp drives retention for a column */\nexport type RoadmapRetentionAnchor = 'created' | 'updated';\n\n/** One column entry after defaults are merged (used by API + UI). */\nexport interface RoadmapBoardColumnResolved {\n status: FeatureStatus;\n title: string;\n visible: boolean;\n /** When set (>0), items older than this many days are hidden from default list (database only). */\n retentionDays?: number;\n retentionAnchor: RoadmapRetentionAnchor;\n}\n\n/** Capabilities exposed to the frontend (GitLab = read-only extensions off). */\nexport interface RoadmapUiCapabilities {\n retentionFiltering: boolean;\n includeBeyondRetentionQuery: boolean;\n adminEditTitleDescription: boolean;\n adminDeleteFeature: boolean;\n adminDeleteComment: boolean;\n creatorEditDeleteSuggested: boolean;\n adminReorder: boolean;\n}\n\n/** Response for GET /features/board-config */\nexport interface RoadmapBoardConfigResponse {\n columns: RoadmapBoardColumnResolved[];\n capabilities: RoadmapUiCapabilities;\n}\n"],"names":["FeatureStatus"],"mappings":"AAAO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,UAAA,CAAA,GAAW,UAAA;AALD,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Lifecycle status of a roadmap feature.\n *\n * @public\n */\nexport enum FeatureStatus {\n Suggested = 'Suggested',\n Planned = 'Planned',\n InProgress = 'In Progress',\n Completed = 'Completed',\n Declined = 'Declined',\n}\n\n/**\n * A roadmap feature as returned by the roadmap API.\n *\n * Type alias (not interface) so it satisfies JsonObject for events/signals.\n *\n * @public\n */\nexport type Feature = {\n id: string;\n title: string;\n description: string;\n status: FeatureStatus;\n votes: number;\n author: string;\n /** ISO 8601 UTC timestamp. */\n createdAt: string;\n /** ISO 8601 UTC timestamp. */\n updatedAt: string;\n /** Sort order within status (database datasource). */\n boardPosition?: number;\n};\n\n/**\n * Payload for suggesting a new feature.\n *\n * @public\n */\nexport interface NewFeature {\n title: string;\n description: string;\n}\n\n/**\n * A comment on a roadmap feature.\n *\n * @public\n */\nexport interface Comment {\n id: string;\n author: string;\n featureId: string;\n text: string;\n /** ISO 8601 UTC timestamp. */\n createdAt: string;\n /** ISO 8601 UTC timestamp. */\n updatedAt: string;\n}\n\n/**\n * Payload for adding a comment to a feature.\n *\n * @public\n */\nexport interface NewComment {\n text: string;\n featureId: string;\n author?: string;\n}\n\n/**\n * A board column with the features it contains.\n *\n * @public\n */\nexport interface Column {\n title: string;\n features: Feature[];\n}\n\n/**\n * Result of toggling a vote on a feature.\n *\n * @public\n */\nexport interface VoteResponse {\n voteAdded: boolean;\n voteCount: number;\n}\n\n/**\n * Which timestamp drives retention for a column.\n *\n * @public\n */\nexport type RoadmapRetentionAnchor = 'created' | 'updated';\n\n/**\n * One column entry after defaults are merged (used by API + UI).\n *\n * @public\n */\nexport interface RoadmapBoardColumnResolved {\n status: FeatureStatus;\n title: string;\n visible: boolean;\n /** When set (positive), items older than this many days are hidden from the default list (database only). */\n retentionDays?: number;\n retentionAnchor: RoadmapRetentionAnchor;\n}\n\n/**\n * Capabilities exposed to the frontend (GitLab = read-only extensions off).\n *\n * @public\n */\nexport interface RoadmapUiCapabilities {\n retentionFiltering: boolean;\n includeBeyondRetentionQuery: boolean;\n adminEditTitleDescription: boolean;\n adminDeleteFeature: boolean;\n adminDeleteComment: boolean;\n creatorEditDeleteSuggested: boolean;\n adminReorder: boolean;\n}\n\n/**\n * Roadmap page header title used when `roadmap.page.title` is not set.\n *\n * @public\n */\nexport const DEFAULT_ROADMAP_PAGE_TITLE = 'Public Roadmap';\n\n/**\n * Roadmap page header subtitle used when `roadmap.page.subtitle` is not set.\n *\n * @public\n */\nexport const DEFAULT_ROADMAP_PAGE_SUBTITLE = 'Shape the Future with Us';\n\n/**\n * Response for GET /features/board-config.\n *\n * @public\n */\nexport interface RoadmapBoardConfigResponse {\n /**\n * Page header title from `roadmap.page.title`. Optional because backends\n * older than this field do not send it; fall back to\n * {@link DEFAULT_ROADMAP_PAGE_TITLE}.\n */\n title?: string;\n /**\n * Page header subtitle from `roadmap.page.subtitle`. Optional because\n * backends older than this field do not send it; fall back to\n * {@link DEFAULT_ROADMAP_PAGE_SUBTITLE}.\n */\n subtitle?: string;\n columns: RoadmapBoardColumnResolved[];\n capabilities: RoadmapUiCapabilities;\n}\n"],"names":["FeatureStatus"],"mappings":"AAKO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,eAAA,UAAA,CAAA,GAAW,UAAA;AALD,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;AAgIL,MAAM,0BAAA,GAA6B;AAOnC,MAAM,6BAAA,GAAgC;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rothenbergt/backstage-plugin-roadmap-common",
3
3
  "description": "Common functionalities for the roadmap plugin",
4
- "version": "0.4.1",
4
+ "version": "1.1.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",