@pc-nexus/models 0.0.1-next.2 → 0.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.
@@ -9,17 +9,16 @@ 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
 
14
- var ViewportSize;
15
- (function (ViewportSize) {
16
- ViewportSize["small"] = "small";
17
- ViewportSize["medium"] = "medium";
18
- ViewportSize["large"] = "large";
19
- ViewportSize["xlarge"] = "xlarge";
20
- ViewportSize["max"] = "max";
21
- })(ViewportSize || (ViewportSize = {}));
22
-
23
22
  var NotifyType;
24
23
  (function (NotifyType) {
25
24
  NotifyType["success"] = "success";
@@ -35,6 +34,15 @@ var HistoryAction;
35
34
  HistoryAction["replace"] = "REPLACE";
36
35
  })(HistoryAction || (HistoryAction = {}));
37
36
 
37
+ var ViewportSize;
38
+ (function (ViewportSize) {
39
+ ViewportSize["small"] = "small";
40
+ ViewportSize["medium"] = "medium";
41
+ ViewportSize["large"] = "large";
42
+ ViewportSize["xlarge"] = "xlarge";
43
+ ViewportSize["max"] = "max";
44
+ })(ViewportSize || (ViewportSize = {}));
45
+
38
46
  /*
39
47
  * Public API Surface of models
40
48
  */
@@ -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/notify.ts","../../../../web/models/src/view.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>) => 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}\n\ninterface NavigationWorkItem {\n target: NavigationTarget.workItem;\n workItemId: string;\n}\n\nexport type NavigationLocation = NavigationWorkItem;\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 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","/*\n * Public API Surface of models\n */\n\nexport * from \"./context\";\nexport * from \"./dialog\";\nexport * from \"./environment\";\nexport * from \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./viewport\";\nexport * from \"./events\";\nexport * from \"./work-item\";\nexport * from \"./user\";\nexport * from \"./request-api\";\nexport * from \"./notify\";\nexport * from \"./view\";\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;AACzB,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ICIhB;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;;ICJZ;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;;ACAzB;;AAEG;;ACFH;;AAEG;;;;"}
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;AAC7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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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc-nexus/models",
3
- "version": "0.0.1-next.2",
3
+ "version": "0.1.0",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0"
@@ -6,7 +6,7 @@ declare enum NexusAppEnvironment {
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
- order: number;
62
+ icon?: string;
63
63
  viewport?: Viewport;
64
64
  }
65
65
  interface EgressItem {
@@ -83,20 +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
-
100
86
  interface EventCallbackParams {
101
87
  payload?: any;
102
88
  extension?: NexusAppExtension;
@@ -117,43 +103,27 @@ interface Subscription {
117
103
  unsubscribe: () => void;
118
104
  }
119
105
 
120
- interface WorkItemOpenCreateOptions {
121
- defaultValues?: {
122
- title?: string;
123
- projectId?: string;
124
- };
125
- onSuccess?: (payload: {
126
- _id: string;
127
- title?: string;
128
- project_id?: string;
129
- }) => void;
130
- }
131
-
132
- interface SelectMemberDialogOptions {
133
- title?: string;
134
- selection?: string[];
135
- onConfirm?: (payload?: string[]) => Promise<void>;
136
- }
137
- interface SelectMemberPopBaseOptions {
138
- origin: HTMLElement;
139
- }
140
- interface MultipleSelectOptions extends SelectMemberPopBaseOptions {
141
- multiple: true;
142
- selection?: string[];
143
- onConfirm?: (ids?: string[]) => Promise<void>;
144
- }
145
- interface SingleSelectOptions extends SelectMemberPopBaseOptions {
146
- multiple?: false;
147
- selection?: string;
148
- onConfirm?: (id?: string) => Promise<void>;
106
+ interface InvokeFunctionParams<T = unknown> {
107
+ function: string;
108
+ payload: T;
149
109
  }
150
- type SelectMemberPopOptions = MultipleSelectOptions | SingleSelectOptions;
151
110
 
152
- interface RequestApiResponseData {
153
- status: number;
154
- headers?: Record<string, string>;
155
- body?: Record<string, any>;
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;
156
125
  }
126
+ type NavigationLocation = NavigationTargetParams;
157
127
 
158
128
  declare enum NotifyType {
159
129
  success = "success",
@@ -182,6 +152,48 @@ interface NotifyAction {
182
152
  onClick: (event?: Event) => void;
183
153
  }
184
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
+
185
197
  declare enum HistoryAction {
186
198
  pop = "POP",
187
199
  push = "PUSH",
@@ -207,5 +219,17 @@ interface NexusHistory {
207
219
  listen(listener: (location: LocationDescriptor, action: HistoryAction) => void): Promise<UnlistenCallback>;
208
220
  }
209
221
 
222
+ interface WorkItemOpenCreateOptions {
223
+ defaultValues?: {
224
+ title?: string;
225
+ projectId?: string;
226
+ };
227
+ onSuccess?: (payload: {
228
+ _id: string;
229
+ title?: string;
230
+ project_id?: string;
231
+ }) => void;
232
+ }
233
+
210
234
  export { HistoryAction, NavigationTarget, NexusAppEnvironment, NotifyType, SUPPORTED_LOCALE_CODES, ViewportSize };
211
- export type { DialogOptions, DialogRef, EgressItem, EventCallbackParams, EventCallbackType, EventEmitParams, EventOnParams, ExtensionData, ExtensionProperties, GetTranslationsResult, InvokeFunctionParams, LocationDescriptor, MultipleSelectOptions, NavigationLocation, NexusAppExtension, NexusFullContext, NexusHistory, NexusSupportedLocaleCode, NotifyAction, NotifyDetail, NotifyOptions, NotifyRef, RequestApiResponseData, SelectMemberDialogOptions, SelectMemberPopOptions, SingleSelectOptions, Subscription, TranslationResourceContent, Translator, UnlistenCallback, Viewport, WorkItemOpenCreateOptions };
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 };