@polywrap/sys-config-bundle-js
v0.12.2
Published
A collection of system-level configurations.
Downloads
134
Readme
Sys Config Bundle
A collection of system-level configurations.
Bundle
import { loggerPlugin } from "@polywrap/logger-plugin-js";
import { dateTimePlugin } from "@polywrap/datetime-plugin-js";
import { concurrentPromisePlugin } from "@polywrap/concurrent-plugin-js";
import { httpPlugin } from "@polywrap/http-plugin-js";
import * as httpResolver from "./embeds/http-resolver/wrap";
import * as ipfsHttpClient from "./embeds/ipfs-http-client/wrap";
import * as ipfsResolver from "./embeds/async-ipfs-resolver/wrap";
export const ipfsProviders: string[] = [
"https://ipfs.wrappers.io",
"https://ipfs.io",
];
export interface SysCommonBundle extends Bundle {
logger: BundlePackage;
datetime: BundlePackage;
concurrent: BundlePackage;
http: BundlePackage;
githubResolver: BundlePackage;
httpResolver: BundlePackage;
wrapscanResolver: BundlePackage;
ipfsHttpClient: BundlePackage;
ipfsResolver: BundlePackage;
}
export const bundle: SysCommonBundle = {
logger: {
uri: "plugin/[email protected]",
package: loggerPlugin({}) as IWrapPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
datetime: {
uri: "plugin/[email protected]",
package: dateTimePlugin({}) as IWrapPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
concurrent: {
uri: "plugin/[email protected]",
package: concurrentPromisePlugin({}) as IWrapPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
http: {
uri: "plugin/[email protected]",
package: httpPlugin({}) as IWrapPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
githubResolver: {
uri: "wrapscan.io/polywrap/[email protected]",
implements: [ExtendableUriResolver.defaultExtInterfaceUris[0].uri],
},
httpResolver: {
uri: "embed/[email protected]",
package: httpResolver.wasmPackage,
implements: [
"wrapscan.io/polywrap/[email protected]",
ExtendableUriResolver.defaultExtInterfaceUris[0].uri
],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
wrapscanResolver: {
uri: "https://wraps.wrapscan.io/r/polywrap/[email protected]",
implements: [
"wrapscan.io/polywrap/[email protected]",
ExtendableUriResolver.defaultExtInterfaceUris[0].uri,
],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
ipfsHttpClient: {
uri: "embed/[email protected]",
package: ipfsHttpClient.wasmPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
ipfsResolver: {
uri: "embed/[email protected]",
package: ipfsResolver.wasmPackage,
implements: [
"wrapscan.io/polywrap/[email protected]",
ExtendableUriResolver.defaultExtInterfaceUris[0].uri,
],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
env: {
provider: ipfsProviders[0],
fallbackProviders: ipfsProviders.slice(1),
retries: { tryResolveUri: 2, getFile: 2 },
},
},
};
Node.JS
If you're using this package within Node.JS, you'll also have the following configurations:
import { fileSystemPlugin } from "@polywrap/file-system-plugin-js";
import * as fileSystemResolver from "./embeds/file-system-resolver/wrap";
interface SysNodeBundle extends Common.SysCommonBundle {
fileSystem: BundlePackage;
fileSystemResolver: BundlePackage;
}
export const bundle: SysNodeBundle = {
...Common.bundle,
fileSystem: {
uri: "plugin/[email protected]",
package: fileSystemPlugin({}) as IWrapPackage,
implements: ["wrapscan.io/polywrap/[email protected]"],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
fileSystemResolver: {
uri: "embed/[email protected]",
package: fileSystemResolver.wasmPackage,
implements: [
"wrapscan.io/polywrap/[email protected]",
ExtendableUriResolver.defaultExtInterfaceUris[0].uri,
],
redirectFrom: ["wrapscan.io/polywrap/[email protected]"],
},
};