New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@casual-simulation/aux-common

Package Overview
Dependencies
Maintainers
2
Versions
473
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@casual-simulation/aux-common - npm Package Compare versions

Comparing version 0.9.19 to 0.9.20

2

Files/File.d.ts

@@ -40,3 +40,3 @@ export declare type PartialFile = Partial<File>;

['aux.context.inventory.color']?: string;
['aux.inventory.height']?: unknown;
['aux.context.inventory.height']?: unknown;
['aux.context.inventory.visible']?: unknown;

@@ -43,0 +43,0 @@ ['aux.scene.user.player.color']?: unknown;

@@ -106,3 +106,3 @@ /**

'aux.context.inventory.color',
'aux.inventory.height',
'aux.context.inventory.height',
'aux.context.inventory.visible',

@@ -109,0 +109,0 @@ 'aux.scene.color',

import { PartialFile, FilesState, File } from './File';
import { Event, DeviceInfo } from '@casual-simulation/causal-trees';
import { Event, DeviceEvent, RemoteEvent } from '@casual-simulation/causal-trees';
/**

@@ -10,3 +10,3 @@ * Defines a union type for all the possible events that can be emitted from a files channel.

*/
export declare type LocalEvents = ShowToastEvent | TweenToEvent | OpenQRCodeScannerEvent | ShowQRCodeEvent | LoadSimulationEvent | UnloadSimulationEvent | SuperShoutEvent | GoToContextEvent | GoToURLEvent | OpenURLEvent | ImportAUXEvent | ShowInputForTagEvent | SetForcedOfflineEvent | SayHelloEvent | GrantRoleEvent | RevokeRoleEvent | ShellEvent;
export declare type LocalEvents = ShowToastEvent | TweenToEvent | OpenQRCodeScannerEvent | ShowQRCodeEvent | LoadSimulationEvent | UnloadSimulationEvent | SuperShoutEvent | GoToContextEvent | GoToURLEvent | OpenURLEvent | ImportAUXEvent | ShowInputForTagEvent | SetForcedOfflineEvent | SayHelloEvent | GrantRoleEvent | RevokeRoleEvent | ShellEvent | OpenConsoleEvent | EchoEvent;
/**

@@ -78,32 +78,18 @@ * Defines a file event that indicates a file was added to the state.

/**
* An event that is used to send events from this device to a remote device.
* An event that is used to print a "hello" message.
*/
export interface RemoteEvent extends Event {
type: 'remote';
/**
* The event that should be sent to the device.
*/
event: FileEvent;
export interface SayHelloEvent extends LocalEvent {
name: 'say_hello';
}
/**
* An event that is used to indicate an event that was sent from a remote device.
* An event that is used to request that a message is sent back to you.
*/
export interface DeviceEvent extends Event {
type: 'device';
export interface EchoEvent extends LocalEvent {
name: 'echo';
/**
* The device which sent the event.
* The message.
*/
device: DeviceInfo;
/**
* The event.
*/
event: FileEvent;
message: string;
}
/**
* An event that is used to print a "hello" message.
*/
export interface SayHelloEvent extends LocalEvent {
name: 'say_hello';
}
/**
* An event that is used to grant a role to a user.

@@ -187,2 +173,12 @@ */

/**
* An event that is used to toggle whether the console is open.
*/
export interface OpenConsoleEvent extends LocalEvent {
name: 'open_console';
/**
* Whether the console should be open.
*/
open: boolean;
}
/**
* An event that is used to show or hide a QR Code on screen.

@@ -484,7 +480,2 @@ */

/**
* Creates a new remote event.
* @param event The event.
*/
export declare function remote(event: FileEvent): RemoteEvent;
/**
* Creates a new SayHelloEvent.

@@ -494,2 +485,6 @@ */

/**
* Creates an new EchoEvent.
*/
export declare function echo(message: string): EchoEvent;
/**
* Creates a new GrantRoleEvent.

@@ -513,2 +508,6 @@ * @param username The username of the user that the role should be granted to.

export declare function shell(script: string): ShellEvent;
/**
* Creates a new ToggleConsoleEvent.
*/
export declare function openConsole(): OpenConsoleEvent;
//# sourceMappingURL=FileEvents.d.ts.map

@@ -260,18 +260,18 @@ /**

/**
* Creates a new remote event.
* @param event The event.
* Creates a new SayHelloEvent.
*/
export function remote(event) {
export function sayHello() {
return {
type: 'remote',
event: event,
type: 'local',
name: 'say_hello',
};
}
/**
* Creates a new SayHelloEvent.
* Creates an new EchoEvent.
*/
export function sayHello() {
export function echo(message) {
return {
type: 'local',
name: 'say_hello',
name: 'echo',
message,
};

@@ -320,2 +320,12 @@ }

}
/**
* Creates a new ToggleConsoleEvent.
*/
export function openConsole() {
return {
type: 'local',
name: 'open_console',
open: true,
};
}
//# sourceMappingURL=FileEvents.js.map
import { SandboxInterface } from './SandboxInterface';
import { SandboxLibrary, SandboxResult } from './Sandbox';
import { ConsoleMessages } from '@casual-simulation/causal-trees';
import { Observable } from 'rxjs';
/**

@@ -8,2 +10,4 @@ * Defines a formula sandbox that uses JavaScript's eval function to run code.

export declare class EvalSandbox {
private static _messages;
static readonly messages: Observable<ConsoleMessages>;
private _transpiler;

@@ -30,3 +34,4 @@ private _lib;

private _transpile;
private static _wrap;
}
//# sourceMappingURL=EvalSandbox.d.ts.map
import { Transpiler } from './Transpiler';
import { keys } from 'lodash';
import { merge } from '../utils';
import { Subject } from 'rxjs';
/**

@@ -15,2 +16,5 @@ * Defines a formula sandbox that uses JavaScript's eval function to run code.

}
static get messages() {
return EvalSandbox._messages;
}
/**

@@ -42,2 +46,3 @@ * Gets the library that the sandbox is using.

error: new Error('Ran out of energy'),
logs: [],
};

@@ -68,15 +73,37 @@ }

}
let logs = [];
try {
this._recursionCounter += 1;
const __transpiled = this._transpile(__js);
const result = __context
? __evalWrapper.call(__context, __transpiled)
: __evalWrapper(__transpiled);
return {
success: true,
extras: __extras,
result,
};
const prevLog = EvalSandbox._wrap('log', 'script', logs);
const prevWarn = EvalSandbox._wrap('warn', 'script', logs);
const prevError = EvalSandbox._wrap('error', 'script', logs);
try {
const result = __context
? __evalWrapper.call(__context, __transpiled)
: __evalWrapper(__transpiled);
return {
success: true,
extras: __extras,
result,
logs: logs,
};
}
finally {
console.log = prevLog;
console.warn = prevWarn;
console.error = prevError;
}
}
catch (e) {
if (e instanceof Error) {
const msg = {
type: 'error',
messages: [e.toString()],
stack: e.stack,
source: 'script',
};
logs.push(msg);
EvalSandbox._messages.next(msg);
}
return {

@@ -86,2 +113,3 @@ success: false,

error: e,
logs: logs,
};

@@ -96,3 +124,19 @@ }

}
static _wrap(type, source, logs) {
let prev = console[type];
console[type] = function () {
let msg = {
type: type,
messages: [...arguments],
stack: new Error().stack,
source: source,
};
logs.push(msg);
EvalSandbox._messages.next(msg);
return prev.apply(this, arguments);
};
return prev;
}
}
EvalSandbox._messages = new Subject();
//# sourceMappingURL=EvalSandbox.js.map

@@ -314,5 +314,10 @@ import { File, FileTags } from '../Files/File';

declare function sayHello(): void;
/**
* Sends an echo event to the server.
*/
declare function echo(message: string): void;
declare function grantRole(username: string, role: string): void;
declare function revokeRole(username: string, role: string): void;
declare function shell(script: string): void;
declare function openDevConsole(): void;
/**

@@ -361,2 +366,3 @@ * Determines if the user is currently connected to the server.

showInputForTag: typeof showInputForTag;
openDevConsole: typeof openDevConsole;
};

@@ -368,2 +374,3 @@ export declare const server: {

shell: typeof shell;
echo: typeof echo;
};

@@ -435,2 +442,3 @@ /**

showInputForTag: typeof showInputForTag;
openDevConsole: typeof openDevConsole;
};

@@ -442,2 +450,3 @@ server: {

shell: typeof shell;
echo: typeof echo;
};

@@ -444,0 +453,0 @@ combine: typeof combine;

import { GLOBALS_FILE_ID } from '../Files/File';
import { action, fileRemoved, fileAdded, toast as toastMessage, tweenTo as calcTweenTo, openQRCodeScanner as calcOpenQRCodeScanner, loadSimulation as calcLoadSimulation, unloadSimulation as calcUnloadSimulation, superShout as calcSuperShout, showQRCode as calcShowQRCode, goToContext as calcGoToContext, goToURL as calcGoToURL, openURL as calcOpenURL, importAUX as calcImportAUX, showInputForTag as calcShowInputForTag, remote, sayHello as calcSayHello, grantRole as calcGrantRole, revokeRole as calcRevokeRole, shell as calcShell, } from '../Files/FileEvents';
import { action, fileRemoved, fileAdded, toast as toastMessage, tweenTo as calcTweenTo, openQRCodeScanner as calcOpenQRCodeScanner, loadSimulation as calcLoadSimulation, unloadSimulation as calcUnloadSimulation, superShout as calcSuperShout, showQRCode as calcShowQRCode, goToContext as calcGoToContext, goToURL as calcGoToURL, openURL as calcOpenURL, importAUX as calcImportAUX, showInputForTag as calcShowInputForTag, sayHello as calcSayHello, grantRole as calcGrantRole, revokeRole as calcRevokeRole, shell as calcShell, openConsole as calcOpenConsole, echo as calcEcho, } from '../Files/FileEvents';
import { calculateActionResultsUsingContext } from '../Files/FilesChannel';

@@ -13,2 +13,3 @@ import uuid from 'uuid/v4';

import { getFileState, getCalculationContext, getActions, setFileState, getUserId, getEnergy, setEnergy, } from './formula-lib-globals';
import { remote } from '@casual-simulation/causal-trees';
/**

@@ -880,2 +881,9 @@ * Sums the given array of numbers and returns the result.

}
/**
* Sends an echo event to the server.
*/
function echo(message) {
let actions = getActions();
actions.push(remote(calcEcho(message)));
}
function grantRole(username, role) {

@@ -893,2 +901,6 @@ let actions = getActions();

}
function openDevConsole() {
let actions = getActions();
actions.push(calcOpenConsole());
}
/**

@@ -953,2 +965,3 @@ * Determines if the user is currently connected to the server.

showInputForTag,
openDevConsole,
};

@@ -960,2 +973,3 @@ export const server = {

shell,
echo,
};

@@ -962,0 +976,0 @@ /**

@@ -0,1 +1,2 @@

import { ConsoleMessages } from '@casual-simulation/causal-trees';
import { SandboxInterface } from './SandboxInterface';

@@ -26,2 +27,6 @@ export interface SandboxMacro {

error?: Error;
/**
* The console log messages that were produced from the script.
*/
logs: ConsoleMessages[];
}

@@ -28,0 +33,0 @@ /**

{
"name": "@casual-simulation/aux-common",
"version": "0.9.19",
"version": "0.9.20",
"description": "Common library for AUX projects",

@@ -36,3 +36,3 @@ "main": "index.js",

"dependencies": {
"@casual-simulation/causal-trees": "^0.9.19",
"@casual-simulation/causal-trees": "^0.9.20",
"@casual-simulation/crypto": "^0.9.7",

@@ -57,3 +57,3 @@ "@types/acorn": "^4.0.5",

],
"gitHead": "67470a48453c78bc4dbb020a9c08135c33720b3b"
"gitHead": "c779e65facf239aff15d52d1765a81efbc2c0f38"
}

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 too big to display

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc