Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
869 commits
Select commit Hold shift + click to select a range
ea28a3c
chore(release): publish
pyramation Dec 15, 2020
56a98f8
fix: test config
yyyyaaa Dec 16, 2020
2c46ec5
fix(graphile-gen): add last and before params to paginated query
yyyyaaa Dec 16, 2020
be6b647
Merge pull request #12 from yyyyaaa/fix/paginated-params-11
pyramation Dec 16, 2020
006f5d6
chore(release): publish
pyramation Dec 16, 2020
30f843f
add missing fields
pyramation Dec 16, 2020
e763817
chore(release): publish
pyramation Dec 16, 2020
af97e76
fixes
pyramation Dec 16, 2020
0fbc5f4
chore(release): publish
pyramation Dec 16, 2020
14c7160
update
pyramation Dec 16, 2020
7b622fb
chore(release): publish
pyramation Dec 16, 2020
ffbb5b0
fixtures
pyramation Dec 17, 2020
fe8aee3
pkgs
pyramation Dec 18, 2020
c7d04dd
updates
pyramation Dec 20, 2020
a58a046
chore(release): publish
pyramation Dec 20, 2020
5f27278
pkg
pyramation Dec 20, 2020
4784095
chore(release): publish
pyramation Dec 20, 2020
b47ffe3
schema api
pyramation Dec 22, 2020
182bd76
chore(release): publish
pyramation Dec 22, 2020
4858357
env
pyramation Dec 22, 2020
603fa55
chore(release): publish
pyramation Dec 22, 2020
49538f9
pkg
pyramation Dec 24, 2020
b92f3eb
chore(release): publish
pyramation Dec 24, 2020
add6cd5
testing
pyramation Dec 24, 2020
b0bd6d8
chore(release): publish
pyramation Dec 24, 2020
21f793f
api updates
pyramation Dec 24, 2020
d47a4ce
chore(release): publish
pyramation Dec 24, 2020
88ed518
api
pyramation Dec 24, 2020
022f4d4
chore(release): publish
pyramation Dec 24, 2020
4760af7
pkg
pyramation Dec 24, 2020
97dcbc9
chore(release): publish
pyramation Dec 24, 2020
aaf1d8c
pkg
pyramation Dec 24, 2020
3f2447f
fix: add 1 more level of selection for generated queries
yyyyaaa Dec 25, 2020
921f6e9
Merge branch 'fix/relational-linking'
pyramation Dec 27, 2020
c669619
chore(release): publish
pyramation Dec 27, 2020
ec11d97
graphile gen
pyramation Dec 27, 2020
9ac48fd
chore(release): publish
pyramation Dec 27, 2020
4616d9e
tables
pyramation Dec 29, 2020
397d607
chore(release): publish
pyramation Dec 29, 2020
b3e5ac6
cors
pyramation Dec 29, 2020
eb13e63
cors
pyramation Dec 29, 2020
e6b7549
chore(release): publish
pyramation Dec 29, 2020
41c1529
updates
pyramation Dec 29, 2020
4e2fe5d
chore(release): publish
pyramation Dec 29, 2020
c88f3c7
cors
pyramation Dec 29, 2020
7bba19c
chore(release): publish
pyramation Dec 29, 2020
d274ef9
updates
pyramation Dec 30, 2020
f10bf9e
chore(release): publish
pyramation Dec 30, 2020
332f551
headers
pyramation Dec 30, 2020
a491d33
chore(release): publish
pyramation Dec 30, 2020
7fb670e
api
pyramation Dec 30, 2020
cb02527
chore(release): publish
pyramation Dec 30, 2020
8e920c7
api
pyramation Dec 30, 2020
62568f6
chore(release): publish
pyramation Dec 30, 2020
9f9bcb4
notes
pyramation Dec 30, 2020
8011c8c
flush
pyramation Dec 30, 2020
4a4fef3
flush and logo
pyramation Dec 30, 2020
bc70d2a
app admin
pyramation Dec 31, 2020
fa66bc0
logs
pyramation Dec 31, 2020
a8c6108
Merge branch 'feat/svc-reload'
pyramation Dec 31, 2020
78970fc
chore(release): publish
pyramation Dec 31, 2020
9f899b8
updates
pyramation Dec 31, 2020
1a6f8a1
chore(release): publish
pyramation Dec 31, 2020
8f753ee
mw
pyramation Jan 2, 2021
6544a29
chore(release): publish
pyramation Jan 2, 2021
bf57504
feat(ast): add intValue type
yyyyaaa Jan 5, 2021
7f55b1d
fix(graphile-gen): limit nodes selection to 3 items
yyyyaaa Jan 5, 2021
a62a2cb
Merge pull request #15 from yyyyaaa/fix/nodes-depth-14
pyramation Jan 9, 2021
ca0632a
chore(release): publish
pyramation Jan 9, 2021
b1f3d17
updates
pyramation Jan 10, 2021
a01da26
chore(release): publish
pyramation Jan 10, 2021
c5eb169
strict auth
pyramation Jan 10, 2021
8bd97fc
chore(release): publish
pyramation Jan 10, 2021
e67af16
only set strict auth if not null
pyramation Jan 10, 2021
3ef7786
chore(release): publish
pyramation Jan 10, 2021
82b81fe
account deletion
pyramation Jan 12, 2021
80428bf
chore(release): publish
pyramation Jan 12, 2021
4b20a99
key
pyramation Jan 15, 2021
76715d0
fix: return cursors from paginated queries
yyyyaaa Jan 21, 2021
d7539fb
Merge pull request #16 from yyyyaaa/fix/return-cursors
pyramation Jan 21, 2021
26be8c8
chore(release): publish
pyramation Jan 21, 2021
e9513db
chore(release): publish
pyramation Jan 25, 2021
cf61734
whitelist
pyramation Feb 3, 2021
b5d6012
client
pyramation Feb 3, 2021
579f9c9
chore(release): publish
pyramation Feb 3, 2021
d1bccf1
pkg: client
pyramation Feb 3, 2021
7f7442e
chore(release): publish
pyramation Feb 3, 2021
c719afa
class
pyramation Feb 5, 2021
de97e48
Merge branch 'feat/granular-fields' into feat/client
pyramation Feb 5, 2021
fcd6f44
concept
pyramation Feb 5, 2021
d52139f
client class
pyramation Feb 5, 2021
f50a0af
fix: files
pyramation Feb 5, 2021
9dc8637
fix: model to query
pyramation Feb 5, 2021
9575d82
pkg
pyramation Feb 5, 2021
2756b3e
fix: edges
pyramation Feb 5, 2021
f7d5fdb
fix: all
pyramation Feb 5, 2021
8b1942e
feat: create
pyramation Feb 5, 2021
1f759f3
feat: mutations
pyramation Feb 5, 2021
3df21de
chore: add dep
yyyyaaa Feb 10, 2021
efe99eb
feat: meta object
yyyyaaa Feb 10, 2021
858d57a
feat(ast): add more ast types
yyyyaaa Feb 10, 2021
31daebb
feat(graphile-client): new client API
yyyyaaa Feb 10, 2021
a3a5984
chore: exports
yyyyaaa Feb 10, 2021
b1e58e1
Merge pull request #22 from yyyyaaa/feat/client-phat
pyramation Feb 10, 2021
02bff88
fix: pkg
pyramation Feb 10, 2021
cce3bf7
chore(release): publish
pyramation Feb 10, 2021
4902222
remove scopes, better setup for OSS
pyramation Feb 11, 2021
f1e095a
Merge branch 'cleanup'
pyramation Feb 11, 2021
e98ecbd
chore(release): publish
pyramation Feb 11, 2021
5700fc7
docs
pyramation Feb 11, 2021
1e7719f
chore(release): publish
pyramation Feb 11, 2021
17714a6
pkg
pyramation Feb 11, 2021
b828591
chore(release): publish
pyramation Feb 11, 2021
7099378
rename
pyramation Feb 11, 2021
d0edd3e
chore(release): publish
pyramation Feb 11, 2021
af52d46
generalized
pyramation Feb 11, 2021
178346c
rename
pyramation Feb 11, 2021
434ab31
chore(release): publish
pyramation Feb 11, 2021
fe81585
template
pyramation Feb 13, 2021
628f9c5
chore(release): publish
pyramation Feb 13, 2021
548d7cd
pkg
pyramation Feb 13, 2021
71ecb48
chore(release): publish
pyramation Feb 13, 2021
f243585
build: copy non-js files
yyyyaaa Feb 17, 2021
a5bb81a
fix: use inline json import to avoid transpiling for package consumers
yyyyaaa Feb 17, 2021
94ac938
fix: should filter out referenced fields
yyyyaaa Feb 17, 2021
b59f10e
Merge pull request #23 from launchql/fix/build-copy-files
yyyyaaa Feb 18, 2021
2639ceb
chore: add commit config
yyyyaaa Feb 18, 2021
01ff7d9
chore: lerna config
yyyyaaa Feb 18, 2021
307ba6a
chore(release): release
yyyyaaa Feb 18, 2021
567ee78
feat: select totalCount by default
yyyyaaa Feb 21, 2021
9fca045
Merge pull request #26 from launchql/feat/total-count
yyyyaaa Feb 21, 2021
3785068
chore(release): release
yyyyaaa Feb 21, 2021
8c71632
build: add rimraf, upgrade babel-env and dedup deps
yyyyaaa Feb 23, 2021
ecf870c
test: update fixtures
yyyyaaa Feb 23, 2021
85d8f5d
feat: custom ast for interval and location
yyyyaaa Feb 23, 2021
db64cb4
fix: selection relation field
yyyyaaa Feb 25, 2021
8dc1cea
fix: could not get scalar fields of junction tables
yyyyaaa Feb 26, 2021
641c05a
fix: should select belongsTo relation subfields
yyyyaaa Feb 26, 2021
7db59ec
chore: move fixture script to fixtures
yyyyaaa Feb 26, 2021
a34f434
fix: handle default value for variables
yyyyaaa Feb 26, 2021
b80bec5
fix: select belongsTo should not include pagination fields
yyyyaaa Feb 26, 2021
dd7b18e
fix(launchql-client): should allow custom selection when create
yyyyaaa Mar 1, 2021
4a4c640
fix(launchql-client): patch should allow select custom selection
yyyyaaa Mar 1, 2021
c43f888
fix(launchql-client): returned delete and patch action not correct
yyyyaaa Mar 2, 2021
b93c55b
Merge pull request #27 from launchql/feat/advanced-fields-ast
yyyyaaa Mar 4, 2021
5a8674f
chore(release): release
yyyyaaa Mar 4, 2021
3d07991
build: publish
yyyyaaa Mar 4, 2021
e64b0fc
build: publish
yyyyaaa Mar 4, 2021
160eeef
build: publish
yyyyaaa Mar 4, 2021
d379aea
chore(release): release
yyyyaaa Mar 4, 2021
31b332f
export
pyramation Mar 14, 2021
5c908fb
chore(release): publish
pyramation Mar 14, 2021
3452097
pg 13
pyramation Mar 19, 2021
001350c
chore(release): publish
pyramation Mar 19, 2021
d5662fe
pkg
pyramation Mar 19, 2021
6d49d44
chore(release): publish
pyramation Mar 19, 2021
37fa75c
parse
pyramation Mar 19, 2021
5d54d72
chore(release): publish
pyramation Mar 19, 2021
732e9eb
simpler api
pyramation Mar 20, 2021
e095581
chore(release): publish
pyramation Mar 20, 2021
b7f1d7f
upgrade parser
pyramation Mar 26, 2021
973367a
chore(release): publish
pyramation Mar 26, 2021
7140eef
launchql react
pyramation Mar 27, 2021
01e5c6a
chore(release): release
pyramation Mar 27, 2021
b9683c8
migrate
pyramation Apr 2, 2021
487b98c
chore(release): publish
pyramation Apr 2, 2021
8cdda30
pkg
pyramation Apr 7, 2021
06ee3d2
chore(release): publish
pyramation Apr 7, 2021
8c41930
testing
pyramation Apr 10, 2021
9977572
chore(release): publish
pyramation Apr 10, 2021
9e00fe5
ctx
pyramation Apr 10, 2021
a0bd664
chore(release): publish
pyramation Apr 10, 2021
d766b00
fix: mutation names
yyyyaaa Apr 15, 2021
cdd0346
Merge pull request #28 from launchql/fix/cleaning-mutation-names
pyramation Apr 15, 2021
b316c39
chore: add comment
yyyyaaa Apr 15, 2021
2aceae4
chore(release): release
yyyyaaa Apr 15, 2021
c9cf60e
enable query batching
pyramation Apr 16, 2021
7706195
remove group ids
pyramation Apr 16, 2021
3980f63
chore(release): publish
pyramation Apr 16, 2021
e239e94
types
pyramation Apr 16, 2021
56039d1
chore(release): publish
pyramation Apr 16, 2021
ab2d73c
pkg
pyramation Apr 19, 2021
66471f6
chore(release): publish
pyramation Apr 19, 2021
609426a
removeGroupIds
pyramation Apr 19, 2021
d1a60bd
chore(release): publish
pyramation Apr 19, 2021
2012d30
images
pyramation Apr 23, 2021
fa7a5e8
chore(release): publish
pyramation Apr 23, 2021
eb0f196
upgrade
pyramation Apr 23, 2021
bb24b05
Merge branch 'upgrade/graphile'
pyramation Apr 23, 2021
4fbff84
chore(release): publish
pyramation Apr 23, 2021
1e084c5
test: update fixtures
yyyyaaa May 4, 2021
1c60fd9
fix(introspectron): selections should not filter custom scalar types
yyyyaaa May 4, 2021
76aeffc
chore: add bootstrap local script
yyyyaaa May 4, 2021
3b170e8
chore: add debug script
yyyyaaa May 5, 2021
5861299
fix: unfilter custom scalar
yyyyaaa May 5, 2021
c0d2ce6
test: add fixtures
yyyyaaa May 5, 2021
d94319a
test: update fixtures
yyyyaaa May 5, 2021
f646295
test: fix incorrect fixture format
yyyyaaa May 5, 2021
af5af40
fix: expand custom scalars in relation fields
yyyyaaa May 5, 2021
22f3422
chore: remove only
yyyyaaa May 6, 2021
b2fea16
fix: condition should rely on foreign constraint
yyyyaaa May 6, 2021
e19789c
Merge pull request #30 from launchql/fix/bug-scalar-nested-29
yyyyaaa May 6, 2021
eb6223e
chore(release): release
yyyyaaa May 6, 2021
1c7fe7c
chore(release): release
yyyyaaa May 6, 2021
9c0ed89
chore(release): release
yyyyaaa May 6, 2021
2c3dfd0
publish
pyramation May 6, 2021
9a2a378
chore(release): release
pyramation May 6, 2021
6f9a79d
pkg
pyramation Jun 10, 2021
5acd573
chore(release): publish
pyramation Jun 10, 2021
4df18aa
updates
pyramation Jun 25, 2021
9c79e96
chore(release): publish
pyramation Jun 25, 2021
b5ee140
updated graphql
pyramation Jul 30, 2021
4332eb8
chore(release): publish
pyramation Jul 30, 2021
09af98c
upgrades
pyramation Aug 31, 2021
68bda03
upgrades
pyramation Aug 31, 2021
9cb91e3
Merge branch 'upgrades/graphile'
pyramation Aug 31, 2021
ff3ca4c
chore(release): publish
pyramation Aug 31, 2021
8a0ce63
update
pyramation Dec 15, 2021
b9a32c2
chore(release): publish
pyramation Dec 15, 2021
ef13ef1
lang
pyramation Feb 13, 2022
959eedf
chore(release): publish
pyramation Feb 13, 2022
3ebb413
i18n
pyramation Feb 13, 2022
2f84a91
chore(release): publish
pyramation Feb 13, 2022
41e4cc7
inflection fix
pyramation Feb 14, 2022
6a94511
chore(release): publish
pyramation Feb 14, 2022
0d3b0cb
Update README.md
pyramation Feb 21, 2024
3c31d9b
Update README.md
pyramation Feb 21, 2024
14ba96d
Add 'launchql-gen/' from commit '0d3b0cbc533fa9cb70c2515cc69372ee602a…
pyramation May 9, 2025
b90f1b0
Add 'launchql/' from commit '3c31d9b64d266a7dca2595f5aeddc22954bc76a6'
pyramation May 9, 2025
f1c09d8
Add 'uuid-hash/' from commit 'be0d805a10f70701fd270773616fb63c49f93cb6'
pyramation May 9, 2025
ec9ff1c
Add 'etag-stream/' from commit 'c3c1ec5bb985596a199d804943702de4b0282…
pyramation May 9, 2025
601dc5a
Add 'stream-to-etag/' from commit '92b9f3c64743941e5e6e07ed75b30ceea3…
pyramation May 9, 2025
7725efc
Add 'etag-hash/' from commit 'c9aea9e5c91d74dc00f51e70ab01667a69d7cc11'
pyramation May 9, 2025
3f1d47c
Add 'uuid-stream/' from commit '447eaf7d6ca64ec0ba2eeda0d365dcb7d8b5b…
pyramation May 9, 2025
1abd030
Add 'uploads/' from commit 'ee86b73ba8688b0f901ab35835b75438821bfb1a'
pyramation May 9, 2025
4d7d9d3
wip: preserving history and monorepo all packages
pyramation May 9, 2025
5d22982
readme
pyramation May 9, 2025
464ac26
wip: renames
pyramation May 9, 2025
52953c2
readme
pyramation May 9, 2025
c672e30
TODO
pyramation May 9, 2025
9b33c7d
wip
pyramation May 9, 2025
eaeb1ab
hashes
pyramation May 9, 2025
430fb91
gql
pyramation May 10, 2025
901f1ad
introspectron
pyramation May 10, 2025
e011d3c
introspectron
pyramation May 10, 2025
0b41892
react-client
pyramation May 10, 2025
e52ec3c
react
pyramation May 10, 2025
987259b
tests
pyramation May 10, 2025
6282953
etags
pyramation May 10, 2025
3fe9355
fixes
pyramation May 10, 2025
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
15 changes: 15 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,24 @@ jobs:
- name: launchql/url-domains
run: cd ./packages/url-domains && yarn test

