@fmsim/api 1.0.35 → 1.0.39
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/custom-elements.json +12 -0
- package/dist/src/index.js +15 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/restful/common.d.ts +1 -0
- package/dist/src/restful/common.js +3 -0
- package/dist/src/restful/common.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/mcs-config/mcs_auto_config.json +0 -2298
package/custom-elements.json
CHANGED
|
@@ -1049,6 +1049,10 @@
|
|
|
1049
1049
|
"kind": "function",
|
|
1050
1050
|
"name": "getUploadTempUrl"
|
|
1051
1051
|
},
|
|
1052
|
+
{
|
|
1053
|
+
"kind": "function",
|
|
1054
|
+
"name": "getDownloadFileUrl"
|
|
1055
|
+
},
|
|
1052
1056
|
{
|
|
1053
1057
|
"kind": "function",
|
|
1054
1058
|
"name": "callApi",
|
|
@@ -1169,6 +1173,14 @@
|
|
|
1169
1173
|
"module": "src/restful/common.ts"
|
|
1170
1174
|
}
|
|
1171
1175
|
},
|
|
1176
|
+
{
|
|
1177
|
+
"kind": "js",
|
|
1178
|
+
"name": "getDownloadFileUrl",
|
|
1179
|
+
"declaration": {
|
|
1180
|
+
"name": "getDownloadFileUrl",
|
|
1181
|
+
"module": "src/restful/common.ts"
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1172
1184
|
{
|
|
1173
1185
|
"kind": "js",
|
|
1174
1186
|
"name": "callApi",
|
package/dist/src/index.js
CHANGED
|
@@ -43,5 +43,20 @@ export async function getPopupData(type, id) {
|
|
|
43
43
|
}
|
|
44
44
|
return response.popupData;
|
|
45
45
|
}
|
|
46
|
+
else {
|
|
47
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
48
|
+
return {
|
|
49
|
+
'INFO-A': '1',
|
|
50
|
+
'INFO-B': '2',
|
|
51
|
+
'INFO-C': '3',
|
|
52
|
+
'INFO-D': '4',
|
|
53
|
+
'INFO-E': '5',
|
|
54
|
+
'INFO-F': '6',
|
|
55
|
+
'INFO-G': '7',
|
|
56
|
+
'INFO-H': '8',
|
|
57
|
+
'INFO-I': '9',
|
|
58
|
+
'INFO-J': '10'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
46
61
|
}
|
|
47
62
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,qBAAqB,EAAE,CAAA;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,qBAAqB,EAAE,CAAA;IACtC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,uBAAuB,EAAE,CAAA;IACxC,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,uBAAuB,EAAE,CAAA;IACxC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,EAAU;;IACzD,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAA,CAAC,MAAM,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,0CAAE,IAAI,CAAA;QAE5D,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClC,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,sBAAsB;iBAChC;aACF,CAAC,CACH,CAAA;YACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,QAAQ,CAAC,SAAS,CAAA;IAC3B,CAAC;AACH,CAAC","sourcesContent":["export * from './graphql'\n\nimport {\n themesColorMap as graphqlThemesColorMap,\n themesColorRange as graphqlThemesColorRange,\n themesAnimationMap as graphqlThemesAnimationMap\n} from './graphql'\n\nimport {\n getPopupData as restfulGetPopupData,\n themesColorMap as restfulThemesColorMap,\n themesColorRange as restfulThemesColorRange,\n themesAnimationMap as restfulThemesAnimationMap\n} from './restful'\n\nexport function isRestfulAvailable() {\n return sessionStorage.getItem('lv_server_ip_port')\n}\n\nexport async function themesColorMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorMap()\n } else {\n return await graphqlThemesColorMap()\n }\n}\n\nexport async function themesColorRange() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorRange()\n } else {\n return await graphqlThemesColorRange()\n }\n}\n\nexport async function themesAnimationMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesAnimationMap()\n } else {\n return await graphqlThemesAnimationMap()\n }\n}\n\nexport async function getPopupData(type: string, id: string) {\n if (isRestfulAvailable()) {\n const response = (await restfulGetPopupData(type, id))?.data\n\n if (!response || !response.status) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: 'Error : getPopupData'\n }\n })\n )\n throw new Error('Error : getPopupData')\n }\n\n return response.popupData\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AAEzB,OAAO,EACL,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,cAAc,IAAI,qBAAqB,EACvC,gBAAgB,IAAI,uBAAuB,EAC3C,kBAAkB,IAAI,yBAAyB,EAChD,MAAM,WAAW,CAAA;AAElB,MAAM,UAAU,kBAAkB;IAChC,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,qBAAqB,EAAE,CAAA;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,qBAAqB,EAAE,CAAA;IACtC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,uBAAuB,EAAE,CAAA;IACxC,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,uBAAuB,EAAE,CAAA;IACxC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,yBAAyB,EAAE,CAAA;IAC1C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,EAAU;;IACzD,IAAI,kBAAkB,EAAE,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAA,CAAC,MAAM,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,0CAAE,IAAI,CAAA;QAE5D,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAClC,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,sBAAsB;iBAChC;aACF,CAAC,CACH,CAAA;YACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,QAAQ,CAAC,SAAS,CAAA;IAC3B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;QACvD,OAAO;YACL,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,IAAI;SACf,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["export * from './graphql'\n\nimport {\n themesColorMap as graphqlThemesColorMap,\n themesColorRange as graphqlThemesColorRange,\n themesAnimationMap as graphqlThemesAnimationMap\n} from './graphql'\n\nimport {\n getPopupData as restfulGetPopupData,\n themesColorMap as restfulThemesColorMap,\n themesColorRange as restfulThemesColorRange,\n themesAnimationMap as restfulThemesAnimationMap\n} from './restful'\n\nexport function isRestfulAvailable() {\n return sessionStorage.getItem('lv_server_ip_port')\n}\n\nexport async function themesColorMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorMap()\n } else {\n return await graphqlThemesColorMap()\n }\n}\n\nexport async function themesColorRange() {\n if (isRestfulAvailable()) {\n return await restfulThemesColorRange()\n } else {\n return await graphqlThemesColorRange()\n }\n}\n\nexport async function themesAnimationMap() {\n if (isRestfulAvailable()) {\n return await restfulThemesAnimationMap()\n } else {\n return await graphqlThemesAnimationMap()\n }\n}\n\nexport async function getPopupData(type: string, id: string) {\n if (isRestfulAvailable()) {\n const response = (await restfulGetPopupData(type, id))?.data\n\n if (!response || !response.status) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: 'Error : getPopupData'\n }\n })\n )\n throw new Error('Error : getPopupData')\n }\n\n return response.popupData\n } else {\n await new Promise(resolve => setTimeout(resolve, 1000))\n return {\n 'INFO-A': '1',\n 'INFO-B': '2',\n 'INFO-C': '3',\n 'INFO-D': '4',\n 'INFO-E': '5',\n 'INFO-F': '6',\n 'INFO-G': '7',\n 'INFO-H': '8',\n 'INFO-I': '9',\n 'INFO-J': '10'\n }\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ export declare function getRestServiceMainUrl(): string;
|
|
|
6
6
|
export declare function getRestServiceMainFullPath(): string;
|
|
7
7
|
export declare function getRestServiceSecondaryUrl(): string;
|
|
8
8
|
export declare function getUploadTempUrl(): string;
|
|
9
|
+
export declare function getDownloadFileUrl(): string;
|
|
9
10
|
export type RestfulReturnType = {
|
|
10
11
|
data: {
|
|
11
12
|
errorMsg: string;
|
|
@@ -20,6 +20,9 @@ export function getRestServiceSecondaryUrl() {
|
|
|
20
20
|
export function getUploadTempUrl() {
|
|
21
21
|
return (sessionStorage.getItem('lv_server_context_path') || '') + '/uploadTempFile';
|
|
22
22
|
}
|
|
23
|
+
export function getDownloadFileUrl() {
|
|
24
|
+
return (sessionStorage.getItem('lv_server_context_path') || '') + '/downloadFile';
|
|
25
|
+
}
|
|
23
26
|
export async function callApi(url, method, params, data) {
|
|
24
27
|
try {
|
|
25
28
|
if (method === 'get') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/restful/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAA;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAA;AAEvF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAA;AACvH,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAA;AACvH,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,C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ent":["import axios from 'axios'\nimport authHeader from './authHeader'\n\nexport const REST_SERVICE_URL = sessionStorage.getItem('lv_server_ip_port') || ''\nexport const FREE_SERVICE_PATH = sessionStorage.getItem('lv_server_context_path') || ''\n\nexport function getRestServiceUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getRestServiceFullPath() {\n return (sessionStorage.getItem('lv_server_ip_port') || '') + (sessionStorage.getItem('lv_server_context_path') || '')\n}\n\nexport function getRestServiceMainUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getRestServiceMainFullPath() {\n return (sessionStorage.getItem('lv_server_ip_port') || '') + (sessionStorage.getItem('lv_server_context_path') || '')\n}\n\nexport function getRestServiceSecondaryUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getUploadTempUrl() {\n return (sessionStorage.getItem('lv_server_context_path') || '') + '/uploadTempFile'\n}\n\nexport type RestfulReturnType = {\n data: {\n errorMsg: string\n status: boolean\n [data: string]: any\n }\n}\n\nexport async function callApi(\n url: string,\n method: string,\n params: any,\n data: any\n): Promise<RestfulReturnType | undefined> {\n try {\n if (method === 'get') {\n return await axios.get(url, { headers: authHeader() })\n } else if (method === 'post') {\n return await axios.post(url, data, { headers: authHeader() })\n } else if (method === 'put') {\n return await axios.put(url, data, { headers: authHeader() })\n } else if (method === 'delete') {\n return await axios.delete(url, { data, headers: authHeader() })\n }\n } catch (e) {\n handleError(e as number)\n }\n}\n\nexport function handleError(errorStatus: number, errorMessage?: string) {\n if (errorStatus) {\n if (errorStatus !== 401) {\n console.log('################## common.error.http-communication : ' + errorMessage + '#####################')\n }\n return\n }\n console.log('################## common.error.server-response : ' + errorMessage + '#####################')\n}\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/restful/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,MAAM,C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AAC;QACH,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACrB,OAAO,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;QACxD,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;QAC/D,CAAC;aAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YAC5B,OAAO,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;QAC9D,CAAC;aAAM,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAA;QACjE,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW,CAAC,CAAW,CAAC,CAAA;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,YAAqB;IACpE,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,uDAAuD,GAAG,YAAY,GAAG,uBAAuB,CAAC,CAAA;QAC/G,CAAC;QACD,OAAM;IACR,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,oDAAoD,GAAG,YAAY,GAAG,uBAAuB,CAAC,CAAA;AAC5G,CAAC","sourcesContent":["import axios from 'axios'\nimport authHeader from './authHeader'\n\nexport const REST_SERVICE_URL = sessionStorage.getItem('lv_server_ip_port') || ''\nexport const FREE_SERVICE_PATH = sessionStorage.getItem('lv_server_context_path') || ''\n\nexport function getRestServiceUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getRestServiceFullPath() {\n return (sessionStorage.getItem('lv_server_ip_port') || '') + (sessionStorage.getItem('lv_server_context_path') || '')\n}\n\nexport function getRestServiceMainUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getRestServiceMainFullPath() {\n return (sessionStorage.getItem('lv_server_ip_port') || '') + (sessionStorage.getItem('lv_server_context_path') || '')\n}\n\nexport function getRestServiceSecondaryUrl() {\n return sessionStorage.getItem('lv_server_ip_port') || ''\n}\n\nexport function getUploadTempUrl() {\n return (sessionStorage.getItem('lv_server_context_path') || '') + '/uploadTempFile'\n}\n\nexport function getDownloadFileUrl() {\n return (sessionStorage.getItem('lv_server_context_path') || '') + '/downloadFile'\n}\n\nexport type RestfulReturnType = {\n data: {\n errorMsg: string\n status: boolean\n [data: string]: any\n }\n}\n\nexport async function callApi(\n url: string,\n method: string,\n params: any,\n data: any\n): Promise<RestfulReturnType | undefined> {\n try {\n if (method === 'get') {\n return await axios.get(url, { headers: authHeader() })\n } else if (method === 'post') {\n return await axios.post(url, data, { headers: authHeader() })\n } else if (method === 'put') {\n return await axios.put(url, data, { headers: authHeader() })\n } else if (method === 'delete') {\n return await axios.delete(url, { data, headers: authHeader() })\n }\n } catch (e) {\n handleError(e as number)\n }\n}\n\nexport function handleError(errorStatus: number, errorMessage?: string) {\n if (errorStatus) {\n if (errorStatus !== 401) {\n console.log('################## common.error.http-communication : ' + errorMessage + '#####################')\n }\n return\n }\n console.log('################## common.error.server-response : ' + errorMessage + '#####################')\n}\n"]}
|