Skip to content

Commit

Permalink
0.0.590
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Oct 3, 2024
1 parent 9fb8922 commit 5fdb68d
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 778 deletions.
2 changes: 2 additions & 0 deletions import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ export type { ClientHandlerRendererProps, ClientHandlerProps } from "./imports/c
export { Packages } from "./imports/packages.js";

export { Files, useFiles, base64ToFile, fileToBase64 } from "./imports/files.js";

export { Packager } from './imports/packager.js';
17 changes: 10 additions & 7 deletions imports/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { matchSorter } from 'match-sorter';
import { useDebounce } from '@react-hook/debounce';
import { Packages } from './packages.js';
import { useFiles, Files } from './files.js';
import { serializeError } from 'serialize-error';
const moduleLog = debug.extend('client');

const log = debug.extend('log');
Expand Down Expand Up @@ -994,25 +995,27 @@ export class DeepClient<L extends Link<Id> = Link<Id>> implements DeepClientInst
this.apolloClient = options?.apolloClient;
this.token = options?.token;
this.secret = options?.secret;
this.ssl = options?.ssl;
this.ssl = options?.ssl || false;
this.ws = options?.ws;
this.client = this.apolloClient;
this.table = options?.table || 'links';

if ((this.deep && !this.apolloClient) || (!!options.path && typeof(options.ssl) === 'boolean')) {
const token = options.token || this?.deep?.token;
const secret = options.secret || this?.deep?.secret;
if ((this.deep && !this.apolloClient) || (!!options.path)) {
const token = this.token || this?.deep?.token;
const secret = this.secret || this?.deep?.secret;
const ssl = this.ssl || this?.deep?.ssl;
const ws = this.ws || this?.deep?.ws;
if (!token && !secret) {
throw new Error('!token && !secret - invalid auth');
}
this.apolloClient = generateApolloClient({
// @ts-ignore
path: (options.path || this.deep?.apolloClient?.path || '').replace(/(^\w+:|^)\/\//, ''),
// @ts-ignore
ssl: options.ssl || this.deep?.apolloClient?.ssl,
ssl: ssl || this.deep?.apolloClient?.ssl,
token: token,
secret: secret,
ws: options.ws,
ws: ws,
});
}

Expand Down Expand Up @@ -1103,7 +1106,7 @@ export class DeepClient<L extends Link<Id> = Link<Id>> implements DeepClientInst

stringify(any?: any): string {
if (typeof(any) === 'object' && typeof(any?.message) === 'string') {
return any?.message;
return serializeError(any);
} else if (typeof(any) === 'string') {
let json;
try { json = JSON.parse(any); } catch(e) {}
Expand Down
110 changes: 55 additions & 55 deletions imports/core-symbols.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,65 @@ export const coreSymbolsPckg: Package = {
uri: 'deep-foundation/core-symbols',
type: 'git',
},
dependencies: {
1: {
dependencies: [
{
name: '@deep-foundation/core',
version: '0.0.0',
},
},
],
data: [
{ id: 'Type', package: { dependencyId: 1, containValue: 'Type' } },
{ id: 'Package', package: { dependencyId: 1, containValue: 'Package' } },
{ id: 'Contain', package: { dependencyId: 1, containValue: 'Contain' } },
{ id: 'Value', package: { dependencyId: 1, containValue: 'Value' } },
{ id: 'Promise', package: { dependencyId: 1, containValue: 'Promise' } },
{ id: 'Then', package: { dependencyId: 1, containValue: 'Then' } },
{ id: 'Resolved', package: { dependencyId: 1, containValue: 'Resolved' } },
{ id: 'Rejected', package: { dependencyId: 1, containValue: 'Rejected' } },
{ id: 'Selector', package: { dependencyId: 1, containValue: 'Selector' } },
{ id: 'SelectorInclude', package: { dependencyId: 1, containValue: 'SelectorInclude' } },
{ id: 'SelectorExclude', package: { dependencyId: 1, containValue: 'SelectorExclude' } },
{ id: 'Rule', package: { dependencyId: 1, containValue: 'Rule' } },
{ id: 'RuleSubject', package: { dependencyId: 1, containValue: 'RuleSubject' } },
{ id: 'RuleObject', package: { dependencyId: 1, containValue: 'RuleObject' } },
{ id: 'Rule', package: { dependencyId: 1, containValue: 'Rule' } },
{ id: 'User', package: { dependencyId: 1, containValue: 'User' } },
{ id: 'Operation', package: { dependencyId: 1, containValue: 'Operation' } },
{ id: 'File', package: { dependencyId: 1, containValue: 'File' } },
{ id: 'SyncTextFile', package: { dependencyId: 1, containValue: 'SyncTextFile' } },
{ id: 'ExecutionProvider', package: { dependencyId: 1, containValue: 'ExecutionProvider' } },
{ id: 'IsolationProvider', package: { dependencyId: 1, containValue: 'IsolationProvider' } },
{ id: 'AsyncFile', package: { dependencyId: 1, containValue: 'AsyncFile' } },
{ id: 'Handler', package: { dependencyId: 1, containValue: 'Handler' } },
{ id: 'Tree', package: { dependencyId: 1, containValue: 'Tree' } },
{ id: 'TreeInclude', package: { dependencyId: 1, containValue: 'TreeInclude' } },
{ id: 'PackageNamespace', package: { dependencyId: 1, containValue: 'PackageNamespace' } },
{ id: 'PackageActive', package: { dependencyId: 1, containValue: 'PackageActive' } },
{ id: 'PackageVersion', package: { dependencyId: 1, containValue: 'PackageVersion' } },
{ id: 'HandleOperation', package: { dependencyId: 1, containValue: 'HandleOperation' } },
{ id: 'PromiseResult', package: { dependencyId: 1, containValue: 'PromiseResult' } },
{ id: 'PromiseReason', package: { dependencyId: 1, containValue: 'PromiseReason' } },
{ id: 'Focus', package: { dependencyId: 1, containValue: 'Focus' } },
{ id: 'Query', package: { dependencyId: 1, containValue: 'Query' } },
{ id: 'Space', package: { dependencyId: 1, containValue: 'Space' } },
{ id: 'Join', package: { dependencyId: 1, containValue: 'Join' } },
{ id: 'SelectorTree', package: { dependencyId: 1, containValue: 'SelectorTree' } },
{ id: 'SelectorFilter', package: { dependencyId: 1, containValue: 'SelectorFilter' } },
{ id: 'Schedule', package: { dependencyId: 1, containValue: 'Schedule' } },
{ id: 'Router', package: { dependencyId: 1, containValue: 'Router' } },
{ id: 'Supports', package: { dependencyId: 1, containValue: 'Supports' } },
{ id: 'PackageInstall', package: { dependencyId: 1, containValue: 'PackageInstall' } },
{ id: 'PackagePublish', package: { dependencyId: 1, containValue: 'PackagePublish' } },
{ id: 'Active', package: { dependencyId: 1, containValue: 'Active' } },
{ id: 'PromiseOut', package: { dependencyId: 1, containValue: 'PromiseOut' } },
{ id: 'PackageQuery', package: { dependencyId: 1, containValue: 'PackageQuery' } },
{ id: 'Port', package: { dependencyId: 1, containValue: 'Port' } },
{ id: 'Route', package: { dependencyId: 1, containValue: 'Route' } },
{ id: 'RouterListening', package: { dependencyId: 1, containValue: 'RouterListening' } },
{ id: 'RouterStringUse', package: { dependencyId: 1, containValue: 'RouterStringUse' } },
{ id: 'Authorization', package: { dependencyId: 1, containValue: 'Authorization' } },
{ id: 'GeneratedFrom', package: { dependencyId: 1, containValue: 'GeneratedFrom' } },
{ id: 'Symbol', package: { dependencyId: 1, containValue: 'Symbol' } },
{ id: 'Type', package: { dependencyId: 0, containValue: 'Type' } },
{ id: 'Package', package: { dependencyId: 0, containValue: 'Package' } },
{ id: 'Contain', package: { dependencyId: 0, containValue: 'Contain' } },
{ id: 'Value', package: { dependencyId: 0, containValue: 'Value' } },
{ id: 'Promise', package: { dependencyId: 0, containValue: 'Promise' } },
{ id: 'Then', package: { dependencyId: 0, containValue: 'Then' } },
{ id: 'Resolved', package: { dependencyId: 0, containValue: 'Resolved' } },
{ id: 'Rejected', package: { dependencyId: 0, containValue: 'Rejected' } },
{ id: 'Selector', package: { dependencyId: 0, containValue: 'Selector' } },
{ id: 'SelectorInclude', package: { dependencyId: 0, containValue: 'SelectorInclude' } },
{ id: 'SelectorExclude', package: { dependencyId: 0, containValue: 'SelectorExclude' } },
{ id: 'Rule', package: { dependencyId: 0, containValue: 'Rule' } },
{ id: 'RuleSubject', package: { dependencyId: 0, containValue: 'RuleSubject' } },
{ id: 'RuleObject', package: { dependencyId: 0, containValue: 'RuleObject' } },
{ id: 'Rule', package: { dependencyId: 0, containValue: 'Rule' } },
{ id: 'User', package: { dependencyId: 0, containValue: 'User' } },
{ id: 'Operation', package: { dependencyId: 0, containValue: 'Operation' } },
{ id: 'File', package: { dependencyId: 0, containValue: 'File' } },
{ id: 'SyncTextFile', package: { dependencyId: 0, containValue: 'SyncTextFile' } },
{ id: 'ExecutionProvider', package: { dependencyId: 0, containValue: 'ExecutionProvider' } },
{ id: 'IsolationProvider', package: { dependencyId: 0, containValue: 'IsolationProvider' } },
{ id: 'AsyncFile', package: { dependencyId: 0, containValue: 'AsyncFile' } },
{ id: 'Handler', package: { dependencyId: 0, containValue: 'Handler' } },
{ id: 'Tree', package: { dependencyId: 0, containValue: 'Tree' } },
{ id: 'TreeInclude', package: { dependencyId: 0, containValue: 'TreeInclude' } },
{ id: 'PackageNamespace', package: { dependencyId: 0, containValue: 'PackageNamespace' } },
{ id: 'PackageActive', package: { dependencyId: 0, containValue: 'PackageActive' } },
{ id: 'PackageVersion', package: { dependencyId: 0, containValue: 'PackageVersion' } },
{ id: 'HandleOperation', package: { dependencyId: 0, containValue: 'HandleOperation' } },
{ id: 'PromiseResult', package: { dependencyId: 0, containValue: 'PromiseResult' } },
{ id: 'PromiseReason', package: { dependencyId: 0, containValue: 'PromiseReason' } },
{ id: 'Focus', package: { dependencyId: 0, containValue: 'Focus' } },
{ id: 'Query', package: { dependencyId: 0, containValue: 'Query' } },
{ id: 'Space', package: { dependencyId: 0, containValue: 'Space' } },
{ id: 'Join', package: { dependencyId: 0, containValue: 'Join' } },
{ id: 'SelectorTree', package: { dependencyId: 0, containValue: 'SelectorTree' } },
{ id: 'SelectorFilter', package: { dependencyId: 0, containValue: 'SelectorFilter' } },
{ id: 'Schedule', package: { dependencyId: 0, containValue: 'Schedule' } },
{ id: 'Router', package: { dependencyId: 0, containValue: 'Router' } },
{ id: 'Supports', package: { dependencyId: 0, containValue: 'Supports' } },
{ id: 'PackageInstall', package: { dependencyId: 0, containValue: 'PackageInstall' } },
{ id: 'PackagePublish', package: { dependencyId: 0, containValue: 'PackagePublish' } },
{ id: 'Active', package: { dependencyId: 0, containValue: 'Active' } },
{ id: 'PromiseOut', package: { dependencyId: 0, containValue: 'PromiseOut' } },
{ id: 'PackageQuery', package: { dependencyId: 0, containValue: 'PackageQuery' } },
{ id: 'Port', package: { dependencyId: 0, containValue: 'Port' } },
{ id: 'Route', package: { dependencyId: 0, containValue: 'Route' } },
{ id: 'RouterListening', package: { dependencyId: 0, containValue: 'RouterListening' } },
{ id: 'RouterStringUse', package: { dependencyId: 0, containValue: 'RouterStringUse' } },
{ id: 'Authorization', package: { dependencyId: 0, containValue: 'Authorization' } },
{ id: 'GeneratedFrom', package: { dependencyId: 0, containValue: 'GeneratedFrom' } },
{ id: 'Symbol', package: { dependencyId: 0, containValue: 'Symbol' } },

{ id: 'TypeSymbol', type: 'Symbol', from: 'Type', to: 'Type', value: { value: '⭐️' } },
{ id: 'PackageSymbol', type: 'Symbol', from: 'Package', to: 'Package', value: { value: '📦' } },
Expand Down
Loading

0 comments on commit 5fdb68d

Please sign in to comment.