From a0eb65e2fa914564a6c660ac9d0a70e35c2ed249 Mon Sep 17 00:00:00 2001 From: tiye Date: Sun, 17 Sep 2023 23:08:12 +0800 Subject: [PATCH 1/4] adding API for loading COS token --- .gitignore | 2 + README.md | 2 +- calcit.cirru | 466 ++++++++++++++++++++++++++++++++++++++++++++- compact.cirru | 75 +++++++- main.mjs | 2 +- package.cirru | 1 + package.json | 3 +- yarn.lock | 512 ++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 1054 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1ce1b95..ee384f9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ js-out/ node_modules example/ + +secrets.cirru diff --git a/README.md b/README.md index e6a95a8..3a6dac2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ COS upload ---- -> script. +> dirty script providing a server. ### Workflow diff --git a/calcit.cirru b/calcit.cirru index 8c6354f..956ed91 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -1,13 +1,215 @@ {} (:package |app) :configs $ {} (:init-fn |app.main/main!) (:port 6001) (:reload-fn |app.main/reload!) (:version |0.0.1) - :modules $ [] + :modules $ [] |skir/ |lilac/ :entries $ {} :test $ {} (:init-fn |app.test/main!) (:reload-fn |app.test/reload!) :modules $ [] |calcit-test/ :files $ {} + |app.http $ %{} :FileEntry + :defs $ {} + |extract-body $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1694963654797) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963654797) (:by |u0) (:text |defn) + |b $ %{} :Leaf (:at 1694963654797) (:by |u0) (:text |extract-body) + |h $ %{} :Expr (:at 1694963654797) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963658068) (:by |u0) (:text |req) + |b $ %{} :Leaf (:at 1694963663526) (:by |u0) (:text |cb) + |l $ %{} :Expr (:at 1694963664050) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963664887) (:by |u0) (:text |let) + |b $ %{} :Expr (:at 1694963665101) (:by |u0) + :data $ {} + |T $ %{} :Expr (:at 1694963665227) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963670711) (:by |u0) (:text |*buf) + |b $ %{} :Expr (:at 1694963682638) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963683662) (:by |u0) (:text |atom) + |T $ %{} :Leaf (:at 1694963682151) (:by |u0) (:text "|\"") + |h $ %{} :Expr (:at 1694963689429) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963759231) (:by |u0) (:text |.!on) + |b $ %{} :Leaf (:at 1694963694657) (:by |u0) (:text |req) + |h $ %{} :Leaf (:at 1694963761588) (:by |u0) (:text "|\"data") + |l $ %{} :Expr (:at 1694963762164) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963762410) (:by |u0) (:text |fn) + |b $ %{} :Expr (:at 1694963762829) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963763266) (:by |u0) (:text |d) + |h $ %{} :Expr (:at 1694963767540) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963769327) (:by |u0) (:text |swap!) + |b $ %{} :Leaf (:at 1694963772308) (:by |u0) (:text |*buf) + |h $ %{} :Leaf (:at 1694963776259) (:by |u0) (:text |str) + |l $ %{} :Leaf (:at 1694963777124) (:by |u0) (:text |d) + |l $ %{} :Expr (:at 1694963779178) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963784238) (:by |u0) (:text |.!on) + |b $ %{} :Leaf (:at 1694963785095) (:by |u0) (:text |req) + |h $ %{} :Leaf (:at 1694963786338) (:by |u0) (:text "|\"end") + |l $ %{} :Expr (:at 1694963787794) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963788058) (:by |u0) (:text |fn) + |b $ %{} :Expr (:at 1694963789704) (:by |u0) + :data $ {} + |h $ %{} :Expr (:at 1694963791022) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963792887) (:by |u0) (:text |cb) + |b $ %{} :Expr (:at 1694963927775) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963930003) (:by |u0) (:text |parse-cirru-edn) + |T $ %{} :Expr (:at 1694963794031) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963794818) (:by |u0) (:text |deref) + |b $ %{} :Leaf (:at 1694963796359) (:by |u0) (:text |*buf) + :ns $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1694963635592) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963635592) (:by |u0) (:text |ns) + |b $ %{} :Leaf (:at 1694963635592) (:by |u0) (:text |app.http) |app.main $ %{} :FileEntry :defs $ {} + |handle-token $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1694964114345) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964114345) (:by |u0) (:text |defn) + |b $ %{} :Leaf (:at 1694964114345) (:by |u0) (:text |handle-token) + |h $ %{} :Expr (:at 1694964114345) (:by |u0) + :data $ {} + |8 $ %{} :Leaf (:at 1694965169989) (:by |u0) (:text |bucket) + |K $ %{} :Leaf (:at 1694965167986) (:by |u0) (:text |app-id) + |V $ %{} :Leaf (:at 1694964120155) (:by |u0) (:text |secret) + |b $ %{} :Leaf (:at 1694965709270) (:by |u0) (:text |file-key) + |h $ %{} :Leaf (:at 1694964114345) (:by |u0) (:text |cb) + |l $ %{} :Expr (:at 1694965091057) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694965398768) (:by |u0) (:text |&let) + |L $ %{} :Expr (:at 1694965389213) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965470020) (:by |u0) (:text |cos-obj) + |b $ %{} :Expr (:at 1694965419151) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |new) + |b $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |COS) + |h $ %{} :Expr (:at 1694965419151) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |js-object) + |b $ %{} :Expr (:at 1694965419151) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |:SecretId) + |b $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |secret) + |h $ %{} :Expr (:at 1694965419151) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |:SecretKey) + |b $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |secret) + |T $ %{} :Expr (:at 1694965324035) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694965327628) (:by |u0) (:text |w-js-log) + |T $ %{} :Expr (:at 1694964121310) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694964130783) (:by |u0) (:text |.!getObjectUrl) + |T $ %{} :Leaf (:at 1694965471813) (:by |u0) (:text |cos-obj) + |b $ %{} :Expr (:at 1694964136608) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964139936) (:by |u0) (:text |js-object) + |b $ %{} :Expr (:at 1694964141141) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964146601) (:by |u0) (:text |:Bucket) + |b $ %{} :Leaf (:at 1694965174854) (:by |u0) (:text |bucket) + |h $ %{} :Expr (:at 1694964148271) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964151067) (:by |u0) (:text |:Region) + |b $ %{} :Leaf (:at 1694965202850) (:by |u0) (:text "|\"ap-hongkong") + |l $ %{} :Expr (:at 1694964170804) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964171559) (:by |u0) (:text |:Key) + |b $ %{} :Expr (:at 1694965736927) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694965737641) (:by |u0) (:text |str) + |L $ %{} :Leaf (:at 1694965741996) (:by |u0) (:text "|\"cos-up/") + |T $ %{} :Expr (:at 1694965711730) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965715635) (:by |u0) (:text |or) + |b $ %{} :Leaf (:at 1694965717664) (:by |u0) (:text |file-key) + |h $ %{} :Leaf (:at 1694965745179) (:by |u0) (:text "|\"demo0") + |o $ %{} :Expr (:at 1694964172280) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964173611) (:by |u0) (:text |:Method) + |b $ %{} :Leaf (:at 1694964175311) (:by |u0) (:text "|\"PUT") + |q $ %{} :Expr (:at 1694964176301) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964177572) (:by |u0) (:text |:Sign) + |b $ %{} :Leaf (:at 1694964178352) (:by |u0) (:text |true) + |h $ %{} :Expr (:at 1694964179797) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964180148) (:by |u0) (:text |fn) + |b $ %{} :Expr (:at 1694964180436) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964181375) (:by |u0) (:text |err) + |b $ %{} :Leaf (:at 1694964181994) (:by |u0) (:text |data) + |h $ %{} :Expr (:at 1694964184670) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964191717) (:by |u0) (:text |js/console.log) + |b $ %{} :Leaf (:at 1694964196675) (:by |u0) (:text "|\"COS DATA:") + |e $ %{} :Leaf (:at 1694964199891) (:by |u0) (:text |err) + |h $ %{} :Leaf (:at 1694964197623) (:by |u0) (:text |data) + |l $ %{} :Expr (:at 1694965755786) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694965756213) (:by |u0) (:text |if) + |L $ %{} :Expr (:at 1694965756448) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965757227) (:by |u0) (:text |some?) + |b $ %{} :Leaf (:at 1694965759167) (:by |u0) (:text |err) + |P $ %{} :Expr (:at 1694965759739) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965760753) (:by |u0) (:text |cb) + |b $ %{} :Expr (:at 1694965761172) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965762235) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694965763578) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965764197) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694965765304) (:by |u0) (:text |400) + |h $ %{} :Expr (:at 1694965765904) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965766708) (:by |u0) (:text |:body) + |b $ %{} :Expr (:at 1694965766995) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965767473) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694965767759) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965768956) (:by |u0) (:text |:message) + |b $ %{} :Expr (:at 1694965769198) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965769733) (:by |u0) (:text |str) + |b $ %{} :Leaf (:at 1694965771296) (:by |u0) (:text |err) + |T $ %{} :Expr (:at 1694964201128) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964201930) (:by |u0) (:text |cb) + |b $ %{} :Expr (:at 1694964202433) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964202754) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694964203074) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964205531) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694964209294) (:by |u0) (:text |200) + |h $ %{} :Expr (:at 1694964210133) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964214934) (:by |u0) (:text |:body) + |b $ %{} :Expr (:at 1694964211759) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964212093) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694965751098) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965751423) (:by |u0) (:text |:url) + |b $ %{} :Expr (:at 1694965812114) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694965813954) (:by |u0) (:text |.-Url) + |T $ %{} :Leaf (:at 1694965753682) (:by |u0) (:text |data) |main! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1606310749711) (:by |u0) :data $ {} @@ -18,7 +220,222 @@ |t $ %{} :Expr (:at 1694961031491) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694961032244) (:by |u0) (:text |println) - |b $ %{} :Leaf (:at 1694961032907) (:by |u0) (:text "|\"DO") + |b $ %{} :Leaf (:at 1694961225229) (:by |u0) (:text "|\"COS get") + |h $ %{} :Expr (:at 1694961211455) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694961217147) (:by |u0) (:text |.-getAuthorization) + |T $ %{} :Leaf (:at 1694961152928) (:by |u0) (:text |COS) + |u $ %{} :Expr (:at 1694961731715) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961740875) (:by |u0) (:text |skir/create-server!) + |b $ %{} :Leaf (:at 1694961746239) (:by |u0) (:text |on-request!) + |h $ %{} :Expr (:at 1694961746988) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961747280) (:by |u0) (:text |{}) + |on-request! $ %{} :CodeEntry (:doc |) + :code $ %{} :Expr (:at 1694961774169) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961775404) (:by |u0) (:text |defn) + |b $ %{} :Leaf (:at 1694961774169) (:by |u0) (:text |on-request!) + |h $ %{} :Expr (:at 1694961774169) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961779866) (:by |u0) (:text |req-data) + |b $ %{} :Leaf (:at 1694961780547) (:by |u0) (:text |res) + |j $ %{} :Expr (:at 1694962052208) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962110795) (:by |u0) (:text |println) + |b $ %{} :Expr (:at 1694962815658) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962826323) (:by |u0) (:text |format-cirru-edn) + |T $ %{} :Expr (:at 1694962124952) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962125596) (:by |u0) (:text |->) + |L $ %{} :Leaf (:at 1694962127506) (:by |u0) (:text |req-data) + |T $ %{} :Expr (:at 1694962111411) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962112945) (:by |u0) (:text |dissoc) + |b $ %{} :Leaf (:at 1694962116810) (:by |u0) (:text |:original-request) + |b $ %{} :Expr (:at 1694962129405) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962130273) (:by |u0) (:text |dissoc) + |b $ %{} :Leaf (:at 1694962131581) (:by |u0) (:text |:headers) + |l $ %{} :Expr (:at 1694962474446) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962560030) (:by |u0) (:text |if) + |F $ %{} :Expr (:at 1694962596988) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962597565) (:by |u0) (:text |and) + |T $ %{} :Expr (:at 1694962560587) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962560689) (:by |u0) (:text |=) + |h $ %{} :Leaf (:at 1694962678761) (:by |u0) (:text |:post) + |l $ %{} :Expr (:at 1694962565387) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962565387) (:by |u0) (:text |:method) + |b $ %{} :Leaf (:at 1694962565387) (:by |u0) (:text |req-data) + |b $ %{} :Expr (:at 1694962599496) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962599496) (:by |u0) (:text |=) + |b $ %{} :Leaf (:at 1694962599496) (:by |u0) (:text "|\"/token") + |h $ %{} :Expr (:at 1694962599496) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962599496) (:by |u0) (:text |:path) + |b $ %{} :Leaf (:at 1694962599496) (:by |u0) (:text |req-data) + |FT $ %{} :Expr (:at 1694962991279) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962992122) (:by |u0) (:text |let) + |L $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |secrets) + |b $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |parse-cirru-edn) + |b $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |fs/readFileSync) + |b $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |path/join) + |b $ %{} :Expr (:at 1694962992617) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |fileURLToPath) + |b $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text |js/import.meta.url) + |h $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text "|\"../../secrets.cirru") + |h $ %{} :Leaf (:at 1694962992617) (:by |u0) (:text "|\"utf8") + |b $ %{} :Expr (:at 1694963113888) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963115360) (:by |u0) (:text |data) + |b $ %{} :Expr (:at 1694963139224) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963139602) (:by |u0) (:text |{}) + |T $ %{} :Expr (:at 1694963886067) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963888365) (:by |u0) (:text |fn) + |L $ %{} :Expr (:at 1694963888992) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963895906) (:by |u0) (:text |cb) + |T $ %{} :Expr (:at 1694963819488) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963820311) (:by |u0) (:text |extract-body) + |L $ %{} :Expr (:at 1694963822360) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963825324) (:by |u0) (:text |:original-request) + |b $ %{} :Leaf (:at 1694963826988) (:by |u0) (:text |req-data) + |T $ %{} :Expr (:at 1694963829908) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963830422) (:by |u0) (:text |fn) + |L $ %{} :Expr (:at 1694963830737) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963831768) (:by |u0) (:text |body) + |X $ %{} :Expr (:at 1694963841324) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963842157) (:by |u0) (:text |println) + |b $ %{} :Leaf (:at 1694963844142) (:by |u0) (:text "|\"BODY") + |h $ %{} :Leaf (:at 1694963844807) (:by |u0) (:text |body) + |b $ %{} :Expr (:at 1694962995113) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694962995596) (:by |u0) (:text |if) + |L $ %{} :Expr (:at 1694963008831) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963009681) (:by |u0) (:text |and) + |T $ %{} :Expr (:at 1694962995972) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962996091) (:by |u0) (:text |=) + |X $ %{} :Expr (:at 1694963004030) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963005723) (:by |u0) (:text |:user) + |b $ %{} :Leaf (:at 1694963956642) (:by |u0) (:text |body) + |b $ %{} :Expr (:at 1694962998424) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963001765) (:by |u0) (:text |:user) + |T $ %{} :Leaf (:at 1694962997936) (:by |u0) (:text |secrets) + |b $ %{} :Expr (:at 1694962995972) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962996091) (:by |u0) (:text |=) + |X $ %{} :Expr (:at 1694963004030) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963015276) (:by |u0) (:text |:pass) + |b $ %{} :Leaf (:at 1694963958850) (:by |u0) (:text |body) + |b $ %{} :Expr (:at 1694962998424) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694963019296) (:by |u0) (:text |:pass-md5) + |T $ %{} :Leaf (:at 1694962997936) (:by |u0) (:text |secrets) + |T $ %{} :Expr (:at 1694964072790) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964086616) (:by |u0) (:text |handle-token) + |X $ %{} :Expr (:at 1694965159056) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965161597) (:by |u0) (:text |:bucket) + |b $ %{} :Leaf (:at 1694965163905) (:by |u0) (:text |secrets) + |b $ %{} :Expr (:at 1694964088819) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964093452) (:by |u0) (:text |:app-id) + |b $ %{} :Leaf (:at 1694964088819) (:by |u0) (:text |secrets) + |h $ %{} :Expr (:at 1694964088819) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694964098454) (:by |u0) (:text |:secret) + |b $ %{} :Leaf (:at 1694964088819) (:by |u0) (:text |secrets) + |j $ %{} :Expr (:at 1694965676070) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694965681589) (:by |u0) (:text |:file-key) + |b $ %{} :Leaf (:at 1694965680094) (:by |u0) (:text |body) + |l $ %{} :Leaf (:at 1694964112871) (:by |u0) (:text |cb) + |b $ %{} :Expr (:at 1694963039350) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963039765) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694963040249) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963041579) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694963042563) (:by |u0) (:text |403) + |h $ %{} :Expr (:at 1694963043516) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963046275) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694963049795) (:by |u0) (:text "|\"Not user") + |l $ %{} :Expr (:at 1694963051391) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963053806) (:by |u0) (:text |:headers) + |b $ %{} :Expr (:at 1694963054030) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963054399) (:by |u0) (:text |{}) + |o $ %{} :Expr (:at 1694963055484) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963056355) (:by |u0) (:text |:body) + |b $ %{} :Expr (:at 1694963056738) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963057054) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694963058243) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963060708) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694963069312) (:by |u0) (:text "|\"not open for all users...") + |T $ %{} :Expr (:at 1694961781144) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961784635) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694961785982) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961786536) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694962696757) (:by |u0) (:text |404) + |h $ %{} :Expr (:at 1694961788900) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961791544) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694962702571) (:by |u0) (:text "|\"Non hit") + |l $ %{} :Expr (:at 1694961793252) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961794463) (:by |u0) (:text |:headers) + |b $ %{} :Expr (:at 1694961794720) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961794988) (:by |u0) (:text |{}) + |o $ %{} :Expr (:at 1694961795807) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961796481) (:by |u0) (:text |:body) + |b $ %{} :Expr (:at 1694961796748) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961797097) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694962000326) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962001801) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694962712108) (:by |u0) (:text "|\"only token is impelemented") |reload! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1606310753106) (:by |u0) :data $ {} @@ -26,6 +443,10 @@ |j $ %{} :Leaf (:at 1606310753106) (:by |u0) (:text |reload!) |r $ %{} :Expr (:at 1606310753106) (:by |u0) :data $ {} + |t $ %{} :Expr (:at 1694961765221) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961770982) (:by |u0) (:text |skir/reset-req-handler!) + |b $ %{} :Leaf (:at 1694961773811) (:by |u0) (:text |on-request!) |v $ %{} :Expr (:at 1606310801441) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694961022767) (:by |u0) (:text |println) @@ -38,5 +459,46 @@ |r $ %{} :Expr (:at 1625340359278) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1625340360591) (:by |u0) (:text |:require) + |b $ %{} :Expr (:at 1694961144809) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961145377) (:by |u0) (:text "|\"cos-nodejs-sdk-v5") + |b $ %{} :Leaf (:at 1694961178747) (:by |u0) (:text |:default) + |h $ %{} :Leaf (:at 1694961149443) (:by |u0) (:text |COS) + |h $ %{} :Expr (:at 1694961756287) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961758311) (:by |u0) (:text |skir.core) + |b $ %{} :Leaf (:at 1694961760028) (:by |u0) (:text |:as) + |h $ %{} :Leaf (:at 1694961760548) (:by |u0) (:text |skir) + |l $ %{} :Expr (:at 1694962173955) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962223445) (:by |u0) (:text |app.$meta) + |b $ %{} :Leaf (:at 1694962179520) (:by |u0) (:text |:refer) + |h $ %{} :Expr (:at 1694962181200) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962199824) (:by |u0) (:text |calcit-dirname) + |o $ %{} :Expr (:at 1694962297412) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962300851) (:by |u0) (:text "|\"node:path") + |b $ %{} :Leaf (:at 1694962303942) (:by |u0) (:text |:as) + |h $ %{} :Leaf (:at 1694962304458) (:by |u0) (:text |path) + |p $ %{} :Expr (:at 1694962386806) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962390302) (:by |u0) (:text "|\"node:url") + |b $ %{} :Leaf (:at 1694962391468) (:by |u0) (:text |:refer) + |h $ %{} :Expr (:at 1694962391731) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962392079) (:by |u0) (:text |fileURLToPath) + |q $ %{} :Expr (:at 1694962326978) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962328650) (:by |u0) (:text "|\"node:fs") + |b $ %{} :Leaf (:at 1694962329184) (:by |u0) (:text |:as) + |h $ %{} :Leaf (:at 1694962329479) (:by |u0) (:text |fs) + |s $ %{} :Expr (:at 1694963808961) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963808961) (:by |u0) (:text |app.http) + |b $ %{} :Leaf (:at 1694963808961) (:by |u0) (:text |:refer) + |h $ %{} :Expr (:at 1694963808961) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694963808961) (:by |u0) (:text |extract-body) :users $ {} |u0 $ {} (:avatar nil) (:id |u0) (:name |chen) (:nickname |chen) (:password |d41d8cd98f00b204e9800998ecf8427e) (:theme :star-trail) diff --git a/compact.cirru b/compact.cirru index b0600ec..0737cbc 100644 --- a/compact.cirru +++ b/compact.cirru @@ -1,19 +1,86 @@ {} (:package |app) :configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!) (:version |0.0.1) - :modules $ [] + :modules $ [] |skir/ |lilac/ :entries $ {} :test $ {} (:init-fn |app.test/main!) (:reload-fn |app.test/reload!) :modules $ [] |calcit-test/ :files $ {} + |app.http $ %{} :FileEntry + :defs $ {} + |extract-body $ %{} :CodeEntry (:doc |) + :code $ quote + defn extract-body (req cb) + let + *buf $ atom "\"" + .!on req "\"data" $ fn (d) (swap! *buf str d) + .!on req "\"end" $ fn () + cb $ parse-cirru-edn (deref *buf) + :ns $ %{} :CodeEntry (:doc |) + :code $ quote (ns app.http) |app.main $ %{} :FileEntry :defs $ {} + |handle-token $ %{} :CodeEntry (:doc |) + :code $ quote + defn handle-token (bucket app-id secret file-key cb) + &let + cos-obj $ new COS + js-object (:SecretId secret) (:SecretKey secret) + w-js-log $ .!getObjectUrl cos-obj + js-object (:Bucket bucket) (:Region "\"ap-hongkong") + :Key $ str "\"cos-up/" (or file-key "\"demo0") + :Method "\"PUT" + :Sign true + fn (err data) (js/console.log "\"COS DATA:" err data) + if (some? err) + cb $ {} (:code 400) + :body $ {} + :message $ str err + cb $ {} (:code 200) + :body $ {} + :url $ .-Url data |main! $ %{} :CodeEntry (:doc |) :code $ quote - defn main! () $ println "\"DO" + defn main! () + println "\"COS get" $ .-getAuthorization COS + skir/create-server! on-request! $ {} + |on-request! $ %{} :CodeEntry (:doc |) + :code $ quote + defn on-request! (req-data res) + println $ format-cirru-edn + -> req-data (dissoc :original-request) (dissoc :headers) + if + and + = :post $ :method req-data + = "\"/token" $ :path req-data + let + secrets $ parse-cirru-edn + fs/readFileSync + path/join (fileURLToPath js/import.meta.url) "\"../../secrets.cirru" + , "\"utf8" + data $ {} + fn (cb) + extract-body (:original-request req-data) + fn (body) (println "\"BODY" body) + if + and + = (:user body) (:user secrets) + = (:pass body) (:pass-md5 secrets) + handle-token (:bucket secrets) (:app-id secrets) (:secret secrets) (:file-key body) cb + {} (:code 403) (:message "\"Not user") + :headers $ {} + :body $ {} (:message "\"not open for all users...") + {} (:code 404) (:message "\"Non hit") + :headers $ {} + :body $ {} (:message "\"only token is impelemented") |reload! $ %{} :CodeEntry (:doc |) :code $ quote - defn reload! () $ println "\"Reloaded." + defn reload! () (skir/reset-req-handler! on-request!) (println "\"Reloaded.") :ns $ %{} :CodeEntry (:doc |) :code $ quote - ns app.main $ :require + ns app.main $ :require ("\"cos-nodejs-sdk-v5" :default COS) (skir.core :as skir) + app.$meta :refer $ calcit-dirname + "\"node:path" :as path + "\"node:url" :refer $ fileURLToPath + "\"node:fs" :as fs + app.http :refer $ extract-body diff --git a/main.mjs b/main.mjs index 3049a77..33b2a3b 100644 --- a/main.mjs +++ b/main.mjs @@ -1,3 +1,3 @@ -import { main_$x_, reload_$x_ } from "./js-out/app.test.mjs" +import { main_$x_, reload_$x_ } from "./js-out/app.main.mjs" main_$x_() diff --git a/package.cirru b/package.cirru index 820dd9c..857fbab 100644 --- a/package.cirru +++ b/package.cirru @@ -1,3 +1,4 @@ {} :dependencies $ {} + |calcit-lang/skir |main diff --git a/package.json b/package.json index 1080d90..68f34c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "version": "0.0.7", "dependencies": { - "@calcit/procs": "^0.8.1" + "@calcit/procs": "^0.8.1", + "cos-nodejs-sdk-v5": "^2.12.4" }, "scripts": {}, "devDependencies": {} diff --git a/yarn.lock b/yarn.lock index 88e0e3c..41fb11e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,3 +25,515 @@ version "0.1.4" resolved "https://registry.npmmirror.com/@cirru/writer.ts/-/writer.ts-0.1.4.tgz#4b5851d002ab7c4891457bf8c707f09620c8f122" integrity sha512-Uy3Y7jjLdaxLW9ajZuIS9rp+dhaSVU95hRRwvnP6E16PwgPl+zGs6Xqn1L7Lqw07ypujrdBBdFQyRJOLc6IHQQ== + +ajv-formats@^1.5.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-1.6.1.tgz#35c7cdcd2a12d509171c37bac32f2e8eb010a536" + integrity sha512-4CjkH20If1lhR5CGtqkrVg3bbOtFEG80X9v6jDOIUhbzzbB+UzPBGy8GQhUNVZ0yvMHdMpawCOcy5ydGMsagGQ== + dependencies: + ajv "^7.0.0" + +ajv@^6.12.3: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^7.0.0, ajv@^7.0.3: + version "7.2.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.2.4.tgz#8e239d4d56cf884bccca8cca362f508446dc160f" + integrity sha512-nBeQgg/ZZA3u3SYxyaDvpvDtgZ/EZPF547ARgZBrG9Bhu1vKDwAIjtIf+sDtJUKa2zOcEbmRLBRSyMraS/Oy1A== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +atomically@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/atomically/-/atomically-1.7.0.tgz#c07a0458432ea6dbc9a3506fffa424b48bccaafe" + integrity sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +conf@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/conf/-/conf-9.0.2.tgz#943589602b1ce274d9234265314336a698972bc5" + integrity sha512-rLSiilO85qHgaTBIIHQpsv8z+NnVfZq3cKuYNCXN1AOqPzced0GWZEe/A517VldRLyQYXUMyV+vszavE2jSAqw== + dependencies: + ajv "^7.0.3" + ajv-formats "^1.5.1" + atomically "^1.7.0" + debounce-fn "^4.0.0" + dot-prop "^6.0.1" + env-paths "^2.2.0" + json-schema-typed "^7.0.3" + make-dir "^3.1.0" + onetime "^5.1.2" + pkg-up "^3.1.0" + semver "^7.3.4" + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + +cos-nodejs-sdk-v5@^2.12.4: + version "2.12.4" + resolved "https://registry.yarnpkg.com/cos-nodejs-sdk-v5/-/cos-nodejs-sdk-v5-2.12.4.tgz#d1c3a449915e53a746351dda1d4a32238b53fa3e" + integrity sha512-TFTLCzK3owRezlqRwlub+9U7LHd4me5m4q6HFGLa4ez5huYAH3GDf/LM+2CZDQ/vMVU/oigbumB+OeDTmAhByg== + dependencies: + conf "^9.0.0" + fast-xml-parser "4.2.5" + mime-types "^2.1.24" + request "^2.88.2" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + +debounce-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/debounce-fn/-/debounce-fn-4.0.0.tgz#ed76d206d8a50e60de0dd66d494d82835ffe61c7" + integrity sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ== + dependencies: + mimic-fn "^3.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +dot-prop@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" + integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== + dependencies: + is-obj "^2.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-xml-parser@4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz#a6747a09296a6cb34f2ae634019bf1738f3b421f" + integrity sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g== + dependencies: + strnum "^1.0.5" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-schema-typed@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/json-schema-typed/-/json-schema-typed-7.0.3.tgz#23ff481b8b4eebcd2ca123b4fa0409e66469a2d9" + integrity sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A== + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@^2.1.24, mime-types@~2.1.19: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-fn@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" + integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + +pkg-up@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" + integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA== + dependencies: + find-up "^3.0.0" + +psl@^1.1.28: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.0, punycode@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +request@^2.88.2: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^6.0.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +sshpk@^1.7.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +strnum@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" + integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== + +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From d8ebbc056b9fe20328422f85540ef3633df01dcc Mon Sep 17 00:00:00 2001 From: tiye Date: Sun, 17 Sep 2023 23:53:41 +0800 Subject: [PATCH 2/4] doc about config file --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 3a6dac2..b04dd07 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,17 @@ COS upload > dirty script providing a server. +Format for `secrets.cirru`: + +```cirru +{} + :bucket |TODO + :app-id |TODO + :secret |TODO + :user |TODO + :pass-md5 |TODO +``` + ### Workflow https://github.com/calcit-lang/calcit-workflow From 59b4e36a08a9ec54d20d5a96f3a2b415961523ab Mon Sep 17 00:00:00 2001 From: tiye Date: Sun, 17 Sep 2023 23:54:37 +0800 Subject: [PATCH 3/4] fixing CI script --- .github/workflows/tests.yaml | 4 ++-- package.cirru | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b042660..a49e609 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,6 +30,6 @@ jobs: version: '0.8.1' - name: "test" - run: caps --ci && cr -1 --entry test + run: caps --ci - - run: cr --emit-js -1 --entry test && yarn && node ./main.mjs + - run: cr --emit-ir -1 diff --git a/package.cirru b/package.cirru index 857fbab..626e24d 100644 --- a/package.cirru +++ b/package.cirru @@ -2,3 +2,4 @@ {} :dependencies $ {} |calcit-lang/skir |main + |calcit-lang/lilac |main From 3d799abd488a0708a85cd4523f085d35ef312676 Mon Sep 17 00:00:00 2001 From: tiye Date: Mon, 18 Sep 2023 02:15:00 +0800 Subject: [PATCH 4/4] add CORS headers --- README.md | 6 ++++ calcit.cirru | 86 ++++++++++++++++++++++++++++++++++++++------------- compact.cirru | 13 +++++--- 3 files changed, 79 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index b04dd07..c7db0f1 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Format for `secrets.cirru`: :pass-md5 |TODO ``` +Dev request: + +```bash +curl -X POST http://localhost:4000/token -d "{} (:user |me) (:pass |aaaa) (:file-key |demo)" +``` + ### Workflow https://github.com/calcit-lang/calcit-workflow diff --git a/calcit.cirru b/calcit.cirru index 956ed91..d11a674 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -101,7 +101,7 @@ |b $ %{} :Expr (:at 1694965419151) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |:SecretId) - |b $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |secret) + |b $ %{} :Leaf (:at 1694973692235) (:by |u0) (:text |app-id) |h $ %{} :Expr (:at 1694965419151) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694965419151) (:by |u0) (:text |:SecretKey) @@ -143,7 +143,7 @@ |q $ %{} :Expr (:at 1694964176301) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694964177572) (:by |u0) (:text |:Sign) - |b $ %{} :Leaf (:at 1694964178352) (:by |u0) (:text |true) + |b $ %{} :Leaf (:at 1694973219376) (:by |u0) (:text |true) |h $ %{} :Expr (:at 1694964179797) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694964180148) (:by |u0) (:text |fn) @@ -197,6 +197,16 @@ :data $ {} |T $ %{} :Leaf (:at 1694964205531) (:by |u0) (:text |:code) |b $ %{} :Leaf (:at 1694964209294) (:by |u0) (:text |200) + |e $ %{} :Expr (:at 1694972076546) (:by |u0) + :data $ {} + |D $ %{} :Leaf (:at 1694972078211) (:by |u0) (:text |:headers) + |T $ %{} :Expr (:at 1694972056828) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694972056828) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694972075657) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694972056828) (:by |u0) (:text "|\"Access-Control-Allow-Origin") + |b $ %{} :Leaf (:at 1694972056828) (:by |u0) (:text "|\"*") |h $ %{} :Expr (:at 1694964210133) (:by |u0) :data $ {} |T $ %{} :Leaf (:at 1694964214934) (:by |u0) (:text |:body) @@ -409,33 +419,65 @@ :data $ {} |T $ %{} :Leaf (:at 1694963060708) (:by |u0) (:text |:message) |b $ %{} :Leaf (:at 1694963069312) (:by |u0) (:text "|\"not open for all users...") - |T $ %{} :Expr (:at 1694961781144) (:by |u0) + |T $ %{} :Expr (:at 1694971986856) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961784635) (:by |u0) (:text |{}) - |b $ %{} :Expr (:at 1694961785982) (:by |u0) + |D $ %{} :Leaf (:at 1694971987353) (:by |u0) (:text |if) + |L $ %{} :Expr (:at 1694971988850) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961786536) (:by |u0) (:text |:code) - |b $ %{} :Leaf (:at 1694962696757) (:by |u0) (:text |404) - |h $ %{} :Expr (:at 1694961788900) (:by |u0) - :data $ {} - |T $ %{} :Leaf (:at 1694961791544) (:by |u0) (:text |:message) - |b $ %{} :Leaf (:at 1694962702571) (:by |u0) (:text "|\"Non hit") - |l $ %{} :Expr (:at 1694961793252) (:by |u0) + |T $ %{} :Leaf (:at 1694971988991) (:by |u0) (:text |=) + |b $ %{} :Leaf (:at 1694971990734) (:by |u0) (:text |:options) + |h $ %{} :Expr (:at 1694971993209) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694971993209) (:by |u0) (:text |:method) + |b $ %{} :Leaf (:at 1694971993209) (:by |u0) (:text |req-data) + |P $ %{} :Expr (:at 1694971994407) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961794463) (:by |u0) (:text |:headers) - |b $ %{} :Expr (:at 1694961794720) (:by |u0) + |T $ %{} :Leaf (:at 1694971994833) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694971995542) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694971996492) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694972000861) (:by |u0) (:text |200) + |h $ %{} :Expr (:at 1694972001896) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694972003323) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694972004128) (:by |u0) (:text "|\"OK") + |l $ %{} :Expr (:at 1694972006038) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961794988) (:by |u0) (:text |{}) - |o $ %{} :Expr (:at 1694961795807) (:by |u0) + |T $ %{} :Leaf (:at 1694972007672) (:by |u0) (:text |:headers) + |b $ %{} :Expr (:at 1694972008020) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694972008294) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694972008835) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694972024712) (:by |u0) (:text "|\"Access-Control-Allow-Origin") + |b $ %{} :Leaf (:at 1694972026676) (:by |u0) (:text "|\"*") + |T $ %{} :Expr (:at 1694961781144) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961796481) (:by |u0) (:text |:body) - |b $ %{} :Expr (:at 1694961796748) (:by |u0) + |T $ %{} :Leaf (:at 1694961784635) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694961785982) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961786536) (:by |u0) (:text |:code) + |b $ %{} :Leaf (:at 1694962696757) (:by |u0) (:text |404) + |h $ %{} :Expr (:at 1694961788900) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961791544) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694962702571) (:by |u0) (:text "|\"Non hit") + |l $ %{} :Expr (:at 1694961793252) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694961797097) (:by |u0) (:text |{}) - |b $ %{} :Expr (:at 1694962000326) (:by |u0) + |T $ %{} :Leaf (:at 1694961794463) (:by |u0) (:text |:headers) + |b $ %{} :Expr (:at 1694961794720) (:by |u0) :data $ {} - |T $ %{} :Leaf (:at 1694962001801) (:by |u0) (:text |:message) - |b $ %{} :Leaf (:at 1694962712108) (:by |u0) (:text "|\"only token is impelemented") + |T $ %{} :Leaf (:at 1694961794988) (:by |u0) (:text |{}) + |o $ %{} :Expr (:at 1694961795807) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961796481) (:by |u0) (:text |:body) + |b $ %{} :Expr (:at 1694961796748) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694961797097) (:by |u0) (:text |{}) + |b $ %{} :Expr (:at 1694962000326) (:by |u0) + :data $ {} + |T $ %{} :Leaf (:at 1694962001801) (:by |u0) (:text |:message) + |b $ %{} :Leaf (:at 1694962712108) (:by |u0) (:text "|\"only token is impelemented") |reload! $ %{} :CodeEntry (:doc |) :code $ %{} :Expr (:at 1606310753106) (:by |u0) :data $ {} diff --git a/compact.cirru b/compact.cirru index 0737cbc..1f3b958 100644 --- a/compact.cirru +++ b/compact.cirru @@ -25,7 +25,7 @@ defn handle-token (bucket app-id secret file-key cb) &let cos-obj $ new COS - js-object (:SecretId secret) (:SecretKey secret) + js-object (:SecretId app-id) (:SecretKey secret) w-js-log $ .!getObjectUrl cos-obj js-object (:Bucket bucket) (:Region "\"ap-hongkong") :Key $ str "\"cos-up/" (or file-key "\"demo0") @@ -37,6 +37,7 @@ :body $ {} :message $ str err cb $ {} (:code 200) + :headers $ {} ("\"Access-Control-Allow-Origin" "\"*") :body $ {} :url $ .-Url data |main! $ %{} :CodeEntry (:doc |) @@ -70,9 +71,13 @@ {} (:code 403) (:message "\"Not user") :headers $ {} :body $ {} (:message "\"not open for all users...") - {} (:code 404) (:message "\"Non hit") - :headers $ {} - :body $ {} (:message "\"only token is impelemented") + if + = :options $ :method req-data + {} (:code 200) (:message "\"OK") + :headers $ {} ("\"Access-Control-Allow-Origin" "\"*") + {} (:code 404) (:message "\"Non hit") + :headers $ {} + :body $ {} (:message "\"only token is impelemented") |reload! $ %{} :CodeEntry (:doc |) :code $ quote defn reload! () (skir/reset-req-handler! on-request!) (println "\"Reloaded.")