oc 0.50.50 → 0.50.52
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +47 -36
- package/CHANGELOG.md +12 -0
- package/dist/cli/facade/dev.d.ts +12 -12
- package/dist/components/oc-client/_package/package.json +5 -5
- package/dist/components/oc-client/_package/server.js +1 -1
- package/dist/components/oc-client/_package/src/oc-client.js +54 -56
- package/dist/components/oc-client/_package/src/oc-client.min.js +1 -1
- package/dist/components/oc-client/_package/src/oc-client.min.map +1 -1
- package/dist/components/oc-client/package-lock.json +2635 -10333
- package/dist/components/oc-client/package.json +2 -2
- package/dist/components/oc-client/src/oc-client.js +54 -56
- package/dist/components/oc-client/src/oc-client.min.js +1 -1
- package/dist/components/oc-client/src/oc-client.min.map +1 -1
- package/dist/registry/domain/extract-package.d.ts +2 -0
- package/dist/registry/domain/extract-package.js +3 -1
- package/dist/registry/routes/components.js +2 -2
- package/dist/registry/routes/publish.js +7 -0
- package/dist/registry/views/index.js +2 -1
- package/dist/registry/views/info.js +4 -3
- package/dist/registry/views/partials/component-parameters.js +6 -2
- package/dist/registry/views/partials/components-dependencies.js +1 -1
- package/dist/registry/views/partials/components-list.js +1 -1
- package/dist/registry/views/partials/components-plugins.js +1 -1
- package/dist/registry/views/partials/components-templates.js +3 -3
- package/dist/registry/views/partials/icon.d.ts +6 -0
- package/dist/registry/views/partials/icon.js +22 -0
- package/dist/registry/views/partials/layout.js +8 -4
- package/dist/registry/views/static/index.d.ts +1 -1
- package/dist/registry/views/static/index.js +22 -4
- package/dist/registry/views/static/info.d.ts +1 -1
- package/dist/registry/views/static/info.js +29 -0
- package/dist/registry/views/static/style.d.ts +1 -1
- package/dist/registry/views/static/style.js +799 -962
- package/dist/utils/put.js +6 -1
- package/package.json +24 -23
- package/tsconfig.json +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
> oc@0.50.50 lint
|
|
12
12
|
> npx @biomejs/biome check preview src test tasks
|
|
13
13
|
|
|
14
|
-
⠙[1G[0K⠹[1G[0K⠸[1G[0K⠼[1G[0K[0m[34mChecked
|
|
14
|
+
⠙[1G[0K⠹[1G[0K⠸[1G[0K⠼[1G[0K[0m[34mChecked 128 files in 36[0m[0m[2m[34mms[0m[0m[34m.[0m[0m[34m No fixes applied.[0m
|
|
15
15
|
⠙[1G[0K⠙[1G[0K[0m[32mBuilding client[39m[0m
|
|
16
16
|
compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/src/components/oc-client/
|
|
17
17
|
[0m[32mClient has been built and packaged[39m[0m 👍
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> oc@0.50.
|
|
3
|
+
> oc@0.50.50 test
|
|
4
4
|
> npm run build && node tasks/mochaTest.js
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> oc@0.50.
|
|
7
|
+
> oc@0.50.50 prebuild
|
|
8
8
|
> rimraf dist
|
|
9
9
|
|
|
10
10
|
⠙[1G[0K
|
|
11
|
-
> oc@0.50.
|
|
11
|
+
> oc@0.50.50 build
|
|
12
12
|
> npm run lint && tsc && node tasks/build.js
|
|
13
13
|
|
|
14
14
|
⠙[1G[0K
|
|
15
|
-
> oc@0.50.
|
|
15
|
+
> oc@0.50.50 lint
|
|
16
16
|
> npx @biomejs/biome check preview src test tasks
|
|
17
17
|
|
|
18
|
-
⠙[1G[0K⠹[1G[0K
|
|
18
|
+
⠙[1G[0K⠹[1G[0K⠸[1G[0K[0m[34mChecked 128 files in 33[0m[0m[2m[34mms[0m[0m[34m.[0m[0m[34m No fixes applied.[0m
|
|
19
19
|
⠙[1G[0K⠙[1G[0K[0m[32mBuilding client[39m[0m
|
|
20
20
|
compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/src/components/oc-client/
|
|
21
21
|
[0m[32mClient has been built and packaged[39m[0m 👍
|
|
@@ -35,13 +35,6 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
35
35
|
[0m[32mTest components packaged[39m[0m 👍
|
|
36
36
|
|
|
37
37
|
[0m[0m
|
|
38
|
-
[0m The targz dependency[0m
|
|
39
|
-
[0m when compressing a folder with targz[0m
|
|
40
|
-
[32m [32m✔[39m[0m[90m should create the file[0m
|
|
41
|
-
[0m when decompressing the created file[0m
|
|
42
|
-
[32m [32m✔[39m[0m[90m should throw no error[0m
|
|
43
|
-
[32m [32m✔[39m[0m[90m should contain the files[0m
|
|
44
|
-
|
|
45
38
|
[0m cli : domain : clean[0m
|
|
46
39
|
[0m when fetching the list of folders to clean[0m
|
|
47
40
|
[0m happy path[0m
|
|
@@ -293,7 +286,7 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
293
286
|
[32m [32m✔[39m[0m[90m should show error message[0m
|
|
294
287
|
[0m when href = /component[0m
|
|
295
288
|
[32m [32m✔[39m[0m[90m href should be /component/~preview/[0m
|
|
296
|
-
(node:
|
|
289
|
+
(node:92394) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
|
|
297
290
|
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
298
291
|
[0m when href = /component/1.X.X[0m
|
|
299
292
|
[32m [32m✔[39m[0m[90m href should be /component/1.X.X/~preview/[0m
|
|
@@ -579,6 +572,7 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
579
572
|
[32m [32m✔[39m[0m[90m should not error[0m
|
|
580
573
|
[32m [32m✔[39m[0m[90m should return the details[0m
|
|
581
574
|
[32m [32m✔[39m[0m[90m should fetch the details from components-details.json[0m
|
|
575
|
+
[32m [32m✔[39m[0m[90m should cache the details after the first fetch[0m
|
|
582
576
|
[0m when details file does not exist on cdn[0m
|
|
583
577
|
[32m [32m✔[39m[0m[90m should return an error[0m
|
|
584
578
|
[0m refresh()[0m
|
|
@@ -596,6 +590,7 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
596
590
|
[0m when component details save succeeds[0m
|
|
597
591
|
[32m [32m✔[39m[0m[90m should not error[0m
|
|
598
592
|
[32m [32m✔[39m[0m[90m should return result[0m
|
|
593
|
+
[32m [32m✔[39m[0m[90m should cache the refreshed details[0m
|
|
599
594
|
[0m when details file is up-to-date on cdn[0m
|
|
600
595
|
[32m [32m✔[39m[0m[90m should not error[0m
|
|
601
596
|
[32m [32m✔[39m[0m[90m should not save it[0m
|
|
@@ -613,6 +608,13 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
613
608
|
[0m when component details save succeeds[0m
|
|
614
609
|
[32m [32m✔[39m[0m[90m should not error[0m
|
|
615
610
|
[32m [32m✔[39m[0m[90m should return result[0m
|
|
611
|
+
[0m polling[0m
|
|
612
|
+
[32m [32m✔[39m[0m[90m should start the polling loop using the configured interval[0m
|
|
613
|
+
[32m [32m✔[39m[0m[90m should clear the previous loop when refreshing again[0m
|
|
614
|
+
[32m [32m✔[39m[0m[90m should restart the loop after each poll[0m
|
|
615
|
+
[32m [32m✔[39m[0m[90m should update the cache when the polled data is newer[0m
|
|
616
|
+
[32m [32m✔[39m[0m[90m should keep the cached data when the polled data is not newer[0m
|
|
617
|
+
[32m [32m✔[39m[0m[90m should fire an error event when polling fails[0m
|
|
616
618
|
|
|
617
619
|
[0m registry : domain : events-handler[0m
|
|
618
620
|
[0m when requiring it multiple times[0m
|
|
@@ -673,57 +675,57 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
673
675
|
|
|
674
676
|
[0m registry : domain : options-sanitiser[0m
|
|
675
677
|
[0m when options is empty[0m
|
|
676
|
-
[32m [32m✔[39m[0m[90m should set prefix to "/"[0m[31m (
|
|
678
|
+
[32m [32m✔[39m[0m[90m should set prefix to "/"[0m[31m (192ms)[0m
|
|
677
679
|
[32m [32m✔[39m[0m[90m should set tempDir to "./temp/"[0m[31m (84ms)[0m
|
|
678
|
-
[32m [32m✔[39m[0m[90m should set hotReloading to false[0m[33m (
|
|
679
|
-
[32m [32m✔[39m[0m[90m should set verbosity to 0[0m[
|
|
680
|
-
[32m [32m✔[39m[0m[90m should set customHeadersToSkipOnWeakVersion to [][0m[33m (
|
|
681
|
-
[32m [32m✔[39m[0m[90m should set timeout to 120000[0m[
|
|
680
|
+
[32m [32m✔[39m[0m[90m should set hotReloading to false[0m[33m (69ms)[0m
|
|
681
|
+
[32m [32m✔[39m[0m[90m should set verbosity to 0[0m[31m (88ms)[0m
|
|
682
|
+
[32m [32m✔[39m[0m[90m should set customHeadersToSkipOnWeakVersion to [][0m[33m (68ms)[0m
|
|
683
|
+
[32m [32m✔[39m[0m[90m should set timeout to 120000[0m[33m (64ms)[0m
|
|
682
684
|
[0m when verbosity is provided[0m
|
|
683
|
-
[32m [32m✔[39m[0m[90m should leave value untouched[0m[33m (
|
|
685
|
+
[32m [32m✔[39m[0m[90m should leave value untouched[0m[33m (64ms)[0m
|
|
684
686
|
[0m customHeadersToSkipOnWeakVersion[0m
|
|
685
687
|
[0m when it contains valid elements[0m
|
|
686
|
-
[32m [32m✔[39m[0m[90m should convert the array elements to lower case[0m[33m (
|
|
688
|
+
[32m [32m✔[39m[0m[90m should convert the array elements to lower case[0m[33m (64ms)[0m
|
|
687
689
|
[0m fallbackRegistryUrl[0m
|
|
688
690
|
[0m when fallbackRegistryUrl doesn't contain / at the end of url[0m
|
|
689
|
-
[32m [32m✔[39m[0m[90m should add `/` at the end of url[0m[33m (
|
|
691
|
+
[32m [32m✔[39m[0m[90m should add `/` at the end of url[0m[33m (60ms)[0m
|
|
690
692
|
[0m when fallbackRegistryUrl contains `/` at the end of url[0m
|
|
691
|
-
[32m [32m✔[39m[0m[90m should not modify fallbackRegistryUrl url[0m[33m (
|
|
693
|
+
[32m [32m✔[39m[0m[90m should not modify fallbackRegistryUrl url[0m[33m (58ms)[0m
|
|
692
694
|
[0m prefix and baseUrl sanitization[0m
|
|
693
|
-
[32m [32m✔[39m[0m[90m should support various scenarios correctly[0m[31m (
|
|
695
|
+
[32m [32m✔[39m[0m[90m should support various scenarios correctly[0m[31m (901ms)[0m
|
|
694
696
|
[0m when pollingInterval[0m
|
|
695
697
|
[0m is provided[0m
|
|
696
|
-
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (
|
|
698
|
+
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (56ms)[0m
|
|
697
699
|
[0m is not provided[0m
|
|
698
|
-
[32m [32m✔[39m[0m[90m should initialize it as 5000[0m[33m (
|
|
700
|
+
[32m [32m✔[39m[0m[90m should initialize it as 5000[0m[33m (59ms)[0m
|
|
699
701
|
[0m when templates[0m
|
|
700
702
|
[0m is provided[0m
|
|
701
703
|
[32m [32m✔[39m[0m[90m should not modify it[0m
|
|
702
704
|
[0m is not provided[0m
|
|
703
|
-
[32m [32m✔[39m[0m[90m should initialize it as 5000[0m[33m (
|
|
705
|
+
[32m [32m✔[39m[0m[90m should initialize it as 5000[0m[33m (56ms)[0m
|
|
704
706
|
[0m when env[0m
|
|
705
707
|
[0m is provided[0m
|
|
706
|
-
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (
|
|
708
|
+
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (54ms)[0m
|
|
707
709
|
[0m is not provided[0m
|
|
708
|
-
[32m [32m✔[39m[0m[90m should initialize it as an empty {}[0m[33m (
|
|
710
|
+
[32m [32m✔[39m[0m[90m should initialize it as an empty {}[0m[33m (58ms)[0m
|
|
709
711
|
[0m storage adapter configuration[0m
|
|
710
712
|
[0m when legacy "s3" param[0m
|
|
711
713
|
[0m is provided[0m
|
|
712
|
-
[32m [32m✔[39m[0m[90m should create a storage.adapter configuration accordingly[0m[31m (
|
|
714
|
+
[32m [32m✔[39m[0m[90m should create a storage.adapter configuration accordingly[0m[31m (289ms)[0m
|
|
713
715
|
[0m when no storage adapter[0m
|
|
714
716
|
[0m is provided[0m
|
|
715
|
-
[32m [32m✔[39m[0m[90m should default to the oc-s3-storage-adapter[0m[33m (
|
|
717
|
+
[32m [32m✔[39m[0m[90m should default to the oc-s3-storage-adapter[0m[33m (63ms)[0m
|
|
716
718
|
[0m when refreshInterval[0m
|
|
717
719
|
[0m is provided[0m
|
|
718
|
-
[32m [32m✔[39m[0m[90m should pass the refreshInterval to the storage options[0m[33m (
|
|
720
|
+
[32m [32m✔[39m[0m[90m should pass the refreshInterval to the storage options[0m[33m (66ms)[0m
|
|
719
721
|
[0m when verbosity[0m
|
|
720
722
|
[0m is provided[0m
|
|
721
|
-
[32m [32m✔[39m[0m[90m should pass the verbosity to the storage options[0m[33m (
|
|
723
|
+
[32m [32m✔[39m[0m[90m should pass the verbosity to the storage options[0m[33m (60ms)[0m
|
|
722
724
|
[0m when storage.path[0m
|
|
723
725
|
[0m does not include a protocol[0m
|
|
724
|
-
[32m [32m✔[39m[0m[90m should sanitize the path to rely on the https protocol[0m[33m (
|
|
726
|
+
[32m [32m✔[39m[0m[90m should sanitize the path to rely on the https protocol[0m[33m (63ms)[0m
|
|
725
727
|
[0m does include a prefix[0m
|
|
726
|
-
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (
|
|
728
|
+
[32m [32m✔[39m[0m[90m should not modify it[0m[33m (63ms)[0m
|
|
727
729
|
|
|
728
730
|
[0m registry : domain : plugins-initialiser[0m
|
|
729
731
|
[0m when initialising not valid plugins[0m
|
|
@@ -807,6 +809,8 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
807
809
|
[32m [32m✔[39m[0m[90m should refresh cached components list[0m
|
|
808
810
|
[32m [32m✔[39m[0m[90m should refresh componens details[0m
|
|
809
811
|
[32m [32m✔[39m[0m[90m should store the component in the correct directory[0m
|
|
812
|
+
[0m when refreshing details is slow[0m
|
|
813
|
+
[32m [32m✔[39m[0m[90m should resolve publish before details refresh finishes[0m
|
|
810
814
|
[0m when on local configuration[0m
|
|
811
815
|
[0m when getting the list of available components[0m
|
|
812
816
|
[32m [32m✔[39m[0m[90m should respond without an error[0m
|
|
@@ -1154,7 +1158,7 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
1154
1158
|
[32m [32m✔[39m[0m[90m should return component's name and request version for both requests[0m
|
|
1155
1159
|
[0m when getting a component that implements a plugin[0m
|
|
1156
1160
|
[0m when plugin not declared in package.json[0m
|
|
1157
|
-
(node:
|
|
1161
|
+
(node:92394) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead. (Triggered by calling processImmediate on process.)
|
|
1158
1162
|
[32m [32m✔[39m[0m[90m should return 500 status code[0m
|
|
1159
1163
|
[32m [32m✔[39m[0m[90m should respond with GENERIC_ERROR error code[0m
|
|
1160
1164
|
[32m [32m✔[39m[0m[90m should respond with error message including missing plugin[0m
|
|
@@ -1451,6 +1455,13 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
1451
1455
|
[0m when a version is not included[0m
|
|
1452
1456
|
[32m [32m✔[39m[0m[90m should return the unmodified dependency[0m
|
|
1453
1457
|
|
|
1458
|
+
[0m The targz dependency[0m
|
|
1459
|
+
[0m when compressing a folder with targz[0m
|
|
1460
|
+
[32m [32m✔[39m[0m[90m should create the file[0m
|
|
1461
|
+
[0m when decompressing the created file[0m
|
|
1462
|
+
[32m [32m✔[39m[0m[90m should throw no error[0m
|
|
1463
|
+
[32m [32m✔[39m[0m[90m should contain the files[0m
|
|
1464
|
+
|
|
1454
1465
|
[0m registry (ui interface)[0m
|
|
1455
1466
|
[0m GET / with Accept: text/html[0m
|
|
1456
1467
|
[32m [32m✔[39m[0m[90m should not error[0m
|
|
@@ -1607,6 +1618,6 @@ compiling component /Users/Ricardo.Agullo/Work/oc/packages/oc/test/fixtures/comp
|
|
|
1607
1618
|
[32m [32m✔[39m[0m[90m should respond with components parameters[0m
|
|
1608
1619
|
|
|
1609
1620
|
|
|
1610
|
-
[92m [0m[32m
|
|
1621
|
+
[92m [0m[32m 847 passing[0m[90m (10s)[0m
|
|
1611
1622
|
|
|
1612
1623
|
⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
package/dist/cli/facade/dev.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const dev: ({ local, logger }: {
|
|
|
18
18
|
verbose?: boolean;
|
|
19
19
|
production?: boolean;
|
|
20
20
|
}): Promise<{
|
|
21
|
-
close: (callback: (err?: Error | undefined | string) => void) => void | import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
21
|
+
close: (callback: (err?: Error | undefined | string) => void) => void | import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse>;
|
|
22
22
|
on: <T extends keyof {
|
|
23
23
|
error: {
|
|
24
24
|
code: string;
|
|
@@ -28,9 +28,9 @@ declare const dev: ({ local, logger }: {
|
|
|
28
28
|
'cache-poll': number;
|
|
29
29
|
request: import("../../registry/domain/events-handler").RequestData;
|
|
30
30
|
'component-retrieved': {
|
|
31
|
-
headers: import("http").IncomingHttpHeaders;
|
|
31
|
+
headers: import("node:http").IncomingHttpHeaders;
|
|
32
32
|
name: string;
|
|
33
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
33
|
+
parameters: import("node:http").IncomingHttpHeaders;
|
|
34
34
|
requestVersion: string;
|
|
35
35
|
duration: number;
|
|
36
36
|
};
|
|
@@ -58,9 +58,9 @@ declare const dev: ({ local, logger }: {
|
|
|
58
58
|
'cache-poll': number;
|
|
59
59
|
request: import("../../registry/domain/events-handler").RequestData;
|
|
60
60
|
'component-retrieved': {
|
|
61
|
-
headers: import("http").IncomingHttpHeaders;
|
|
61
|
+
headers: import("node:http").IncomingHttpHeaders;
|
|
62
62
|
name: string;
|
|
63
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
63
|
+
parameters: import("node:http").IncomingHttpHeaders;
|
|
64
64
|
requestVersion: string;
|
|
65
65
|
duration: number;
|
|
66
66
|
};
|
|
@@ -83,7 +83,7 @@ declare const dev: ({ local, logger }: {
|
|
|
83
83
|
register: <T = any>(plugin: oc.Plugin<T>, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
84
84
|
start: (callback: (err: unknown, data?: {
|
|
85
85
|
app: import("express").Express;
|
|
86
|
-
server: import("http").Server;
|
|
86
|
+
server: import("node:http").Server;
|
|
87
87
|
} | undefined) => void) => Promise<void>;
|
|
88
88
|
app: import("express").Express;
|
|
89
89
|
}>;
|
|
@@ -100,7 +100,7 @@ declare const dev: ({ local, logger }: {
|
|
|
100
100
|
verbose?: boolean;
|
|
101
101
|
production?: boolean;
|
|
102
102
|
}, arguments__1: (error: unknown, value: {
|
|
103
|
-
close: (callback: (err?: Error | undefined | string) => void) => void | import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
103
|
+
close: (callback: (err?: Error | undefined | string) => void) => void | import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse>;
|
|
104
104
|
on: <T extends keyof {
|
|
105
105
|
error: {
|
|
106
106
|
code: string;
|
|
@@ -110,9 +110,9 @@ declare const dev: ({ local, logger }: {
|
|
|
110
110
|
'cache-poll': number;
|
|
111
111
|
request: import("../../registry/domain/events-handler").RequestData;
|
|
112
112
|
'component-retrieved': {
|
|
113
|
-
headers: import("http").IncomingHttpHeaders;
|
|
113
|
+
headers: import("node:http").IncomingHttpHeaders;
|
|
114
114
|
name: string;
|
|
115
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
115
|
+
parameters: import("node:http").IncomingHttpHeaders;
|
|
116
116
|
requestVersion: string;
|
|
117
117
|
duration: number;
|
|
118
118
|
};
|
|
@@ -140,9 +140,9 @@ declare const dev: ({ local, logger }: {
|
|
|
140
140
|
'cache-poll': number;
|
|
141
141
|
request: import("../../registry/domain/events-handler").RequestData;
|
|
142
142
|
'component-retrieved': {
|
|
143
|
-
headers: import("http").IncomingHttpHeaders;
|
|
143
|
+
headers: import("node:http").IncomingHttpHeaders;
|
|
144
144
|
name: string;
|
|
145
|
-
parameters: import("http").IncomingHttpHeaders;
|
|
145
|
+
parameters: import("node:http").IncomingHttpHeaders;
|
|
146
146
|
requestVersion: string;
|
|
147
147
|
duration: number;
|
|
148
148
|
};
|
|
@@ -165,7 +165,7 @@ declare const dev: ({ local, logger }: {
|
|
|
165
165
|
register: <T = any>(plugin: oc.Plugin<T>, callback?: ((...args: any[]) => void) | undefined) => void;
|
|
166
166
|
start: (callback: (err: unknown, data?: {
|
|
167
167
|
app: import("express").Express;
|
|
168
|
-
server: import("http").Server;
|
|
168
|
+
server: import("node:http").Server;
|
|
169
169
|
} | undefined) => void) => Promise<void>;
|
|
170
170
|
app: import("express").Express;
|
|
171
171
|
}) => void): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-client",
|
|
3
3
|
"description": "The OpenComponents client-side javascript client",
|
|
4
|
-
"version": "0.50.
|
|
4
|
+
"version": "0.50.51",
|
|
5
5
|
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
|
|
6
6
|
"author": "Matteo Figus <matteofigus@gmail.com>",
|
|
7
7
|
"oc": {
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dataProvider": {
|
|
25
25
|
"type": "node.js",
|
|
26
|
-
"hashKey": "
|
|
26
|
+
"hashKey": "eb6f0f6e8adbdc8373db06539b04c840ac3faa2a",
|
|
27
27
|
"src": "server.js",
|
|
28
28
|
"size": 644
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"version": "0.50.
|
|
31
|
+
"version": "0.50.51",
|
|
32
32
|
"packaged": true,
|
|
33
|
-
"date":
|
|
33
|
+
"date": 1781764817361
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"oc-template-es6-compiler": "^
|
|
36
|
+
"oc-template-es6-compiler": "^8.0.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(t,s)=>{const{staticPath:e,templates:a}=t;return s(null,{staticPath:e,templates:a})},r=(t,s)=>{o(t,(e,a,i={})=>{if(e)return s(e);if(a==null)return s(null,{__oc_emptyResponse:!0});const n=t.action?a:Object.assign({},a,{_staticPath:t.staticPath,_baseUrl:t.baseUrl,_componentName:"oc-client",_componentVersion:"0.50.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(t,s)=>{const{staticPath:e,templates:a}=t;return s(null,{staticPath:e,templates:a})},r=(t,s)=>{o(t,(e,a,i={})=>{if(e)return s(e);if(a==null)return s(null,{__oc_emptyResponse:!0});const n=t.action?a:Object.assign({},a,{_staticPath:t.staticPath,_baseUrl:t.baseUrl,_componentName:"oc-client",_componentVersion:"0.50.51"}),c=t.staticPath.indexOf("http")===0?t.staticPath:"https:"+t.staticPath;return s(null,Object.assign({},{component:{key:"c4abb6bf4dc6657fb718a45b64bd6b2cb92e874a",src:c+"template.js",props:n,esm:!1,development:void 0}}))})};exports.data=r;
|
|
@@ -445,15 +445,15 @@
|
|
|
445
445
|
if (o.stack) e.stack = o.stack;
|
|
446
446
|
return Object.assign(e, o.originalError, o);
|
|
447
447
|
}
|
|
448
|
-
function createOc(
|
|
449
|
-
if (
|
|
450
|
-
return
|
|
448
|
+
function createOc(oc) {
|
|
449
|
+
if (oc.status) {
|
|
450
|
+
return oc;
|
|
451
451
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
452
|
+
oc.status = "loading";
|
|
453
|
+
oc.conf = oc.conf || {};
|
|
454
|
+
oc.cmd = oc.cmd || [];
|
|
455
|
+
oc.renderedComponents = oc.renderedComponents || {};
|
|
456
|
+
oc.clientVersion = "2.1.10";
|
|
457
457
|
let isRequired = (name, value) => {
|
|
458
458
|
if (!value) {
|
|
459
459
|
throw name + " parameter is required";
|
|
@@ -468,9 +468,9 @@
|
|
|
468
468
|
let retries = {};
|
|
469
469
|
let isBool = (a) => typeof a == "boolean";
|
|
470
470
|
let timeout = setTimeout;
|
|
471
|
-
let ocCmd =
|
|
472
|
-
let ocConf =
|
|
473
|
-
let renderedComponents =
|
|
471
|
+
let ocCmd = oc.cmd;
|
|
472
|
+
let ocConf = oc.conf;
|
|
473
|
+
let renderedComponents = oc.renderedComponents;
|
|
474
474
|
let dataRenderedAttribute = "data-rendered";
|
|
475
475
|
let dataRenderingAttribute = "data-rendering";
|
|
476
476
|
let nonce = $document.currentScript?.nonce;
|
|
@@ -551,7 +551,7 @@
|
|
|
551
551
|
...typeof globalHeaders == "function" ? globalHeaders() : globalHeaders
|
|
552
552
|
};
|
|
553
553
|
};
|
|
554
|
-
|
|
554
|
+
oc.addStylesToHead = (styles) => {
|
|
555
555
|
let style = $document.createElement("style");
|
|
556
556
|
style.textContent = styles;
|
|
557
557
|
if (nonce) {
|
|
@@ -560,14 +560,14 @@
|
|
|
560
560
|
$document.head.appendChild(style);
|
|
561
561
|
};
|
|
562
562
|
let loadAfterReady = () => {
|
|
563
|
-
|
|
563
|
+
oc.ready(oc.renderUnloadedComponents);
|
|
564
564
|
};
|
|
565
|
-
|
|
565
|
+
oc.registerTemplates = (templates) => {
|
|
566
566
|
registerTemplates(templates);
|
|
567
567
|
loadAfterReady();
|
|
568
568
|
return registeredTemplates;
|
|
569
569
|
};
|
|
570
|
-
|
|
570
|
+
oc.require = (nameSpace, url, callback) => {
|
|
571
571
|
if (!callback) {
|
|
572
572
|
callback = url;
|
|
573
573
|
url = nameSpace;
|
|
@@ -607,12 +607,12 @@
|
|
|
607
607
|
callback(loaded);
|
|
608
608
|
} else {
|
|
609
609
|
let loading = toLoad[0];
|
|
610
|
-
|
|
610
|
+
oc.require(loading.global, loading.url, (resolved) => {
|
|
611
611
|
asyncRequireForEach(toLoad.slice(1), loaded.concat(resolved), callback);
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
};
|
|
615
|
-
|
|
615
|
+
oc.requireSeries = asyncRequireForEach;
|
|
616
616
|
let processHtml = (component, data, callback) => {
|
|
617
617
|
let setAttribute = component.setAttribute.bind(component);
|
|
618
618
|
let dataName = data.name;
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
renderedComponents[dataName].baseUrl = data.baseUrl;
|
|
637
637
|
}
|
|
638
638
|
data.element = component;
|
|
639
|
-
|
|
639
|
+
oc.events.fire("oc:rendered", { ...data, id: data.ocId });
|
|
640
640
|
}
|
|
641
641
|
callback();
|
|
642
642
|
};
|
|
@@ -677,8 +677,8 @@
|
|
|
677
677
|
}
|
|
678
678
|
}).catch(cb);
|
|
679
679
|
};
|
|
680
|
-
|
|
681
|
-
|
|
680
|
+
oc.getData = getData;
|
|
681
|
+
oc.getAction = (options) => {
|
|
682
682
|
return new Promise((resolve, reject) => {
|
|
683
683
|
let name = options.component;
|
|
684
684
|
getData(
|
|
@@ -707,7 +707,7 @@
|
|
|
707
707
|
);
|
|
708
708
|
});
|
|
709
709
|
};
|
|
710
|
-
|
|
710
|
+
oc.build = (options) => {
|
|
711
711
|
isRequired("baseUrl", options.baseUrl);
|
|
712
712
|
isRequired("name", options.name);
|
|
713
713
|
let withFinalSlash = (s) => {
|
|
@@ -727,7 +727,7 @@
|
|
|
727
727
|
}
|
|
728
728
|
return "<" + OC_TAG + ' href="' + href + '"></' + OC_TAG + ">";
|
|
729
729
|
};
|
|
730
|
-
|
|
730
|
+
oc.ready = (callback) => {
|
|
731
731
|
if (initialised) {
|
|
732
732
|
callback();
|
|
733
733
|
} else if (initialising) {
|
|
@@ -737,7 +737,7 @@
|
|
|
737
737
|
let done = () => {
|
|
738
738
|
initialised = true;
|
|
739
739
|
initialising = false;
|
|
740
|
-
|
|
740
|
+
oc.events = /* @__PURE__ */ (() => {
|
|
741
741
|
let listeners = {};
|
|
742
742
|
return {
|
|
743
743
|
fire(key, data) {
|
|
@@ -787,16 +787,16 @@
|
|
|
787
787
|
);
|
|
788
788
|
}
|
|
789
789
|
callback();
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
oc.events.fire("oc:ready", oc);
|
|
791
|
+
oc.status = "ready";
|
|
792
792
|
ocCmd.map((cmd) => {
|
|
793
|
-
cmd(
|
|
793
|
+
cmd(oc);
|
|
794
794
|
});
|
|
795
|
-
|
|
796
|
-
push: (f) => f(
|
|
795
|
+
oc.cmd = {
|
|
796
|
+
push: (f) => f(oc)
|
|
797
797
|
};
|
|
798
798
|
};
|
|
799
|
-
|
|
799
|
+
oc.requireSeries(externals, done);
|
|
800
800
|
}
|
|
801
801
|
};
|
|
802
802
|
const renderOc = (template, apiResponse, callback) => {
|
|
@@ -804,7 +804,7 @@
|
|
|
804
804
|
if (isEsm) {
|
|
805
805
|
renderEsm(apiResponse.data, callback);
|
|
806
806
|
} else {
|
|
807
|
-
|
|
807
|
+
oc.render(template, apiResponse.data, callback);
|
|
808
808
|
}
|
|
809
809
|
};
|
|
810
810
|
const renderEsm = async (data, callback) => {
|
|
@@ -825,8 +825,8 @@
|
|
|
825
825
|
callback(error);
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
oc.render = (compiledViewInfo, model, callback) => {
|
|
829
|
+
oc.ready(() => {
|
|
830
830
|
if (model && model.__oc_emptyResponse == true) {
|
|
831
831
|
return callback(null, "");
|
|
832
832
|
}
|
|
@@ -838,7 +838,7 @@
|
|
|
838
838
|
}
|
|
839
839
|
let template = registeredTemplates[type];
|
|
840
840
|
if (template) {
|
|
841
|
-
|
|
841
|
+
oc.require(
|
|
842
842
|
["oc", "components", compiledViewInfo.key],
|
|
843
843
|
compiledViewInfo.src,
|
|
844
844
|
(compiledView) => {
|
|
@@ -873,8 +873,8 @@
|
|
|
873
873
|
}
|
|
874
874
|
});
|
|
875
875
|
};
|
|
876
|
-
|
|
877
|
-
|
|
876
|
+
oc.renderNestedComponent = (component, callback) => {
|
|
877
|
+
oc.ready(() => {
|
|
878
878
|
component = component[0] || component;
|
|
879
879
|
let getAttribute = component.getAttribute.bind(component);
|
|
880
880
|
let setAttribute = component.setAttribute.bind(component);
|
|
@@ -888,7 +888,7 @@
|
|
|
888
888
|
}
|
|
889
889
|
if (isRendering) {
|
|
890
890
|
timeout(() => {
|
|
891
|
-
|
|
891
|
+
oc.renderNestedComponent(component, callback);
|
|
892
892
|
}, POLLING_INTERVAL);
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
@@ -897,7 +897,7 @@
|
|
|
897
897
|
if (!DISABLE_LOADER) {
|
|
898
898
|
component.innerHTML = '<div class="oc-loading">' + MESSAGES_LOADING_COMPONENT + "</div>";
|
|
899
899
|
}
|
|
900
|
-
|
|
900
|
+
oc.renderByHref(
|
|
901
901
|
{
|
|
902
902
|
href: getAttribute("href"),
|
|
903
903
|
id: getAttribute("id"),
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
setAttribute(dataRenderedAttribute, false);
|
|
910
910
|
setAttribute("data-failed", true);
|
|
911
911
|
component.innerHTML = "";
|
|
912
|
-
|
|
912
|
+
oc.events.fire("oc:failed", {
|
|
913
913
|
originalError: err,
|
|
914
914
|
data,
|
|
915
915
|
component
|
|
@@ -923,14 +923,14 @@
|
|
|
923
923
|
);
|
|
924
924
|
});
|
|
925
925
|
};
|
|
926
|
-
|
|
926
|
+
oc.renderByHref = (hrefOrOptions, retryNumberOrCallback, callback) => {
|
|
927
927
|
callback = callback || retryNumberOrCallback;
|
|
928
928
|
let ocId = Math.floor(Math.random() * 9999999999);
|
|
929
929
|
let retryNumber = hrefOrOptions.retryNumber || +retryNumberOrCallback || 0;
|
|
930
930
|
let href = hrefOrOptions.href || hrefOrOptions;
|
|
931
931
|
let id = hrefOrOptions.id || ocId;
|
|
932
932
|
let element = hrefOrOptions.element;
|
|
933
|
-
|
|
933
|
+
oc.ready(() => {
|
|
934
934
|
if (!href) {
|
|
935
935
|
callback(MESSAGES_ERRORS_RENDERING + MESSAGES_ERRORS_HREF_MISSING);
|
|
936
936
|
} else {
|
|
@@ -976,7 +976,7 @@
|
|
|
976
976
|
retry(
|
|
977
977
|
href,
|
|
978
978
|
(requestNumber) => {
|
|
979
|
-
|
|
979
|
+
oc.renderByHref(
|
|
980
980
|
{
|
|
981
981
|
href,
|
|
982
982
|
retryNumber: requestNumber,
|
|
@@ -994,28 +994,28 @@
|
|
|
994
994
|
}
|
|
995
995
|
});
|
|
996
996
|
};
|
|
997
|
-
|
|
998
|
-
|
|
997
|
+
oc.renderUnloadedComponents = () => {
|
|
998
|
+
oc.ready(() => {
|
|
999
999
|
let unloadedComponents = $document.querySelectorAll(
|
|
1000
1000
|
`${OC_TAG}:not([data-rendered="true"]):not([data-failed="true"])`
|
|
1001
1001
|
);
|
|
1002
1002
|
unloadedComponents.forEach((unloadedComponent, idx) => {
|
|
1003
|
-
|
|
1003
|
+
oc.renderNestedComponent(unloadedComponent, () => {
|
|
1004
1004
|
if (idx == unloadedComponents.length - 1) {
|
|
1005
|
-
|
|
1005
|
+
oc.renderUnloadedComponents();
|
|
1006
1006
|
}
|
|
1007
1007
|
});
|
|
1008
1008
|
});
|
|
1009
1009
|
});
|
|
1010
1010
|
};
|
|
1011
|
-
|
|
1012
|
-
|
|
1011
|
+
oc.load = (placeholder, href, callback) => {
|
|
1012
|
+
oc.ready(() => {
|
|
1013
1013
|
callback = callback || noop;
|
|
1014
1014
|
if (placeholder) {
|
|
1015
1015
|
placeholder = placeholder[0] || placeholder;
|
|
1016
1016
|
placeholder.innerHTML = "<" + OC_TAG + ' href="' + href + '" />';
|
|
1017
1017
|
let newComponent = placeholder.querySelector(OC_TAG);
|
|
1018
|
-
|
|
1018
|
+
oc.renderNestedComponent(newComponent, () => {
|
|
1019
1019
|
callback(newComponent);
|
|
1020
1020
|
});
|
|
1021
1021
|
}
|
|
@@ -1045,7 +1045,7 @@
|
|
|
1045
1045
|
for (const entry of entries) {
|
|
1046
1046
|
if (entry.isIntersecting) {
|
|
1047
1047
|
observer.disconnect();
|
|
1048
|
-
|
|
1048
|
+
oc.renderNestedComponent(this, () => {
|
|
1049
1049
|
});
|
|
1050
1050
|
break;
|
|
1051
1051
|
}
|
|
@@ -1053,7 +1053,7 @@
|
|
|
1053
1053
|
});
|
|
1054
1054
|
observer.observe(this);
|
|
1055
1055
|
} else {
|
|
1056
|
-
|
|
1056
|
+
oc.renderNestedComponent(this, () => {
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
@@ -1063,7 +1063,7 @@
|
|
|
1063
1063
|
this.#connected = false;
|
|
1064
1064
|
const id = this.getAttribute("id");
|
|
1065
1065
|
if (id) {
|
|
1066
|
-
|
|
1066
|
+
oc.events.fire("oc:unrendered", {
|
|
1067
1067
|
element: this,
|
|
1068
1068
|
id
|
|
1069
1069
|
});
|
|
@@ -1078,12 +1078,10 @@
|
|
|
1078
1078
|
}
|
|
1079
1079
|
);
|
|
1080
1080
|
}
|
|
1081
|
-
return
|
|
1081
|
+
return oc;
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
// src/index.js
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
window.ljs = ljs2;
|
|
1088
|
-
window.oc = createOc(oc);
|
|
1085
|
+
window.ljs = new LJS();
|
|
1086
|
+
window.oc = createOc(window.oc || {});
|
|
1089
1087
|
})();
|