@pc-nexus/models 0.0.1-next.1

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 ADDED
@@ -0,0 +1,3 @@
1
+ # Nexus Models
2
+
3
+ Nexus Models is a type library that is dependent on the Nexus SDK
@@ -0,0 +1,32 @@
1
+ var NexusAppEnvironment;
2
+ (function (NexusAppEnvironment) {
3
+ NexusAppEnvironment["Development"] = "development";
4
+ NexusAppEnvironment["Production"] = "production";
5
+ })(NexusAppEnvironment || (NexusAppEnvironment = {}));
6
+
7
+ const SUPPORTED_LOCALE_CODES = ["zh-cn", "en-us"];
8
+
9
+ var NavigationTarget;
10
+ (function (NavigationTarget) {
11
+ NavigationTarget["workItem"] = "workItem";
12
+ })(NavigationTarget || (NavigationTarget = {}));
13
+
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
+ /*
24
+ * Public API Surface of models
25
+ */
26
+
27
+ /**
28
+ * Generated bundle index. Do not edit.
29
+ */
30
+
31
+ export { NavigationTarget, NexusAppEnvironment, SUPPORTED_LOCALE_CODES, ViewportSize };
32
+ //# sourceMappingURL=pc-nexus-models.mjs.map
@@ -0,0 +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 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\nexport interface NavigationWorkItem {\n target: NavigationTarget.workItem;\n workItemId: string;\n}\n\nexport type NavigationLocation = NavigationWorkItem;\n\nexport interface NavigatePayload {\n url?: string;\n location?: NavigationLocation;\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 \"./extension\";\nexport * from \"./invoke\";\nexport * from \"./locale\";\nexport * from \"./navigation\";\nexport * from \"./viewport\";\nexport * from \"./events\";\nexport * from \"./work-item\";\nexport * from \"./user\";\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;;ACJxB;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pc-nexus/models",
3
+ "version": "0.0.1-next.1",
4
+ "peerDependencies": {},
5
+ "dependencies": {
6
+ "tslib": "^2.3.0"
7
+ },
8
+ "sideEffects": false,
9
+ "module": "fesm2022/pc-nexus-models.mjs",
10
+ "typings": "types/pc-nexus-models.d.ts",
11
+ "exports": {
12
+ "./package.json": {
13
+ "default": "./package.json"
14
+ },
15
+ ".": {
16
+ "types": "./types/pc-nexus-models.d.ts",
17
+ "default": "./fesm2022/pc-nexus-models.mjs"
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,152 @@
1
+ declare enum NexusAppEnvironment {
2
+ Development = "development",
3
+ Production = "production"
4
+ }
5
+
6
+ declare const SUPPORTED_LOCALE_CODES: readonly ["zh-cn", "en-us"];
7
+ type NexusSupportedLocaleCode = (typeof SUPPORTED_LOCALE_CODES)[number];
8
+ interface Translator {
9
+ translate: (key: string, params?: Record<string, any>) => string;
10
+ }
11
+ interface GetTranslationsResult {
12
+ locale: NexusSupportedLocaleCode;
13
+ translations: TranslationResourceContent | null;
14
+ }
15
+ interface TranslationResourceContent {
16
+ [key: string]: string | TranslationResourceContent;
17
+ }
18
+
19
+ type ExtensionData = Record<string, any>;
20
+ interface NexusFullContext<T = ExtensionData> {
21
+ team_id?: string;
22
+ extension: T;
23
+ environment_id: string;
24
+ environment_type: NexusAppEnvironment;
25
+ local_id: string;
26
+ locale: NexusSupportedLocaleCode;
27
+ module_key: string;
28
+ site_url: string;
29
+ timezone: string;
30
+ }
31
+
32
+ interface Viewport {
33
+ size?: ViewportSize;
34
+ }
35
+ declare enum ViewportSize {
36
+ small = "small",
37
+ medium = "medium",
38
+ large = "large",
39
+ xlarge = "xlarge",
40
+ max = "max"
41
+ }
42
+
43
+ interface DialogOptions {
44
+ resource: string;
45
+ size?: ViewportSize;
46
+ context?: Record<string, unknown>;
47
+ backdropClosable?: boolean;
48
+ onClose?: (payload?: unknown) => void;
49
+ }
50
+ interface DialogRef<T = unknown> {
51
+ close: (payload?: T) => void;
52
+ }
53
+
54
+ interface ExtensionProperties {
55
+ key: string;
56
+ resolver: {
57
+ function: string;
58
+ };
59
+ resource: string;
60
+ resource_upload_id: string;
61
+ title: string;
62
+ order: number;
63
+ viewport?: Viewport;
64
+ }
65
+ interface EgressItem {
66
+ addresses: string[];
67
+ type: string;
68
+ category: string | null;
69
+ in_scope_eud: string | null;
70
+ }
71
+ interface NexusAppExtension {
72
+ id: string;
73
+ target: string;
74
+ scopes: string[];
75
+ module_id: string;
76
+ environment_id: string;
77
+ environment_key: string;
78
+ environment_type: NexusAppEnvironment;
79
+ installation_id: string;
80
+ app_version: string;
81
+ properties: ExtensionProperties;
82
+ egress?: EgressItem[];
83
+ installation_config: unknown | null;
84
+ }
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
+ interface EventCallbackParams {
105
+ payload?: any;
106
+ extension?: NexusAppExtension;
107
+ }
108
+ type EventCallbackType = (payload?: any, extension?: NexusAppExtension) => Promise<any>;
109
+ interface EventOnParams {
110
+ eventName: string;
111
+ callback: EventCallbackType;
112
+ }
113
+ interface EventEmitParams {
114
+ eventName: string;
115
+ payload: CustomEventInit<{
116
+ payload?: any;
117
+ extension?: NexusAppExtension;
118
+ }>;
119
+ }
120
+ interface Subscription {
121
+ unsubscribe: () => void;
122
+ }
123
+
124
+ interface WorkItemOpenCreateOptions {
125
+ defaultValues?: {
126
+ title?: string;
127
+ projectId?: string;
128
+ };
129
+ onSuccess?: (payload: {
130
+ _id: string;
131
+ title?: string;
132
+ project_id?: string;
133
+ }) => void;
134
+ }
135
+
136
+ interface SelectMemberDialogOptions {
137
+ title?: string;
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 };