@nordcraft/runtime 1.0.18 → 1.0.19
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/dist/api/createAPI.js +2 -1
- package/dist/api/createAPI.js.map +1 -1
- package/dist/api/createAPIv2.js +5 -5
- package/dist/api/createAPIv2.js.map +1 -1
- package/dist/custom-element.main.esm.js +17 -17
- package/dist/custom-element.main.esm.js.map +4 -4
- package/dist/page.main.esm.js +3 -3
- package/dist/page.main.esm.js.map +4 -4
- package/package.json +4 -4
- package/src/api/createAPI.ts +2 -4
- package/src/api/createAPIv2.ts +5 -4
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://github.com/nordcraftengine/nordcraft",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@nordcraft/core": "1.0.
|
|
8
|
-
"@nordcraft/std-lib": "1.0.
|
|
7
|
+
"@nordcraft/core": "1.0.19",
|
|
8
|
+
"@nordcraft/std-lib": "1.0.19",
|
|
9
9
|
"fast-deep-equal": "3.1.3",
|
|
10
10
|
"path-to-regexp": "6.3.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@happy-dom/global-registrator": "17.
|
|
13
|
+
"@happy-dom/global-registrator": "17.5.6"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsc && bun scripts/build.js",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"files": ["dist", "src"],
|
|
22
22
|
"main": "dist/page.main.js",
|
|
23
23
|
"types": "dist/page.main.d.ts",
|
|
24
|
-
"version": "1.0.
|
|
24
|
+
"version": "1.0.19"
|
|
25
25
|
}
|
package/src/api/createAPI.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
2
2
|
import type { LegacyComponentAPI } from '@nordcraft/core/dist/api/apiTypes'
|
|
3
|
+
import { mapHeadersToObject } from '@nordcraft/core/dist/api/headers'
|
|
3
4
|
import type { ComponentData } from '@nordcraft/core/dist/component/component.types'
|
|
4
5
|
import { applyFormula, isFormula } from '@nordcraft/core/dist/formula/formula'
|
|
5
6
|
import { mapValues } from '@nordcraft/core/dist/utils/collections'
|
|
@@ -362,10 +363,7 @@ export function createLegacyAPI(
|
|
|
362
363
|
url: request?.url ?? apiPayload.url,
|
|
363
364
|
method: request?.method ?? apiPayload.method,
|
|
364
365
|
auth: request?.auth ?? apiPayload.auth,
|
|
365
|
-
headers:
|
|
366
|
-
(acc, [key, value]) => ({ ...acc, [key]: value }),
|
|
367
|
-
{},
|
|
368
|
-
),
|
|
366
|
+
headers: mapHeadersToObject(headers),
|
|
369
367
|
body,
|
|
370
368
|
}
|
|
371
369
|
return trigger(payload)
|
package/src/api/createAPIv2.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
isJsonHeader,
|
|
18
18
|
isJsonStreamHeader,
|
|
19
19
|
isTextHeader,
|
|
20
|
+
mapHeadersToObject,
|
|
20
21
|
} from '@nordcraft/core/dist/api/headers'
|
|
21
22
|
import type { ComponentData } from '@nordcraft/core/dist/component/component.types'
|
|
22
23
|
import type {
|
|
@@ -582,7 +583,7 @@ export function createAPI({
|
|
|
582
583
|
error: null,
|
|
583
584
|
response: {
|
|
584
585
|
status: res.status,
|
|
585
|
-
headers:
|
|
586
|
+
headers: mapHeadersToObject(res.headers),
|
|
586
587
|
},
|
|
587
588
|
}
|
|
588
589
|
return endResponse({ api, apiStatus: status, componentData, performance })
|
|
@@ -607,7 +608,7 @@ export function createAPI({
|
|
|
607
608
|
error: null,
|
|
608
609
|
response: {
|
|
609
610
|
status: res.status,
|
|
610
|
-
headers:
|
|
611
|
+
headers: mapHeadersToObject(res.headers),
|
|
611
612
|
},
|
|
612
613
|
}
|
|
613
614
|
return endResponse({ api, apiStatus: status, componentData, performance })
|
|
@@ -700,7 +701,7 @@ export function createAPI({
|
|
|
700
701
|
data: parseChunksForData(this.chunks),
|
|
701
702
|
error: null,
|
|
702
703
|
response: {
|
|
703
|
-
headers:
|
|
704
|
+
headers: mapHeadersToObject(res.headers),
|
|
704
705
|
},
|
|
705
706
|
},
|
|
706
707
|
},
|
|
@@ -754,7 +755,7 @@ export function createAPI({
|
|
|
754
755
|
error: null,
|
|
755
756
|
response: {
|
|
756
757
|
status: res.status,
|
|
757
|
-
headers:
|
|
758
|
+
headers: mapHeadersToObject(res.headers),
|
|
758
759
|
},
|
|
759
760
|
}
|
|
760
761
|
|