Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clientfirst #250

Open
wants to merge 177 commits into
base: main-broken
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
243604a
clientfirst
ivansglazunov Aug 27, 2023
6dc6a1a
Merge branch 'main' into client-first
Konard Oct 10, 2023
78b76af
0.0.315
Konard Oct 10, 2023
18e0f51
0.0.316
Konard Oct 17, 2023
5181b2c
0.0.317
Konard Oct 17, 2023
6bc4ffa
tests fix
Konard Oct 21, 2023
033dcf3
Attempt to support both jsdom and node tests.
Konard Oct 21, 2023
09206c3
deep.unsafe field is added to DeepClient
Konard Oct 21, 2023
b1ae1fc
0.0.318
Konard Oct 21, 2023
38a4a26
fix useMinilinksSubscription
ivansglazunov Oct 22, 2023
da5115e
typing
ivansglazunov Oct 22, 2023
9d395dd
0.0.319
Konard Oct 22, 2023
8b21c17
secret is now passed unconditionally to async handlers
Konard Oct 22, 2023
c782254
0.0.320
Konard Oct 22, 2023
5c464eb
https://github.com/deep-foundation/npm-packager/issues/76 npm-package…
Konard Oct 23, 2023
5d37383
0.0.321
Konard Oct 23, 2023
a90d8c9
fix
ivansglazunov Oct 23, 2023
eeb9fcb
0.0.322
Konard Oct 24, 2023
f3973f4
update to use workspaces
Konard Oct 25, 2023
34fb5de
call.cjs
Konard Oct 25, 2023
152088b
package:watch is added
Konard Oct 25, 2023
ee24c53
Update README.md
Konard Nov 13, 2023
135131d
Update README.md
Konard Nov 13, 2023
532e999
Update README.md
Konard Nov 13, 2023
1443732
deep/ml.subscribe, Traveler, aggregation: count|avg|sum|min|max
ivansglazunov Nov 15, 2023
d7b3854
fix build
ivansglazunov Nov 18, 2023
409879d
fix minilinks sub
ivansglazunov Nov 18, 2023
379ab2e
Add select in handler test
FreePhoenix888 Nov 18, 2023
40d1e91
Update test
FreePhoenix888 Nov 18, 2023
ffeb19e
Merge branch 'main' of https://github.com/deep-foundation/deeplinks
FreePhoenix888 Nov 18, 2023
8539b75
Update test select in handler
FreePhoenix888 Nov 18, 2023
58cde8c
Get deep from handler arg in test
FreePhoenix888 Nov 18, 2023
ea6d95d
Add deep is available without using handler argument
FreePhoenix888 Nov 18, 2023
5b5399c
Fix test name
FreePhoenix888 Nov 18, 2023
fa2f989
Merge branch 'subscribe'
ivansglazunov Nov 26, 2023
8ec2199
nameLocal package
ivansglazunov Nov 26, 2023
857c946
fix ts
ivansglazunov Nov 26, 2023
079c943
hot fix
ivansglazunov Nov 26, 2023
e42be20
await name not use ml
ivansglazunov Nov 26, 2023
531c4d8
merge main
ivansglazunov Dec 3, 2023
a6d9a5f
better for inspector evaluation
ivansglazunov Dec 12, 2023
73a9191
Add action AllowInsertType, object Type, subject guest test
FreePhoenix888 Dec 14, 2023
41a72e7
Add `action AllowInsertType, object Type, subject guest, rule created…
FreePhoenix888 Dec 14, 2023
aca2017
Add warmup script
Konard Dec 14, 2023
cfa5f3f
fix user switch empty screen
ivansglazunov Dec 18, 2023
851f345
Add `admin can insert Type` test
FreePhoenix888 Dec 19, 2023
081d67f
Merge pull request #287 from deep-foundation/tests/permissions/insert…
FreePhoenix888 Dec 19, 2023
042b4c2
Freeze minio version
Konard Dec 23, 2023
1e2a699
0.0.323
Konard Dec 23, 2023
16daede
fix var error in client-handler
ivansglazunov Dec 24, 2023
6cb7756
Update @deep-foundation/hasura
Konard Dec 25, 2023
fe7c26a
Get admin link id and login by using guestDeep
FreePhoenix888 Dec 29, 2023
6307c8b
Merge branch 'main' of https://github.com/deep-foundation/deeplinks
FreePhoenix888 Dec 29, 2023
7d48cc3
fix minilinks subscription
ivansglazunov Jan 2, 2024
609258e
0.0.324
Konard Jan 8, 2024
b2b2da7
Replace founded with found
Konard Jan 10, 2024
3b07300
minilinks strings id support and cyber boilerplayt
ivansglazunov Jan 13, 2024
3df6085
Update DeepClient constructor
Konard Jan 14, 2024
373c510
Add .gitpod.yml
Konard Jan 14, 2024
d10b75c
https://github.com/deep-foundation/npm-packager/issues/72
Konard Jan 22, 2024
398175a
0.0.325
Konard Jan 22, 2024
70c37fc
Update package:release command
Konard Jan 22, 2024
2d7f889
https://github.com/deep-foundation/npm-packager/issues/72
Konard Jan 25, 2024
7256d0c
0.0.326
Konard Jan 25, 2024
8912246
0.0.327
Konard Jan 25, 2024
346da42
Update apollo-server-core and apollo-server-express
Konard Jan 25, 2024
848f85b
0.0.328
Konard Jan 25, 2024
3b69a89
Update apollo-server, apollo-server-core, apollo-server-express
Konard Jan 25, 2024
d945eaf
Add @deep-foundation/npm-packager back
Konard Jan 25, 2024
6f402d6
0.0.329
Konard Jan 25, 2024
14c0772
Add "create a new user, join to admin, insert type" test
FreePhoenix888 Jan 29, 2024
b023ebc
https://github.com/deep-foundation/deeplinks/issues/297
Konard Jan 29, 2024
f144fc6
Fix https://github.com/deep-foundation/deeplinks/issues/297
Konard Jan 29, 2024
427e406
0.0.330
Konard Jan 29, 2024
2aa70ed
Add insert doc
FreePhoenix888 Feb 9, 2024
2ebc589
Add update doc
FreePhoenix888 Feb 9, 2024
ccca433
Update insert doc
FreePhoenix888 Feb 9, 2024
b432efd
Add delete doc
FreePhoenix888 Feb 9, 2024
32f2555
Add serial doc
FreePhoenix888 Feb 9, 2024
d0ad853
Add await doc
FreePhoenix888 Feb 9, 2024
2b19f03
Add id doc
FreePhoenix888 Feb 9, 2024
e8da48b
Remove unused doc
FreePhoenix888 Feb 9, 2024
e5329a0
Add idLocal doc
FreePhoenix888 Feb 9, 2024
378a179
Update whoami doc
FreePhoenix888 Feb 9, 2024
ac31d24
Add login doc
FreePhoenix888 Feb 9, 2024
6a5b362
Add logout doc
FreePhoenix888 Feb 9, 2024
ab1f639
Add can doc
FreePhoenix888 Feb 9, 2024
4662ae2
Add name doc
FreePhoenix888 Feb 9, 2024
b1c8659
Add nameLocal doc
FreePhoenix888 Feb 9, 2024
af620fb
Add select doc
FreePhoenix888 Feb 9, 2024
f5012b5
Update subscribe doc
FreePhoenix888 Feb 10, 2024
09fa165
Add select by id example
FreePhoenix888 Feb 10, 2024
f3b1790
Add select by type_id example
FreePhoenix888 Feb 10, 2024
1e1909b
Add select by from_id example
FreePhoenix888 Feb 10, 2024
a89e1a0
Add select by to_id example
FreePhoenix888 Feb 10, 2024
2e7e7df
Add select by string value example
FreePhoenix888 Feb 10, 2024
8cf8f10
Add select by number example
FreePhoenix888 Feb 10, 2024
198b154
Add select by object value example
FreePhoenix888 Feb 10, 2024
69dea0c
Add `Insert without from and to` example
FreePhoenix888 Feb 10, 2024
9269e58
Add `Insert with from and to` example
FreePhoenix888 Feb 10, 2024
01e4443
Update `Insert without from and to` example
FreePhoenix888 Feb 10, 2024
906ac65
Add `Insert with from and to equal to any` example
FreePhoenix888 Feb 10, 2024
b65d73b
Rename to `Insert Type from Package to User`
FreePhoenix888 Feb 10, 2024
1699816
Rename to `Insert Type`
FreePhoenix888 Feb 10, 2024
5f6b211
Rename to `Insert Type with from Any to Any`
FreePhoenix888 Feb 10, 2024
b633711
Update `Insert Type with from Any to Any` example
FreePhoenix888 Feb 10, 2024
fd96e3e
Update `Insert Type from Package to User` example
FreePhoenix888 Feb 10, 2024
af7a8db
Add `Insert Type with from Package to Any` example
FreePhoenix888 Feb 10, 2024
9e946f2
Add `Insert Type with from Any to Package` example
FreePhoenix888 Feb 10, 2024
9600004
Add `Insert string` example
FreePhoenix888 Feb 10, 2024
723a7f6
Add `Insert number` example
FreePhoenix888 Feb 10, 2024
bed455f
Add `Insert object` example
FreePhoenix888 Feb 10, 2024
e7e0e15
Add `Update from by id` example
FreePhoenix888 Feb 10, 2024
eb5fbd8
Add `Update to by id` example
FreePhoenix888 Feb 10, 2024
03df3bd
Add `Update string value by link id` example
FreePhoenix888 Feb 10, 2024
ca8923e
Update `Update to by id` examle
FreePhoenix888 Feb 10, 2024
4db8340
Update `Update from by id` example
FreePhoenix888 Feb 10, 2024
fb664b1
Add `Update number value by link id` example
FreePhoenix888 Feb 10, 2024
33d71b5
Add `Update object value by link id` example
FreePhoenix888 Feb 10, 2024
391b5da
Add `Delete by id` example
FreePhoenix888 Feb 10, 2024
970b98d
Add `Delete by from_id` example
FreePhoenix888 Feb 10, 2024
9dbe23a
Update `Delete by id` example
FreePhoenix888 Feb 10, 2024
4356977
Add example `Delete by to_id`
FreePhoenix888 Feb 10, 2024
72157f0
Add `Delete by type_id` example
FreePhoenix888 Feb 10, 2024
7e0d58f
Move `Delete by type_id` example after id example
FreePhoenix888 Feb 10, 2024
0b5596e
Add `Delete by string value` example
FreePhoenix888 Feb 10, 2024
70047df
Update `Delete by string value` example
FreePhoenix888 Feb 10, 2024
1359507
Add `Delete by number value` example
FreePhoenix888 Feb 10, 2024
e7b427f
Add `Delete by object value` example
FreePhoenix888 Feb 10, 2024
e20d56a
Add `Delete string value by link id` example
FreePhoenix888 Feb 10, 2024
25159c8
Add `Delete number value by link id` example
FreePhoenix888 Feb 10, 2024
a53170b
Update `Delete string value by link id` example
FreePhoenix888 Feb 10, 2024
63b6fd8
Add `Delete object value by link id` example
FreePhoenix888 Feb 10, 2024
3e3d7e4
Add `Await a promise of npm-packager` example
FreePhoenix888 Feb 10, 2024
86c667e
Add `Get Core Package Link Id` example
FreePhoenix888 Feb 14, 2024
2a01d0a
Add `Get User Type Link Id From Core Package` example
FreePhoenix888 Feb 14, 2024
084bde7
Add `Get the link called "My Nested Link Name" contained in the link …
FreePhoenix888 Feb 14, 2024
9b5bbec
Add `Get Admin Link Id` example
FreePhoenix888 Feb 14, 2024
e961b35
Add `Get Core Package Link Id` example
FreePhoenix888 Feb 14, 2024
e602405
Add `Get Core Package Link Id` example
FreePhoenix888 Feb 14, 2024
7a1929e
Add `Get the link called "My Nested Link Name" contained in the link …
FreePhoenix888 Feb 14, 2024
1fc1e09
Add `Get Admin Link Id` example
FreePhoenix888 Feb 14, 2024
87d8f47
Add example for `whoami`
FreePhoenix888 Feb 14, 2024
1a79392
Add login example
FreePhoenix888 Feb 15, 2024
faf6850
Add `guest` doc
FreePhoenix888 Feb 15, 2024
044c8f1
Update `login` doc
FreePhoenix888 Feb 15, 2024
941f514
Update `guest` doc
FreePhoenix888 Feb 15, 2024
d8516b2
Update doc
FreePhoenix888 Feb 15, 2024
dcdee14
Update `can` doc
FreePhoenix888 Feb 15, 2024
d01a37c
Add `name ` example
FreePhoenix888 Feb 15, 2024
237aa6d
Remove imports from examples
FreePhoenix888 Feb 15, 2024
90d7390
Add `nameLocal` example
FreePhoenix888 Feb 15, 2024
db8337f
Add `import` doc
FreePhoenix888 Feb 15, 2024
64375d2
Add remarks to `import`
FreePhoenix888 Feb 15, 2024
39bd88d
Add `Async handler using import` example
FreePhoenix888 Feb 15, 2024
5675dbb
Add remarks to `update`
FreePhoenix888 Feb 15, 2024
6369faf
ReExport createSerialOperation in clinet from gql
FreePhoenix888 Feb 15, 2024
1edf98e
Fix merge conflict
FreePhoenix888 Feb 15, 2024
aca1b0d
Add `evalClientHandler` doc
FreePhoenix888 Feb 15, 2024
0a97d69
Revert "ReExport createSerialOperation in clinet from gql"
FreePhoenix888 Feb 21, 2024
828e03b
Merge pull request #307 from deep-foundation/documentation/add_client…
FreePhoenix888 Feb 21, 2024
b6e6c18
Merge pull request #302 from deep-foundation/documentation/client/add…
FreePhoenix888 Feb 21, 2024
ec043ab
0.0.331
FreePhoenix888 Feb 21, 2024
40e2711
test server-build.yaml
suenot Mar 2, 2024
63d47e6
Update server build workflow
suenot Mar 2, 2024
b8922c9
Update server-build.yaml with dependency installation and port allowance
suenot Mar 2, 2024
9feca94
Add production build workflow
suenot Mar 2, 2024
94f5b40
Remove containerd.io and update dependencies
suenot Mar 2, 2024
30bd379
Remove Docker setup and allow ports 3006 and 3007
suenot Mar 2, 2024
235ee25
Update production-build.yaml to remove containerd.io installation and…
suenot Mar 2, 2024
096d6f1
Update dependencies and install git and curl
suenot Mar 2, 2024
faafd5d
Update server-build.yaml and remove production-build.yaml
suenot Mar 2, 2024
2ae6d35
Merge pull request #314 from suenot/main
Konard Mar 2, 2024
10bb4b3
Fix https://github.com/deep-foundation/dev/issues/213
Konard Mar 3, 2024
a04b6c4
merge main
ivansglazunov Mar 5, 2024
708cf5e
fully remote=false local=true worked
ivansglazunov Mar 12, 2024
82e2b25
final fix dual sync
ivansglazunov Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/server-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Server build

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update dependencies
run: |
sudo apt-get update && sudo apt-get upgrade

- name: Install dependencies
run: |
sudo apt install -y git curl

- name: Allow ports 3006 and 3007
run: |
sudo ufw allow 3006
sudo ufw allow 3007

- name: Install Node Version Manager (NVM)
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 18 && nvm use 18 && nvm alias default 18
npm i -g npm@latest

- name: Install and configure @deep-foundation/deeplinks
run: |
npm rm --unsafe-perm -g @deep-foundation/deeplinks
npm install --unsafe-perm -g @deep-foundation/deeplinks@latest

- name: Set environment variables
run: |
export HOST_IP="185.105.118.59"
export DEEPCASE_HOST="$HOST_IP:3007"
export DEEPLINKS_HOST="$HOST_IP:3006"
export HASURA_ADMIN_SECRET=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));")
export POSTGRES_PASSWORD=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));")
export MINIO_ACCESS_KEY=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));")
export MINIO_SECRET_KEY=$(node -e "console.log(require('crypto').randomBytes(24).toString('hex'));")

- name: Create call-options.json
run: |
tee call-options.json << JSON
{
"operation": "run",
"envs": {
"DEEPLINKS_PUBLIC_URL": "http://$DEEPLINKS_HOST",
"NEXT_PUBLIC_DEEPLINKS_URL": "http://$DEEPLINKS_HOST",
"NEXT_PUBLIC_GQL_PATH": "$DEEPLINKS_HOST/gql",
"NEXT_PUBLIC_GQL_SSL": "0",
"NEXT_PUBLIC_DEEPLINKS_SERVER": "http://$DEEPCASE_HOST",
"NEXT_PUBLIC_ENGINES_ROUTE": "0",
"NEXT_PUBLIC_DISABLE_CONNECTOR": "1",
"JWT_SECRET": "'{\"type\":\"HS256\",\"key\":\"$(node -e "console.log(require('crypto').randomBytes(50).toString('base64'));")\"}'",
"DEEPLINKS_HASURA_STORAGE_URL": "http://host.docker.internal:8000/",
"HASURA_GRAPHQL_ADMIN_SECRET": "$HASURA_ADMIN_SECRET",
"MIGRATIONS_HASURA_SECRET": "$HASURA_ADMIN_SECRET",
"DEEPLINKS_HASURA_SECRET": "$HASURA_ADMIN_SECRET",
"POSTGRES_PASSWORD": "$POSTGRES_PASSWORD",
"HASURA_GRAPHQL_DATABASE_URL": "postgres://postgres:$POSTGRES_PASSWORD@postgres:5432/postgres",
"POSTGRES_MIGRATIONS_SOURCE": "postgres://postgres:[email protected]:5432/postgres?sslmode=disable",
"RESTORE_VOLUME_FROM_SNAPSHOT": "0",
"MANUAL_MIGRATIONS": "1",
"MINIO_ROOT_USER": "$MINIO_ACCESS_KEY",
"MINIO_ROOT_PASSWORD": "$MINIO_SECRET_KEY",
"S3_ACCESS_KEY": "$MINIO_ACCESS_KEY",
"S3_SECRET_KEY": "$MINIO_SECRET_KEY"
}
}
JSON

- name: Run deeplinks
run: |
export DEEPLINKS_CALL_OPTIONS=$(cat call-options.json)
export DEBUG="deeplinks:engine:*,deeplinks:migrations:*"
deeplinks
3 changes: 3 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tasks:
- init: npm ci
command: echo "hello"
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ Deep.Links is started together with Deep.Case app and other services in GitPod.
4. Press `Enter` to execute that command again, that will finish restart sequence.
![IMG_1493](https://github.com/deep-foundation/deepcase-app/assets/1431904/56f48dad-d751-44c7-8871-164f824f122b)

## Dignostics

### Get all logs:

```sh
docker logs deep-links
```

### Get live logs:

```sh
docker logs -f deep-links
```

### Enter the sh from inside the docker container:

```sh
docker exec -it deep-links sh
```

## Library
See [Documentation] for examples and API

Expand Down
38 changes: 20 additions & 18 deletions automation/remove-build-files.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import glob from "glob";
import fs from "fs-extra";
export {}

const options = {
ignore: "**/node_modules/**",
nodir: true,
};
// import glob from "glob";
// import fs from "fs-extra";

glob("./**/*.{d.ts,js,js.map}", options, (err, files) => {
if (err) {
console.log(err);
return;
}
// const options = {
// ignore: "**/node_modules/**",
// nodir: true,
// };

files.forEach((file) => {
fs.remove(file, (err) => {
if (err) console.error(`Failed to remove ${file}:`, err);
else console.log(`Successfully removed ${file}`);
});
});
});
// glob("./**/*.{d.ts,js,js.map}", options, (err, files) => {
// if (err) {
// console.log(err);
// return;
// }

// files.forEach((file) => {
// fs.remove(file, (err) => {
// if (err) console.error(`Failed to remove ${file}:`, err);
// else console.log(`Successfully removed ${file}`);
// });
// });
// });
Empty file modified call.cjs
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion docker-prod/deep/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:
max-file: "3"
minio:
container_name: deep-minio
image: minio/minio
image: minio/minio:RELEASE.2023-09-30T07-02-29Z
restart: always
volumes:
- 'minio-data:/export'
Expand Down
18 changes: 12 additions & 6 deletions imports/client-handler.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import { DeepClient } from './client.js';
import { gql } from '@apollo/client/index.js';

export async function evalClientHandler({
value,
deep,
input = {},
}: {
/**
* Evaluates a client handler
* @returns A promise that resolves to an object with either an error property that contains error or data property that contains result of the handler.
*/
export async function evalClientHandler(options: {
value: string;
deep: DeepClient;
input?: any;
}): Promise<{
error?: any;
data?: any;
}> {
const {
value,
deep,
input = {},
} = options;
try {
console.log('evalClientHandler', 'value', value);
// const evalResult = (new Function(`return ${value}`))();
// console.log('evalClientHandler', 'evalResult', evalResult);
const evalResult = eval(value);
console.log('evalClientHandler', 'evalResult', evalResult);
if (typeof evalResult === 'function') {
return {
data: await evalResult({ deep, gql, ...input }),
Expand Down
Loading