Skip to content

Commit 64de01b

Browse files
committed
fixes for structs
1 parent 5777928 commit 64de01b

23 files changed

+161
-114
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
For happy code!
1111
</p>
1212

13+
## This API is still under construction
14+
There's plenty of working tools available already. However, we are randomly breaking/finding old broken code and improving things constantly as we push out a model we feel can be competitive. 100% FOSS!
15+
1316
**GraphScript** is a highly customizable, high performance library for creating complex full stack software and library architectures. It's based around graphs hierarchies, event systems, and microservices, with an intuitive composition and node/function indexing tree system for rapid development.
1417

1518
Check out the code in [examples](./examples) for very clear, compelling implementatons that flex our rapidly evolving feature sets. Please join our small cabal of open source contributors and help us grow this library as an alternative full stack framework.
@@ -75,12 +78,15 @@ This forms a microservices layer on top of the graph system. It makes it easier
7578
- `graphscript-services.gpu`: Experimental `gpu.js` plugin. ~500kb, use it with workers for best results.
7679
- `graphscript-services.storage`: Some BrowserFS, CSV, and Google Drive utilities. Not very complete.
7780

81+
### Contributing
82+
83+
Want to see this API improve faster? Please contribute or create issues and offer perspective. This repo is mostly a labor of love by Josh, with Garrett swooping in to reality check the actual utility of it from time to time. We want this to API to give you open web super powers, so we can all move on to building much more interesting end products as a community, as well as get more students, engineers, and researchers working in a collaborative development environment. This is the future! Down with knowledge and tool hoarding!
7884

