asma-helpers 0.2.33 → 0.2.35
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/.prettierrc +15 -15
- package/.vscode/settings.json +39 -39
- package/README.md +0 -0
- package/lib/clients/srvAuth.d.ts +1 -1
- package/lib/clients/srvAuth.js +6 -6
- package/lib/global.d.ts +40 -39
- package/lib/global.d.ts.map +1 -1
- package/lib/global.js +4 -4
- package/lib/global.js.map +1 -1
- package/lib/helpers/CapitalizeFistLetter.d.ts +2 -2
- package/lib/helpers/CapitalizeFistLetter.js +6 -6
- package/lib/helpers/Config.d.ts +5 -5
- package/lib/helpers/Config.js +44 -44
- package/lib/helpers/EnvironmentToOperateTypes.d.ts +7 -7
- package/lib/helpers/EnvironmentToOperateTypes.js +8 -8
- package/lib/helpers/EnvironmentsUrls.d.ts +93 -93
- package/lib/helpers/EnvironmentsUrls.js +89 -89
- package/lib/helpers/FormatNumberConstants.d.ts +24 -24
- package/lib/helpers/FormatNumberConstants.js +40 -40
- package/lib/helpers/InitializeIDBListenersOnMstSnapshots.d.ts +1 -1
- package/lib/helpers/InitializeIDBListenersOnMstSnapshots.js +49 -49
- package/lib/helpers/InitializeIDBListenersOnMstSnapshotsThenCatch.d.ts +8 -8
- package/lib/helpers/InitializeIDBListenersOnMstSnapshotsThenCatch.js +68 -68
- package/lib/helpers/IsAdcuris.d.ts +2 -2
- package/lib/helpers/IsAdcuris.js +4 -4
- package/lib/helpers/IsNotEmpty.d.ts +1 -1
- package/lib/helpers/IsNotEmpty.js +3 -3
- package/lib/helpers/NorwegianPostalCodes.d.ts +8 -8
- package/lib/helpers/NorwegianPostalCodes.js +3 -3
- package/lib/helpers/ProcessServerError.d.ts +2 -2
- package/lib/helpers/ProcessServerError.js +100 -100
- package/lib/helpers/attachUserJournalCredentials.d.ts +1 -1
- package/lib/helpers/attachUserJournalCredentials.js +16 -16
- package/lib/helpers/base64ToFile.d.ts +1 -1
- package/lib/helpers/base64ToFile.js +8 -8
- package/lib/helpers/clearCacheData.d.ts +1 -1
- package/lib/helpers/clearCacheData.js +12 -12
- package/lib/helpers/generateEnvConfigsBindings.d.ts +30 -30
- package/lib/helpers/generateEnvConfigsBindings.js +48 -48
- package/lib/helpers/generateGenqlClient.d.ts +16 -16
- package/lib/helpers/generateGenqlClient.d.ts.map +1 -1
- package/lib/helpers/generateGenqlClient.js +77 -75
- package/lib/helpers/generateGenqlClient.js.map +1 -1
- package/lib/helpers/generateSrvAuthBindings.d.ts +36 -36
- package/lib/helpers/generateSrvAuthBindings.d.ts.map +1 -1
- package/lib/helpers/generateSrvAuthBindings.js +163 -153
- package/lib/helpers/generateSrvAuthBindings.js.map +1 -1
- package/lib/helpers/getGqlOperationName.d.ts +1 -1
- package/lib/helpers/getGqlOperationName.js +15 -15
- package/lib/helpers/getSubdomain.d.ts +12 -12
- package/lib/helpers/getSubdomain.js +39 -39
- package/lib/helpers/isValidUrl.d.ts +1 -1
- package/lib/helpers/isValidUrl.js +9 -9
- package/lib/helpers/parseJwt.d.ts +1 -1
- package/lib/helpers/parseJwt.js +7 -7
- package/lib/helpers/userTypingSignal.d.ts +4 -4
- package/lib/helpers/userTypingSignal.js +32 -32
- package/lib/index.d.ts +28 -28
- package/lib/index.js +26 -26
- package/lib/interfaces/api/advoca/ISaveToDataBase.d.ts +16 -16
- package/lib/interfaces/api/advoca/ISaveToDataBase.js +1 -1
- package/lib/interfaces/api/advoca/IUploadedDocument.d.ts +26 -26
- package/lib/interfaces/api/advoca/IUploadedDocument.js +1 -1
- package/lib/interfaces/enums.d.ts +50 -50
- package/lib/interfaces/enums.js +59 -59
- package/lib/utility/fetch.d.ts +1 -1
- package/lib/utility/fetch.js +5 -5
- package/package.json +29 -29
- package/src/clients/srvAuth.ts +6 -6
- package/src/global.ts +46 -45
- package/src/helpers/CapitalizeFistLetter.ts +7 -7
- package/src/helpers/Config.ts +58 -58
- package/src/helpers/EnvironmentToOperateTypes.ts +6 -6
- package/src/helpers/EnvironmentsUrls.ts +102 -102
- package/src/helpers/FormatNumberConstants.ts +41 -41
- package/src/helpers/InitializeIDBListenersOnMstSnapshots.ts +62 -62
- package/src/helpers/InitializeIDBListenersOnMstSnapshotsThenCatch.ts +82 -82
- package/src/helpers/IsAdcuris.ts +4 -4
- package/src/helpers/IsNotEmpty.ts +2 -2
- package/src/helpers/NorwegianPostalCodes.ts +6 -6
- package/src/helpers/ProcessServerError.ts +92 -92
- package/src/helpers/attachUserJournalCredentials.ts +23 -23
- package/src/helpers/base64ToFile.ts +9 -9
- package/src/helpers/clearCacheData.ts +15 -15
- package/src/helpers/generateEnvConfigsBindings.ts +82 -82
- package/src/helpers/generateGenqlClient.ts +110 -108
- package/src/helpers/generateSrvAuthBindings.ts +217 -204
- package/src/helpers/getGqlOperationName.ts +20 -20
- package/src/helpers/getSubdomain.ts +50 -50
- package/src/helpers/isValidUrl.ts +12 -12
- package/src/helpers/parseJwt.ts +10 -10
- package/src/index.ts +34 -34
- package/src/interfaces/api/advoca/ISaveToDataBase.ts +17 -17
- package/src/interfaces/api/advoca/IUploadedDocument.ts +23 -23
- package/src/interfaces/enums.ts +56 -56
- package/src/utility/fetch.ts +9 -9
- package/tsconfig.json +84 -84
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export function getGqlOperationName(query: string): string | undefined {
|
|
2
|
-
const is_query = query.includes('query') ? 'query' : undefined
|
|
3
|
-
|
|
4
|
-
const is_mutation = query.includes('mutation') ? 'mutation' : undefined
|
|
5
|
-
|
|
6
|
-
const is_subscription = query.includes('subscription') ? 'subscription' : undefined
|
|
7
|
-
|
|
8
|
-
const split_word = is_query || is_mutation || is_subscription
|
|
9
|
-
|
|
10
|
-
if (!split_word) {
|
|
11
|
-
return undefined
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let operationName = query?.split(split_word, 2)?.[1]?.split('{', 1)[0]?.split(' ')?.[1]?.trim()
|
|
15
|
-
|
|
16
|
-
if (operationName?.includes('(')) {
|
|
17
|
-
operationName = operationName.split('(', 1)[0]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return operationName
|
|
1
|
+
export function getGqlOperationName(query: string): string | undefined {
|
|
2
|
+
const is_query = query.includes('query') ? 'query' : undefined
|
|
3
|
+
|
|
4
|
+
const is_mutation = query.includes('mutation') ? 'mutation' : undefined
|
|
5
|
+
|
|
6
|
+
const is_subscription = query.includes('subscription') ? 'subscription' : undefined
|
|
7
|
+
|
|
8
|
+
const split_word = is_query || is_mutation || is_subscription
|
|
9
|
+
|
|
10
|
+
if (!split_word) {
|
|
11
|
+
return undefined
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let operationName = query?.split(split_word, 2)?.[1]?.split('{', 1)[0]?.split(' ')?.[1]?.trim()
|
|
15
|
+
|
|
16
|
+
if (operationName?.includes('(')) {
|
|
17
|
+
operationName = operationName.split('(', 1)[0]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return operationName
|
|
21
21
|
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated moved to asma-genql-directory use from there
|
|
3
|
-
*/
|
|
4
|
-
function getSubdomain() {
|
|
5
|
-
const hostname_arr = window.location.hostname.split('.') // fretex-dfsf.advoca.no
|
|
6
|
-
|
|
7
|
-
let subdomain = ''
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
hostname_arr.length === 3 &&
|
|
11
|
-
hostname_arr[0] &&
|
|
12
|
-
!['dev', 'test', 'stage', 'intern', 'www'].find((sub) => sub === hostname_arr[0])
|
|
13
|
-
) {
|
|
14
|
-
subdomain = hostname_arr[0]
|
|
15
|
-
|
|
16
|
-
const subdomain_arr = subdomain.split('-')
|
|
17
|
-
|
|
18
|
-
if (subdomain_arr.length === 2 && subdomain_arr[0]) {
|
|
19
|
-
subdomain = subdomain_arr[0]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return subdomain
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated moved to asma-genql-directory use from there
|
|
26
|
-
*/
|
|
27
|
-
export const subdomain = getSubdomain()
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated moved to asma-genql-directory use from there
|
|
30
|
-
*/
|
|
31
|
-
export function redirectFromSubdomainToDomain() {
|
|
32
|
-
const domain_hostname = `${createDomainUrlFromSubdomain()}${window.location.pathname}`
|
|
33
|
-
|
|
34
|
-
window.location.href = domain_hostname
|
|
35
|
-
|
|
36
|
-
return null
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated moved to asma-genql-directory use from there
|
|
40
|
-
*/
|
|
41
|
-
export function createDomainUrlFromSubdomain() {
|
|
42
|
-
let hostname = window.location.hostname.replace(subdomain, '')
|
|
43
|
-
|
|
44
|
-
;(hostname.startsWith('-') && (hostname = hostname.substring(1))) ||
|
|
45
|
-
(hostname.startsWith('.') && (hostname = 'www' + hostname))
|
|
46
|
-
|
|
47
|
-
const { port, protocol } = window.location
|
|
48
|
-
|
|
49
|
-
return protocol + '//' + hostname + (port ? `:${port}` : '')
|
|
50
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated moved to asma-genql-directory use from there
|
|
3
|
+
*/
|
|
4
|
+
function getSubdomain() {
|
|
5
|
+
const hostname_arr = window.location.hostname.split('.') // fretex-dfsf.advoca.no
|
|
6
|
+
|
|
7
|
+
let subdomain = ''
|
|
8
|
+
|
|
9
|
+
if (
|
|
10
|
+
hostname_arr.length === 3 &&
|
|
11
|
+
hostname_arr[0] &&
|
|
12
|
+
!['dev', 'test', 'stage', 'intern', 'www'].find((sub) => sub === hostname_arr[0])
|
|
13
|
+
) {
|
|
14
|
+
subdomain = hostname_arr[0]
|
|
15
|
+
|
|
16
|
+
const subdomain_arr = subdomain.split('-')
|
|
17
|
+
|
|
18
|
+
if (subdomain_arr.length === 2 && subdomain_arr[0]) {
|
|
19
|
+
subdomain = subdomain_arr[0]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return subdomain
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated moved to asma-genql-directory use from there
|
|
26
|
+
*/
|
|
27
|
+
export const subdomain = getSubdomain()
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated moved to asma-genql-directory use from there
|
|
30
|
+
*/
|
|
31
|
+
export function redirectFromSubdomainToDomain() {
|
|
32
|
+
const domain_hostname = `${createDomainUrlFromSubdomain()}${window.location.pathname}`
|
|
33
|
+
|
|
34
|
+
window.location.href = domain_hostname
|
|
35
|
+
|
|
36
|
+
return null
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated moved to asma-genql-directory use from there
|
|
40
|
+
*/
|
|
41
|
+
export function createDomainUrlFromSubdomain() {
|
|
42
|
+
let hostname = window.location.hostname.replace(subdomain, '')
|
|
43
|
+
|
|
44
|
+
;(hostname.startsWith('-') && (hostname = hostname.substring(1))) ||
|
|
45
|
+
(hostname.startsWith('.') && (hostname = 'www' + hostname))
|
|
46
|
+
|
|
47
|
+
const { port, protocol } = window.location
|
|
48
|
+
|
|
49
|
+
return protocol + '//' + hostname + (port ? `:${port}` : '')
|
|
50
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export function isValidUrl(urlString: string) {
|
|
2
|
-
const urlPattern = new RegExp(
|
|
3
|
-
'^(https?:\\/\\/)?' + // validate protocol
|
|
4
|
-
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
5
|
-
'((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address
|
|
6
|
-
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
7
|
-
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
8
|
-
'(\\#[-a-z\\d_]*)?$',
|
|
9
|
-
'i',
|
|
10
|
-
)
|
|
11
|
-
return !!urlPattern.test(urlString)
|
|
12
|
-
}
|
|
1
|
+
export function isValidUrl(urlString: string) {
|
|
2
|
+
const urlPattern = new RegExp(
|
|
3
|
+
'^(https?:\\/\\/)?' + // validate protocol
|
|
4
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
5
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))' + // validate OR ip (v4) address
|
|
6
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
7
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
8
|
+
'(\\#[-a-z\\d_]*)?$',
|
|
9
|
+
'i',
|
|
10
|
+
)
|
|
11
|
+
return !!urlPattern.test(urlString)
|
|
12
|
+
}
|
package/src/helpers/parseJwt.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function parseJwt<R>(jwtToken: string): R|undefined {
|
|
4
|
-
const base64Url = jwtToken?.split('.')[1]
|
|
5
|
-
|
|
6
|
-
if (base64Url === undefined) {
|
|
7
|
-
return {} as any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return JSON.parse(decodeURIComponent(escape(window.atob(base64Url))))
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export function parseJwt<R>(jwtToken: string): R|undefined {
|
|
4
|
+
const base64Url = jwtToken?.split('.')[1]
|
|
5
|
+
|
|
6
|
+
if (base64Url === undefined) {
|
|
7
|
+
return {} as any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return JSON.parse(decodeURIComponent(escape(window.atob(base64Url))))
|
|
11
11
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export { getServerErrorMessage, processServerError } from './helpers/ProcessServerError'
|
|
2
|
-
export { CURENCY_NOK, NORVEGIAN_PHONE_NUMBER, ORDINARY, PERSONAL_NUMBER, YEARS } from './helpers/FormatNumberConstants'
|
|
3
|
-
export { COUNTRIES, POSTAL_CODE } from './helpers/NorwegianPostalCodes'
|
|
4
|
-
export { capitalizeFirstLetter, toLowercaseAndCapitalizeFirstLetter } from './helpers/CapitalizeFistLetter'
|
|
5
|
-
export * from './helpers/IsAdcuris'
|
|
6
|
-
export * from './helpers/IsNotEmpty'
|
|
7
|
-
export * from './helpers/Config'
|
|
8
|
-
export * from './helpers/InitializeIDBListenersOnMstSnapshots'
|
|
9
|
-
export * from './helpers/InitializeIDBListenersOnMstSnapshotsThenCatch'
|
|
10
|
-
|
|
11
|
-
export * from './helpers/getGqlOperationName'
|
|
12
|
-
export * from './helpers/parseJwt'
|
|
13
|
-
export * from './helpers/EnvironmentsUrls'
|
|
14
|
-
export * from './helpers/EnvironmentToOperateTypes'
|
|
15
|
-
export * from './helpers/generateSrvAuthBindings'
|
|
16
|
-
export * from './helpers/getSubdomain'
|
|
17
|
-
export * from './helpers/clearCacheData'
|
|
18
|
-
export * from './helpers/generateGenqlClient'
|
|
19
|
-
export * from './helpers/generateEnvConfigsBindings'
|
|
20
|
-
export * from './helpers/userTypingSignal'
|
|
21
|
-
export * from './helpers/base64ToFile'
|
|
22
|
-
export * from './helpers/isValidUrl'
|
|
23
|
-
export * from './helpers/attachUserJournalCredentials'
|
|
24
|
-
|
|
25
|
-
export * from './utility/fetch'
|
|
26
|
-
|
|
27
|
-
export * from './clients/srvAuth'
|
|
28
|
-
|
|
29
|
-
export type { IUploadedDocument } from './interfaces/api/advoca/IUploadedDocument'
|
|
30
|
-
export type { IFeedBack, ISaveToDataBase } from './interfaces/api/advoca/ISaveToDataBase'
|
|
31
|
-
|
|
32
|
-
export * from './interfaces/enums'
|
|
33
|
-
|
|
34
|
-
export * from './global'
|
|
1
|
+
export { getServerErrorMessage, processServerError } from './helpers/ProcessServerError'
|
|
2
|
+
export { CURENCY_NOK, NORVEGIAN_PHONE_NUMBER, ORDINARY, PERSONAL_NUMBER, YEARS } from './helpers/FormatNumberConstants'
|
|
3
|
+
export { COUNTRIES, POSTAL_CODE } from './helpers/NorwegianPostalCodes'
|
|
4
|
+
export { capitalizeFirstLetter, toLowercaseAndCapitalizeFirstLetter } from './helpers/CapitalizeFistLetter'
|
|
5
|
+
export * from './helpers/IsAdcuris'
|
|
6
|
+
export * from './helpers/IsNotEmpty'
|
|
7
|
+
export * from './helpers/Config'
|
|
8
|
+
export * from './helpers/InitializeIDBListenersOnMstSnapshots'
|
|
9
|
+
export * from './helpers/InitializeIDBListenersOnMstSnapshotsThenCatch'
|
|
10
|
+
|
|
11
|
+
export * from './helpers/getGqlOperationName'
|
|
12
|
+
export * from './helpers/parseJwt'
|
|
13
|
+
export * from './helpers/EnvironmentsUrls'
|
|
14
|
+
export * from './helpers/EnvironmentToOperateTypes'
|
|
15
|
+
export * from './helpers/generateSrvAuthBindings'
|
|
16
|
+
export * from './helpers/getSubdomain'
|
|
17
|
+
export * from './helpers/clearCacheData'
|
|
18
|
+
export * from './helpers/generateGenqlClient'
|
|
19
|
+
export * from './helpers/generateEnvConfigsBindings'
|
|
20
|
+
export * from './helpers/userTypingSignal'
|
|
21
|
+
export * from './helpers/base64ToFile'
|
|
22
|
+
export * from './helpers/isValidUrl'
|
|
23
|
+
export * from './helpers/attachUserJournalCredentials'
|
|
24
|
+
|
|
25
|
+
export * from './utility/fetch'
|
|
26
|
+
|
|
27
|
+
export * from './clients/srvAuth'
|
|
28
|
+
|
|
29
|
+
export type { IUploadedDocument } from './interfaces/api/advoca/IUploadedDocument'
|
|
30
|
+
export type { IFeedBack, ISaveToDataBase } from './interfaces/api/advoca/ISaveToDataBase'
|
|
31
|
+
|
|
32
|
+
export * from './interfaces/enums'
|
|
33
|
+
|
|
34
|
+
export * from './global'
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export interface ISaveToDataBase {
|
|
2
|
-
method: string
|
|
3
|
-
json: string
|
|
4
|
-
uuid: string | undefined
|
|
5
|
-
feedback: IFeedBack
|
|
6
|
-
url: string
|
|
7
|
-
origin?: {
|
|
8
|
-
method: string
|
|
9
|
-
// history: any
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface IFeedBack {
|
|
14
|
-
error?: string
|
|
15
|
-
type: string
|
|
16
|
-
message: string
|
|
17
|
-
show_time: number
|
|
1
|
+
export interface ISaveToDataBase {
|
|
2
|
+
method: string
|
|
3
|
+
json: string
|
|
4
|
+
uuid: string | undefined
|
|
5
|
+
feedback: IFeedBack
|
|
6
|
+
url: string
|
|
7
|
+
origin?: {
|
|
8
|
+
method: string
|
|
9
|
+
// history: any
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IFeedBack {
|
|
14
|
+
error?: string
|
|
15
|
+
type: string
|
|
16
|
+
message: string
|
|
17
|
+
show_time: number
|
|
18
18
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export interface IUploadedDocument {
|
|
2
|
-
created_at: string
|
|
3
|
-
customer: {
|
|
4
|
-
comm_consents_descr: string
|
|
5
|
-
contact_email: string
|
|
6
|
-
contact_message: string
|
|
7
|
-
contact_tel: string
|
|
8
|
-
|
|
9
|
-
id: number
|
|
10
|
-
logo: string
|
|
11
|
-
name: string
|
|
12
|
-
updated_at: string
|
|
13
|
-
}
|
|
14
|
-
customer_id: number
|
|
15
|
-
id: number
|
|
16
|
-
name: string
|
|
17
|
-
path: string
|
|
18
|
-
patientIds: { id: number; soknad_id: string }[]
|
|
19
|
-
region: number
|
|
20
|
-
sds_id: number
|
|
21
|
-
updated_at: string
|
|
22
|
-
upload_patient_id: number
|
|
23
|
-
success: string
|
|
1
|
+
export interface IUploadedDocument {
|
|
2
|
+
created_at: string
|
|
3
|
+
customer: {
|
|
4
|
+
comm_consents_descr: string
|
|
5
|
+
contact_email: string
|
|
6
|
+
contact_message: string
|
|
7
|
+
contact_tel: string
|
|
8
|
+
|
|
9
|
+
id: number
|
|
10
|
+
logo: string
|
|
11
|
+
name: string
|
|
12
|
+
updated_at: string
|
|
13
|
+
}
|
|
14
|
+
customer_id: number
|
|
15
|
+
id: number
|
|
16
|
+
name: string
|
|
17
|
+
path: string
|
|
18
|
+
patientIds: { id: number; soknad_id: string }[]
|
|
19
|
+
region: number
|
|
20
|
+
sds_id: number
|
|
21
|
+
updated_at: string
|
|
22
|
+
upload_patient_id: number
|
|
23
|
+
success: string
|
|
24
24
|
}
|
package/src/interfaces/enums.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
export enum InitiatorTypes {
|
|
2
|
-
Customer = 'customer',
|
|
3
|
-
Patient = 'patient',
|
|
4
|
-
SelfCompletable = 'self-completable',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum QnrContextTypes {
|
|
8
|
-
Advoca = 'advoca',
|
|
9
|
-
Portal = 'portal',
|
|
10
|
-
Outlook = 'outlook',
|
|
11
|
-
}
|
|
12
|
-
export enum DocSignicatSignStatusTypes {
|
|
13
|
-
Complteted = 'completed',
|
|
14
|
-
Rejected = 'rejected',
|
|
15
|
-
Waiting = 'waiting',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export enum DocProxyStatusTypes {
|
|
19
|
-
Signed = 'signed',
|
|
20
|
-
WaitingForSigning = 'waiting_for_signing',
|
|
21
|
-
OnlyForView = 'only_for_view',
|
|
22
|
-
/* download = 'download',
|
|
23
|
-
uploaded = 'uploaded' */
|
|
24
|
-
}
|
|
25
|
-
export enum QuestionTypes {
|
|
26
|
-
BooleanQuestion = 'BooleanQuestion',
|
|
27
|
-
CheckBoxes = 'CheckBoxes',
|
|
28
|
-
CompositeQuestion = 'CompositeQuestion',
|
|
29
|
-
DateField = 'DateField',
|
|
30
|
-
Dropdown = 'Dropdown',
|
|
31
|
-
FormatNumber = 'FormatNumber',
|
|
32
|
-
LinearScale = 'LinearScale',
|
|
33
|
-
Link = 'Link',
|
|
34
|
-
RadioButtons = 'RadioButtons',
|
|
35
|
-
TextLong = 'TextLong',
|
|
36
|
-
TextShort = 'TextShort',
|
|
37
|
-
Emoticons = 'Emoticons',
|
|
38
|
-
DocumentUpload = 'DocumentUpload',
|
|
39
|
-
Readonly = 'Readonly',
|
|
40
|
-
ExpressionQuestion = 'ExpressionQuestion',
|
|
41
|
-
Chart = 'Chart',
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export enum ActorTypes {
|
|
45
|
-
Mappable = 'mappable',
|
|
46
|
-
Custom = 'custom',
|
|
47
|
-
Complex = 'complex',
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export enum EnvironmentEnums {
|
|
51
|
-
local = 'local',
|
|
52
|
-
dev = 'dev',
|
|
53
|
-
test = 'test',
|
|
54
|
-
stage = 'stage',
|
|
55
|
-
prod = 'prod',
|
|
56
|
-
}
|
|
1
|
+
export enum InitiatorTypes {
|
|
2
|
+
Customer = 'customer',
|
|
3
|
+
Patient = 'patient',
|
|
4
|
+
SelfCompletable = 'self-completable',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum QnrContextTypes {
|
|
8
|
+
Advoca = 'advoca',
|
|
9
|
+
Portal = 'portal',
|
|
10
|
+
Outlook = 'outlook',
|
|
11
|
+
}
|
|
12
|
+
export enum DocSignicatSignStatusTypes {
|
|
13
|
+
Complteted = 'completed',
|
|
14
|
+
Rejected = 'rejected',
|
|
15
|
+
Waiting = 'waiting',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export enum DocProxyStatusTypes {
|
|
19
|
+
Signed = 'signed',
|
|
20
|
+
WaitingForSigning = 'waiting_for_signing',
|
|
21
|
+
OnlyForView = 'only_for_view',
|
|
22
|
+
/* download = 'download',
|
|
23
|
+
uploaded = 'uploaded' */
|
|
24
|
+
}
|
|
25
|
+
export enum QuestionTypes {
|
|
26
|
+
BooleanQuestion = 'BooleanQuestion',
|
|
27
|
+
CheckBoxes = 'CheckBoxes',
|
|
28
|
+
CompositeQuestion = 'CompositeQuestion',
|
|
29
|
+
DateField = 'DateField',
|
|
30
|
+
Dropdown = 'Dropdown',
|
|
31
|
+
FormatNumber = 'FormatNumber',
|
|
32
|
+
LinearScale = 'LinearScale',
|
|
33
|
+
Link = 'Link',
|
|
34
|
+
RadioButtons = 'RadioButtons',
|
|
35
|
+
TextLong = 'TextLong',
|
|
36
|
+
TextShort = 'TextShort',
|
|
37
|
+
Emoticons = 'Emoticons',
|
|
38
|
+
DocumentUpload = 'DocumentUpload',
|
|
39
|
+
Readonly = 'Readonly',
|
|
40
|
+
ExpressionQuestion = 'ExpressionQuestion',
|
|
41
|
+
Chart = 'Chart',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export enum ActorTypes {
|
|
45
|
+
Mappable = 'mappable',
|
|
46
|
+
Custom = 'custom',
|
|
47
|
+
Complex = 'complex',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export enum EnvironmentEnums {
|
|
51
|
+
local = 'local',
|
|
52
|
+
dev = 'dev',
|
|
53
|
+
test = 'test',
|
|
54
|
+
stage = 'stage',
|
|
55
|
+
prod = 'prod',
|
|
56
|
+
}
|
package/src/utility/fetch.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export async function http<R>(
|
|
2
|
-
request: RequestInfo,
|
|
3
|
-
init?:RequestInit
|
|
4
|
-
): Promise<R> {
|
|
5
|
-
const response = await fetch(request,init);
|
|
6
|
-
|
|
7
|
-
const body = await response.json();
|
|
8
|
-
|
|
9
|
-
return body;
|
|
1
|
+
export async function http<R>(
|
|
2
|
+
request: RequestInfo,
|
|
3
|
+
init?:RequestInit
|
|
4
|
+
): Promise<R> {
|
|
5
|
+
const response = await fetch(request,init);
|
|
6
|
+
|
|
7
|
+
const body = await response.json();
|
|
8
|
+
|
|
9
|
+
return body;
|
|
10
10
|
}
|