@pc-nexus/models 0.0.1-next.3 → 0.5.0-next.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.
|
@@ -43,6 +43,15 @@ var ViewportSize;
|
|
|
43
43
|
ViewportSize["max"] = "max";
|
|
44
44
|
})(ViewportSize || (ViewportSize = {}));
|
|
45
45
|
|
|
46
|
+
var WorkItemTypeGroup;
|
|
47
|
+
(function (WorkItemTypeGroup) {
|
|
48
|
+
WorkItemTypeGroup[WorkItemTypeGroup["requirement"] = 1] = "requirement";
|
|
49
|
+
WorkItemTypeGroup[WorkItemTypeGroup["task"] = 2] = "task";
|
|
50
|
+
WorkItemTypeGroup[WorkItemTypeGroup["bug"] = 3] = "bug";
|
|
51
|
+
WorkItemTypeGroup[WorkItemTypeGroup["issue"] = 4] = "issue";
|
|
52
|
+
WorkItemTypeGroup[WorkItemTypeGroup["plan"] = 5] = "plan";
|
|
53
|
+
})(WorkItemTypeGroup || (WorkItemTypeGroup = {}));
|
|
54
|
+
|
|
46
55
|
/*
|
|
47
56
|
* Public API Surface of models
|
|
48
57
|
*/
|
|
@@ -51,5 +60,5 @@ var ViewportSize;
|
|
|
51
60
|
* Generated bundle index. Do not edit.
|
|
52
61
|
*/
|
|
53
62
|
|
|
54
|
-
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
63
|
+
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
|
|
55
64
|
//# sourceMappingURL=pc-nexus-models.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pc-nexus-models.mjs","sources":["../../../../web/models/src/environment.ts","../../../../web/models/src/locale.ts","../../../../web/models/src/navigation.ts","../../../../web/models/src/notify.ts","../../../../web/models/src/view.ts","../../../../web/models/src/viewport.ts","../../../../web/models/src/public-api.ts","../../../../web/models/src/pc-nexus-models.ts"],"sourcesContent":["export enum NexusAppEnvironment {\n development = \"development\",\n production = \"production\",\n}\n","export const SUPPORTED_LOCALE_CODES = [\"zh-cn\", \"en-us\"] as const;\n\nexport type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];\n\nexport interface Translator {\n translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;\n}\nexport interface GetTranslationsResult {\n locale: NexusSupportedLocaleCode;\n translations: TranslationResourceContent | null;\n}\n\nexport interface TranslationResourceContent {\n [key: string]: string | TranslationResourceContent;\n}\n","export enum NavigationTarget {\n workItem = \"workItem\",\n testCase = \"testCase\",\n page = \"page\",\n idea = \"idea\",\n ticket = \"ticket\",\n project = \"project\",\n library = \"library\",\n space = \"space\",\n product = \"product\",\n}\n\ninterface NavigationTargetParams {\n target: NavigationTarget;\n id: string;\n}\n\nexport type NavigationLocation = NavigationTargetParams;\n","export enum NotifyType {\n success = \"success\",\n error = \"error\",\n warning = \"warning\",\n info = \"info\",\n}\n\nexport interface NotifyOptions {\n type
|
|
1
|
+
{"version":3,"file":"pc-nexus-models.mjs","sources":["../../../../web/models/src/environment.ts","../../../../web/models/src/locale.ts","../../../../web/models/src/navigation.ts","../../../../web/models/src/notify.ts","../../../../web/models/src/view.ts","../../../../web/models/src/viewport.ts","../../../../web/models/src/work-item.ts","../../../../web/models/src/public-api.ts","../../../../web/models/src/pc-nexus-models.ts"],"sourcesContent":["export enum NexusAppEnvironment {\n development = \"development\",\n production = \"production\",\n}\n","export const SUPPORTED_LOCALE_CODES = [\"zh-cn\", \"en-us\"] as const;\n\nexport type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];\n\nexport interface Translator {\n translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;\n}\nexport interface GetTranslationsResult {\n locale: NexusSupportedLocaleCode;\n translations: TranslationResourceContent | null;\n}\n\nexport interface TranslationResourceContent {\n [key: string]: string | TranslationResourceContent;\n}\n","export enum NavigationTarget {\n workItem = \"workItem\",\n testCase = \"testCase\",\n page = \"page\",\n idea = \"idea\",\n ticket = \"ticket\",\n project = \"project\",\n library = \"library\",\n space = \"space\",\n product = \"product\",\n}\n\ninterface NavigationTargetParams {\n target: NavigationTarget;\n id: string;\n}\n\nexport type NavigationLocation = NavigationTargetParams;\n","export enum NotifyType {\n success = \"success\",\n error = \"error\",\n warning = \"warning\",\n info = \"info\",\n}\n\nexport interface NotifyOptions {\n type: NotifyType;\n title?: string;\n description?: string;\n detail?: string | NotifyDetail;\n actions?: NotifyAction[];\n isAutoClose?: boolean;\n}\n\nexport interface NotifyRef {\n close: () => void;\n}\n\nexport interface NotifyDetail {\n link?: string;\n content?: string;\n}\n\nexport interface NotifyAction {\n text: string;\n icon?: string;\n onClick: (event?: Event) => void;\n}\n","export enum HistoryAction {\n pop = \"POP\",\n push = \"PUSH\",\n replace = \"REPLACE\",\n}\n\nexport interface LocationDescriptor {\n pathname: string;\n search?: string;\n hash?: string;\n state?: unknown;\n}\n\nexport type UnlistenCallback = () => void;\n\nexport interface NexusHistory {\n action: HistoryAction;\n location: LocationDescriptor;\n push(path: string, state?: unknown): void;\n push(location: LocationDescriptor): void;\n replace(path: string, state?: unknown): void;\n replace(location: LocationDescriptor): void;\n go(n: number): void;\n goBack(): void;\n goForward(): void;\n listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;\n}\n","export interface Viewport {\n size?: ViewportSize;\n}\n\nexport enum ViewportSize {\n small = \"small\",\n medium = \"medium\",\n large = \"large\",\n xlarge = \"xlarge\",\n max = \"max\",\n}\n","export enum WorkItemTypeGroup {\n requirement = 1,\n task = 2,\n bug = 3,\n issue = 4,\n plan = 5,\n}\n\nexport interface WorkItem {\n id: string;\n short_id: string;\n identifier: string;\n title: string;\n type_group?: WorkItemTypeGroup;\n type_id?: string;\n}\n\nexport interface WorkItemOpenCreateOptions {\n defaultValues?: {\n title?: string;\n project_id?: string;\n };\n onSuccess?: (payload: WorkItem) => void;\n}\n","/*\n * Public API Surface of models\n */\n\nexport * from \"./context\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./events\";\nexport * from \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./notify\";\nexport * from \"./processor\";\nexport * from \"./request-api\";\nexport * from \"./user\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./work-item\";\nexport * from \"./idea\";\nexport * from \"./test-case\";\nexport * from \"./ticket\";\nexport * from \"./page\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC3B,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,mBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC7B,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;;MCAlB,sBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO;;ICA3C;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,gBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACvB,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ICAhB;AAAZ,C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AA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACZ,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,GAAA,EAAA,CAAA,CAAA;;ACA7B;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pc-nexus/models",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.5.0-next.0",
|
|
4
4
|
"peerDependencies": {},
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.3.0"
|
|
@@ -16,5 +16,6 @@
|
|
|
16
16
|
"types": "./types/pc-nexus-models.d.ts",
|
|
17
17
|
"default": "./fesm2022/pc-nexus-models.mjs"
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"type": "module"
|
|
20
21
|
}
|
|
@@ -18,15 +18,35 @@ interface TranslationResourceContent {
|
|
|
18
18
|
|
|
19
19
|
type ExtensionData = Record<string, any>;
|
|
20
20
|
interface NexusFullContext<T = ExtensionData> {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
app: {
|
|
22
|
+
id: string;
|
|
23
|
+
version: string;
|
|
24
|
+
};
|
|
25
|
+
environment: {
|
|
26
|
+
id: string;
|
|
27
|
+
type: NexusAppEnvironment;
|
|
28
|
+
};
|
|
29
|
+
team: {
|
|
30
|
+
id: string;
|
|
31
|
+
url: string;
|
|
32
|
+
locale: NexusSupportedLocaleCode;
|
|
33
|
+
timezone: string;
|
|
34
|
+
};
|
|
35
|
+
installation: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
account: {
|
|
39
|
+
id: string;
|
|
40
|
+
locale: NexusSupportedLocaleCode;
|
|
41
|
+
timezone: string;
|
|
42
|
+
};
|
|
43
|
+
extension: {
|
|
44
|
+
key: string;
|
|
45
|
+
local_id: string;
|
|
46
|
+
target: string;
|
|
47
|
+
location: string;
|
|
48
|
+
data: T;
|
|
49
|
+
};
|
|
30
50
|
}
|
|
31
51
|
|
|
32
52
|
interface Viewport {
|
|
@@ -50,6 +70,13 @@ interface DialogOptions {
|
|
|
50
70
|
interface DialogRef<T = unknown> {
|
|
51
71
|
close: (payload?: T) => void;
|
|
52
72
|
}
|
|
73
|
+
interface DialogConfirmOptions {
|
|
74
|
+
content: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
operationType?: "danger" | "primary";
|
|
77
|
+
onConfirm: () => Promise<void>;
|
|
78
|
+
onCancel?: () => void;
|
|
79
|
+
}
|
|
53
80
|
|
|
54
81
|
interface ExtensionProperties {
|
|
55
82
|
key: string;
|
|
@@ -68,19 +95,18 @@ interface EgressItem {
|
|
|
68
95
|
category: string | null;
|
|
69
96
|
in_scope_eud: string | null;
|
|
70
97
|
}
|
|
71
|
-
interface NexusAppExtension {
|
|
72
|
-
|
|
98
|
+
interface NexusAppExtension<T extends ExtensionProperties = ExtensionProperties> {
|
|
99
|
+
app_id: string;
|
|
100
|
+
app_version: string;
|
|
73
101
|
target: string;
|
|
74
|
-
|
|
75
|
-
module_id: string;
|
|
102
|
+
extension_id: string;
|
|
76
103
|
environment_id: string;
|
|
77
104
|
environment_key: string;
|
|
78
105
|
environment_type: NexusAppEnvironment;
|
|
79
106
|
installation_id: string;
|
|
80
|
-
|
|
81
|
-
properties: ExtensionProperties;
|
|
107
|
+
properties: T;
|
|
82
108
|
egress?: EgressItem[];
|
|
83
|
-
|
|
109
|
+
resource_ports?: Record<string, number>;
|
|
84
110
|
}
|
|
85
111
|
|
|
86
112
|
interface EventCallbackParams {
|
|
@@ -132,7 +158,7 @@ declare enum NotifyType {
|
|
|
132
158
|
info = "info"
|
|
133
159
|
}
|
|
134
160
|
interface NotifyOptions {
|
|
135
|
-
type
|
|
161
|
+
type: NotifyType;
|
|
136
162
|
title?: string;
|
|
137
163
|
description?: string;
|
|
138
164
|
detail?: string | NotifyDetail;
|
|
@@ -173,11 +199,12 @@ interface RequestApiResponseData {
|
|
|
173
199
|
headers?: Record<string, string>;
|
|
174
200
|
body?: Record<string, any>;
|
|
175
201
|
}
|
|
202
|
+
type NexusRequestInit = Omit<RequestInit, "signal">;
|
|
176
203
|
|
|
177
204
|
interface SelectMemberDialogOptions {
|
|
178
205
|
title?: string;
|
|
179
206
|
selection?: string[];
|
|
180
|
-
onConfirm
|
|
207
|
+
onConfirm: (payload?: string[]) => Promise<void>;
|
|
181
208
|
}
|
|
182
209
|
interface SelectMemberPopBaseOptions {
|
|
183
210
|
origin: HTMLElement;
|
|
@@ -219,17 +246,79 @@ interface NexusHistory {
|
|
|
219
246
|
listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
|
|
220
247
|
}
|
|
221
248
|
|
|
249
|
+
declare enum WorkItemTypeGroup {
|
|
250
|
+
requirement = 1,
|
|
251
|
+
task = 2,
|
|
252
|
+
bug = 3,
|
|
253
|
+
issue = 4,
|
|
254
|
+
plan = 5
|
|
255
|
+
}
|
|
256
|
+
interface WorkItem {
|
|
257
|
+
id: string;
|
|
258
|
+
short_id: string;
|
|
259
|
+
identifier: string;
|
|
260
|
+
title: string;
|
|
261
|
+
type_group?: WorkItemTypeGroup;
|
|
262
|
+
type_id?: string;
|
|
263
|
+
}
|
|
222
264
|
interface WorkItemOpenCreateOptions {
|
|
223
265
|
defaultValues?: {
|
|
224
266
|
title?: string;
|
|
225
|
-
|
|
267
|
+
project_id?: string;
|
|
226
268
|
};
|
|
227
|
-
onSuccess?: (payload:
|
|
228
|
-
|
|
269
|
+
onSuccess?: (payload: WorkItem) => void;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface Idea {
|
|
273
|
+
id: string;
|
|
274
|
+
short_id: string;
|
|
275
|
+
identifier: string;
|
|
276
|
+
title: string;
|
|
277
|
+
}
|
|
278
|
+
interface IdeaOpenCreateOptions {
|
|
279
|
+
defaultValues?: {
|
|
229
280
|
title?: string;
|
|
230
|
-
|
|
231
|
-
}
|
|
281
|
+
product_id?: string;
|
|
282
|
+
};
|
|
283
|
+
onSuccess?: (payload: Idea) => void;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface TestCase {
|
|
287
|
+
id: string;
|
|
288
|
+
short_id: string;
|
|
289
|
+
identifier: string;
|
|
290
|
+
title: string;
|
|
291
|
+
}
|
|
292
|
+
interface TestCaseOpenCreateOptions {
|
|
293
|
+
defaultValues?: {
|
|
294
|
+
title?: string;
|
|
295
|
+
library_id?: string;
|
|
296
|
+
};
|
|
297
|
+
onSuccess?: (payload: TestCase) => void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
interface Ticket {
|
|
301
|
+
id: string;
|
|
302
|
+
short_id: string;
|
|
303
|
+
identifier: string;
|
|
304
|
+
title: string;
|
|
305
|
+
}
|
|
306
|
+
interface TicketOpenCreateOptions {
|
|
307
|
+
defaultValues?: {
|
|
308
|
+
title?: string;
|
|
309
|
+
product_id?: string;
|
|
310
|
+
};
|
|
311
|
+
onSuccess?: (payload: Ticket) => void;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
interface Page {
|
|
315
|
+
id: string;
|
|
316
|
+
short_id: string;
|
|
317
|
+
title: string;
|
|
318
|
+
}
|
|
319
|
+
interface PageOpenCreateOptions {
|
|
320
|
+
onSuccess?: (payload: Page) => void;
|
|
232
321
|
}
|
|
233
322
|
|
|
234
|
-
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
235
|
-
export type { DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, ProcessOptions, ProcessRef, RequestApiResponseData, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TranslationResourceContent, Translator, UnlistenCallback, Viewport, WorkItemOpenCreateOptions };
|
|
323
|
+
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
|
|
324
|
+
export type { DialogConfirmOptions, DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, Idea, IdeaOpenCreateOptions, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusRequestInit, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, Page, PageOpenCreateOptions, ProcessOptions, ProcessRef, RequestApiResponseData, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TestCase, TestCaseOpenCreateOptions, Ticket, TicketOpenCreateOptions, TranslationResourceContent, Translator, UnlistenCallback, Viewport, WorkItem, WorkItemOpenCreateOptions };
|