@endo/compartment-mapper
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "@endo/compartment-mapper", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "The compartment mapper assembles Node applications in a sandbox", | ||
@@ -50,6 +50,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@endo/cjs-module-analyzer": "^1.0.4", | ||
"@endo/static-module-record": "^1.1.1", | ||
"@endo/zip": "^1.0.4", | ||
"ses": "^1.4.1" | ||
"@endo/cjs-module-analyzer": "^1.0.5", | ||
"@endo/static-module-record": "^1.1.2", | ||
"@endo/zip": "^1.0.5", | ||
"ses": "^1.5.0" | ||
}, | ||
@@ -65,3 +65,3 @@ "devDependencies": { | ||
"eslint-plugin-import": "^2.29.0", | ||
"prettier": "^3.0.0", | ||
"prettier": "^3.2.5", | ||
"typescript": "~5.5.0-dev.20240327" | ||
@@ -105,3 +105,3 @@ }, | ||
}, | ||
"gitHead": "25229bdcc26babb3afe0c229df4283a0f3c105f3" | ||
"gitHead": "08e59bc0d262565165636c2e3875bbe3dcb91cf8" | ||
} |
export function parseArchive(archiveBytes: Uint8Array, archiveLocation?: string | undefined, options?: { | ||
expectedSha512?: string | undefined; | ||
computeSha512?: import("./types.js").HashFn | undefined; | ||
computeSha512?: HashFn | undefined; | ||
modules?: Record<string, unknown> | undefined; | ||
importHook?: import("./types.js").ExitModuleImportHook | undefined; | ||
importHook?: ExitModuleImportHook | undefined; | ||
Compartment?: typeof Compartment | undefined; | ||
computeSourceLocation?: import("./types.js").ComputeSourceLocationHook | undefined; | ||
computeSourceMapLocation?: import("./types.js").ComputeSourceMapLocationHook | undefined; | ||
} | undefined): Promise<import('./types.js').Application>; | ||
export function loadArchive(readPowers: import('./types.js').ReadFn | import('./types.js').ReadPowers, archiveLocation: string, options?: import("./types.js").LoadArchiveOptions | undefined): Promise<import('./types.js').Application>; | ||
export function importArchive(readPowers: import('./types.js').ReadFn | import('./types.js').ReadPowers, archiveLocation: string, options: import('./types.js').ExecuteOptions & import('./types.js').LoadArchiveOptions): Promise<object>; | ||
computeSourceLocation?: ComputeSourceLocationHook | undefined; | ||
computeSourceMapLocation?: ComputeSourceMapLocationHook | undefined; | ||
} | undefined): Promise<Application>; | ||
export function loadArchive(readPowers: import("@endo/zip").ReadFn | ReadPowers, archiveLocation: string, options?: LoadArchiveOptions | undefined): Promise<Application>; | ||
export function importArchive(readPowers: import("@endo/zip").ReadFn | ReadPowers, archiveLocation: string, options: ExecuteOptions & LoadArchiveOptions): Promise<object>; | ||
export type CompartmentConstructor = typeof Compartment; | ||
import type { HashFn } from './types.js'; | ||
import type { ExitModuleImportHook } from './types.js'; | ||
import type { ComputeSourceLocationHook } from './types.js'; | ||
import type { ComputeSourceMapLocationHook } from './types.js'; | ||
import type { Application } from './types.js'; | ||
import type { ReadPowers } from './types.js'; | ||
import type { LoadArchiveOptions } from './types.js'; | ||
import type { ExecuteOptions } from './types.js'; | ||
//# sourceMappingURL=import-archive.d.ts.map |
@@ -18,2 +18,5 @@ // @ts-check | ||
/** @import {StaticModuleType} from 'ses' */ | ||
/** @import {Application, CompartmentDescriptor, ComputeSourceLocationHook, ComputeSourceMapLocationHook, ExecuteFn, ExecuteOptions, ExitModuleImportHook, HashFn, ImportHookMaker, LoadArchiveOptions, ParserImplementation, ReadPowers} from './types.js' */ | ||
const DefaultCompartment = Compartment; | ||
@@ -27,3 +30,3 @@ | ||
/** @type {Record<string, import('./types.js').ParserImplementation>} */ | ||
/** @type {Record<string, ParserImplementation>} */ | ||
const parserForLanguage = { | ||
@@ -39,3 +42,3 @@ 'pre-cjs-json': parserPreCjs, | ||
* @param {string} errorMessage - error to throw on execute | ||
* @returns {import('./types.js').StaticModuleType} | ||
* @returns {StaticModuleType} | ||
*/ | ||
@@ -61,9 +64,9 @@ const postponeErrorToExecute = errorMessage => { | ||
* @param {(path: string) => Uint8Array} get | ||
* @param {Record<string, import('./types.js').CompartmentDescriptor>} compartments | ||
* @param {Record<string, CompartmentDescriptor>} compartments | ||
* @param {string} archiveLocation | ||
* @param {import('./types.js').HashFn} [computeSha512] | ||
* @param {import('./types.js').ComputeSourceLocationHook} [computeSourceLocation] | ||
* @param {import('./types.js').ExitModuleImportHook} [exitModuleImportHook] | ||
* @param {import('./types.js').ComputeSourceMapLocationHook} [computeSourceMapLocation] | ||
* @returns {import('./types.js').ImportHookMaker} | ||
* @param {HashFn} [computeSha512] | ||
* @param {ComputeSourceLocationHook} [computeSourceLocation] | ||
* @param {ExitModuleImportHook} [exitModuleImportHook] | ||
* @param {ComputeSourceMapLocationHook} [computeSourceMapLocation] | ||
* @returns {ImportHookMaker} | ||
*/ | ||
@@ -80,3 +83,3 @@ const makeArchiveImportHookMaker = ( | ||
// per-assembly: | ||
/** @type {import('./types.js').ImportHookMaker} */ | ||
/** @type {ImportHookMaker} */ | ||
const makeImportHook = ({ | ||
@@ -252,9 +255,9 @@ packageLocation, | ||
* @param {string} [options.expectedSha512] | ||
* @param {import('./types.js').HashFn} [options.computeSha512] | ||
* @param {HashFn} [options.computeSha512] | ||
* @param {Record<string, unknown>} [options.modules] | ||
* @param {import('./types.js').ExitModuleImportHook} [options.importHook] | ||
* @param {ExitModuleImportHook} [options.importHook] | ||
* @param {CompartmentConstructor} [options.Compartment] | ||
* @param {import('./types.js').ComputeSourceLocationHook} [options.computeSourceLocation] | ||
* @param {import('./types.js').ComputeSourceMapLocationHook} [options.computeSourceMapLocation] | ||
* @returns {Promise<import('./types.js').Application>} | ||
* @param {ComputeSourceLocationHook} [options.computeSourceLocation] | ||
* @param {ComputeSourceMapLocationHook} [options.computeSourceMapLocation] | ||
* @returns {Promise<Application>} | ||
*/ | ||
@@ -365,3 +368,3 @@ export const parseArchive = async ( | ||
/** @type {import('./types.js').ExecuteFn} */ | ||
/** @type {ExecuteFn} */ | ||
const execute = async options => { | ||
@@ -410,6 +413,6 @@ const { | ||
/** | ||
* @param {import('./types.js').ReadFn | import('./types.js').ReadPowers} readPowers | ||
* @param {import('@endo/zip').ReadFn | ReadPowers} readPowers | ||
* @param {string} archiveLocation | ||
* @param {import('./types.js').LoadArchiveOptions} [options] | ||
* @returns {Promise<import('./types.js').Application>} | ||
* @param {LoadArchiveOptions} [options] | ||
* @returns {Promise<Application>} | ||
*/ | ||
@@ -439,5 +442,5 @@ export const loadArchive = async ( | ||
/** | ||
* @param {import('./types.js').ReadFn | import('./types.js').ReadPowers} readPowers | ||
* @param {import('@endo/zip').ReadFn | ReadPowers} readPowers | ||
* @param {string} archiveLocation | ||
* @param {import('./types.js').ExecuteOptions & import('./types.js').LoadArchiveOptions} options | ||
* @param {ExecuteOptions & LoadArchiveOptions} options | ||
* @returns {Promise<object>} | ||
@@ -444,0 +447,0 @@ */ |
@@ -9,3 +9,2 @@ export function mapParsers(languageForExtension: Record<string, Language>, languageForModuleSpecifier: Record<string, string>, parserForLanguage: Record<string, ParserImplementation>, moduleTransforms?: ModuleTransforms): ParseFn; | ||
export function assemble(compartmentMap: CompartmentMapDescriptor, options: LinkOptions): Compartment; | ||
export type ERef<T_1> = import('@endo/eventual-send').ERef<T_1>; | ||
import type { Language } from './types.js'; | ||
@@ -12,0 +11,0 @@ import type { ParserImplementation } from './types.js'; |
@@ -13,5 +13,4 @@ // @ts-check | ||
/** @import {CompartmentMapDescriptor} from './types.js' */ | ||
/** @import {DeferredAttenuatorsProvider} from './types.js' */ | ||
/** @import {LinkOptions} from './types.js' */ | ||
/** @template T @typedef {import('@endo/eventual-send').ERef<T>} ERef */ | ||
/** @import {ERef} from '@endo/eventual-send' */ | ||
@@ -18,0 +17,0 @@ import { resolve as resolveFallback } from './node-module-specifier.js'; |
@@ -243,5 +243,4 @@ // @ts-check | ||
} | ||
const { namespace } = await compartments[ATTENUATORS_COMPARTMENT].import( | ||
attenuatorSpecifier, | ||
); | ||
const { namespace } = | ||
await compartments[ATTENUATORS_COMPARTMENT].import(attenuatorSpecifier); | ||
return namespace; | ||
@@ -248,0 +247,0 @@ }; |
@@ -1,6 +0,1 @@ | ||
export type FinalStaticModuleType = import('ses').FinalStaticModuleType; | ||
export type ThirdPartyStaticModuleInterface = import('ses').ThirdPartyStaticModuleInterface; | ||
export type ImportHook = import('ses').ImportHook; | ||
export type StaticModuleType = import('ses').StaticModuleType; | ||
export type Transform = import('ses').Transform; | ||
/** | ||
@@ -168,3 +163,3 @@ * A compartment map describes how to construct an application as a graph of | ||
record: FinalStaticModuleType; | ||
sourceMap?: string; | ||
sourceMap?: string | undefined; | ||
}>; | ||
@@ -190,4 +185,4 @@ /** | ||
globals?: object; | ||
transforms?: import("ses").Transform[] | undefined; | ||
__shimTransforms__?: import("ses").Transform[] | undefined; | ||
transforms?: Transform[] | undefined; | ||
__shimTransforms__?: Transform[] | undefined; | ||
modules?: Record<string, any> | undefined; | ||
@@ -237,3 +232,3 @@ importHook?: ExitModuleImportHook | undefined; | ||
exit?: string | undefined; | ||
record?: import("ses").StaticModuleType | undefined; | ||
record?: StaticModuleType | undefined; | ||
}; | ||
@@ -362,2 +357,7 @@ export type Artifact = { | ||
export type SomeObject = Record<PropertyKey, any>; | ||
import type { ImportHook } from 'ses'; | ||
import type { FinalStaticModuleType } from 'ses'; | ||
import type { ThirdPartyStaticModuleInterface } from 'ses'; | ||
import type { Transform } from 'ses'; | ||
import type { StaticModuleType } from 'ses'; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -6,7 +6,7 @@ // @ts-check | ||
/** @typedef {import('ses').FinalStaticModuleType} FinalStaticModuleType */ | ||
/** @typedef {import('ses').ThirdPartyStaticModuleInterface} ThirdPartyStaticModuleInterface */ | ||
/** @typedef {import('ses').ImportHook} ImportHook */ | ||
/** @typedef {import('ses').StaticModuleType} StaticModuleType */ | ||
/** @typedef {import('ses').Transform} Transform */ | ||
/** @import {FinalStaticModuleType} from 'ses' */ | ||
/** @import {ThirdPartyStaticModuleInterface} from 'ses' */ | ||
/** @import {ImportHook} from 'ses' */ | ||
/** @import {StaticModuleType} from 'ses' */ | ||
/** @import {Transform} from 'ses' */ | ||
@@ -13,0 +13,0 @@ // ///////////////////////////////////////////////////////////////////////////// |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6617
277464
Updated@endo/zip@^1.0.5
Updatedses@^1.5.0