@pc-nexus/models 0.5.0-next.0 → 0.5.0-next.10
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.
|
@@ -4,7 +4,7 @@ var NexusAppEnvironment;
|
|
|
4
4
|
NexusAppEnvironment["production"] = "production";
|
|
5
5
|
})(NexusAppEnvironment || (NexusAppEnvironment = {}));
|
|
6
6
|
|
|
7
|
-
const SUPPORTED_LOCALE_CODES = ["zh-
|
|
7
|
+
const SUPPORTED_LOCALE_CODES = ["zh-CN", "en-US"];
|
|
8
8
|
|
|
9
9
|
var NavigationTarget;
|
|
10
10
|
(function (NavigationTarget) {
|
|
@@ -27,6 +27,9 @@ var NotifyType;
|
|
|
27
27
|
NotifyType["info"] = "info";
|
|
28
28
|
})(NotifyType || (NotifyType = {}));
|
|
29
29
|
|
|
30
|
+
const NEXUS_CONTENT_UPDATE_EVENT = "nexus:content:update";
|
|
31
|
+
const NEXUS_CONTENT_CHANGE_EVENT = "nexus:content:change";
|
|
32
|
+
|
|
30
33
|
var HistoryAction;
|
|
31
34
|
(function (HistoryAction) {
|
|
32
35
|
HistoryAction["pop"] = "POP";
|
|
@@ -41,6 +44,7 @@ var ViewportSize;
|
|
|
41
44
|
ViewportSize["large"] = "large";
|
|
42
45
|
ViewportSize["xlarge"] = "xlarge";
|
|
43
46
|
ViewportSize["max"] = "max";
|
|
47
|
+
ViewportSize["fullscreen"] = "fullscreen";
|
|
44
48
|
})(ViewportSize || (ViewportSize = {}));
|
|
45
49
|
|
|
46
50
|
var WorkItemTypeGroup;
|
|
@@ -60,5 +64,5 @@ var WorkItemTypeGroup;
|
|
|
60
64
|
* Generated bundle index. Do not edit.
|
|
61
65
|
*/
|
|
62
66
|
|
|
63
|
-
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
|
|
67
|
+
export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
|
|
64
68
|
//# 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/
|
|
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/richtext.ts","../../../../web/models/src/view.ts","../../../../web/models/src/viewport.ts","../../../../web/models/src/workitem.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 const NEXUS_CONTENT_UPDATE_EVENT = \"nexus:content:update\";\nexport const NEXUS_CONTENT_CHANGE_EVENT = \"nexus:content:change\";\n\nexport interface RichtextText {\n text: string;\n [key: string]: unknown;\n}\n\nexport interface RichtextElement {\n type: string;\n children: Descendant[];\n [key: string]: unknown;\n}\n\nexport type Descendant = RichtextElement | RichtextText;\nexport type RichtextContent = Descendant[] | string;\n\nexport interface RichtextRendererRef {\n iframe: HTMLIFrameElement;\n update: (content: RichtextContent) => void;\n}\n\nexport interface RichtextEditorRef extends RichtextRendererRef {\n destroy: () => void;\n}\n\nexport interface RendererIframeOptions {\n content?: RichtextContent;\n}\n\nexport interface EditorIframeOptions extends RendererIframeOptions {\n onContentChange?: (content: RichtextContent) => void;\n}\n\nexport interface RichtextBridgeMessage {\n type: string;\n content?: any;\n timestamp?: number;\n source?: string;\n readonly?: boolean;\n}\n\nexport interface IframeResizerApi {\n sendMessage: (message: unknown, targetOrigin?: string) => 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 fullscreen = \"fullscreen\",\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 description?: string;\n };\n onSuccess?: (payload: WorkItem) => void;\n}\n","/*\n * Public API Surface of models\n */\n\nexport * from \"./context\";\nexport * from \"./condition\";\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 \"./richtext\";\nexport * from \"./user\";\nexport * from \"./view\";\nexport * from \"./viewport\";\nexport * from \"./workitem\";\nexport * from \"./idea\";\nexport * from \"./testcase\";\nexport * from \"./ticket\";\nexport * from \"./page\";\nexport * from \"./store\";\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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;AACX,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC7B,CAAC,EAPW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;ICJZ;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAe;AACf,IAAA,iBAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,iBAAA,CAAA,iBAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,GAAA,KAAO;AACP,IAAA,iBAAA,CAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS;AACT,IAAA,iBAAA,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
|
@@ -3,7 +3,7 @@ declare enum NexusAppEnvironment {
|
|
|
3
3
|
production = "production"
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
declare const SUPPORTED_LOCALE_CODES: readonly ["zh-
|
|
6
|
+
declare const SUPPORTED_LOCALE_CODES: readonly ["zh-CN", "en-US"];
|
|
7
7
|
type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
|
|
8
8
|
interface Translator {
|
|
9
9
|
translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;
|
|
@@ -35,7 +35,7 @@ interface NexusFullContext<T = ExtensionData> {
|
|
|
35
35
|
installation: {
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
user: {
|
|
39
39
|
id: string;
|
|
40
40
|
locale: NexusSupportedLocaleCode;
|
|
41
41
|
timezone: string;
|
|
@@ -49,6 +49,18 @@ interface NexusFullContext<T = ExtensionData> {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
type ConditionPrimitive = string | number | boolean | null;
|
|
53
|
+
type ConditionValue = ConditionPrimitive | ConditionPrimitive[];
|
|
54
|
+
interface Conditions {
|
|
55
|
+
and?: Conditions;
|
|
56
|
+
or?: Conditions;
|
|
57
|
+
not?: Conditions;
|
|
58
|
+
hasPermission?: string;
|
|
59
|
+
isAdmin?: boolean;
|
|
60
|
+
isLoggedIn?: boolean;
|
|
61
|
+
[path: string]: ConditionValue | Conditions | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
interface Viewport {
|
|
53
65
|
size?: ViewportSize;
|
|
54
66
|
}
|
|
@@ -57,7 +69,8 @@ declare enum ViewportSize {
|
|
|
57
69
|
medium = "medium",
|
|
58
70
|
large = "large",
|
|
59
71
|
xlarge = "xlarge",
|
|
60
|
-
max = "max"
|
|
72
|
+
max = "max",
|
|
73
|
+
fullscreen = "fullscreen"
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
interface DialogOptions {
|
|
@@ -66,6 +79,8 @@ interface DialogOptions {
|
|
|
66
79
|
context?: Record<string, unknown>;
|
|
67
80
|
backdropClosable?: boolean;
|
|
68
81
|
onClose?: (payload?: unknown) => void;
|
|
82
|
+
title?: string;
|
|
83
|
+
icon?: string;
|
|
69
84
|
}
|
|
70
85
|
interface DialogRef<T = unknown> {
|
|
71
86
|
close: (payload?: T) => void;
|
|
@@ -78,7 +93,11 @@ interface DialogConfirmOptions {
|
|
|
78
93
|
onCancel?: () => void;
|
|
79
94
|
}
|
|
80
95
|
|
|
81
|
-
interface
|
|
96
|
+
interface Subscription {
|
|
97
|
+
unsubscribe: () => void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface ExtensionProperties<T extends Conditions = Conditions> {
|
|
82
101
|
key: string;
|
|
83
102
|
resolver: {
|
|
84
103
|
function: string;
|
|
@@ -88,6 +107,7 @@ interface ExtensionProperties {
|
|
|
88
107
|
title: string;
|
|
89
108
|
icon?: string;
|
|
90
109
|
viewport?: Viewport;
|
|
110
|
+
displayConditions?: T;
|
|
91
111
|
}
|
|
92
112
|
interface EgressItem {
|
|
93
113
|
addresses: string[];
|
|
@@ -109,26 +129,6 @@ interface NexusAppExtension<T extends ExtensionProperties = ExtensionProperties>
|
|
|
109
129
|
resource_ports?: Record<string, number>;
|
|
110
130
|
}
|
|
111
131
|
|
|
112
|
-
interface EventCallbackParams {
|
|
113
|
-
payload?: any;
|
|
114
|
-
extension?: NexusAppExtension;
|
|
115
|
-
}
|
|
116
|
-
type EventCallbackType = (payload?: any, extension?: NexusAppExtension) => Promise<any>;
|
|
117
|
-
interface EventOnParams {
|
|
118
|
-
eventName: string;
|
|
119
|
-
callback: EventCallbackType;
|
|
120
|
-
}
|
|
121
|
-
interface EventEmitParams {
|
|
122
|
-
eventName: string;
|
|
123
|
-
payload: CustomEventInit<{
|
|
124
|
-
payload?: any;
|
|
125
|
-
extension?: NexusAppExtension;
|
|
126
|
-
}>;
|
|
127
|
-
}
|
|
128
|
-
interface Subscription {
|
|
129
|
-
unsubscribe: () => void;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
132
|
interface InvokeFunctionParams<T = unknown> {
|
|
133
133
|
function: string;
|
|
134
134
|
payload: T;
|
|
@@ -201,6 +201,43 @@ interface RequestApiResponseData {
|
|
|
201
201
|
}
|
|
202
202
|
type NexusRequestInit = Omit<RequestInit, "signal">;
|
|
203
203
|
|
|
204
|
+
declare const NEXUS_CONTENT_UPDATE_EVENT = "nexus:content:update";
|
|
205
|
+
declare const NEXUS_CONTENT_CHANGE_EVENT = "nexus:content:change";
|
|
206
|
+
interface RichtextText {
|
|
207
|
+
text: string;
|
|
208
|
+
[key: string]: unknown;
|
|
209
|
+
}
|
|
210
|
+
interface RichtextElement {
|
|
211
|
+
type: string;
|
|
212
|
+
children: Descendant[];
|
|
213
|
+
[key: string]: unknown;
|
|
214
|
+
}
|
|
215
|
+
type Descendant = RichtextElement | RichtextText;
|
|
216
|
+
type RichtextContent = Descendant[] | string;
|
|
217
|
+
interface RichtextRendererRef {
|
|
218
|
+
iframe: HTMLIFrameElement;
|
|
219
|
+
update: (content: RichtextContent) => void;
|
|
220
|
+
}
|
|
221
|
+
interface RichtextEditorRef extends RichtextRendererRef {
|
|
222
|
+
destroy: () => void;
|
|
223
|
+
}
|
|
224
|
+
interface RendererIframeOptions {
|
|
225
|
+
content?: RichtextContent;
|
|
226
|
+
}
|
|
227
|
+
interface EditorIframeOptions extends RendererIframeOptions {
|
|
228
|
+
onContentChange?: (content: RichtextContent) => void;
|
|
229
|
+
}
|
|
230
|
+
interface RichtextBridgeMessage {
|
|
231
|
+
type: string;
|
|
232
|
+
content?: any;
|
|
233
|
+
timestamp?: number;
|
|
234
|
+
source?: string;
|
|
235
|
+
readonly?: boolean;
|
|
236
|
+
}
|
|
237
|
+
interface IframeResizerApi {
|
|
238
|
+
sendMessage: (message: unknown, targetOrigin?: string) => void;
|
|
239
|
+
}
|
|
240
|
+
|
|
204
241
|
interface SelectMemberDialogOptions {
|
|
205
242
|
title?: string;
|
|
206
243
|
selection?: string[];
|
|
@@ -265,6 +302,7 @@ interface WorkItemOpenCreateOptions {
|
|
|
265
302
|
defaultValues?: {
|
|
266
303
|
title?: string;
|
|
267
304
|
project_id?: string;
|
|
305
|
+
description?: string;
|
|
268
306
|
};
|
|
269
307
|
onSuccess?: (payload: WorkItem) => void;
|
|
270
308
|
}
|
|
@@ -314,11 +352,34 @@ interface TicketOpenCreateOptions {
|
|
|
314
352
|
interface Page {
|
|
315
353
|
id: string;
|
|
316
354
|
short_id: string;
|
|
317
|
-
|
|
355
|
+
name: string;
|
|
318
356
|
}
|
|
319
357
|
interface PageOpenCreateOptions {
|
|
320
358
|
onSuccess?: (payload: Page) => void;
|
|
321
359
|
}
|
|
322
360
|
|
|
323
|
-
|
|
324
|
-
|
|
361
|
+
interface UploadResult {
|
|
362
|
+
success: boolean;
|
|
363
|
+
key: string;
|
|
364
|
+
status?: number;
|
|
365
|
+
error?: string;
|
|
366
|
+
}
|
|
367
|
+
interface DownloadResult {
|
|
368
|
+
success: boolean;
|
|
369
|
+
key: string;
|
|
370
|
+
blob?: Blob;
|
|
371
|
+
status?: number;
|
|
372
|
+
error?: string;
|
|
373
|
+
}
|
|
374
|
+
interface GetMetadataResult {
|
|
375
|
+
key: string;
|
|
376
|
+
name?: string;
|
|
377
|
+
mimeType?: string;
|
|
378
|
+
checksum?: string;
|
|
379
|
+
size?: number;
|
|
380
|
+
createdAt?: string;
|
|
381
|
+
error?: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { HistoryAction, NEXUS_CONTENT_CHANGE_EVENT, NEXUS_CONTENT_UPDATE_EVENT, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize, WorkItemTypeGroup };
|
|
385
|
+
export type { ConditionPrimitive, ConditionValue, Conditions, Descendant, DialogConfirmOptions, DialogOptions, DialogRef, DownloadResult, EditorIframeOptions, EgressItem, ExtensionData, ExtensionProperties, GetMetadataResult, GetTranslationsResult, Idea, IdeaOpenCreateOptions, IframeResizerApi, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusRequestInit, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, Page, PageOpenCreateOptions, ProcessOptions, ProcessRef, RendererIframeOptions, RequestApiResponseData, RichtextBridgeMessage, RichtextContent, RichtextEditorRef, RichtextElement, RichtextRendererRef, RichtextText, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TestCase, TestCaseOpenCreateOptions, Ticket, TicketOpenCreateOptions, TranslationResourceContent, Translator, UnlistenCallback, UploadResult, Viewport, WorkItem, WorkItemOpenCreateOptions };
|