-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbundle.py
More file actions
100 lines (94 loc) · 3.76 KB
/
bundle.py
File metadata and controls
100 lines (94 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""This module contains the configuration for the system bundle."""
from typing import Dict
from polywrap_client_config_builder import BundlePackage
from polywrap_core import Uri
from polywrap_fs_plugin import file_system_plugin
from polywrap_http_plugin import http_plugin
from polywrap_logger_plugin import logger_plugin
from polywrap_uri_resolvers import ExtendableUriResolver
from .embeds import get_embedded_wrap
ipfs_providers = [
"https://ipfs.wrappers.io",
"https://ipfs.io",
]
sys_bundle: Dict[str, BundlePackage] = {
"http": BundlePackage(
uri=Uri.from_str("plugin/http@1.1.0"),
package=http_plugin(),
implements=[
Uri.from_str("wrapscan.io/polywrap/http@1.0"),
],
redirects_from=[
Uri.from_str("wrapscan.io/polywrap/http@1.0"),
],
),
"http_resolver": BundlePackage(
uri=Uri.from_str("embed/http-uri-resolver-ext@1.0.1"),
package=get_embedded_wrap("http-resolver"),
implements=[
Uri.from_str("wrapscan.io/polywrap/http-uri-resolver@1.0"),
*ExtendableUriResolver.DEFAULT_EXT_INTERFACE_URIS,
],
redirects_from=[
Uri.from_str("wrapscan.io/polywrap/http-uri-resolver@1.0"),
],
),
"wrapscan_resolver": BundlePackage(
uri=Uri("https", "wraps.wrapscan.io/r/polywrap/wrapscan-uri-resolver@1.0"),
implements=[
Uri.from_str("wrapscan.io/polywrap/wrapscan-uri-resolver@1.0"),
*ExtendableUriResolver.DEFAULT_EXT_INTERFACE_URIS,
],
redirects_from=[Uri.from_str("wrapscan.io/polywrap/wrapscan-uri-resolver@1.0")],
),
"ipfs_http_client": BundlePackage(
uri=Uri.from_str("embed/ipfs-http-client@1.0.0"),
package=get_embedded_wrap("ipfs-http-client"),
implements=[Uri.from_str("wrapscan.io/polywrap/ipfs-http-client@1.0")],
redirects_from=[Uri.from_str("wrapscan.io/polywrap/ipfs-http-client@1.0")],
),
"ipfs_resolver": BundlePackage(
uri=Uri.from_str("embed/sync-ipfs-uri-resolver-ext@1.0.1"),
package=get_embedded_wrap("ipfs-sync-resolver"),
implements=[
Uri.from_str("wrapscan.io/polywrap/sync-ipfs-uri-resolver@1.0"),
*ExtendableUriResolver.DEFAULT_EXT_INTERFACE_URIS,
],
redirects_from=[
Uri.from_str("wrapscan.io/polywrap/sync-ipfs-uri-resolver@1.0"),
],
env={
"provider": ipfs_providers[0],
"fallbackProviders": ipfs_providers[1:],
"retries": {"tryResolveUri": 2, "getFile": 2},
},
),
"github_resolver": BundlePackage(
uri=Uri.from_str("wrapscan.io/polywrap/github-uri-resolver@1.0"),
implements=ExtendableUriResolver.DEFAULT_EXT_INTERFACE_URIS,
),
"file_system": BundlePackage(
uri=Uri.from_str("plugin/file-system@1.0.0"),
package=file_system_plugin(),
implements=[Uri.from_str("wrapscan.io/polywrap/file-system@1.0")],
redirects_from=[Uri.from_str("wrapscan.io/polywrap/file-system@1.0")],
),
"file_system_resolver": BundlePackage(
uri=Uri.from_str("embed/file-system-uri-resolver-ext@1.0.1"),
package=get_embedded_wrap("file-system-resolver"),
implements=[
Uri.from_str("wrapscan.io/polywrap/file-system-uri-resolver@1.0"),
*ExtendableUriResolver.DEFAULT_EXT_INTERFACE_URIS,
],
redirects_from=[
Uri.from_str("wrapscan.io/polywrap/file-system-uri-resolver@1.0")
],
),
"logger": BundlePackage(
uri=Uri.from_str("plugin/logger@1.0.0"),
package=logger_plugin(),
implements=[Uri.from_str("wrapscan.io/polywrap/logger@1.0")],
redirects_from=[Uri.from_str("wrapscan.io/polywrap/logger@1.0")],
),
}
__all__ = ["sys_bundle"]