- name: launchql/uuid-hash
run: cd ./packages/uuid-hash && yarn test

- name: launchql/uuid-stream
run: cd ./packages/uuid-stream && yarn test

- name: launchql/query-builder
run: cd ./packages/query-builder && yarn test

- name: launchql/introspectron
run: cd ./packages/introspectron && yarn test

- name: launchql/react-client
run: cd ./packages/react-client && yarn test

- name: launchql/launchql-gen
run: cd ./packages/launchql-gen && yarn test

- name: launchql/codegen
run: cd ./packages/codegen && yarn test

Expand Down
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [ ] remove travis
- [ ] it('getOne(): handles missing selection gracefully' NOT PASSING
- [ ] @launchql/react tests
Binary file added assets/launchql.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/outline-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"resolutions": {
"pg": "^8.15.6",
"@types/pg": "^8.11.10"
"@types/pg": "^8.11.10",
"graphql": "15.5.2"
}
}
14 changes: 13 additions & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# cli
# @launchql/cli

<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@launchql/cli"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fcli%2Fpackage.json"/></a>
</p>
14 changes: 12 additions & 2 deletions packages/client/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# launchql 2.0
# @launchql/client

In constuction!
<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@launchql/client"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fclient%2Fpackage.json"/></a>
</p>

## Disclaimer