7985
### See also:
8086
- [`device-decoder`](https://github.com/brainsatplay/device-decoder) - Complex Browser USB and Browser or Native Mobile Bluetooth driver set that is by-default multithreaded using our web worker system. You can use the worker system to create fully-threaded pipelines from the device codec without touching the main thread.
8187

8288
## Acknowledgments
83-
This library is maintained by [Joshua Brewster](https://github.com/joshbrew) and [Garrett Flynn](https://github.com/garrettmflynn), who use contract work and community contributions to support themselves. You can contribute to our work through [Open Collective](https://opencollective.com/brainsatplay), along with whoever joins the team eventually.
89+
This library is maintained by [Joshua Brewster](https://github.com/joshbrew) and [Garrett Flynn](https://github.com/garrettmflynn), who use contract work and community contributions to support themselves to build free/libre software and hardware plans. You can contribute to our work through [Open Collective](https://opencollective.com/brainsatplay), or get in touch.
8490

8591
### Backers
8692
[Support us with a monthly donation](https://opencollective.com/brainsatplay#backer) and help us continue our activities!

src/extras/____package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphscript-services-node",
3-
"version": "0.2.136",
3+
"version": "0.2.142",
44
"description": "Extra services for graphscript.",
55
"main": "dist/index.services.node.js",
66
"types": "dist/src/extras/index.services.d.ts",

src/extras/_package.json renamed to src/extras/__package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "graphscript-services",
3-
"version": "0.2.136",
2+
"name": "graphscript-services.storage",
3+
"version": "0.2.130",
44
"description": "Extra services for graphscript.",
5-
"main": "dist/index.services.js",
6-
"module": "dist/index.services.esm.js",
7-
"types": "dist/src/extras/index.services.d.ts",
5+
"main": "dist/index.storage.services.js",
6+
"module": "dist/index.storage.services.esm.js",
7+
"types": "dist/index.storage.services.d.ts",
88
"scripts": {
99
"start": "tinybuild path=tinybuild.config.js && tinybuild path=tinybuild.gpu.config.js && tinybuild path=tinybuild.storage.config.js",
1010
"build": "tinybuild build",
@@ -24,10 +24,9 @@
2424
"license": "AGPL-3.0-or-later",
2525
"dependencies": {
2626
"brainsatplay-math": "~0.0.25",
27-
"browserfs": "~1.4.3",
27+
"browserfs": "^1.4.3",
2828
"gpujsutils": "~1.0.12",
29-
"web-worker": "~1.2.0",
30-
"webgl-plot-utils": "~0.3.20"
29+
"webgl-plot-utils":"~0.3.20"
3130
},
3231
"nodemonConfig": {
3332
"env": {

src/extras/dist/extras/struct/Struct.frontend.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export declare class StructFrontend extends Service {
1414
setupUser: (userinfo: Partial<User>, callback?: (currentUser: any) => void) => Promise<any>;
1515
baseServerCallback: (data: any) => void;
1616
structNotification: () => void;
17-
structDeleted: (id: any) => void;
17+
structDeleted: (struct: {
18+
_id: string;
19+
structType: string;
20+
}) => void;
1821
onResult: (data: any) => void;
1922
randomId(tag?: string): string;
2023
/**

src/extras/dist/index.services.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extras/dist/index.services.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extras/dist/index.services.node.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extras/dist/src/core/Graph.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EventHandler } from "./EventHandler";
22
export declare const state: EventHandler;
3-
export declare type GraphNodeProperties = {
3+
export type GraphNodeProperties = {
44
__props?: Function | {
55
[key: string]: any;
66
} | GraphNodeProperties | GraphNode;
@@ -27,11 +27,11 @@ export declare type GraphNodeProperties = {
2727
__args?: any[];
2828
[key: string]: any;
2929
};
30-
export declare type Loader = (node: GraphNode, parent: Graph | GraphNode, graph: Graph, roots: any, properties: GraphNodeProperties, key: string) => void;
31-
export declare type Roots = {
30+
export type Loader = (node: GraphNode, parent: Graph | GraphNode, graph: Graph, roots: any, properties: GraphNodeProperties, key: string) => void;
31+
export type Roots = {
3232
[key: string]: any;
3333
};
34-
export declare type GraphOptions = {
34+
export type GraphOptions = {
3535
roots?: Roots;
3636
loaders?: {
3737
[key: string]: Loader | {
@@ -44,13 +44,13 @@ export declare type GraphOptions = {
4444
mapGraphs?: false;
4545
[key: string]: any;
4646
};
47-
export declare type argObject = {
47+
export type argObject = {
4848
__input?: string | ((...args: any[]) => any);
4949
__callback: string | ((...args: any[]) => any);
5050
__args?: any[];
5151
__output?: string | argObject | ((...args: any[]) => any);
5252
};
53-
export declare type Listener = {
53+
export type Listener = {
5454
node: GraphNode;
5555
graph: Graph;
5656
source?: string;

src/extras/dist/src/extras/algorithms/util/ArrayManip.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
1+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
22
export declare class ArrayManip {
33
static autoscale(array: any, lineIdx?: number, nLines?: number, centerZero?: boolean, ymin?: number, ymax?: number, clamp?: boolean): any;
44
static genTimestamps(ct: any, sps: any): any[];

src/extras/dist/src/extras/algorithms/util/BiquadFilters.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export declare type FilterSettings = {
1+
export type FilterSettings = {
22
sps: number;
33
useSMA4?: boolean;
44
useNotch50?: boolean;

src/extras/dist/src/extras/struct/Struct.backend.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { Service } from "../../services/Service";
44
import { User } from '../../services/router/Router';
55
export declare const toObjectId: (str: any) => any;
66
export declare const getStringId: (mongoid: string | ObjectId) => any;
7-
declare type CollectionsType = {
7+
type CollectionsType = {
88
[x: string]: CollectionType;
99
};
10-
declare type CollectionType = any | {
10+
type CollectionType = any | {
1111
instance?: any;
1212
reference: {
1313
[key: string]: any;

src/extras/dist/src/extras/struct/Struct.frontend.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export declare class StructFrontend extends Service {
1414
setupUser: (userinfo: Partial<User>, callback?: (currentUser: any) => void) => Promise<any>;
1515
baseServerCallback: (data: any) => void;
1616
structNotification: () => void;
17-
structDeleted: (id: any) => void;
17+
structDeleted: (args: {
18+
_id: string;
19+
structType: string;
20+
}) => void;
1821
onResult: (data: any) => void;
1922
randomId(tag?: string): string;
2023
/**

src/extras/dist/src/extras/struct/datastructures/DataTablet.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ export declare class DataTablet {
4444
getDataByTimeRange(begin: number, end: number, type: string, ownerId: string): ArbitraryObject;
4545
getDataByType(type: string, timestamp: number, ownerId: string): any;
4646
filterSleepResults(unfiltered?: ArbitraryObject): ArbitraryObject;
47-
sortObjectByPropName(object: ArbitraryObject): {};
47+
sortObjectByPropName(object: ArbitraryObject): ArbitraryObject;
4848
checkRollover(collection: string, limit?: number): boolean;
4949
}

src/extras/dist/src/extras/struct/datastructures/types.d.ts

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export declare type ArbitraryObject = {
1+
export type ArbitraryObject = {
22
[x: string | number]: any;
33
};
4-
export declare type Struct = {
4+
export type Struct = {
55
_id: string;
66
structType?: string | number;
77
timestamp?: string | number;
@@ -12,23 +12,23 @@ export declare type Struct = {
1212
};
1313
[key: string]: any;
1414
};
15-
export declare type DataTypes = 'byTime' | 'notes' | 'events' | 'sleep' | 'food' | 'rx' | 'hr' | 'ppg' | 'hrv' | 'ecg' | 'emg' | 'eeg' | 'fnirs' | string | number | undefined;
16-
export declare type StructTypes = LooseStructTypes | DataTypes | 'data' | 'struct' | string | number | undefined;
17-
export declare type LooseStructTypes = 'coherence' | 'imu' | 'eyetracker' | 'profile' | 'authorization' | 'group' | 'event' | 'chatroom' | 'comment' | 'notification' | 'schedule' | 'date' | string | number | undefined;
18-
export declare type Data = {
15+
export type DataTypes = 'byTime' | 'notes' | 'events' | 'sleep' | 'food' | 'rx' | 'hr' | 'ppg' | 'hrv' | 'ecg' | 'emg' | 'eeg' | 'fnirs' | string | number | undefined;
16+
export type StructTypes = LooseStructTypes | DataTypes | 'data' | 'struct' | string | number | undefined;
17+
export type LooseStructTypes = 'coherence' | 'imu' | 'eyetracker' | 'profile' | 'authorization' | 'group' | 'event' | 'chatroom' | 'comment' | 'notification' | 'schedule' | 'date' | string | number | undefined;
18+
export type Data = {
1919
type: string;
2020
data: any;
2121
timestamp?: string | number;
2222
};
23-
export declare type DataStruct = {
23+
export type DataStruct = {
2424
title?: string;
2525
author?: string;
2626
expires: boolean | number | string;
2727
type: string;
2828
data: Data[];
2929
tag?: string | number;
3030
} & Struct;
31-
export declare type EventStruct = {
31+
export type EventStruct = {
3232
event: string;
3333
author: string;
3434
startTime: string;
@@ -39,7 +39,7 @@ export declare type EventStruct = {
3939
users: {};
4040
tag?: string | number;
4141
} & Struct;
42-
export declare type ChatroomStruct = {
42+
export type ChatroomStruct = {
4343
message: string;
4444
topic: string;
4545
author: string;
@@ -51,34 +51,34 @@ export declare type ChatroomStruct = {
5151
videoChatActive: boolean;
5252
tag?: string | number;
5353
} & Struct;
54-
export declare type CommentStruct = {
54+
export type CommentStruct = {
5555
author: string;
5656
replyTo: string;
5757
attachments: Data | string | number[];
5858
replies: string[];
5959
users: {};
6060
tag?: string | number;
6161
} & Struct;
62-
export declare type NotificationStruct = {
62+
export type NotificationStruct = {
6363
note: string;
6464
parentUserId: string;
6565
tag?: string | number;
6666
} & Struct;
67-
export declare type ScheduleStruct = {
67+
export type ScheduleStruct = {
6868
title: string;
6969
author: string;
7070
attachments: Data | string | number[];
7171
dates: string[];
7272
tag?: string | number;
7373
} & Struct;
74-
export declare type DateStruct = {
74+
export type DateStruct = {
7575
timeSet: string | number;
7676
notes: string;
7777
recurs: number | string | boolean;
7878
attachments: Data | string | number[];
7979
tag?: string | number;
8080
} & Struct;
81-
export declare type ProfileStruct = {
81+
export type ProfileStruct = {
8282
username?: string;
8383
name?: string;
8484
firstName?: string;
@@ -98,7 +98,7 @@ export declare type ProfileStruct = {
9898
refreshToken?: string;
9999
tag?: string | number;
100100
} & Struct;
101-
export declare type AuthorizationStruct = {
101+
export type AuthorizationStruct = {
102102
authorizedId: string;
103103
authorizedName: string;
104104
authorizerId: string;
@@ -112,7 +112,7 @@ export declare type AuthorizationStruct = {
112112
associatedAuthId: string | number;
113113
tag?: string | number;
114114
} & Struct;
115-
export declare type GroupStruct = {
115+
export type GroupStruct = {
116116
name: string;
117117
details: string;
118118
admins: {};
@@ -121,9 +121,9 @@ export declare type GroupStruct = {
121121
users: {};
122122
tag?: string | number;
123123
} & Struct;
124-
declare type FreqBand = [number[], number[]];
125-
export declare type FrequencyBandNames = 'scp' | 'delta' | 'theta' | 'alpha1' | 'alpha2' | 'beta' | 'lowgamma' | 'highgamma';
126-
export declare type FrequencyBandsStruct = {
124+
type FreqBand = [number[], number[]];
125+
export type FrequencyBandNames = 'scp' | 'delta' | 'theta' | 'alpha1' | 'alpha2' | 'beta' | 'lowgamma' | 'highgamma';
126+
export type FrequencyBandsStruct = {
127127
scp: FreqBand | [];
128128
delta: FreqBand | [];
129129
theta: FreqBand | [];
@@ -133,7 +133,7 @@ export declare type FrequencyBandsStruct = {
133133
lowgamma: FreqBand | [];
134134
highgamma: FreqBand | [];
135135
};
136-
export declare type EEGStruct = {
136+
export type EEGStruct = {
137137
position: {
138138
x: number;
139139
y: number;
@@ -151,7 +151,7 @@ export declare type EEGStruct = {
151151
startTime: number | string;
152152
tag?: string | number;
153153
} & Struct;
154-
export declare type CoherenceStruct = {
154+
export type CoherenceStruct = {
155155
x0: number;
156156
y0: number;
157157
z0: number;
@@ -166,7 +166,7 @@ export declare type CoherenceStruct = {
166166
startTime: number | string;
167167
tag?: string | number;
168168
} & Struct;
169-
export declare type FNIRSStruct = {
169+
export type FNIRSStruct = {
170170
position: {
171171
x: number;
172172
y: number;
@@ -198,7 +198,7 @@ export declare type FNIRSStruct = {
198198
startTime: number | string;
199199
tag?: string | number;
200200
} & Struct;
201-
export declare type IMUStruct = {
201+
export type IMUStruct = {
202202
Ax: number[];
203203
Ay: number[];
204204
Az: number[];
@@ -208,7 +208,7 @@ export declare type IMUStruct = {
208208
startTime: number | string;
209209
tag?: string | number;
210210
} & Struct;
211-
export declare type EyeTrackerStruct = {
211+
export type EyeTrackerStruct = {
212212
count: number;
213213
times: number[];
214214
x: number[];
@@ -218,7 +218,7 @@ export declare type EyeTrackerStruct = {
218218
startTime: number | string;
219219
tag?: string | number;
220220
} & Struct;
221-
export declare type ECGStruct = {
221+
export type ECGStruct = {
222222
count: number;
223223
times: number[];
224224
raw: number[];
@@ -228,7 +228,7 @@ export declare type ECGStruct = {
228228
startTime: number | string;
229229
tag?: string | number;
230230
} & Struct;
231-
export declare type PPGStruct = FNIRSStruct;
232-
export declare type HRVStruct = ECGStruct;
233-
export declare type EMGStruct = EEGStruct;
231+
export type PPGStruct = FNIRSStruct;
232+
export type HRVStruct = ECGStruct;
233+
export type EMGStruct = EEGStruct;
234234
export {};

src/extras/dist/src/services/Service.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Graph, GraphNode, GraphOptions } from "../../src/core/Graph";
2-
export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
3-
export declare type ServiceMessage = {
2+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
3+
export type ServiceMessage = {
44
route?: string;
55
args?: any;
66
method?: string;
77
node?: string | GraphNode;
88
[key: string]: any;
99
};
10-
export declare type ServiceOptions = GraphOptions & {
10+
export type ServiceOptions = GraphOptions & {
1111
services?: {
1212
[key: string]: Service | Function | {
1313
[key: string]: any;

0 commit comments

Comments
 (0)