@pc-nexus/models 0.0.1-next.1 → 0.0.1-next.3
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var NexusAppEnvironment;
|
|
2
2
|
(function (NexusAppEnvironment) {
|
|
3
|
-
NexusAppEnvironment["
|
|
4
|
-
NexusAppEnvironment["
|
|
3
|
+
NexusAppEnvironment["development"] = "development";
|
|
4
|
+
NexusAppEnvironment["production"] = "production";
|
|
5
5
|
})(NexusAppEnvironment || (NexusAppEnvironment = {}));
|
|
6
6
|
|
|
7
7
|
const SUPPORTED_LOCALE_CODES = ["zh-cn", "en-us"];
|
|
@@ -9,8 +9,31 @@ const SUPPORTED_LOCALE_CODES = ["zh-cn", "en-us"];
|
|
|
9
9
|
var NavigationTarget;
|
|
10
10
|
(function (NavigationTarget) {
|
|
11
11
|
NavigationTarget["workItem"] = "workItem";
|
|
12
|
+
NavigationTarget["testCase"] = "testCase";
|
|
13
|
+
NavigationTarget["page"] = "page";
|
|
14
|
+
NavigationTarget["idea"] = "idea";
|
|
15
|
+
NavigationTarget["ticket"] = "ticket";
|
|
16
|
+
NavigationTarget["project"] = "project";
|
|
17
|
+
NavigationTarget["library"] = "library";
|
|
18
|
+
NavigationTarget["space"] = "space";
|
|
19
|
+
NavigationTarget["product"] = "product";
|
|
12
20
|
})(NavigationTarget || (NavigationTarget = {}));
|
|
13
21
|
|
|
22
|
+
var NotifyType;
|
|
23
|
+
(function (NotifyType) {
|
|
24
|
+
NotifyType["success"] = "success";
|
|
25
|
+
NotifyType["error"] = "error";
|
|
26
|
+
NotifyType["warning"] = "warning";
|
|
27
|
+
NotifyType["info"] = "info";
|
|
28
|
+
})(NotifyType || (NotifyType = {}));
|
|
29
|
+
|
|
30
|
+
var HistoryAction;
|
|
31
|
+
(function (HistoryAction) {
|
|
32
|
+
HistoryAction["pop"] = "POP";
|
|
33
|
+
HistoryAction["push"] = "PUSH";
|
|
34
|
+
HistoryAction["replace"] = "REPLACE";
|
|
35
|
+
})(HistoryAction || (HistoryAction = {}));
|
|
36
|
+
|
|
14
37
|
var ViewportSize;
|
|
15
38
|
(function (ViewportSize) {
|
|
16
39
|
ViewportSize["small"] = "small";
|
|
@@ -28,5 +51,5 @@ var ViewportSize;
|
|
|
28
51
|
* Generated bundle index. Do not edit.
|
|
29
52
|
*/
|
|
30
53
|
|
|
31
|
-
export { NavigationTarget, NexusAppEnvironment, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
54
|
+
export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
32
55
|
//# 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/viewport.ts","../../../../web/models/src/public-api.ts","../../../../web/models/src/pc-nexus-models.ts"],"sourcesContent":["export enum NexusAppEnvironment {\n
|
|
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?: 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","/*\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\";\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,CAAA,UAAY,UAAU,EAAA;AAClB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EALW,UAAU,KAAV,UAAU,GAAA,EAAA,CAAA,CAAA;;ICAV;AAAZ,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACvB,CAAC,EAJW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;;ICIb;AAAZ,CAAA,UAAY,YAAY,EAAA;AACpB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,YAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,YAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACf,CAAC,EANW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;ACJxB;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare enum NexusAppEnvironment {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
development = "development",
|
|
3
|
+
production = "production"
|
|
4
4
|
}
|
|
5
5
|
|
|
6
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
|
-
translate: (key: string, params?: Record<string, any>) => string;
|
|
9
|
+
translate: (key: string, params?: Record<string, any>) => TranslationResourceContent | string;
|
|
10
10
|
}
|
|
11
11
|
interface GetTranslationsResult {
|
|
12
12
|
locale: NexusSupportedLocaleCode;
|
|
@@ -59,7 +59,7 @@ interface ExtensionProperties {
|
|
|
59
59
|
resource: string;
|
|
60
60
|
resource_upload_id: string;
|
|
61
61
|
title: string;
|
|
62
|
-
|
|
62
|
+
icon?: string;
|
|
63
63
|
viewport?: Viewport;
|
|
64
64
|
}
|
|
65
65
|
interface EgressItem {
|
|
@@ -83,24 +83,6 @@ interface NexusAppExtension {
|
|
|
83
83
|
installation_config: unknown | null;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
interface InvokeFunctionParams<T = unknown> {
|
|
87
|
-
function: string;
|
|
88
|
-
payload: T;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare enum NavigationTarget {
|
|
92
|
-
workItem = "workItem"
|
|
93
|
-
}
|
|
94
|
-
interface NavigationWorkItem {
|
|
95
|
-
target: NavigationTarget.workItem;
|
|
96
|
-
workItemId: string;
|
|
97
|
-
}
|
|
98
|
-
type NavigationLocation = NavigationWorkItem;
|
|
99
|
-
interface NavigatePayload {
|
|
100
|
-
url?: string;
|
|
101
|
-
location?: NavigationLocation;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
86
|
interface EventCallbackParams {
|
|
105
87
|
payload?: any;
|
|
106
88
|
extension?: NexusAppExtension;
|
|
@@ -121,6 +103,122 @@ interface Subscription {
|
|
|
121
103
|
unsubscribe: () => void;
|
|
122
104
|
}
|
|
123
105
|
|
|
106
|
+
interface InvokeFunctionParams<T = unknown> {
|
|
107
|
+
function: string;
|
|
108
|
+
payload: T;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare enum NavigationTarget {
|
|
112
|
+
workItem = "workItem",
|
|
113
|
+
testCase = "testCase",
|
|
114
|
+
page = "page",
|
|
115
|
+
idea = "idea",
|
|
116
|
+
ticket = "ticket",
|
|
117
|
+
project = "project",
|
|
118
|
+
library = "library",
|
|
119
|
+
space = "space",
|
|
120
|
+
product = "product"
|
|
121
|
+
}
|
|
122
|
+
interface NavigationTargetParams {
|
|
123
|
+
target: NavigationTarget;
|
|
124
|
+
id: string;
|
|
125
|
+
}
|
|
126
|
+
type NavigationLocation = NavigationTargetParams;
|
|
127
|
+
|
|
128
|
+
declare enum NotifyType {
|
|
129
|
+
success = "success",
|
|
130
|
+
error = "error",
|
|
131
|
+
warning = "warning",
|
|
132
|
+
info = "info"
|
|
133
|
+
}
|
|
134
|
+
interface NotifyOptions {
|
|
135
|
+
type?: NotifyType;
|
|
136
|
+
title?: string;
|
|
137
|
+
description?: string;
|
|
138
|
+
detail?: string | NotifyDetail;
|
|
139
|
+
actions?: NotifyAction[];
|
|
140
|
+
isAutoClose?: boolean;
|
|
141
|
+
}
|
|
142
|
+
interface NotifyRef {
|
|
143
|
+
close: () => void;
|
|
144
|
+
}
|
|
145
|
+
interface NotifyDetail {
|
|
146
|
+
link?: string;
|
|
147
|
+
content?: string;
|
|
148
|
+
}
|
|
149
|
+
interface NotifyAction {
|
|
150
|
+
text: string;
|
|
151
|
+
icon?: string;
|
|
152
|
+
onClick: (event?: Event) => void;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
type ProcessOptions = File | CustomProcessItem;
|
|
156
|
+
interface CustomProcessItem {
|
|
157
|
+
name: string;
|
|
158
|
+
icon?: string;
|
|
159
|
+
}
|
|
160
|
+
interface ProcessRef {
|
|
161
|
+
id: string;
|
|
162
|
+
setProgress(progress: number): void;
|
|
163
|
+
complete(payload?: {
|
|
164
|
+
fileUrl?: string;
|
|
165
|
+
message?: string;
|
|
166
|
+
}): void;
|
|
167
|
+
error(message: string): void;
|
|
168
|
+
cancel(): void;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
interface RequestApiResponseData {
|
|
172
|
+
status: number;
|
|
173
|
+
headers?: Record<string, string>;
|
|
174
|
+
body?: Record<string, any>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface SelectMemberDialogOptions {
|
|
178
|
+
title?: string;
|
|
179
|
+
selection?: string[];
|
|
180
|
+
onConfirm?: (payload?: string[]) => Promise<void>;
|
|
181
|
+
}
|
|
182
|
+
interface SelectMemberPopBaseOptions {
|
|
183
|
+
origin: HTMLElement;
|
|
184
|
+
}
|
|
185
|
+
interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
|
|
186
|
+
multiple: true;
|
|
187
|
+
selection?: string[];
|
|
188
|
+
onConfirm?: (ids?: string[]) => Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
interface SingleSelectOptions extends SelectMemberPopBaseOptions {
|
|
191
|
+
multiple?: false;
|
|
192
|
+
selection?: string;
|
|
193
|
+
onConfirm?: (id?: string) => Promise<void>;
|
|
194
|
+
}
|
|
195
|
+
type SelectMemberPopOptions = MultipleSelectOptions | SingleSelectOptions;
|
|
196
|
+
|
|
197
|
+
declare enum HistoryAction {
|
|
198
|
+
pop = "POP",
|
|
199
|
+
push = "PUSH",
|
|
200
|
+
replace = "REPLACE"
|
|
201
|
+
}
|
|
202
|
+
interface LocationDescriptor {
|
|
203
|
+
pathname: string;
|
|
204
|
+
search?: string;
|
|
205
|
+
hash?: string;
|
|
206
|
+
state?: unknown;
|
|
207
|
+
}
|
|
208
|
+
type UnlistenCallback = () => void;
|
|
209
|
+
interface NexusHistory {
|
|
210
|
+
action: HistoryAction;
|
|
211
|
+
location: LocationDescriptor;
|
|
212
|
+
push(path: string, state?: unknown): void;
|
|
213
|
+
push(location: LocationDescriptor): void;
|
|
214
|
+
replace(path: string, state?: unknown): void;
|
|
215
|
+
replace(location: LocationDescriptor): void;
|
|
216
|
+
go(n: number): void;
|
|
217
|
+
goBack(): void;
|
|
218
|
+
goForward(): void;
|
|
219
|
+
listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
|
|
220
|
+
}
|
|
221
|
+
|
|
124
222
|
interface WorkItemOpenCreateOptions {
|
|
125
223
|
defaultValues?: {
|
|
126
224
|
title?: string;
|
|
@@ -133,20 +231,5 @@ interface WorkItemOpenCreateOptions {
|
|
|
133
231
|
}) => void;
|
|
134
232
|
}
|
|
135
233
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
selection?: string[];
|
|
139
|
-
onConfirm?: (payload?: string[]) => Promise<void>;
|
|
140
|
-
}
|
|
141
|
-
type SelectMemberPopOptions = {
|
|
142
|
-
multiple?: true;
|
|
143
|
-
selection?: string[];
|
|
144
|
-
onConfirm?: (payload?: string[]) => Promise<void>;
|
|
145
|
-
} | {
|
|
146
|
-
multiple?: false;
|
|
147
|
-
selection?: string;
|
|
148
|
-
onConfirm?: (payload?: string) => Promise<void>;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export { NavigationTarget, NexusAppEnvironment, SUPPORTED_LOCALE_CODES, ViewportSize };
|
|
152
|
-
export type { DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, InvokeFunctionParams, NavigatePayload, NavigationLocation, NavigationWorkItem, NexusAppExtension, NexusFullContext, NexusSupportedLocaleCode, SelectMemberDialogOptions, SelectMemberPopOptions, Subscription, TranslationResourceContent, Translator, Viewport, WorkItemOpenCreateOptions };
|
|
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 };
|