Expand Down
14 changes: 13 additions & 1 deletion packages/codegen/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# launchql 2.0
# @launchql/codegen

<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@launchql/codegen"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fcodegen%2Fpackage.json"/></a>
</p>

In constuction!

Expand Down
14 changes: 13 additions & 1 deletion packages/content-type-stream/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# content-type-stream
# @launchql/content-type-stream

<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@launchql/content-type-stream"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fcontent-type-stream%2Fpackage.json"/></a>
</p>

```sh
npm install @launchql/content-type-stream
Expand Down
6 changes: 3 additions & 3 deletions packages/content-type-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@launchql/mmmagic": "0.5.3",
"buffer-peek-stream": "1.1.0",
"etag-hash": "1.0.1",
"etag-hash": "^2.0.0",
"mime": "2.4.6",
"@launchql/mmmagic": "0.5.3",
"uuid-hash": "1.0.2"
"uuid-hash": "^2.0.0"
}
}
5 changes: 2 additions & 3 deletions packages/content-type-stream/src/content-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import crypto from 'crypto';
import stream from 'stream';

// TODO move these into this monorepo
import uuid from 'uuid-hash';
import etag from 'etag-hash';
import * as uuid from 'uuid-hash';
import * as etag from 'etag-hash';

export class ContentStream extends stream.Transform {
constructor() {
Expand Down
14 changes: 12 additions & 2 deletions packages/deparser/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# launchql 2.0
# @launchql/deparser

In constuction!
<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@launchql/deparser"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fdeparser%2Fpackage.json"/></a>
</p>

## Disclaimer

Expand Down
32 changes: 32 additions & 0 deletions packages/etag-hash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ETag Hash

<p align="center" width="100%">
<img height="120" src="https://github.com/launchql/pgsql-parser/assets/545047/6440fa7d-918b-4a3b-8d1b-755d85de8bea" />
</p>

<p align="center" width="100%">
<a href="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/launchql/launchql-2.0/actions/workflows/run-tests.yaml/badge.svg" />
</a>
<a href="https://github.com/launchql/launchql-2.0/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/etag-hash"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/launchql-2.0?filename=packages%2Fetag-hash%2Fpackage.json"/></a>
</p>

Es6 class that generates ETag using the same algorithm as S3 via MD5 sum.

Useful for verifying Amazon S3 multi-part uploads.

## Installation

```sh
npm install etag-hash
```

## Usage

```js
const createHash = require('etag-hash').createHash;
const etag = createHash().update(contents).digest();
```

ETags compatible with s3, API similar to the crypto module to be compatible with streams. Thanks to the author of [this post](https://stackoverflow.com/questions/12186993/what-is-the-algorithm-to-compute-the-amazon-s3-etag-for-a-file-larger-than-5gb#answer-19896823) for the breakdown of the algorithm.
29 changes: 29 additions & 0 deletions packages/etag-hash/__tests__/etag-hash.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { createHash } from '../src';

describe('ETag', () => {
it('ETag hash', async () => {
const res: Record<string, string> = {};
const strings = ['Hello World', 'Another String'];

for (let i = 0; i < strings.length; i++) {
const str = strings[i];
res[str] = createHash()
.update(Buffer.from(str, 'utf8'))
.digest();
}

expect(res).toMatchSnapshot();
});

it('Large ETag hash', async () => {
const hash = createHash();

const SZ = 5 * 1024 * 1024;
for (let i = 0; i < SZ; i++) {
hash.update(Buffer.from(String(i), 'utf8'));
}

const res = hash.digest();
expect(res).toMatchSnapshot();
});
});
18 changes: 18 additions & 0 deletions packages/etag-hash/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
babelConfig: false,
tsconfig: "tsconfig.json",
},
],
},
transformIgnorePatterns: [`/node_modules/*`],
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
modulePathIgnorePatterns: ["dist/*"]
};
40 changes: 40 additions & 0 deletions packages/etag-hash/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "etag-hash",
"version": "2.0.0",
"author": "Dan Lynch <pyramation@gmail.com>",
"description": "Es6 class that generates ETag using the same algorithm as S3 via MD5 sum.",
"main": "index.js",
"module": "esm/index.js",
"types": "index.d.ts",
"homepage": "https://github.com/launchql/launchql",
"license": "SEE LICENSE IN LICENSE",
"publishConfig": {
"access": "public",
"directory": "dist"
},
"repository": {
"type": "git",
"url": "https://github.com/launchql/launchql"
},
"bugs": {
"url": "https://github.com/launchql/launchql/issues"
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
"clean": "rimraf dist/**",
"prepare": "npm run build",
"build": "npm run clean; tsc; tsc -p tsconfig.esm.json; npm run copy",
"build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
"lint": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch"
},
"keywords": [
"hash",
"crypto",
"s3",
"minio",
"etag",
"md5"
]
}
50 changes: 50 additions & 0 deletions packages/etag-hash/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { createHash as createCryptoHash, Hash as NodeHash } from 'crypto';

export class ETagHash {
private partSizeInBytes: number;
private sums: NodeHash[];
private part: number;
private bytes: number;

constructor(partSizeInMb: number = 5) {
this.partSizeInBytes = partSizeInMb * 1024 * 1024;
this.sums = [createCryptoHash('md5')];
this.part = 0;
this.bytes = 0;
}

update(chunk: Buffer): this {
const len = chunk.length;

if (this.bytes + len < this.partSizeInBytes) {
this.sums[this.part].update(chunk);
this.bytes += len;
} else {
const bytesNeeded = this.partSizeInBytes - this.bytes;
this.sums[this.part].update(chunk.subarray(0, bytesNeeded));
this.part++;
this.sums.push(createCryptoHash('md5'));
this.bytes = len - bytesNeeded;
this.sums[this.part].update(chunk.subarray(bytesNeeded));
}

return this;
}

digest(): string {
if (!this.part) {
return this.sums[0].digest('hex');
}

const checksum = this.sums.map((s) => s.digest('hex')).join('');
const final = createCryptoHash('md5')
.update(Buffer.from(checksum, 'hex'))
.digest('hex');

return `${final}-${this.part + 1}`;
}
}

export const createHash = (...args: ConstructorParameters<typeof ETagHash>): ETagHash => {
return new ETagHash(...args);
};
9 changes: 9 additions & 0 deletions packages/etag-hash/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/esm",
"module": "es2022",
"rootDir": "src/",
"declaration": false
}
}
9 changes: 9 additions & 0 deletions packages/etag-hash/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src/"
},
"include": ["src/**/*.ts"],
"exclude": ["dist", "node_modules", "**/*.spec.*", "**/*.test.*"]
}
Loading