From 0d98663c8402a11ed480b918e1b2201c563c0c4d Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 13 Aug 2024 05:35:48 +0000 Subject: [PATCH 1/7] add a minimal example that works --- sdk/purescript/demo/.gitignore | 10 ++ sdk/purescript/demo/.npmrc | 1 + sdk/purescript/demo/README.md | 15 +++ sdk/purescript/demo/bun.lockb | Bin 0 -> 7286 bytes sdk/purescript/demo/index.ts | 5 + sdk/purescript/demo/package.json | 14 +++ sdk/purescript/demo/packages.dhall | 105 ++++++++++++++++++ sdk/purescript/demo/spago.dhall | 17 +++ sdk/purescript/demo/src/FluentCI/Cache.purs | 3 + sdk/purescript/demo/src/FluentCI/Client.js | 70 ++++++++++++ sdk/purescript/demo/src/FluentCI/Client.purs | 18 +++ sdk/purescript/demo/src/FluentCI/Devbox.purs | 4 + sdk/purescript/demo/src/FluentCI/Devenv.purs | 4 + .../demo/src/FluentCI/Directory.purs | 4 + sdk/purescript/demo/src/FluentCI/Envhub.purs | 4 + sdk/purescript/demo/src/FluentCI/File.purs | 4 + sdk/purescript/demo/src/FluentCI/Flox.purs | 3 + sdk/purescript/demo/src/FluentCI/Git.purs | 3 + sdk/purescript/demo/src/FluentCI/Mise.purs | 3 + sdk/purescript/demo/src/FluentCI/Nix.purs | 3 + .../demo/src/FluentCI/Pipeline.purs | 3 + sdk/purescript/demo/src/FluentCI/Pixi.purs | 3 + sdk/purescript/demo/src/FluentCI/Pkgx.purs | 3 + sdk/purescript/demo/src/FluentCI/Secret.js | 8 ++ sdk/purescript/demo/src/FluentCI/Secret.purs | 15 +++ .../demo/src/FluentCI/SecretManager.purs | 3 + sdk/purescript/demo/src/FluentCI/Service.purs | 3 + sdk/purescript/demo/src/Main.purs | 16 +++ sdk/purescript/demo/test/Main.purs | 11 ++ sdk/purescript/demo/tsconfig.json | 27 +++++ 30 files changed, 382 insertions(+) create mode 100644 sdk/purescript/demo/.gitignore create mode 100644 sdk/purescript/demo/.npmrc create mode 100644 sdk/purescript/demo/README.md create mode 100755 sdk/purescript/demo/bun.lockb create mode 100644 sdk/purescript/demo/index.ts create mode 100644 sdk/purescript/demo/package.json create mode 100644 sdk/purescript/demo/packages.dhall create mode 100644 sdk/purescript/demo/spago.dhall create mode 100644 sdk/purescript/demo/src/FluentCI/Cache.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Client.js create mode 100644 sdk/purescript/demo/src/FluentCI/Client.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Devbox.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Devenv.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Directory.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Envhub.purs create mode 100644 sdk/purescript/demo/src/FluentCI/File.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Flox.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Git.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Mise.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Nix.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Pipeline.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Pixi.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Pkgx.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Secret.js create mode 100644 sdk/purescript/demo/src/FluentCI/Secret.purs create mode 100644 sdk/purescript/demo/src/FluentCI/SecretManager.purs create mode 100644 sdk/purescript/demo/src/FluentCI/Service.purs create mode 100644 sdk/purescript/demo/src/Main.purs create mode 100644 sdk/purescript/demo/test/Main.purs create mode 100644 sdk/purescript/demo/tsconfig.json diff --git a/sdk/purescript/demo/.gitignore b/sdk/purescript/demo/.gitignore new file mode 100644 index 0000000..30efe19 --- /dev/null +++ b/sdk/purescript/demo/.gitignore @@ -0,0 +1,10 @@ +/bower_components/ +/node_modules/ +/.pulp-cache/ +/output/ +/generated-docs/ +/.psc-package/ +/.psc* +/.purs* +/.psa* +/.spago diff --git a/sdk/purescript/demo/.npmrc b/sdk/purescript/demo/.npmrc new file mode 100644 index 0000000..41583e3 --- /dev/null +++ b/sdk/purescript/demo/.npmrc @@ -0,0 +1 @@ +@jsr:registry=https://npm.jsr.io diff --git a/sdk/purescript/demo/README.md b/sdk/purescript/demo/README.md new file mode 100644 index 0000000..efe0fcb --- /dev/null +++ b/sdk/purescript/demo/README.md @@ -0,0 +1,15 @@ +# demo + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.1.22. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/sdk/purescript/demo/bun.lockb b/sdk/purescript/demo/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..abb96ba3adbda7f7f7d051ff55938926b13f3369 GIT binary patch literal 7286 zcmeHMc~q0f7Edsuz*E_@h({ZE7AlZ0Blw0T2Vktk=BBWr&4jFD7ICr@7|D+uWB)`ujjn?hxeS1nfYdZzkBD- z+?g+zf7dOXFO>KmhH1xTHU^pcN97+hoL(*~{%Y;B%C^||c6iNf z+!66EZ|S@z`6DK&9*Jx#N4mV1om+J8Ok2vh0nHWeJ7;D*EdI1&WWP0L!>hMjHF!1^ zIkawynKmY1Z1}b2+{5c89{SztLGZV;lg=8BIX2xn<-w}k((|e2w`?={L1}h}-}5q3 zde?N!$vawDo0G6J@}g|#I~pg)^^#>U-Tz8()ljCvO61gJ-Co z3$>jQ={1fL7| z@qowmvxZ0CbtL%j0gv&E`wp>agFZs=)&Ro&hgf`oPH(}rCJ*sDmiUguB9^!=c-~?O zXS8dKyMsfg%vn9{L`>N*>0zI5BM}(K0-LVB@k4VxbU!_${B-q(&WNhox3lkm(lsL}fx(OC3=xh;%;p0f*|+x2z2aB0xTz|A zl%a)D#OYO!K0j_}RQqUm`IS?ahnmW{XBLXQ8y3Yi-MU?|aAD}Wype8+2_4PSrTZDY zcy1Bl{OnLXwW#2i?(^e2*t}pbGr`Aeb|&tryC!_L*{U>Qj$L?Ot_7Vud$LSYZdz|X zziw^iXxp5`-y(xKxhD&XZY*N(GS6$y7dggh9t#^}!%So8i2}LZRv zN;GN8S2Fh*^M2!$eto*VQMS}KrY7ETyg^OItct+WMqiJQBoSeoE%Sa*7oBo%pp$({ z)DbpwoU7THr)i(`9GPoBpO5>;tq5|=W7td1f3%rnH+%EA_Fd`;#{1^1$SQbyfyQz{ zgv*`kap!!mb;qhpJoc2@+?bs`^ZaQ3v2{5gB=ld*Pfa|q)#jILC#DY#?^s#H;Kloc z2&eU%3tNAmbj0sw-6El*t#{FKLoqwuthn{4UtM~}naf*)ep%4M-ne9GY~`R~LqE$h zi|Rh!6td`K%tVLOiK80@nG9a$cLGQF{gH>K*0QDyxwBU^#bnmlZTGw$c21TB-u&i5 z{lFHBtB0m;xE1>IwzFmz6KcM44m{5(GvYp8ogb?1_W-#YNcmSZ zyjhyR;Eq@dTH-KcBDQk1hi~4apaovP0Y`XUe%}R@g%_P6G|(VQLAj zX0aSV59ro(881$|?da5Kz{X!!m@Ok&Gm@<`U^`O+N(jAK@PLgPk_R(jyF(ACVUdg- z$&?weT`7SFB^0nou8!o$4A>zq0D_K&Nz~EY~y$1 zMxs!QWTBz7c)1^G@v-qzcZ6CUO^@aC0Zc(BB~$W~_yPg{<&k`6$`uw?EnTVYQ`0h4 z0<93MLPH@F&WogVTal-dtcZcQA;c<)R7R^+2^46Eq$#CJ%I^sQK2KNS=>h<$`#`@U$U@EFzVXrg`BKwJ5@m3_>@Fd19p~CJLOxQz*p}zDTK(yj~+ilfa$w>hVDz zu-B>tLe$K2p&*9QUWg@6%9)#($b}jx(A5MGETjstMydcJRTo`VfGgAUR-lbo?EtX$ z`CAXH_F*)`WoTZn1HnoGSO-?3%X*yJ2T$)Hpy_S!gcMo;EO8NG>NqJcMkViqrFRgp z^fq|fxoKG>%Vc6XPoz{pP|-4_g6@m$rNPMh(o2{ro@roXA6$6c0U8S)c$9Ksj(=qk zy%Z=ANN`Coaj%Gx-mnI3_%9|rA>9##4QNAt87gVv8dr)|#(+s8Dt ZUeF$zK+xL&ONuucE~ literal 0 HcmV?d00001 diff --git a/sdk/purescript/demo/index.ts b/sdk/purescript/demo/index.ts new file mode 100644 index 0000000..403be0e --- /dev/null +++ b/sdk/purescript/demo/index.ts @@ -0,0 +1,5 @@ +import { main } from "./output/Main"; + +console.log("Hello via Bun!"); + +main(); diff --git a/sdk/purescript/demo/package.json b/sdk/purescript/demo/package.json new file mode 100644 index 0000000..ed83a41 --- /dev/null +++ b/sdk/purescript/demo/package.json @@ -0,0 +1,14 @@ +{ + "name": "demo", + "module": "index.ts", + "type": "module", + "devDependencies": { + "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "dependencies": { + "@fluentci/sdk": "npm:@jsr/fluentci__sdk" + } +} \ No newline at end of file diff --git a/sdk/purescript/demo/packages.dhall b/sdk/purescript/demo/packages.dhall new file mode 100644 index 0000000..dc350c8 --- /dev/null +++ b/sdk/purescript/demo/packages.dhall @@ -0,0 +1,105 @@ +{- +Welcome to your new Dhall package-set! + +Below are instructions for how to edit this file for most use +cases, so that you don't need to know Dhall to use it. + +## Use Cases + +Most will want to do one or both of these options: +1. Override/Patch a package's dependency +2. Add a package not already in the default package set + +This file will continue to work whether you use one or both options. +Instructions for each option are explained below. + +### Overriding/Patching a package + +Purpose: +- Change a package's dependency to a newer/older release than the + default package set's release +- Use your own modified version of some dependency that may + include new API, changed API, removed API by + using your custom git repo of the library rather than + the package set's repo + +Syntax: +where `entityName` is one of the following: +- dependencies +- repo +- version +------------------------------- +let upstream = -- +in upstream + with packageName.entityName = "new value" +------------------------------- + +Example: +------------------------------- +let upstream = -- +in upstream + with halogen.version = "master" + with halogen.repo = "https://example.com/path/to/git/repo.git" + + with halogen-vdom.version = "v4.0.0" + with halogen-vdom.dependencies = [ "extra-dependency" ] # halogen-vdom.dependencies +------------------------------- + +### Additions + +Purpose: +- Add packages that aren't already included in the default package set + +Syntax: +where `` is: +- a tag (i.e. "v4.0.0") +- a branch (i.e. "master") +- commit hash (i.e. "701f3e44aafb1a6459281714858fadf2c4c2a977") +------------------------------- +let upstream = -- +in upstream + with new-package-name = + { dependencies = + [ "dependency1" + , "dependency2" + ] + , repo = + "https://example.com/path/to/git/repo.git" + , version = + "" + } +------------------------------- + +Example: +------------------------------- +let upstream = -- +in upstream + with benchotron = + { dependencies = + [ "arrays" + , "exists" + , "profunctor" + , "strings" + , "quickcheck" + , "lcg" + , "transformers" + , "foldable-traversable" + , "exceptions" + , "node-fs" + , "node-buffer" + , "node-readline" + , "datetime" + , "now" + ] + , repo = + "https://github.com/hdgarrood/purescript-benchotron.git" + , version = + "v7.0.0" + } +------------------------------- +-} +let upstream = + https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20240812/packages.dhall + sha256:557dc416167543923d0f944fdc0c7bc3e0466b9467a8fc2fba0460f8d5425725 + +in upstream diff --git a/sdk/purescript/demo/spago.dhall b/sdk/purescript/demo/spago.dhall new file mode 100644 index 0000000..0457830 --- /dev/null +++ b/sdk/purescript/demo/spago.dhall @@ -0,0 +1,17 @@ +{- +Welcome to a Spago project! +You can edit this file as you like. + +Need help? See the following resources: +- Spago documentation: https://github.com/purescript/spago +- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html + +When creating a new Spago project, you can use +`spago init --no-comments` or `spago init -C` +to generate this file without the comments in this block. +-} +{ name = "my-project" +, dependencies = [ "aff", "console", "effect", "prelude" ] +, packages = ./packages.dhall +, sources = [ "src/**/*.purs", "test/**/*.purs" ] +} diff --git a/sdk/purescript/demo/src/FluentCI/Cache.purs b/sdk/purescript/demo/src/FluentCI/Cache.purs new file mode 100644 index 0000000..b9d0bdf --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Cache.purs @@ -0,0 +1,3 @@ +module FluentCI.Cache where + +data Cache \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Client.js b/sdk/purescript/demo/src/FluentCI/Client.js new file mode 100644 index 0000000..3de8728 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Client.js @@ -0,0 +1,70 @@ +import { dag } from "@fluentci/sdk"; + +export { dag }; + +export function awsSecretsManager(c) { + return function (client) { + return function (region) { + return function (accessKeyId) { + return function (clientSecret) { + return function (tenantId) { + return function (keyvaultName) { + return function (keyvaultUrl) { + return function () { + return c.awsSecretsManager({ + client, + region, + accessKeyId, + clientSecret, + tenantId, + keyvaultName, + keyvaultUrl, + }); + }; + }; + }; + }; + }; + }; + }; + }; +} + +export function azureKeyvault(c) { + return function (clientId) { + return function (clientSecret) { + return function (tenantId) { + return function (keyvaultName) { + return function (keyvaultUrl) { + return function () { + return c.azureKeyvault({ + clientId, + clientSecret, + tenantId, + keyvaultName, + keyvaultUrl, + }); + }; + }; + }; + }; + }; + }; +} +export function cache(c) { + return function (key) { + return function () { + return c.cache(key); + }; + }; +} + +export function setSecret(c) { + return function (name) { + return function (value) { + return function () { + return c.setSecret(name, value); + }; + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Client.purs b/sdk/purescript/demo/src/FluentCI/Client.purs new file mode 100644 index 0000000..9ae15d8 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Client.purs @@ -0,0 +1,18 @@ +module FluentCI.Client where + +import Effect (Effect) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.SecretManager (SecretManager) + +data Client + +foreign import dag :: Client + +foreign import setSecret :: Client -> String -> String -> Effect Secret + +foreign import awsSecretsManager :: Client -> String -> String -> String -> String -> Effect SecretManager + +foreign import azureKeyvault :: Client -> String -> String -> String -> String -> String -> Effect SecretManager + +foreign import cache :: Client -> String -> Effect Cache \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.purs b/sdk/purescript/demo/src/FluentCI/Devbox.purs new file mode 100644 index 0000000..fd6a4ce --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Devbox.purs @@ -0,0 +1,4 @@ +module FluentCI.Devbox where + + +data Devbox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.purs b/sdk/purescript/demo/src/FluentCI/Devenv.purs new file mode 100644 index 0000000..8c994fc --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Devenv.purs @@ -0,0 +1,4 @@ +module FluentCI.Devenv where + + +data Devenv \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Directory.purs b/sdk/purescript/demo/src/FluentCI/Directory.purs new file mode 100644 index 0000000..8f8b08e --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Directory.purs @@ -0,0 +1,4 @@ +module FluentCI.Directory where + + +data Directory \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.purs b/sdk/purescript/demo/src/FluentCI/Envhub.purs new file mode 100644 index 0000000..fed8420 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Envhub.purs @@ -0,0 +1,4 @@ +module FluentCI.Envhub where + + +data Envhub \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/File.purs b/sdk/purescript/demo/src/FluentCI/File.purs new file mode 100644 index 0000000..c14bbc2 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/File.purs @@ -0,0 +1,4 @@ +module File where + + +data File \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Flox.purs b/sdk/purescript/demo/src/FluentCI/Flox.purs new file mode 100644 index 0000000..b3447a8 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Flox.purs @@ -0,0 +1,3 @@ +module FluentCI.Flox where + +data Flox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Git.purs b/sdk/purescript/demo/src/FluentCI/Git.purs new file mode 100644 index 0000000..2c63628 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Git.purs @@ -0,0 +1,3 @@ +module FluentCI.Git where + +data Git \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Mise.purs b/sdk/purescript/demo/src/FluentCI/Mise.purs new file mode 100644 index 0000000..394608d --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Mise.purs @@ -0,0 +1,3 @@ +module FluentCI.Mise where + +data Mise \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Nix.purs b/sdk/purescript/demo/src/FluentCI/Nix.purs new file mode 100644 index 0000000..b370c4e --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Nix.purs @@ -0,0 +1,3 @@ +module FluentCI.Nix where + +data Nix \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.purs b/sdk/purescript/demo/src/FluentCI/Pipeline.purs new file mode 100644 index 0000000..b9a1d0c --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pipeline.purs @@ -0,0 +1,3 @@ +module FluentCI.Pipeline where + +data Pipeline \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.purs b/sdk/purescript/demo/src/FluentCI/Pixi.purs new file mode 100644 index 0000000..54f21a7 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pixi.purs @@ -0,0 +1,3 @@ +module FluentCI.Pixi where + +data Pixi \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.purs b/sdk/purescript/demo/src/FluentCI/Pkgx.purs new file mode 100644 index 0000000..b3d0116 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pkgx.purs @@ -0,0 +1,3 @@ +module FluentCI.Pkgx where + +data Pkgx \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Secret.js b/sdk/purescript/demo/src/FluentCI/Secret.js new file mode 100644 index 0000000..f0c6ac2 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Secret.js @@ -0,0 +1,8 @@ +export function _plaintext(s) { + return function (onError, onSuccess) { + s.plaintext().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Secret.purs b/sdk/purescript/demo/src/FluentCI/Secret.purs new file mode 100644 index 0000000..9a51166 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Secret.purs @@ -0,0 +1,15 @@ +module FluentCI.Secret where + +import Prelude + +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) + + +data Secret + + +foreign import _plaintext :: Secret -> EffectFnAff String + +plaintext :: Secret -> Aff String +plaintext secret = fromEffectFnAff $ _plaintext secret \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/SecretManager.purs b/sdk/purescript/demo/src/FluentCI/SecretManager.purs new file mode 100644 index 0000000..fe12a72 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/SecretManager.purs @@ -0,0 +1,3 @@ +module FluentCI.SecretManager where + +data SecretManager \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Service.purs b/sdk/purescript/demo/src/FluentCI/Service.purs new file mode 100644 index 0000000..6e5444b --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Service.purs @@ -0,0 +1,3 @@ +module Service where + +data Service \ No newline at end of file diff --git a/sdk/purescript/demo/src/Main.purs b/sdk/purescript/demo/src/Main.purs new file mode 100644 index 0000000..359523b --- /dev/null +++ b/sdk/purescript/demo/src/Main.purs @@ -0,0 +1,16 @@ +module Main where + +import Prelude + +import Effect (Effect) +import Effect.Aff (launchAff_) +import Effect.Class (liftEffect) +import Effect.Class.Console as Console +import FluentCI.Client (dag, setSecret) +import FluentCI.Secret (plaintext) + +main :: Effect Unit +main = launchAff_ do + secret <- liftEffect $ setSecret dag "secret" "value 123" + result <- plaintext secret + Console.log result diff --git a/sdk/purescript/demo/test/Main.purs b/sdk/purescript/demo/test/Main.purs new file mode 100644 index 0000000..f91f98c --- /dev/null +++ b/sdk/purescript/demo/test/Main.purs @@ -0,0 +1,11 @@ +module Test.Main where + +import Prelude + +import Effect (Effect) +import Effect.Class.Console (log) + +main :: Effect Unit +main = do + log "🍝" + log "You should add some tests." diff --git a/sdk/purescript/demo/tsconfig.json b/sdk/purescript/demo/tsconfig.json new file mode 100644 index 0000000..238655f --- /dev/null +++ b/sdk/purescript/demo/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + // Enable latest features + "lib": ["ESNext", "DOM"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +} From dfb16eddfcf0f666d913ff971b89cc96426113a8 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 13 Aug 2024 19:46:24 +0000 Subject: [PATCH 2/7] add purescript bindings --- sdk/purescript/demo/index.ts | 2 - sdk/purescript/demo/src/FluentCI/Cache.js | 19 ++ sdk/purescript/demo/src/FluentCI/Cache.purs | 16 +- sdk/purescript/demo/src/FluentCI/Client.js | 113 +++++++++++ sdk/purescript/demo/src/FluentCI/Client.purs | 45 ++++- sdk/purescript/demo/src/FluentCI/Devbox.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Devbox.purs | 43 +++- sdk/purescript/demo/src/FluentCI/Devenv.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Devenv.purs | 42 +++- sdk/purescript/demo/src/FluentCI/Directory.js | 185 ++++++++++++++++++ .../demo/src/FluentCI/Directory.purs | 75 ++++++- sdk/purescript/demo/src/FluentCI/Envhub.js | 102 ++++++++++ sdk/purescript/demo/src/FluentCI/Envhub.purs | 43 +++- sdk/purescript/demo/src/FluentCI/File.js | 71 +++++++ sdk/purescript/demo/src/FluentCI/File.purs | 42 +++- sdk/purescript/demo/src/FluentCI/Flox.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Flox.purs | 43 +++- sdk/purescript/demo/src/FluentCI/Git.js | 31 +++ sdk/purescript/demo/src/FluentCI/Git.purs | 23 ++- sdk/purescript/demo/src/FluentCI/Mise.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Mise.purs | 43 +++- sdk/purescript/demo/src/FluentCI/Nix.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Nix.purs | 45 ++++- sdk/purescript/demo/src/FluentCI/Pipeline.js | 136 +++++++++++++ .../demo/src/FluentCI/Pipeline.purs | 63 +++++- sdk/purescript/demo/src/FluentCI/Pixi.js | 94 +++++++++ sdk/purescript/demo/src/FluentCI/Pixi.purs | 43 +++- sdk/purescript/demo/src/FluentCI/Pkgx.js | 102 ++++++++++ sdk/purescript/demo/src/FluentCI/Pkgx.purs | 45 ++++- sdk/purescript/demo/src/FluentCI/Secret.js | 27 +++ sdk/purescript/demo/src/FluentCI/Secret.purs | 16 ++ .../demo/src/FluentCI/SecretManager.js | 19 ++ .../demo/src/FluentCI/SecretManager.purs | 17 +- sdk/purescript/demo/src/FluentCI/Service.js | 8 + sdk/purescript/demo/src/FluentCI/Service.purs | 14 +- sdk/purescript/demo/src/Main.purs | 16 +- 36 files changed, 2027 insertions(+), 26 deletions(-) create mode 100644 sdk/purescript/demo/src/FluentCI/Cache.js create mode 100644 sdk/purescript/demo/src/FluentCI/Devbox.js create mode 100644 sdk/purescript/demo/src/FluentCI/Devenv.js create mode 100644 sdk/purescript/demo/src/FluentCI/Directory.js create mode 100644 sdk/purescript/demo/src/FluentCI/Envhub.js create mode 100644 sdk/purescript/demo/src/FluentCI/File.js create mode 100644 sdk/purescript/demo/src/FluentCI/Flox.js create mode 100644 sdk/purescript/demo/src/FluentCI/Git.js create mode 100644 sdk/purescript/demo/src/FluentCI/Mise.js create mode 100644 sdk/purescript/demo/src/FluentCI/Nix.js create mode 100644 sdk/purescript/demo/src/FluentCI/Pipeline.js create mode 100644 sdk/purescript/demo/src/FluentCI/Pixi.js create mode 100644 sdk/purescript/demo/src/FluentCI/Pkgx.js create mode 100644 sdk/purescript/demo/src/FluentCI/SecretManager.js create mode 100644 sdk/purescript/demo/src/FluentCI/Service.js diff --git a/sdk/purescript/demo/index.ts b/sdk/purescript/demo/index.ts index 403be0e..1ad2d81 100644 --- a/sdk/purescript/demo/index.ts +++ b/sdk/purescript/demo/index.ts @@ -1,5 +1,3 @@ import { main } from "./output/Main"; -console.log("Hello via Bun!"); - main(); diff --git a/sdk/purescript/demo/src/FluentCI/Cache.js b/sdk/purescript/demo/src/FluentCI/Cache.js new file mode 100644 index 0000000..0339fe2 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Cache.js @@ -0,0 +1,19 @@ +export function _id(c) { + return function (id) { + return function (onError, onSuccess) { + c.id(id).then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; + }; +} + +export function _key(c) { + return function (onError, onSuccess) { + c.key().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Cache.purs b/sdk/purescript/demo/src/FluentCI/Cache.purs index b9d0bdf..a593391 100644 --- a/sdk/purescript/demo/src/FluentCI/Cache.purs +++ b/sdk/purescript/demo/src/FluentCI/Cache.purs @@ -1,3 +1,17 @@ module FluentCI.Cache where -data Cache \ No newline at end of file +import Prelude +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) + +data Cache + +foreign import _id :: Cache -> EffectFnAff String + +foreign import _key :: Cache -> EffectFnAff String + +id :: Cache -> Aff String +id cache = fromEffectFnAff $ _id cache + +key :: Cache -> Aff String +key cache = fromEffectFnAff $ _key cache \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Client.js b/sdk/purescript/demo/src/FluentCI/Client.js index 3de8728..867d368 100644 --- a/sdk/purescript/demo/src/FluentCI/Client.js +++ b/sdk/purescript/demo/src/FluentCI/Client.js @@ -51,6 +51,7 @@ export function azureKeyvault(c) { }; }; } + export function cache(c) { return function (key) { return function () { @@ -59,6 +60,118 @@ export function cache(c) { }; } +export function devbox(c) { + return function () { + return c.devbox(); + }; +} + +export function devenv(c) { + return function () { + return c.devenv(); + }; +} + +export function directory(c) { + return function (path) { + return function () { + return c.directory(path); + }; + }; +} + +export function file(c) { + return function (path) { + return function () { + return c.file(path); + }; + }; +} + +export function flox(c) { + return function () { + return c.flox(); + }; +} + +export function git(c) { + return function (url) { + return function () { + return c.git(url); + }; + }; +} + +export function googleCloudSecretManager(c) { + return function (client) { + return function (project) { + return function (googleCredentialsFile) { + return function () { + return c.googleCloudSecretManager({ + client, + project, + googleCredentialsFile, + }); + }; + }; + }; + }; +} + +export function hashicorpVault(c) { + return function (address) { + return function (token) { + return function (cacerts) { + return function () { + return c.hashicorpVault(address, token, cacerts); + }; + }; + }; + }; +} + +export function http(c) { + return function (url) { + return function () { + return c.http(url); + }; + }; +} + +export function mise(c) { + return function () { + return c.mise(); + }; +} + +export function nix(c) { + return function (args) { + return function () { + return c.nix(args); + }; + }; +} + +export function pipeline(c) { + return function (name) { + return function () { + return c.pipeline(name); + }; + }; +} + +export function pixi(c) { + return function () { + return c.pixi(); + }; +} + +export function pkgx(c) { + return function () { + return c.pkgx(); + }; +} + export function setSecret(c) { return function (name) { return function (value) { diff --git a/sdk/purescript/demo/src/FluentCI/Client.purs b/sdk/purescript/demo/src/FluentCI/Client.purs index 9ae15d8..857f253 100644 --- a/sdk/purescript/demo/src/FluentCI/Client.purs +++ b/sdk/purescript/demo/src/FluentCI/Client.purs @@ -2,6 +2,16 @@ module FluentCI.Client where import Effect (Effect) import FluentCI.Cache (Cache) +import FluentCI.Devbox (Devbox) +import FluentCI.Devenv (Devenv) +import FluentCI.Directory (Directory, File) +import FluentCI.Flox (Flox) +import FluentCI.Git (Git) +import FluentCI.Mise (Mise) +import FluentCI.Nix (Nix, NixArgs) +import FluentCI.Pipeline (Pipeline) +import FluentCI.Pixi (Pixi) +import FluentCI.Pkgx (Pkgx) import FluentCI.Secret (Secret) import FluentCI.SecretManager (SecretManager) @@ -9,10 +19,39 @@ data Client foreign import dag :: Client -foreign import setSecret :: Client -> String -> String -> Effect Secret - foreign import awsSecretsManager :: Client -> String -> String -> String -> String -> Effect SecretManager foreign import azureKeyvault :: Client -> String -> String -> String -> String -> String -> Effect SecretManager -foreign import cache :: Client -> String -> Effect Cache \ No newline at end of file +foreign import cache :: Client -> String -> Effect Cache + +foreign import devbox :: Client -> Effect Devbox + +foreign import devenv :: Client -> Effect Devenv + +foreign import directory :: Client -> String -> Effect Directory + +foreign import file :: Client -> String -> Effect File + +foreign import flox :: Client -> Effect Flox + +foreign import git :: Client -> String -> Effect Git + +foreign import googleCloudSecretManager :: Client -> String -> String -> Effect SecretManager + +foreign import hashicorpVault :: Client -> String -> String -> String -> String -> Effect SecretManager + +foreign import http :: Client -> String -> Effect File + +foreign import mise :: Client -> Effect Mise + +foreign import nix :: Client -> NixArgs -> Effect Nix + +foreign import pipeline :: Client -> String -> Effect Pipeline + +foreign import pixi :: Client -> Effect Pixi + + +foreign import pkgx :: Client -> Effect Pkgx + +foreign import setSecret :: Client -> String -> String -> Effect Secret diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.js b/sdk/purescript/demo/src/FluentCI/Devbox.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Devbox.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.purs b/sdk/purescript/demo/src/FluentCI/Devbox.purs index fd6a4ce..deecc96 100644 --- a/sdk/purescript/demo/src/FluentCI/Devbox.purs +++ b/sdk/purescript/demo/src/FluentCI/Devbox.purs @@ -1,4 +1,45 @@ module FluentCI.Devbox where +import Prelude -data Devbox \ No newline at end of file +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + + +data Devbox + +foreign import _id :: Devbox -> EffectFnAff String + +foreign import _stderr :: Devbox -> EffectFnAff String + +foreign import _stdout :: Devbox -> EffectFnAff String + +foreign import asService :: Devbox -> Effect Service + + +id :: Devbox -> Aff String +id devbox = fromEffectFnAff $ _id devbox + +stderr :: Devbox -> Aff String +stderr devbox = fromEffectFnAff $ _stderr devbox + +stdout :: Devbox -> Aff String +stdout devbox = fromEffectFnAff $ _stdout devbox + +foreign import waitOn :: Devbox -> Int -> Int -> Effect Devbox + +foreign import withCache :: Devbox -> Cache -> Effect Devbox + +foreign import withEnvVariable :: Devbox -> String -> String -> Effect Devbox + +foreign import withExec :: Devbox -> Array String -> Effect Devbox + +foreign import withSecretVariable :: Devbox -> String -> Secret -> Effect Devbox + +foreign import withService :: Devbox -> Service -> Effect Devbox + +foreign import withWorkdir :: Devbox -> String -> Effect Devbox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.js b/sdk/purescript/demo/src/FluentCI/Devenv.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Devenv.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.purs b/sdk/purescript/demo/src/FluentCI/Devenv.purs index 8c994fc..48b5cac 100644 --- a/sdk/purescript/demo/src/FluentCI/Devenv.purs +++ b/sdk/purescript/demo/src/FluentCI/Devenv.purs @@ -1,4 +1,44 @@ module FluentCI.Devenv where +import Prelude -data Devenv \ No newline at end of file +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + + +data Devenv + +foreign import _id :: Devenv -> EffectFnAff String + +foreign import _stderr :: Devenv -> EffectFnAff String + +foreign import _stdout :: Devenv -> EffectFnAff String + +foreign import asService :: Devenv -> Effect Service + +foreign import waitOn :: Devenv -> Int -> Int -> Effect Devenv + +foreign import withCache :: Devenv -> Cache -> Effect Devenv + +foreign import withEnvVariable :: Devenv -> String -> String -> Effect Devenv + +foreign import withExec :: Devenv -> Array String -> Effect Devenv + +foreign import withSecretVariable :: Devenv -> String -> Secret -> Effect Devenv + +foreign import withService :: Devenv -> Service -> Effect Devenv + +foreign import withWorkdir :: Devenv -> String -> Effect Devenv + +id :: Devenv -> Aff String +id devenv = fromEffectFnAff $ _id devenv + +stderr :: Devenv -> Aff String +stderr devenv = fromEffectFnAff $ _stderr devenv + +stdout :: Devenv -> Aff String +stdout devenv = fromEffectFnAff $ _stdout devenv \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Directory.js b/sdk/purescript/demo/src/FluentCI/Directory.js new file mode 100644 index 0000000..7166302 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Directory.js @@ -0,0 +1,185 @@ +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function devbox(d) { + return function () { + return d.devbox(); + }; +} + +export function devenv(d) { + return function () { + return d.devenv(); + }; +} + +export function _entries(d) { + return function (onError, onSuccess) { + d.entries().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function flox(d) { + return function () { + return d.flox(); + }; +} + +export function mise(d) { + return function () { + return d.mise(); + }; +} + +export function nix(d) { + return function (args) { + return function () { + return d.nix(args); + }; + }; +} + +export function pixi(d) { + return function () { + return d.pixi(); + }; +} + +export function pkgx(d) { + return function () { + return d.pkgx(); + }; +} + +export function directory(d) { + return function (path) { + return function () { + return d.directory(path); + }; + }; +} + +export function _stderr() { + return function (onError, onSuccess) { + return function (d) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; + }; +} + +export function _stdout() { + return function (onError, onSuccess) { + return function (d) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; + }; +} + +export function waitOn() { + return function (port) { + return function (timeout) { + return function () { + return function (d) { + return d.waitOn(port, timeout); + }; + }; + }; + }; +} + +export function withCache() { + return function (cache) { + return function () { + return function (d) { + return d.withCache(cache); + }; + }; + }; +} + +export function withEnvVariable() { + return function (name) { + return function (value) { + return function () { + return function (d) { + return d.withEnvVariable(name, value); + }; + }; + }; + }; +} + +export function withExec() { + return function (command) { + return function () { + return function (d) { + return d.withExec(command); + }; + }; + }; +} + +export function withSecretVariable() { + return function (name) { + return function (secret) { + return function () { + return function (d) { + return d.withSecretVariable(name, secret); + }; + }; + }; + }; +} + +export function withService() { + return function (service) { + return function () { + return function (d) { + return d.withService(service); + }; + }; + }; +} + +export function withWorkdir(d) { + return function (path) { + return function () { + return d.withWorkdir(path); + }; + }; +} + +export function withFile(d) { + return function (path) { + return function () { + return d.withFile(path); + }; + }; +} + +export function zip(d) { + return function () { + return d.zip(); + }; +} + +export function tarCzvf(d) { + return function () { + return d.tarCzvf(); + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Directory.purs b/sdk/purescript/demo/src/FluentCI/Directory.purs index 8f8b08e..d130f00 100644 --- a/sdk/purescript/demo/src/FluentCI/Directory.purs +++ b/sdk/purescript/demo/src/FluentCI/Directory.purs @@ -1,4 +1,77 @@ module FluentCI.Directory where +import Prelude -data Directory \ No newline at end of file +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Devbox (Devbox) +import FluentCI.Devenv (Devenv) +import FluentCI.Flox (Flox) +import FluentCI.Mise (Mise) +import FluentCI.Nix (Nix) +import FluentCI.Pixi (Pixi) +import FluentCI.Pkgx (Pkgx) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + + +data Directory + +data File + +foreign import _id :: Directory -> EffectFnAff String + +foreign import _stderr :: Directory -> EffectFnAff String + +foreign import _stdout :: Directory -> EffectFnAff String + +foreign import _entries :: Directory -> EffectFnAff (Array String) + +id :: Directory -> Aff String +id dir = fromEffectFnAff $ _id dir + +stderr :: Directory -> Aff String +stderr dir = fromEffectFnAff $ _stderr dir + +stdout :: Directory -> Aff String +stdout dir = fromEffectFnAff $ _stdout dir + +entries :: Directory -> Aff (Array String) +entries dir = fromEffectFnAff $ _entries dir + +foreign import devbox :: Directory -> Aff Devbox + +foreign import devenv :: Directory -> Aff Devenv + +foreign import flox :: Directory -> Aff Flox + +foreign import mise :: Directory -> Aff Mise + +foreign import nix :: Directory -> Aff Nix + +foreign import pixi :: Directory -> Aff Pixi + +foreign import pkgx :: Directory -> Aff Pkgx + +foreign import directory :: Directory -> String -> Aff Directory + +foreign import tarCzvf :: Directory -> Aff File + +foreign import waitOn :: Directory -> Int -> Int -> Aff Directory + +foreign import withCache :: Directory -> Cache -> Aff Directory + +foreign import withEnvVariable :: Directory -> String -> String -> Aff Directory + +foreign import withExec :: Directory -> Array String -> Aff Directory + +foreign import withFile :: Directory -> String -> Aff Directory + +foreign import withSecretVariable :: Directory -> String -> Secret -> Aff Directory + +foreign import withService :: Directory -> Service -> Aff Directory + +foreign import withWorkdir :: Directory -> String -> Aff Directory + +foreign import zip :: Directory -> Aff File \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.js b/sdk/purescript/demo/src/FluentCI/Envhub.js new file mode 100644 index 0000000..a4828fc --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Envhub.js @@ -0,0 +1,102 @@ +export function _id(e) { + return function (onError, onSuccess) { + e.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function asService(e) { + return function () { + return e.asService(); + }; +} + +export function _stderr(e) { + return function (onError, onSuccess) { + e.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(e) { + return function (onError, onSuccess) { + e.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function use(e) { + return function (environement) { + return function () { + return e.use(environement); + }; + }; +} + +export function waitOn(e) { + return function (port) { + return function (timeout) { + return function () { + return e.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(e) { + return function (cache) { + return function () { + return e.withCache(cache); + }; + }; +} + +export function withEnvVariable(e) { + return function (name) { + return function (value) { + return function () { + return e.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(e) { + return function (command) { + return function () { + return e.withExec(command); + }; + }; +} + +export function withSecretVariable(e) { + return function (name) { + return function (secret) { + return function () { + return e.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(e) { + return function (service) { + return function () { + return e.withService(service); + }; + }; +} + +export function withWorkdir(e) { + return function (path) { + return function () { + return e.withWorkdir(path); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.purs b/sdk/purescript/demo/src/FluentCI/Envhub.purs index fed8420..2a04d49 100644 --- a/sdk/purescript/demo/src/FluentCI/Envhub.purs +++ b/sdk/purescript/demo/src/FluentCI/Envhub.purs @@ -1,4 +1,45 @@ module FluentCI.Envhub where +import Prelude -data Envhub \ No newline at end of file +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + + +data Envhub + +foreign import _id :: Envhub -> EffectFnAff String + +foreign import _stderr :: Envhub -> EffectFnAff String + +foreign import _stdout :: Envhub -> EffectFnAff String + +id :: Envhub -> Aff String +id envhub = fromEffectFnAff $ _id envhub + +stderr :: Envhub -> Aff String +stderr envhub = fromEffectFnAff $ _stderr envhub + +stdout :: Envhub -> Aff String +stdout envhub = fromEffectFnAff $ _stdout envhub + +foreign import use :: Envhub -> String -> Aff Envhub + +foreign import asService :: Envhub -> Aff Service + +foreign import waitOn :: Envhub -> Int -> Int -> Aff Envhub + +foreign import withCache :: Envhub -> Cache -> Aff Envhub + +foreign import withEnvVariable :: Envhub -> String -> String -> Aff Envhub + +foreign import withExec :: Envhub -> Array String -> Aff Envhub + +foreign import withSecretVariable :: Envhub -> String -> Secret -> Aff Envhub + +foreign import withService :: Envhub -> Service -> Aff Envhub + +foreign import withWorkdir :: Envhub -> String -> Aff Envhub \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/File.js b/sdk/purescript/demo/src/FluentCI/File.js new file mode 100644 index 0000000..92812ac --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/File.js @@ -0,0 +1,71 @@ +export function _id(f) { + return function (onError, onSuccess) { + f.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _chmod(f) { + return function (mode) { + return function () { + return f.chmod(mode); + }; + }; +} + +export function _md5(f) { + return function (onError, onSuccess) { + f.md5().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _path(f) { + return function (onError, onSuccess) { + f.path().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _sha256(f) { + return function (onError, onSuccess) { + f.sha256().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function tarCzvf(f) { + return function () { + return f.tarCzvf(); + }; +} + +export function tarXzvf(f) { + return function (outputDir) { + return f.tarXzvf(outputDir); + }; +} + +export function unzip(f) { + return function (outputDir) { + return function () { + return f.unzip(outputDir); + }; + }; +} + +export function zip(f) { + return function () { + return function () { + return f.zip(); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/File.purs b/sdk/purescript/demo/src/FluentCI/File.purs index c14bbc2..9003f59 100644 --- a/sdk/purescript/demo/src/FluentCI/File.purs +++ b/sdk/purescript/demo/src/FluentCI/File.purs @@ -1,4 +1,42 @@ -module File where +module FluentCI.File where +import Prelude -data File \ No newline at end of file +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Directory (Directory, File) + + +foreign import _id :: File -> EffectFnAff String + +foreign import _chmod :: File -> String -> EffectFnAff File + +foreign import _md5 :: File -> EffectFnAff String + +foreign import _path :: File -> EffectFnAff String + +foreign import _sha256 :: File -> EffectFnAff String + +id :: File -> Aff String +id file = fromEffectFnAff $ _id file + +chmod :: File -> String -> Aff File +chmod file mode = fromEffectFnAff $ _chmod file mode + +md5 :: File -> Aff String +md5 file = fromEffectFnAff $ _md5 file + +path :: File -> Aff String +path file = fromEffectFnAff $ _path file + +sha256 :: File -> Aff String +sha256 file = fromEffectFnAff $ _sha256 file + +foreign import tarCzvf :: File -> Effect File + +foreign import tarXzvf :: File -> Effect Directory + +foreign import unzip :: File -> Effect Directory + +foreign import zip :: File -> Effect File diff --git a/sdk/purescript/demo/src/FluentCI/Flox.js b/sdk/purescript/demo/src/FluentCI/Flox.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Flox.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Flox.purs b/sdk/purescript/demo/src/FluentCI/Flox.purs index b3447a8..f6a56ff 100644 --- a/sdk/purescript/demo/src/FluentCI/Flox.purs +++ b/sdk/purescript/demo/src/FluentCI/Flox.purs @@ -1,3 +1,44 @@ module FluentCI.Flox where -data Flox \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data Flox + +foreign import _id :: Flox -> EffectFnAff String + +foreign import _stderr :: Flox -> EffectFnAff String + +foreign import _stdout :: Flox -> EffectFnAff String + +foreign import asService :: Flox -> Effect Service + + +id :: Flox -> Aff String +id flox = fromEffectFnAff $ _id flox + +stderr :: Flox -> Aff String +stderr flox = fromEffectFnAff $ _stderr flox + +stdout :: Flox -> Aff String +stdout flox = fromEffectFnAff $ _stdout flox + +foreign import waitOn :: Flox -> Int -> Int -> Effect Flox + +foreign import withCache :: Flox -> Cache -> Effect Flox + +foreign import withEnvVariable :: Flox -> String -> String -> Effect Flox + +foreign import withExec :: Flox -> Array String -> Effect Flox + +foreign import withSecretVariable :: Flox -> String -> Secret -> Effect Flox + +foreign import withService :: Flox -> Service -> Effect Flox + +foreign import withWorkdir :: Flox -> String -> Effect Flox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Git.js b/sdk/purescript/demo/src/FluentCI/Git.js new file mode 100644 index 0000000..3a9e3a2 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Git.js @@ -0,0 +1,31 @@ +export function _id(s) { + return function (onError, onSuccess) { + s.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function branch(s) { + return function (name) { + return function () { + return s.branch(); + }; + }; +} + +export function _commit(s) { + return function (onError, onSuccess) { + s.commit().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function tree(s) { + return function () { + return s.tree(); + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Git.purs b/sdk/purescript/demo/src/FluentCI/Git.purs index 2c63628..379a880 100644 --- a/sdk/purescript/demo/src/FluentCI/Git.purs +++ b/sdk/purescript/demo/src/FluentCI/Git.purs @@ -1,3 +1,24 @@ module FluentCI.Git where -data Git \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Directory (Directory) + +data Git + +foreign import _id :: Git -> EffectFnAff String + +foreign import _commit :: Git -> EffectFnAff String + +id :: Git -> Aff String +id git = fromEffectFnAff $ _id git + +commit :: Git -> Aff String +commit git = fromEffectFnAff $ _commit git + +foreign import branch :: Git -> String -> Effect Git + +foreign import tree :: Git -> Effect Directory diff --git a/sdk/purescript/demo/src/FluentCI/Mise.js b/sdk/purescript/demo/src/FluentCI/Mise.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Mise.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Mise.purs b/sdk/purescript/demo/src/FluentCI/Mise.purs index 394608d..e756c5e 100644 --- a/sdk/purescript/demo/src/FluentCI/Mise.purs +++ b/sdk/purescript/demo/src/FluentCI/Mise.purs @@ -1,3 +1,44 @@ module FluentCI.Mise where -data Mise \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data Mise + +foreign import _id :: Mise -> EffectFnAff String + +foreign import _stderr :: Mise -> EffectFnAff String + +foreign import _stdout :: Mise -> EffectFnAff String + +foreign import asService :: Mise -> Effect Service + + +id :: Mise -> Aff String +id mise = fromEffectFnAff $ _id mise + +stderr :: Mise -> Aff String +stderr mise = fromEffectFnAff $ _stderr mise + +stdout :: Mise -> Aff String +stdout mise = fromEffectFnAff $ _stdout mise + +foreign import waitOn :: Mise -> Int -> Int -> Effect Mise + +foreign import withCache :: Mise -> Cache -> Effect Mise + +foreign import withEnvVariable :: Mise -> String -> String -> Effect Mise + +foreign import withExec :: Mise -> Array String -> Effect Mise + +foreign import withSecretVariable :: Mise -> String -> Secret -> Effect Mise + +foreign import withService :: Mise -> Service -> Effect Mise + +foreign import withWorkdir :: Mise -> String -> Effect Mise \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Nix.js b/sdk/purescript/demo/src/FluentCI/Nix.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Nix.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Nix.purs b/sdk/purescript/demo/src/FluentCI/Nix.purs index b370c4e..c1465a2 100644 --- a/sdk/purescript/demo/src/FluentCI/Nix.purs +++ b/sdk/purescript/demo/src/FluentCI/Nix.purs @@ -1,3 +1,46 @@ module FluentCI.Nix where -data Nix \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data NixArgs = NixArgs { impure :: Boolean } + +data Nix + +foreign import _id :: Nix -> EffectFnAff String + +foreign import _stderr :: Nix -> EffectFnAff String + +foreign import _stdout :: Nix -> EffectFnAff String + +foreign import asService :: Nix -> Effect Service + + +id :: Nix -> Aff String +id nix = fromEffectFnAff $ _id nix + +stderr :: Nix -> Aff String +stderr nix = fromEffectFnAff $ _stderr nix + +stdout :: Nix -> Aff String +stdout nix = fromEffectFnAff $ _stdout nix + +foreign import waitOn :: Nix -> Int -> Int -> Effect Nix + +foreign import withCache :: Nix -> Cache -> Effect Nix + +foreign import withEnvVariable :: Nix -> String -> String -> Effect Nix + +foreign import withExec :: Nix -> Array String -> Effect Nix + +foreign import withSecretVariable :: Nix -> String -> Secret -> Effect Nix + +foreign import withService :: Nix -> Service -> Effect Nix + +foreign import withWorkdir :: Nix -> String -> Effect Nix \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.js b/sdk/purescript/demo/src/FluentCI/Pipeline.js new file mode 100644 index 0000000..3e0396b --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pipeline.js @@ -0,0 +1,136 @@ +export function asService(s) { + return function () { + return s.asService(); + }; +} + +export function _id(s) { + return function (onError, onSuccess) { + s.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function devbox(s) { + return function () { + return s.devbox(); + }; +} + +export function devenv(s) { + return function () { + return s.devenv(); + }; +} + +export function envhub(s) { + return function () { + return s.envhub(); + }; +} + +export function mise(s) { + return function () { + return s.mise(); + }; +} + +export function nix(s) { + return function () { + return s.nix(); + }; +} + +export function pixi(s) { + return function () { + return s.pixi(); + }; +} + +export function pkgx(s) { + return function () { + return s.pkgx(); + }; +} + +export function _stderr(s) { + return function (onError, onSuccess) { + s.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(s) { + return function (onError, onSuccess) { + s.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(s) { + return function (port) { + return function (timeout) { + return function () { + return s.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(s) { + return function (cache) { + return function () { + return s.withCache(cache); + }; + }; +} + +export function withEnvVariable(s) { + return function (name) { + return function (value) { + return function () { + return s.withEnvVariable(name, value); + }; + }; + }; +} + +export function withSecretVariable(s) { + return function (name) { + return function (secret) { + return function () { + return s.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withExec(s) { + return function (command) { + return function () { + return s.withExec(command); + }; + }; +} + +export function withService(s) { + return function (service) { + return function () { + return s.withService(service); + }; + }; +} + +export function withWorkdir(s) { + return function (path) { + return function () { + return s.withWorkdir(path); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.purs b/sdk/purescript/demo/src/FluentCI/Pipeline.purs index b9a1d0c..6972076 100644 --- a/sdk/purescript/demo/src/FluentCI/Pipeline.purs +++ b/sdk/purescript/demo/src/FluentCI/Pipeline.purs @@ -1,3 +1,64 @@ module FluentCI.Pipeline where -data Pipeline \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Devbox (Devbox) +import FluentCI.Devenv (Devenv) +import FluentCI.Envhub (Envhub) +import FluentCI.Mise (Mise) +import FluentCI.Nix (Nix) +import FluentCI.Pixi (Pixi) +import FluentCI.Pkgx (Pkgx) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data Pipeline + +foreign import _id :: Pipeline -> EffectFnAff String + +foreign import _stderr :: Pipeline -> EffectFnAff String + +foreign import _stdout :: Pipeline -> EffectFnAff String + +id :: Pipeline -> Aff String +id pipeline = fromEffectFnAff $ _id pipeline + +stderr :: Pipeline -> Aff String +stderr pipeline = fromEffectFnAff $ _stderr pipeline + +stdout :: Pipeline -> Aff String +stdout pipeline = fromEffectFnAff $ _stdout pipeline + +foreign import asService :: Pipeline -> Effect Service + +foreign import waitOn :: Pipeline -> Int -> Int -> Effect Pipeline + +foreign import devbox :: Pipeline -> Effect Devbox + +foreign import devenv :: Pipeline -> Effect Devenv + +foreign import envhub :: Pipeline -> Effect Envhub + +foreign import mise :: Pipeline -> Effect Mise + +foreign import nix :: Pipeline -> Effect Nix + +foreign import pixi :: Pipeline -> Effect Pixi + +foreign import pkgx :: Pipeline -> Effect Pkgx + +foreign import withCache :: Pipeline -> Cache -> Effect Pipeline + +foreign import withEnvVariable :: Pipeline -> String -> String -> Effect Pipeline + +foreign import withSecretVariable :: Pipeline -> String -> Secret -> Effect Pipeline + +foreign import withExec :: Pipeline -> Array String -> Effect Pipeline + +foreign import withService :: Pipeline -> Service -> Effect Pipeline + +foreign import withWorkdir :: Pipeline -> String -> Effect Pipeline \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.js b/sdk/purescript/demo/src/FluentCI/Pixi.js new file mode 100644 index 0000000..ae692d0 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pixi.js @@ -0,0 +1,94 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.purs b/sdk/purescript/demo/src/FluentCI/Pixi.purs index 54f21a7..ddda60d 100644 --- a/sdk/purescript/demo/src/FluentCI/Pixi.purs +++ b/sdk/purescript/demo/src/FluentCI/Pixi.purs @@ -1,3 +1,44 @@ module FluentCI.Pixi where -data Pixi \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data Pixi + +foreign import _id :: Pixi -> EffectFnAff String + +foreign import _stderr :: Pixi -> EffectFnAff String + +foreign import _stdout :: Pixi -> EffectFnAff String + +foreign import asService :: Pixi -> Effect Service + + +id :: Pixi -> Aff String +id pixi = fromEffectFnAff $ _id pixi + +stderr :: Pixi -> Aff String +stderr pixi = fromEffectFnAff $ _stderr pixi + +stdout :: Pixi -> Aff String +stdout pixi = fromEffectFnAff $ _stdout pixi + +foreign import waitOn :: Pixi -> Int -> Int -> Effect Pixi + +foreign import withCache :: Pixi -> Cache -> Effect Pixi + +foreign import withEnvVariable :: Pixi -> String -> String -> Effect Pixi + +foreign import withExec :: Pixi -> Array String -> Effect Pixi + +foreign import withSecretVariable :: Pixi -> String -> Secret -> Effect Pixi + +foreign import withService :: Pixi -> Service -> Effect Pixi + +foreign import withWorkdir :: Pixi -> String -> Effect Pixi \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.js b/sdk/purescript/demo/src/FluentCI/Pkgx.js new file mode 100644 index 0000000..fab83b8 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Pkgx.js @@ -0,0 +1,102 @@ +export function asService(d) { + return function () { + return d.asService(); + }; +} + +export function _id(d) { + return function (onError, onSuccess) { + d.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stderr(d) { + return function (onError, onSuccess) { + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _stdout(d) { + return function (onError, onSuccess) { + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function waitOn(d) { + return function (port) { + return function (timeout) { + return function () { + return d.waitOn(port, timeout); + }; + }; + }; +} + +export function withCache(d) { + return function (cache) { + return function () { + return d.withCache(cache); + }; + }; +} + +export function withEnvVariable(d) { + return function (name) { + return function (value) { + return function () { + return d.withEnvVariable(name, value); + }; + }; + }; +} + +export function withExec(d) { + return function (command) { + return function () { + return d.withExec(command); + }; + }; +} + +export function withSecretVariable(d) { + return function (name) { + return function (secret) { + return function () { + return d.withSecretVariable(name, secret); + }; + }; + }; +} + +export function withService(d) { + return function (service) { + return function () { + return d.withService(service); + }; + }; +} + +export function withWorkdir(d) { + return function (workdir) { + return function () { + return d.withWorkdir(workdir); + }; + }; +} + +export function withPackages(d) { + return function (packages) { + return function () { + return d.withPackages(packages); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.purs b/sdk/purescript/demo/src/FluentCI/Pkgx.purs index b3d0116..a5bc247 100644 --- a/sdk/purescript/demo/src/FluentCI/Pkgx.purs +++ b/sdk/purescript/demo/src/FluentCI/Pkgx.purs @@ -1,3 +1,46 @@ module FluentCI.Pkgx where -data Pkgx \ No newline at end of file +import Prelude + +import Effect (Effect) +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) +import FluentCI.Cache (Cache) +import FluentCI.Secret (Secret) +import FluentCI.Service (Service) + +data Pkgx + +foreign import _id :: Pkgx -> EffectFnAff String + +foreign import _stderr :: Pkgx -> EffectFnAff String + +foreign import _stdout :: Pkgx -> EffectFnAff String + +foreign import asService :: Pkgx -> Effect Service + + +id :: Pkgx -> Aff String +id pkgx = fromEffectFnAff $ _id pkgx + +stderr :: Pkgx -> Aff String +stderr pkgx = fromEffectFnAff $ _stderr pkgx + +stdout :: Pkgx -> Aff String +stdout pkgx = fromEffectFnAff $ _stdout pkgx + +foreign import waitOn :: Pkgx -> Int -> Int -> Effect Pkgx + +foreign import withCache :: Pkgx -> Cache -> Effect Pkgx + +foreign import withEnvVariable :: Pkgx -> String -> String -> Effect Pkgx + +foreign import withExec :: Pkgx -> Array String -> Effect Pkgx + +foreign import withSecretVariable :: Pkgx -> String -> Secret -> Effect Pkgx + +foreign import withService :: Pkgx -> Service -> Effect Pkgx + +foreign import withWorkdir :: Pkgx -> String -> Effect Pkgx + +foreign import withPackages :: Pkgx -> Array String -> Effect Pkgx \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Secret.js b/sdk/purescript/demo/src/FluentCI/Secret.js index f0c6ac2..d448a91 100644 --- a/sdk/purescript/demo/src/FluentCI/Secret.js +++ b/sdk/purescript/demo/src/FluentCI/Secret.js @@ -1,3 +1,30 @@ +export function _id(s) { + return function (onError, onSuccess) { + s.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _mount(s) { + return function (onError, onSuccess) { + s.mount().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _name(s) { + return function (onError, onSuccess) { + s.name().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + export function _plaintext(s) { return function (onError, onSuccess) { s.plaintext().then(onSuccess).catch(onError); diff --git a/sdk/purescript/demo/src/FluentCI/Secret.purs b/sdk/purescript/demo/src/FluentCI/Secret.purs index 9a51166..cd67d5a 100644 --- a/sdk/purescript/demo/src/FluentCI/Secret.purs +++ b/sdk/purescript/demo/src/FluentCI/Secret.purs @@ -9,7 +9,23 @@ import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) data Secret +foreign import _id :: Secret -> EffectFnAff String + +foreign import _mount :: Secret -> EffectFnAff String + +foreign import _name :: Secret -> EffectFnAff String + foreign import _plaintext :: Secret -> EffectFnAff String + +id :: Secret -> Aff String +id secret = fromEffectFnAff $ _id secret + +mount :: Secret -> Aff String +mount secret = fromEffectFnAff $ _mount secret + +name :: Secret -> Aff String +name secret = fromEffectFnAff $ _name secret + plaintext :: Secret -> Aff String plaintext secret = fromEffectFnAff $ _plaintext secret \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/SecretManager.js b/sdk/purescript/demo/src/FluentCI/SecretManager.js new file mode 100644 index 0000000..d3f33c2 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/SecretManager.js @@ -0,0 +1,19 @@ +export function _id(s) { + return function (onError, onSuccess) { + s.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} + +export function _getSecret(s) { + return function (name) { + return function (onError, onSuccess) { + s.getSecret(name).then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/SecretManager.purs b/sdk/purescript/demo/src/FluentCI/SecretManager.purs index fe12a72..3dbc086 100644 --- a/sdk/purescript/demo/src/FluentCI/SecretManager.purs +++ b/sdk/purescript/demo/src/FluentCI/SecretManager.purs @@ -1,3 +1,18 @@ module FluentCI.SecretManager where -data SecretManager \ No newline at end of file +import Prelude + +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) + +data SecretManager + +foreign import _id :: SecretManager -> EffectFnAff String + +foreign import _getSecret :: SecretManager -> String -> EffectFnAff String + +id :: SecretManager -> Aff String +id secretManager = fromEffectFnAff $ _id secretManager + +getSecret :: SecretManager -> String -> Aff String +getSecret secretManager secretName = fromEffectFnAff $ _getSecret secretManager secretName \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Service.js b/sdk/purescript/demo/src/FluentCI/Service.js new file mode 100644 index 0000000..de13cb8 --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Service.js @@ -0,0 +1,8 @@ +export function _id(s) { + return function (onError, onSuccess) { + s.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); + }; + }; +} diff --git a/sdk/purescript/demo/src/FluentCI/Service.purs b/sdk/purescript/demo/src/FluentCI/Service.purs index 6e5444b..4746f66 100644 --- a/sdk/purescript/demo/src/FluentCI/Service.purs +++ b/sdk/purescript/demo/src/FluentCI/Service.purs @@ -1,3 +1,13 @@ -module Service where +module FluentCI.Service where -data Service \ No newline at end of file +import Prelude + +import Effect.Aff (Aff) +import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) + +data Service + +foreign import _id :: Service -> EffectFnAff String + +id :: Service -> Aff String +id service = fromEffectFnAff $ _id service \ No newline at end of file diff --git a/sdk/purescript/demo/src/Main.purs b/sdk/purescript/demo/src/Main.purs index 359523b..2f4845d 100644 --- a/sdk/purescript/demo/src/Main.purs +++ b/sdk/purescript/demo/src/Main.purs @@ -6,11 +6,19 @@ import Effect (Effect) import Effect.Aff (launchAff_) import Effect.Class (liftEffect) import Effect.Class.Console as Console -import FluentCI.Client (dag, setSecret) +import FluentCI.Client (dag, pipeline, setSecret) +import FluentCI.Pipeline (withSecretVariable, withExec, stdout) import FluentCI.Secret (plaintext) main :: Effect Unit main = launchAff_ do - secret <- liftEffect $ setSecret dag "secret" "value 123" - result <- plaintext secret - Console.log result + secret <- liftEffect $ setSecret dag "GITHUB" "my-github-token" + value <- plaintext secret + p <- liftEffect $ do + p1 <- pipeline dag "secret-demo" + p2 <- withSecretVariable p1 "GITHUB" secret + withExec p2 ["echo", "$GITHUB"] + output <- stdout p + Console.log value + Console.log "Secret demo:" + Console.log output From 9420ad9fa464876041c80557ea17e3af8a3ef5b8 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 13 Aug 2024 20:16:10 +0000 Subject: [PATCH 3/7] update example --- sdk/purescript/demo/.gitignore | 1 + sdk/purescript/demo/src/Main.purs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sdk/purescript/demo/.gitignore b/sdk/purescript/demo/.gitignore index 30efe19..b42f1fb 100644 --- a/sdk/purescript/demo/.gitignore +++ b/sdk/purescript/demo/.gitignore @@ -8,3 +8,4 @@ /.purs* /.psa* /.spago +demo \ No newline at end of file diff --git a/sdk/purescript/demo/src/Main.purs b/sdk/purescript/demo/src/Main.purs index 2f4845d..a1ba8b0 100644 --- a/sdk/purescript/demo/src/Main.purs +++ b/sdk/purescript/demo/src/Main.purs @@ -7,7 +7,9 @@ import Effect.Aff (launchAff_) import Effect.Class (liftEffect) import Effect.Class.Console as Console import FluentCI.Client (dag, pipeline, setSecret) -import FluentCI.Pipeline (withSecretVariable, withExec, stdout) +import FluentCI.Mise (withWorkdir) +import FluentCI.Mise as Mise +import FluentCI.Pipeline (mise, withSecretVariable, withExec, stdout) import FluentCI.Secret (plaintext) main :: Effect Unit @@ -19,6 +21,18 @@ main = launchAff_ do p2 <- withSecretVariable p1 "GITHUB" secret withExec p2 ["echo", "$GITHUB"] output <- stdout p + + m <- liftEffect $ do + pip <- pipeline dag "mise-demo" + m1 <- mise pip + m2 <- withWorkdir m1 "./mise-demo" + m3 <- Mise.withExec m2 ["mise", "--version"] + Mise.withExec m3 ["which", "bun"] + miseOutput <- Mise.stdout m + Console.log value Console.log "Secret demo:" Console.log output + + Console.log "Mise: " + Console.log miseOutput From 99f98203f1b20a1fe3fa8f23eab60be7c190aee0 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 14 Aug 2024 12:17:11 +0000 Subject: [PATCH 4/7] use purescript type classes --- sdk/purescript/demo/src/FluentCI/Cache.js | 10 +- sdk/purescript/demo/src/FluentCI/Class.purs | 361 ++++++++++++++++++ sdk/purescript/demo/src/FluentCI/Devbox.js | 6 +- sdk/purescript/demo/src/FluentCI/Devbox.purs | 2 +- sdk/purescript/demo/src/FluentCI/Devenv.js | 6 +- sdk/purescript/demo/src/FluentCI/Devenv.purs | 2 +- sdk/purescript/demo/src/FluentCI/Directory.js | 56 +-- .../demo/src/FluentCI/Directory.purs | 19 +- sdk/purescript/demo/src/FluentCI/Envhub.js | 8 +- sdk/purescript/demo/src/FluentCI/Envhub.purs | 3 +- sdk/purescript/demo/src/FluentCI/Flox.js | 6 +- sdk/purescript/demo/src/FluentCI/Flox.purs | 2 +- sdk/purescript/demo/src/FluentCI/Git.js | 2 +- sdk/purescript/demo/src/FluentCI/Mise.js | 6 +- sdk/purescript/demo/src/FluentCI/Mise.purs | 2 +- sdk/purescript/demo/src/FluentCI/Nix.js | 6 +- sdk/purescript/demo/src/FluentCI/Nix.purs | 4 +- sdk/purescript/demo/src/FluentCI/Pipeline.js | 14 +- .../demo/src/FluentCI/Pipeline.purs | 6 +- sdk/purescript/demo/src/FluentCI/Pixi.js | 6 +- sdk/purescript/demo/src/FluentCI/Pixi.purs | 2 +- sdk/purescript/demo/src/FluentCI/Pkgx.js | 6 +- sdk/purescript/demo/src/FluentCI/Pkgx.purs | 2 +- sdk/purescript/demo/src/Main.purs | 110 +++++- 24 files changed, 544 insertions(+), 103 deletions(-) create mode 100644 sdk/purescript/demo/src/FluentCI/Class.purs diff --git a/sdk/purescript/demo/src/FluentCI/Cache.js b/sdk/purescript/demo/src/FluentCI/Cache.js index 0339fe2..8062e32 100644 --- a/sdk/purescript/demo/src/FluentCI/Cache.js +++ b/sdk/purescript/demo/src/FluentCI/Cache.js @@ -1,10 +1,8 @@ export function _id(c) { - return function (id) { - return function (onError, onSuccess) { - c.id(id).then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; + return function (onError, onSuccess) { + c.id().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Class.purs b/sdk/purescript/demo/src/FluentCI/Class.purs new file mode 100644 index 0000000..a4c719b --- /dev/null +++ b/sdk/purescript/demo/src/FluentCI/Class.purs @@ -0,0 +1,361 @@ +module FluentCI.Class where + + +import Effect (Effect) +import Effect.Aff (Aff) +import FluentCI.Cache as Cache +import FluentCI.Devbox as Devbox +import FluentCI.Devenv as Devenv +import FluentCI.Directory as Directory +import FluentCI.Flox as Flox +import FluentCI.Mise as Mise +import FluentCI.Nix (NixArgs) +import FluentCI.Nix as Nix +import FluentCI.Pipeline as Pipeline +import FluentCI.Pixi as Pixi +import FluentCI.Pkgx as Pkgx +import FluentCI.Secret as Secret +import FluentCI.Service as Service + +class Id a where + id :: a -> Aff String + +instance Id Devbox.Devbox where + id devbox = Devbox.id devbox + +instance Id Devenv.Devenv where + id devenv = Devenv.id devenv + +instance Id Cache.Cache where + id cache = Cache.id cache + +instance Id Directory.Directory where + id directory = Directory.id directory + +instance Id Mise.Mise where + id mise = Mise.id mise + +instance Id Nix.Nix where + id nix = Nix.id nix + +instance Id Pixi.Pixi where + id pixi = Pixi.id pixi + +instance Id Pkgx.Pkgx where + id pkgx = Pkgx.id pkgx + +instance Id Flox.Flox where + id flox = Flox.id flox + +instance Id Pipeline.Pipeline where + id pipeline = Pipeline.id pipeline + +instance Id Service.Service where + id service = Service.id service + +instance Id Secret.Secret where + id secret = Secret.id secret + +class Stderr a where + stderr :: a -> Aff String + +instance Stderr Pipeline.Pipeline where + stderr pipeline = Pipeline.stderr pipeline + +instance Stderr Mise.Mise where + stderr mise = Mise.stderr mise + +instance Stderr Devbox.Devbox where + stderr devbox = Devbox.stderr devbox + +instance Stderr Devenv.Devenv where + stderr devenv = Devenv.stderr devenv + +instance Stderr Nix.Nix where + stderr nix = Nix.stderr nix + +instance Stderr Pixi.Pixi where + stderr pixi = Pixi.stderr pixi + +instance Stderr Pkgx.Pkgx where + stderr pkgx = Pkgx.stderr pkgx + +instance Stderr Flox.Flox where + stderr flox = Flox.stderr flox + +instance Stderr Directory.Directory where + stderr directory = Directory.stderr directory + + +class Stdout a where + stdout :: a -> Aff String + +instance Stdout Pipeline.Pipeline where + stdout pipeline = Pipeline.stdout pipeline + +instance Stdout Mise.Mise where + stdout mise = Mise.stdout mise + +instance Stdout Devbox.Devbox where + stdout devbox = Devbox.stdout devbox + +instance Stdout Devenv.Devenv where + stdout devenv = Devenv.stdout devenv + +instance Stdout Nix.Nix where + stdout nix = Nix.stdout nix + +instance Stdout Pixi.Pixi where + stdout pixi = Pixi.stdout pixi + +instance Stdout Pkgx.Pkgx where + stdout pkgx = Pkgx.stdout pkgx + +instance Stdout Flox.Flox where + stdout flox = Flox.stdout flox + +instance Stdout Directory.Directory where + stdout directory = Directory.stdout directory + +class AsService a where + asService :: a -> String -> Effect Service.Service + +instance AsService Devbox.Devbox where + asService devbox name = Devbox.asService devbox name + +instance AsService Devenv.Devenv where + asService devenv name = Devenv.asService devenv name + +instance AsService Nix.Nix where + asService nix name = Nix.asService nix name + +instance AsService Mise.Mise where + asService mise name = Mise.asService mise name + +instance AsService Pipeline.Pipeline where + asService pipeline name = Pipeline.asService pipeline name + +instance AsService Pixi.Pixi where + asService pixi name = Pixi.asService pixi name + +instance AsService Pkgx.Pkgx where + asService pkgx = Pkgx.asService pkgx + +instance AsService Flox.Flox where + asService flox name = Flox.asService flox name + + +class WaitOn a where + waitOn :: a -> Int -> Int -> Effect a + +instance WaitOn Devbox.Devbox where + waitOn devbox port timeout = Devbox.waitOn devbox port timeout + +instance WaitOn Devenv.Devenv where + waitOn devenv port timeout = Devenv.waitOn devenv port timeout + +instance WaitOn Nix.Nix where + waitOn nix port timeout = Nix.waitOn nix port timeout + +instance WaitOn Mise.Mise where + waitOn mise port timeout = Mise.waitOn mise port timeout + +instance WaitOn Pipeline.Pipeline where + waitOn pipeline port timeout = Pipeline.waitOn pipeline port timeout + +instance WaitOn Pixi.Pixi where + waitOn pixi port timeout = Pixi.waitOn pixi port timeout + +instance WaitOn Pkgx.Pkgx where + waitOn pkgx port timeout = Pkgx.waitOn pkgx port timeout + +instance WaitOn Flox.Flox where + waitOn flox port timeout = Flox.waitOn flox port timeout + + +class WithCache a where + withCache :: a -> Cache.Cache -> Effect a + +instance WithCache Devbox.Devbox where + withCache devbox cache = Devbox.withCache devbox cache + +instance WithCache Devenv.Devenv where + withCache devenv cache = Devenv.withCache devenv cache + +instance WithCache Nix.Nix where + withCache nix cache = Nix.withCache nix cache + +instance WithCache Mise.Mise where + withCache mise cache = Mise.withCache mise cache + +instance WithCache Pipeline.Pipeline where + withCache pipeline cache = Pipeline.withCache pipeline cache + +instance WithCache Pixi.Pixi where + withCache pixi cache = Pixi.withCache pixi cache + +instance WithCache Pkgx.Pkgx where + withCache pkgx cache = Pkgx.withCache pkgx cache + +instance WithCache Flox.Flox where + withCache flox cache = Flox.withCache flox cache + +class WithEnvVariable a where + withEnvVariable :: a -> String -> String -> Effect a + +class WithExec a where + withExec :: a -> Array String -> Effect a + +instance WithExec Devbox.Devbox where + withExec devbox args = Devbox.withExec devbox args + +instance WithExec Devenv.Devenv where + withExec devenv args = Devenv.withExec devenv args + +instance WithExec Nix.Nix where + withExec nix args = Nix.withExec nix args + +instance WithExec Mise.Mise where + withExec mise args = Mise.withExec mise args + +instance WithExec Pipeline.Pipeline where + withExec pipeline args = Pipeline.withExec pipeline args + +instance WithExec Pixi.Pixi where + withExec pixi args = Pixi.withExec pixi args + +instance WithExec Pkgx.Pkgx where + withExec pkgx args = Pkgx.withExec pkgx args + +instance WithExec Flox.Flox where + withExec flox args = Flox.withExec flox args + +instance WithExec Directory.Directory where + withExec directory args = Directory.withExec directory args + +class WithSecretVariable a where + withSecretVariable :: a -> String -> Secret.Secret -> Effect a + +instance WithSecretVariable Devbox.Devbox where + withSecretVariable devbox name secret = Devbox.withSecretVariable devbox name secret + +instance WithSecretVariable Devenv.Devenv where + withSecretVariable devenv name secret = Devenv.withSecretVariable devenv name secret + +instance WithSecretVariable Nix.Nix where + withSecretVariable nix name secret = Nix.withSecretVariable nix name secret + +instance WithSecretVariable Mise.Mise where + withSecretVariable mise name secret = Mise.withSecretVariable mise name secret + +instance WithSecretVariable Pipeline.Pipeline where + withSecretVariable pipeline name secret = Pipeline.withSecretVariable pipeline name secret + +instance WithSecretVariable Pixi.Pixi where + withSecretVariable pixi name secret = Pixi.withSecretVariable pixi name secret + +instance WithSecretVariable Pkgx.Pkgx where + withSecretVariable pkgx name secret = Pkgx.withSecretVariable pkgx name secret + +instance WithSecretVariable Flox.Flox where + withSecretVariable flox name secret = Flox.withSecretVariable flox name secret + +class WithService a where + withService :: a -> Service.Service -> Effect a + +instance WithService Devbox.Devbox where + withService devbox service = Devbox.withService devbox service + +instance WithService Devenv.Devenv where + withService devenv service = Devenv.withService devenv service + +instance WithService Nix.Nix where + withService nix service = Nix.withService nix service + +instance WithService Mise.Mise where + withService mise service = Mise.withService mise service + +instance WithService Pipeline.Pipeline where + withService pipeline service = Pipeline.withService pipeline service + +instance WithService Pixi.Pixi where + withService pixi service = Pixi.withService pixi service + +instance WithService Pkgx.Pkgx where + withService pkgx service = Pkgx.withService pkgx service + +instance WithService Flox.Flox where + withService flox service = Flox.withService flox service + + +class WithWorkdir a where + withWorkdir :: a -> String -> Effect a + +instance WithWorkdir Devbox.Devbox where + withWorkdir devbox path = Devbox.withWorkdir devbox path + +instance WithWorkdir Devenv.Devenv where + withWorkdir devenv path = Devenv.withWorkdir devenv path + +instance WithWorkdir Nix.Nix where + withWorkdir nix path = Nix.withWorkdir nix path + +instance WithWorkdir Mise.Mise where + withWorkdir mise path = Mise.withWorkdir mise path + +instance WithWorkdir Pipeline.Pipeline where + withWorkdir pipeline path = Pipeline.withWorkdir pipeline path + +instance WithWorkdir Pixi.Pixi where + withWorkdir pixi path = Pixi.withWorkdir pixi path + +instance WithWorkdir Pkgx.Pkgx where + withWorkdir pkgx path = Pkgx.withWorkdir pkgx path + +instance WithWorkdir Flox.Flox where + withWorkdir flox path = Flox.withWorkdir flox path + +class Devbox a where + devbox :: a -> Effect Devbox.Devbox + +instance Devbox Pipeline.Pipeline where + devbox pipeline = Pipeline.devbox pipeline + +instance Devbox Directory.Directory where + devbox directory = Directory.devbox directory + +class Mise a where + mise :: a -> Effect Mise.Mise + +instance Mise Pipeline.Pipeline where + mise pipeline = Pipeline.mise pipeline + +instance Mise Directory.Directory where + mise directory = Directory.mise directory + +class Nix a where + nix :: a -> NixArgs -> Effect Nix.Nix + +instance Nix Pipeline.Pipeline where + nix pipeline args = Pipeline.nix pipeline args + +instance Nix Directory.Directory where + nix directory args = Directory.nix directory args + +class Pixi a where + pixi :: a -> Effect Pixi.Pixi + +instance Pixi Pipeline.Pipeline where + pixi pipeline = Pipeline.pixi pipeline + +instance Pixi Directory.Directory where + pixi directory = Directory.pixi directory + +class Pkgx a where + pkgx :: a -> Effect Pkgx.Pkgx + +instance Pkgx Pipeline.Pipeline where + pkgx pipeline = Pipeline.pkgx pipeline + +instance Pkgx Directory.Directory where + pkgx directory = Directory.pkgx directory diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.js b/sdk/purescript/demo/src/FluentCI/Devbox.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Devbox.js +++ b/sdk/purescript/demo/src/FluentCI/Devbox.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.purs b/sdk/purescript/demo/src/FluentCI/Devbox.purs index deecc96..ce1c73f 100644 --- a/sdk/purescript/demo/src/FluentCI/Devbox.purs +++ b/sdk/purescript/demo/src/FluentCI/Devbox.purs @@ -18,7 +18,7 @@ foreign import _stderr :: Devbox -> EffectFnAff String foreign import _stdout :: Devbox -> EffectFnAff String -foreign import asService :: Devbox -> Effect Service +foreign import asService :: Devbox -> String -> Effect Service id :: Devbox -> Aff String diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.js b/sdk/purescript/demo/src/FluentCI/Devenv.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Devenv.js +++ b/sdk/purescript/demo/src/FluentCI/Devenv.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.purs b/sdk/purescript/demo/src/FluentCI/Devenv.purs index 48b5cac..f1998af 100644 --- a/sdk/purescript/demo/src/FluentCI/Devenv.purs +++ b/sdk/purescript/demo/src/FluentCI/Devenv.purs @@ -18,7 +18,7 @@ foreign import _stderr :: Devenv -> EffectFnAff String foreign import _stdout :: Devenv -> EffectFnAff String -foreign import asService :: Devenv -> Effect Service +foreign import asService :: Devenv -> String -> Effect Service foreign import waitOn :: Devenv -> Int -> Int -> Effect Devenv diff --git a/sdk/purescript/demo/src/FluentCI/Directory.js b/sdk/purescript/demo/src/FluentCI/Directory.js index 7166302..7dc8b09 100644 --- a/sdk/purescript/demo/src/FluentCI/Directory.js +++ b/sdk/purescript/demo/src/FluentCI/Directory.js @@ -68,90 +68,74 @@ export function directory(d) { }; } -export function _stderr() { +export function _stderr(d) { return function (onError, onSuccess) { - return function (d) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; + d.stderr().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); }; }; } -export function _stdout() { +export function _stdout(d) { return function (onError, onSuccess) { - return function (d) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; + d.stdout().then(onSuccess).catch(onError); + return function (cancelError, onCancelerError, onCancelerSuccess) { + onCancelerSuccess(); }; }; } -export function waitOn() { +export function waitOn(d) { return function (port) { return function (timeout) { return function () { - return function (d) { - return d.waitOn(port, timeout); - }; + return d.waitOn(port, timeout); }; }; }; } -export function withCache() { +export function withCache(d) { return function (cache) { return function () { - return function (d) { - return d.withCache(cache); - }; + return d.withCache(cache); }; }; } -export function withEnvVariable() { +export function withEnvVariable(d) { return function (name) { return function (value) { return function () { - return function (d) { - return d.withEnvVariable(name, value); - }; + return d.withEnvVariable(name, value); }; }; }; } -export function withExec() { +export function withExec(d) { return function (command) { return function () { - return function (d) { - return d.withExec(command); - }; + return d.withExec(command); }; }; } -export function withSecretVariable() { +export function withSecretVariable(d) { return function (name) { return function (secret) { return function () { - return function (d) { - return d.withSecretVariable(name, secret); - }; + return d.withSecretVariable(name, secret); }; }; }; } -export function withService() { +export function withService(d) { return function (service) { return function () { - return function (d) { - return d.withService(service); - }; + return d.withService(service); }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Directory.purs b/sdk/purescript/demo/src/FluentCI/Directory.purs index d130f00..814db54 100644 --- a/sdk/purescript/demo/src/FluentCI/Directory.purs +++ b/sdk/purescript/demo/src/FluentCI/Directory.purs @@ -2,6 +2,7 @@ module FluentCI.Directory where import Prelude +import Effect (Effect) import Effect.Aff (Aff) import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) import FluentCI.Cache (Cache) @@ -9,7 +10,7 @@ import FluentCI.Devbox (Devbox) import FluentCI.Devenv (Devenv) import FluentCI.Flox (Flox) import FluentCI.Mise (Mise) -import FluentCI.Nix (Nix) +import FluentCI.Nix (Nix, NixArgs) import FluentCI.Pixi (Pixi) import FluentCI.Pkgx (Pkgx) import FluentCI.Secret (Secret) @@ -40,19 +41,19 @@ stdout dir = fromEffectFnAff $ _stdout dir entries :: Directory -> Aff (Array String) entries dir = fromEffectFnAff $ _entries dir -foreign import devbox :: Directory -> Aff Devbox +foreign import devbox :: Directory -> Effect Devbox -foreign import devenv :: Directory -> Aff Devenv +foreign import devenv :: Directory -> Effect Devenv -foreign import flox :: Directory -> Aff Flox +foreign import flox :: Directory -> Effect Flox -foreign import mise :: Directory -> Aff Mise +foreign import mise :: Directory -> Effect Mise -foreign import nix :: Directory -> Aff Nix +foreign import nix :: Directory -> NixArgs -> Effect Nix -foreign import pixi :: Directory -> Aff Pixi +foreign import pixi :: Directory -> Effect Pixi -foreign import pkgx :: Directory -> Aff Pkgx +foreign import pkgx :: Directory -> Effect Pkgx foreign import directory :: Directory -> String -> Aff Directory @@ -64,7 +65,7 @@ foreign import withCache :: Directory -> Cache -> Aff Directory foreign import withEnvVariable :: Directory -> String -> String -> Aff Directory -foreign import withExec :: Directory -> Array String -> Aff Directory +foreign import withExec :: Directory -> Array String -> Effect Directory foreign import withFile :: Directory -> String -> Aff Directory diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.js b/sdk/purescript/demo/src/FluentCI/Envhub.js index a4828fc..5281f2a 100644 --- a/sdk/purescript/demo/src/FluentCI/Envhub.js +++ b/sdk/purescript/demo/src/FluentCI/Envhub.js @@ -7,9 +7,11 @@ export function _id(e) { }; } -export function asService(e) { - return function () { - return e.asService(); +export function asService(d) { + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.purs b/sdk/purescript/demo/src/FluentCI/Envhub.purs index 2a04d49..958506b 100644 --- a/sdk/purescript/demo/src/FluentCI/Envhub.purs +++ b/sdk/purescript/demo/src/FluentCI/Envhub.purs @@ -2,6 +2,7 @@ module FluentCI.Envhub where import Prelude +import Effect (Effect) import Effect.Aff (Aff) import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) import FluentCI.Cache (Cache) @@ -28,7 +29,7 @@ stdout envhub = fromEffectFnAff $ _stdout envhub foreign import use :: Envhub -> String -> Aff Envhub -foreign import asService :: Envhub -> Aff Service +foreign import asService :: Envhub -> String-> Effect Service foreign import waitOn :: Envhub -> Int -> Int -> Aff Envhub diff --git a/sdk/purescript/demo/src/FluentCI/Flox.js b/sdk/purescript/demo/src/FluentCI/Flox.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Flox.js +++ b/sdk/purescript/demo/src/FluentCI/Flox.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Flox.purs b/sdk/purescript/demo/src/FluentCI/Flox.purs index f6a56ff..4dd8291 100644 --- a/sdk/purescript/demo/src/FluentCI/Flox.purs +++ b/sdk/purescript/demo/src/FluentCI/Flox.purs @@ -17,7 +17,7 @@ foreign import _stderr :: Flox -> EffectFnAff String foreign import _stdout :: Flox -> EffectFnAff String -foreign import asService :: Flox -> Effect Service +foreign import asService :: Flox -> String -> Effect Service id :: Flox -> Aff String diff --git a/sdk/purescript/demo/src/FluentCI/Git.js b/sdk/purescript/demo/src/FluentCI/Git.js index 3a9e3a2..0eabec4 100644 --- a/sdk/purescript/demo/src/FluentCI/Git.js +++ b/sdk/purescript/demo/src/FluentCI/Git.js @@ -10,7 +10,7 @@ export function _id(s) { export function branch(s) { return function (name) { return function () { - return s.branch(); + return s.branch(name); }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Mise.js b/sdk/purescript/demo/src/FluentCI/Mise.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Mise.js +++ b/sdk/purescript/demo/src/FluentCI/Mise.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Mise.purs b/sdk/purescript/demo/src/FluentCI/Mise.purs index e756c5e..e2302cf 100644 --- a/sdk/purescript/demo/src/FluentCI/Mise.purs +++ b/sdk/purescript/demo/src/FluentCI/Mise.purs @@ -17,7 +17,7 @@ foreign import _stderr :: Mise -> EffectFnAff String foreign import _stdout :: Mise -> EffectFnAff String -foreign import asService :: Mise -> Effect Service +foreign import asService :: Mise -> String -> Effect Service id :: Mise -> Aff String diff --git a/sdk/purescript/demo/src/FluentCI/Nix.js b/sdk/purescript/demo/src/FluentCI/Nix.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Nix.js +++ b/sdk/purescript/demo/src/FluentCI/Nix.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Nix.purs b/sdk/purescript/demo/src/FluentCI/Nix.purs index c1465a2..a2e698d 100644 --- a/sdk/purescript/demo/src/FluentCI/Nix.purs +++ b/sdk/purescript/demo/src/FluentCI/Nix.purs @@ -9,7 +9,7 @@ import FluentCI.Cache (Cache) import FluentCI.Secret (Secret) import FluentCI.Service (Service) -data NixArgs = NixArgs { impure :: Boolean } +type NixArgs = { impure :: Boolean } data Nix @@ -19,7 +19,7 @@ foreign import _stderr :: Nix -> EffectFnAff String foreign import _stdout :: Nix -> EffectFnAff String -foreign import asService :: Nix -> Effect Service +foreign import asService :: Nix -> String -> Effect Service id :: Nix -> Aff String diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.js b/sdk/purescript/demo/src/FluentCI/Pipeline.js index 3e0396b..b04e0e5 100644 --- a/sdk/purescript/demo/src/FluentCI/Pipeline.js +++ b/sdk/purescript/demo/src/FluentCI/Pipeline.js @@ -1,6 +1,8 @@ -export function asService(s) { - return function () { - return s.asService(); +export function asService(d) { + return function (name) { + return function () { + return d.asService(name); + }; }; } @@ -38,8 +40,10 @@ export function mise(s) { } export function nix(s) { - return function () { - return s.nix(); + return function (args) { + return function () { + return s.nix(); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.purs b/sdk/purescript/demo/src/FluentCI/Pipeline.purs index 6972076..580dc5c 100644 --- a/sdk/purescript/demo/src/FluentCI/Pipeline.purs +++ b/sdk/purescript/demo/src/FluentCI/Pipeline.purs @@ -10,7 +10,7 @@ import FluentCI.Devbox (Devbox) import FluentCI.Devenv (Devenv) import FluentCI.Envhub (Envhub) import FluentCI.Mise (Mise) -import FluentCI.Nix (Nix) +import FluentCI.Nix (Nix, NixArgs) import FluentCI.Pixi (Pixi) import FluentCI.Pkgx (Pkgx) import FluentCI.Secret (Secret) @@ -33,7 +33,7 @@ stderr pipeline = fromEffectFnAff $ _stderr pipeline stdout :: Pipeline -> Aff String stdout pipeline = fromEffectFnAff $ _stdout pipeline -foreign import asService :: Pipeline -> Effect Service +foreign import asService :: Pipeline -> String -> Effect Service foreign import waitOn :: Pipeline -> Int -> Int -> Effect Pipeline @@ -45,7 +45,7 @@ foreign import envhub :: Pipeline -> Effect Envhub foreign import mise :: Pipeline -> Effect Mise -foreign import nix :: Pipeline -> Effect Nix +foreign import nix :: Pipeline -> NixArgs -> Effect Nix foreign import pixi :: Pipeline -> Effect Pixi diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.js b/sdk/purescript/demo/src/FluentCI/Pixi.js index ae692d0..eefef49 100644 --- a/sdk/purescript/demo/src/FluentCI/Pixi.js +++ b/sdk/purescript/demo/src/FluentCI/Pixi.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.purs b/sdk/purescript/demo/src/FluentCI/Pixi.purs index ddda60d..aa5e23b 100644 --- a/sdk/purescript/demo/src/FluentCI/Pixi.purs +++ b/sdk/purescript/demo/src/FluentCI/Pixi.purs @@ -17,7 +17,7 @@ foreign import _stderr :: Pixi -> EffectFnAff String foreign import _stdout :: Pixi -> EffectFnAff String -foreign import asService :: Pixi -> Effect Service +foreign import asService :: Pixi -> String -> Effect Service id :: Pixi -> Aff String diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.js b/sdk/purescript/demo/src/FluentCI/Pkgx.js index fab83b8..1cf3d95 100644 --- a/sdk/purescript/demo/src/FluentCI/Pkgx.js +++ b/sdk/purescript/demo/src/FluentCI/Pkgx.js @@ -1,6 +1,8 @@ export function asService(d) { - return function () { - return d.asService(); + return function (name) { + return function () { + return d.asService(name); + }; }; } diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.purs b/sdk/purescript/demo/src/FluentCI/Pkgx.purs index a5bc247..249e3ad 100644 --- a/sdk/purescript/demo/src/FluentCI/Pkgx.purs +++ b/sdk/purescript/demo/src/FluentCI/Pkgx.purs @@ -17,7 +17,7 @@ foreign import _stderr :: Pkgx -> EffectFnAff String foreign import _stdout :: Pkgx -> EffectFnAff String -foreign import asService :: Pkgx -> Effect Service +foreign import asService :: Pkgx -> String -> Effect Service id :: Pkgx -> Aff String diff --git a/sdk/purescript/demo/src/Main.purs b/sdk/purescript/demo/src/Main.purs index a1ba8b0..bdc70bf 100644 --- a/sdk/purescript/demo/src/Main.purs +++ b/sdk/purescript/demo/src/Main.purs @@ -6,33 +6,109 @@ import Effect (Effect) import Effect.Aff (launchAff_) import Effect.Class (liftEffect) import Effect.Class.Console as Console -import FluentCI.Client (dag, pipeline, setSecret) -import FluentCI.Mise (withWorkdir) -import FluentCI.Mise as Mise -import FluentCI.Pipeline (mise, withSecretVariable, withExec, stdout) -import FluentCI.Secret (plaintext) +import FluentCI.Class (asService, id, mise, nix, pkgx, stdout, withExec, withSecretVariable, withService, withWorkdir) +import FluentCI.Client (cache, dag, git, pipeline, setSecret) +import FluentCI.Directory (Directory, entries) +import FluentCI.Git (branch, tree) +import FluentCI.Mise (Mise) +import FluentCI.Pipeline (Pipeline) +import FluentCI.Pkgx (withPackages) +import FluentCI.Secret (Secret, plaintext) +import FluentCI.Service (Service) main :: Effect Unit main = launchAff_ do secret <- liftEffect $ setSecret dag "GITHUB" "my-github-token" value <- plaintext secret - p <- liftEffect $ do - p1 <- pipeline dag "secret-demo" - p2 <- withSecretVariable p1 "GITHUB" secret - withExec p2 ["echo", "$GITHUB"] + p <- liftEffect $ secretDemo secret output <- stdout p - m <- liftEffect $ do - pip <- pipeline dag "mise-demo" - m1 <- mise pip - m2 <- withWorkdir m1 "./mise-demo" - m3 <- Mise.withExec m2 ["mise", "--version"] - Mise.withExec m3 ["which", "bun"] - miseOutput <- Mise.stdout m - + m <- liftEffect $ miseDemo + miseOutput <- stdout m + + c <- liftEffect $ cache dag "pixi" + cacheId <- id c + + pingService <- liftEffect $ ping + pingGhService <- liftEffect $ pingGh + + pingDemoPipeline <- liftEffect $ pingDemo pingService pingGhService + pingOutput <- stdout pingDemoPipeline + + git <- liftEffect $ gitDemo + gitOutput <- stdout git + + gitEntries <- liftEffect $ gitEntriesDemo + gitEntriesOutput <- entries gitEntries + Console.log value Console.log "Secret demo:" Console.log output Console.log "Mise: " Console.log miseOutput + + Console.log "CacheId: " + Console.log cacheId + + Console.log "pingOutput: " + Console.log pingOutput + + Console.log "GitOutput: " + Console.log gitOutput + + Console.log "GitEntriesOutput: " + Console.debugShow gitEntriesOutput + +ping :: Effect Service +ping = do + p <- pipeline dag "demo" + p1 <- nix p { impure: true } + p2 <- withWorkdir p1 "./nix-demo" + p3 <- withExec p2 ["nix", "--version"] + p4 <- withExec p3 ["ping", "fluentci.io"] + asService p4 "ping-fluentci" + +secretDemo :: Secret -> Effect Pipeline +secretDemo secret = do + p <- pipeline dag "secret-demo" + p1 <- withSecretVariable p "GITHUB" secret + withExec p1 ["echo", "$GITHUB"] + +pingGh :: Effect Service +pingGh = do + p <- pipeline dag "demo" + p1 <- pkgx p + p2 <- withPackages p1 ["ping"] + p3 <- withExec p2 ["ping", "github.com"] + asService p3 "ping-github" + +miseDemo :: Effect Mise +miseDemo = do + p <- pipeline dag "mise-demo" + m <- mise p + m1 <- withWorkdir m "./mise-demo" + m2 <- withExec m1 ["mise", "--version"] + withExec m2 ["which", "bun"] + +pingDemo :: Service -> Service -> Effect Pipeline +pingDemo svc1 svc2 = do + p <- pipeline dag "ping-demo" + p1 <- withService p svc1 + p2 <- withService p1 svc2 + p3 <- withExec p2 ["sleep", "15"] + withExec p3 ["ls", "-ltr", ".fluentci"] + +gitDemo :: Effect Directory +gitDemo = do + g <- git dag "https://github.com/tsirysndr/me" + g1 <- branch g "main" + g2 <- tree g1 + g3 <- withExec g2 ["ls", "-ltr"] + withExec g3 ["pwd"] + +gitEntriesDemo :: Effect Directory +gitEntriesDemo = do + g <- git dag "https://github.com/tsirysndr/me" + g1 <- branch g "main" + tree g1 From 3862bae08bd2053491d4594a59cdcda246c762ea Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 14 Aug 2024 13:22:08 +0000 Subject: [PATCH 5/7] update example update example add comments --- sdk/purescript/demo/src/FluentCI/Cache.purs | 12 ++++++++ sdk/purescript/demo/src/Main.purs | 33 +++++---------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/sdk/purescript/demo/src/FluentCI/Cache.purs b/sdk/purescript/demo/src/FluentCI/Cache.purs index a593391..39de11f 100644 --- a/sdk/purescript/demo/src/FluentCI/Cache.purs +++ b/sdk/purescript/demo/src/FluentCI/Cache.purs @@ -10,8 +10,20 @@ foreign import _id :: Cache -> EffectFnAff String foreign import _key :: Cache -> EffectFnAff String +-- | Get the cache id. +-- | +-- | ```purescript +-- | c <- liftEffect $ cache dag "cache-demo" +-- | cacheId <- id c +-- | ``` id :: Cache -> Aff String id cache = fromEffectFnAff $ _id cache +-- | Get the cache key. +-- | +-- | ```purescript +-- | c <- liftEffect $ cache dag "cache-demo" +-- | cacheKey <- key c +-- | ``` key :: Cache -> Aff String key cache = fromEffectFnAff $ _key cache \ No newline at end of file diff --git a/sdk/purescript/demo/src/Main.purs b/sdk/purescript/demo/src/Main.purs index bdc70bf..d05d075 100644 --- a/sdk/purescript/demo/src/Main.purs +++ b/sdk/purescript/demo/src/Main.purs @@ -19,46 +19,27 @@ import FluentCI.Service (Service) main :: Effect Unit main = launchAff_ do secret <- liftEffect $ setSecret dag "GITHUB" "my-github-token" - value <- plaintext secret + plaintext secret >>= Console.log p <- liftEffect $ secretDemo secret - output <- stdout p + stdout p >>= Console.log m <- liftEffect $ miseDemo - miseOutput <- stdout m + stdout m >>= Console.log c <- liftEffect $ cache dag "pixi" - cacheId <- id c + id c >>= Console.log pingService <- liftEffect $ ping pingGhService <- liftEffect $ pingGh pingDemoPipeline <- liftEffect $ pingDemo pingService pingGhService - pingOutput <- stdout pingDemoPipeline + stdout pingDemoPipeline >>= Console.log git <- liftEffect $ gitDemo - gitOutput <- stdout git + stdout git >>= Console.log gitEntries <- liftEffect $ gitEntriesDemo - gitEntriesOutput <- entries gitEntries - - Console.log value - Console.log "Secret demo:" - Console.log output - - Console.log "Mise: " - Console.log miseOutput - - Console.log "CacheId: " - Console.log cacheId - - Console.log "pingOutput: " - Console.log pingOutput - - Console.log "GitOutput: " - Console.log gitOutput - - Console.log "GitEntriesOutput: " - Console.debugShow gitEntriesOutput + entries gitEntries >>= Console.debugShow ping :: Effect Service ping = do From b604920fc9887937e81ff1ed8ad87b60e4d79409 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 14 Aug 2024 14:15:20 +0000 Subject: [PATCH 6/7] update spago.dhall --- sdk/purescript/demo/spago.dhall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/purescript/demo/spago.dhall b/sdk/purescript/demo/spago.dhall index 0457830..5f55b08 100644 --- a/sdk/purescript/demo/spago.dhall +++ b/sdk/purescript/demo/spago.dhall @@ -10,7 +10,7 @@ When creating a new Spago project, you can use `spago init --no-comments` or `spago init -C` to generate this file without the comments in this block. -} -{ name = "my-project" +{ name = "fluentci" , dependencies = [ "aff", "console", "effect", "prelude" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs", "test/**/*.purs" ] From dcfb39f2d08c879677a36bd26c858dca895acba4 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 14 Aug 2024 14:56:11 +0000 Subject: [PATCH 7/7] move purescript sdk to another git repository update README.md --- sdk/purescript/README.md | 147 +++++++ sdk/purescript/demo/packages.dhall | 13 + sdk/purescript/demo/spago.dhall | 4 +- sdk/purescript/demo/src/FluentCI/Cache.js | 17 - sdk/purescript/demo/src/FluentCI/Cache.purs | 29 -- sdk/purescript/demo/src/FluentCI/Class.purs | 361 ------------------ sdk/purescript/demo/src/FluentCI/Client.js | 183 --------- sdk/purescript/demo/src/FluentCI/Client.purs | 57 --- sdk/purescript/demo/src/FluentCI/Devbox.js | 96 ----- sdk/purescript/demo/src/FluentCI/Devbox.purs | 45 --- sdk/purescript/demo/src/FluentCI/Devenv.js | 96 ----- sdk/purescript/demo/src/FluentCI/Devenv.purs | 44 --- sdk/purescript/demo/src/FluentCI/Directory.js | 169 -------- .../demo/src/FluentCI/Directory.purs | 78 ---- sdk/purescript/demo/src/FluentCI/Envhub.js | 104 ----- sdk/purescript/demo/src/FluentCI/Envhub.purs | 46 --- sdk/purescript/demo/src/FluentCI/File.js | 71 ---- sdk/purescript/demo/src/FluentCI/File.purs | 42 -- sdk/purescript/demo/src/FluentCI/Flox.js | 96 ----- sdk/purescript/demo/src/FluentCI/Flox.purs | 44 --- sdk/purescript/demo/src/FluentCI/Git.js | 31 -- sdk/purescript/demo/src/FluentCI/Git.purs | 24 -- sdk/purescript/demo/src/FluentCI/Mise.js | 96 ----- sdk/purescript/demo/src/FluentCI/Mise.purs | 44 --- sdk/purescript/demo/src/FluentCI/Nix.js | 96 ----- sdk/purescript/demo/src/FluentCI/Nix.purs | 46 --- sdk/purescript/demo/src/FluentCI/Pipeline.js | 140 ------- .../demo/src/FluentCI/Pipeline.purs | 64 ---- sdk/purescript/demo/src/FluentCI/Pixi.js | 96 ----- sdk/purescript/demo/src/FluentCI/Pixi.purs | 44 --- sdk/purescript/demo/src/FluentCI/Pkgx.js | 104 ----- sdk/purescript/demo/src/FluentCI/Pkgx.purs | 46 --- sdk/purescript/demo/src/FluentCI/Secret.js | 35 -- sdk/purescript/demo/src/FluentCI/Secret.purs | 31 -- .../demo/src/FluentCI/SecretManager.js | 19 - .../demo/src/FluentCI/SecretManager.purs | 18 - sdk/purescript/demo/src/FluentCI/Service.js | 8 - sdk/purescript/demo/src/FluentCI/Service.purs | 13 - 38 files changed, 162 insertions(+), 2535 deletions(-) create mode 100644 sdk/purescript/README.md delete mode 100644 sdk/purescript/demo/src/FluentCI/Cache.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Cache.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Class.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Client.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Client.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Devbox.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Devbox.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Devenv.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Devenv.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Directory.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Directory.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Envhub.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Envhub.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/File.js delete mode 100644 sdk/purescript/demo/src/FluentCI/File.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Flox.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Flox.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Git.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Git.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Mise.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Mise.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Nix.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Nix.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Pipeline.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Pipeline.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Pixi.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Pixi.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Pkgx.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Pkgx.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Secret.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Secret.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/SecretManager.js delete mode 100644 sdk/purescript/demo/src/FluentCI/SecretManager.purs delete mode 100644 sdk/purescript/demo/src/FluentCI/Service.js delete mode 100644 sdk/purescript/demo/src/FluentCI/Service.purs diff --git a/sdk/purescript/README.md b/sdk/purescript/README.md new file mode 100644 index 0000000..4439938 --- /dev/null +++ b/sdk/purescript/README.md @@ -0,0 +1,147 @@ +# FluentCI Purescript SDK + +The FluentCI Purescript SDK is a library that provides a Purescript interface to the FluentCI API. + +Go to the [purescript-fluentci](https://github.com/fluentci-io/purescript-fluentci) repository for more information. + +## 🚚 Installation + +Add `fluentci` to your `spago.dhall` dependencies: + +```dhall +{ name = "demo" +, dependencies = [ "aff", "console", "effect", "prelude", "fluentci" ] +, packages = ./packages.dhall +, sources = [ "src/**/*.purs", "test/**/*.purs" ] +} +``` + +And add the following to your `packages.dhall`: + +```dhall +let upstream = + https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20240812/packages.dhall + sha256:557dc416167543923d0f944fdc0c7bc3e0466b9467a8fc2fba0460f8d5425725 + +in upstream + with fluentci = + { dependencies = + [ "aff" + , "console" + , "effect" + , "prelude" + ] + , repo = + "https://github.com/fluentci-io/purescript-fluentci.git" + , version = + "d0d904915b1eade1f1e72ab541708ad4b43ccd5e" + } +``` + +Then install the package: + +```bash +spago install +``` + +## 🚀 Quick Start + +This is a quick start guide to get you up and running with the FluentCI Purescript SDK. + +```purescript +module Main where + +import Prelude + +import Effect (Effect) +import Effect.Aff (launchAff_) +import Effect.Class (liftEffect) +import Effect.Class.Console as Console +import FluentCI.Class (asService, id, mise, nix, pkgx, stdout, withExec, withSecretVariable, withService, withWorkdir) +import FluentCI.Client (cache, dag, git, pipeline, setSecret) +import FluentCI.Directory (Directory, entries) +import FluentCI.Git (branch, tree) +import FluentCI.Mise (Mise) +import FluentCI.Pipeline (Pipeline) +import FluentCI.Pkgx (withPackages) +import FluentCI.Secret (Secret, plaintext) +import FluentCI.Service (Service) + +main :: Effect Unit +main = launchAff_ do + secret <- liftEffect $ setSecret dag "GITHUB" "my-github-token" + plaintext secret >>= Console.log + p <- liftEffect $ secretDemo secret + stdout p >>= Console.log + + m <- liftEffect $ miseDemo + stdout m >>= Console.log + + c <- liftEffect $ cache dag "pixi" + id c >>= Console.log + + pingService <- liftEffect $ ping + pingGhService <- liftEffect $ pingGh + + pingDemoPipeline <- liftEffect $ pingDemo pingService pingGhService + stdout pingDemoPipeline >>= Console.log + + git <- liftEffect $ gitDemo + stdout git >>= Console.log + + gitEntries <- liftEffect $ gitEntriesDemo + entries gitEntries >>= Console.debugShow + +ping :: Effect Service +ping = do + p <- pipeline dag "demo" + p1 <- nix p { impure: true } + p2 <- withWorkdir p1 "./nix-demo" + p3 <- withExec p2 ["nix", "--version"] + p4 <- withExec p3 ["ping", "fluentci.io"] + asService p4 "ping-fluentci" + +secretDemo :: Secret -> Effect Pipeline +secretDemo secret = do + p <- pipeline dag "secret-demo" + p1 <- withSecretVariable p "GITHUB" secret + withExec p1 ["echo", "$GITHUB"] + +pingGh :: Effect Service +pingGh = do + p <- pipeline dag "demo" + p1 <- pkgx p + p2 <- withPackages p1 ["ping"] + p3 <- withExec p2 ["ping", "github.com"] + asService p3 "ping-github" + +miseDemo :: Effect Mise +miseDemo = do + p <- pipeline dag "mise-demo" + m <- mise p + m1 <- withWorkdir m "./mise-demo" + m2 <- withExec m1 ["mise", "--version"] + withExec m2 ["which", "bun"] + +pingDemo :: Service -> Service -> Effect Pipeline +pingDemo svc1 svc2 = do + p <- pipeline dag "ping-demo" + p1 <- withService p svc1 + p2 <- withService p1 svc2 + p3 <- withExec p2 ["sleep", "15"] + withExec p3 ["ls", "-ltr", ".fluentci"] + +gitDemo :: Effect Directory +gitDemo = do + g <- git dag "https://github.com/tsirysndr/me" + g1 <- branch g "main" + g2 <- tree g1 + g3 <- withExec g2 ["ls", "-ltr"] + withExec g3 ["pwd"] + +gitEntriesDemo :: Effect Directory +gitEntriesDemo = do + g <- git dag "https://github.com/tsirysndr/me" + g1 <- branch g "main" + tree g1 +``` diff --git a/sdk/purescript/demo/packages.dhall b/sdk/purescript/demo/packages.dhall index dc350c8..0f003f6 100644 --- a/sdk/purescript/demo/packages.dhall +++ b/sdk/purescript/demo/packages.dhall @@ -103,3 +103,16 @@ let upstream = sha256:557dc416167543923d0f944fdc0c7bc3e0466b9467a8fc2fba0460f8d5425725 in upstream + with fluentci = + { dependencies = + [ "aff" + , "console" + , "effect" + , "prelude" + ] + , repo = + "https://github.com/fluentci-io/purescript-fluentci.git" + , version = + "d0d904915b1eade1f1e72ab541708ad4b43ccd5e" + } + diff --git a/sdk/purescript/demo/spago.dhall b/sdk/purescript/demo/spago.dhall index 5f55b08..b2fef1a 100644 --- a/sdk/purescript/demo/spago.dhall +++ b/sdk/purescript/demo/spago.dhall @@ -10,8 +10,8 @@ When creating a new Spago project, you can use `spago init --no-comments` or `spago init -C` to generate this file without the comments in this block. -} -{ name = "fluentci" -, dependencies = [ "aff", "console", "effect", "prelude" ] +{ name = "demo" +, dependencies = [ "aff", "console", "effect", "prelude", "fluentci" ] , packages = ./packages.dhall , sources = [ "src/**/*.purs", "test/**/*.purs" ] } diff --git a/sdk/purescript/demo/src/FluentCI/Cache.js b/sdk/purescript/demo/src/FluentCI/Cache.js deleted file mode 100644 index 8062e32..0000000 --- a/sdk/purescript/demo/src/FluentCI/Cache.js +++ /dev/null @@ -1,17 +0,0 @@ -export function _id(c) { - return function (onError, onSuccess) { - c.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _key(c) { - return function (onError, onSuccess) { - c.key().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Cache.purs b/sdk/purescript/demo/src/FluentCI/Cache.purs deleted file mode 100644 index 39de11f..0000000 --- a/sdk/purescript/demo/src/FluentCI/Cache.purs +++ /dev/null @@ -1,29 +0,0 @@ -module FluentCI.Cache where - -import Prelude -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) - -data Cache - -foreign import _id :: Cache -> EffectFnAff String - -foreign import _key :: Cache -> EffectFnAff String - --- | Get the cache id. --- | --- | ```purescript --- | c <- liftEffect $ cache dag "cache-demo" --- | cacheId <- id c --- | ``` -id :: Cache -> Aff String -id cache = fromEffectFnAff $ _id cache - --- | Get the cache key. --- | --- | ```purescript --- | c <- liftEffect $ cache dag "cache-demo" --- | cacheKey <- key c --- | ``` -key :: Cache -> Aff String -key cache = fromEffectFnAff $ _key cache \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Class.purs b/sdk/purescript/demo/src/FluentCI/Class.purs deleted file mode 100644 index a4c719b..0000000 --- a/sdk/purescript/demo/src/FluentCI/Class.purs +++ /dev/null @@ -1,361 +0,0 @@ -module FluentCI.Class where - - -import Effect (Effect) -import Effect.Aff (Aff) -import FluentCI.Cache as Cache -import FluentCI.Devbox as Devbox -import FluentCI.Devenv as Devenv -import FluentCI.Directory as Directory -import FluentCI.Flox as Flox -import FluentCI.Mise as Mise -import FluentCI.Nix (NixArgs) -import FluentCI.Nix as Nix -import FluentCI.Pipeline as Pipeline -import FluentCI.Pixi as Pixi -import FluentCI.Pkgx as Pkgx -import FluentCI.Secret as Secret -import FluentCI.Service as Service - -class Id a where - id :: a -> Aff String - -instance Id Devbox.Devbox where - id devbox = Devbox.id devbox - -instance Id Devenv.Devenv where - id devenv = Devenv.id devenv - -instance Id Cache.Cache where - id cache = Cache.id cache - -instance Id Directory.Directory where - id directory = Directory.id directory - -instance Id Mise.Mise where - id mise = Mise.id mise - -instance Id Nix.Nix where - id nix = Nix.id nix - -instance Id Pixi.Pixi where - id pixi = Pixi.id pixi - -instance Id Pkgx.Pkgx where - id pkgx = Pkgx.id pkgx - -instance Id Flox.Flox where - id flox = Flox.id flox - -instance Id Pipeline.Pipeline where - id pipeline = Pipeline.id pipeline - -instance Id Service.Service where - id service = Service.id service - -instance Id Secret.Secret where - id secret = Secret.id secret - -class Stderr a where - stderr :: a -> Aff String - -instance Stderr Pipeline.Pipeline where - stderr pipeline = Pipeline.stderr pipeline - -instance Stderr Mise.Mise where - stderr mise = Mise.stderr mise - -instance Stderr Devbox.Devbox where - stderr devbox = Devbox.stderr devbox - -instance Stderr Devenv.Devenv where - stderr devenv = Devenv.stderr devenv - -instance Stderr Nix.Nix where - stderr nix = Nix.stderr nix - -instance Stderr Pixi.Pixi where - stderr pixi = Pixi.stderr pixi - -instance Stderr Pkgx.Pkgx where - stderr pkgx = Pkgx.stderr pkgx - -instance Stderr Flox.Flox where - stderr flox = Flox.stderr flox - -instance Stderr Directory.Directory where - stderr directory = Directory.stderr directory - - -class Stdout a where - stdout :: a -> Aff String - -instance Stdout Pipeline.Pipeline where - stdout pipeline = Pipeline.stdout pipeline - -instance Stdout Mise.Mise where - stdout mise = Mise.stdout mise - -instance Stdout Devbox.Devbox where - stdout devbox = Devbox.stdout devbox - -instance Stdout Devenv.Devenv where - stdout devenv = Devenv.stdout devenv - -instance Stdout Nix.Nix where - stdout nix = Nix.stdout nix - -instance Stdout Pixi.Pixi where - stdout pixi = Pixi.stdout pixi - -instance Stdout Pkgx.Pkgx where - stdout pkgx = Pkgx.stdout pkgx - -instance Stdout Flox.Flox where - stdout flox = Flox.stdout flox - -instance Stdout Directory.Directory where - stdout directory = Directory.stdout directory - -class AsService a where - asService :: a -> String -> Effect Service.Service - -instance AsService Devbox.Devbox where - asService devbox name = Devbox.asService devbox name - -instance AsService Devenv.Devenv where - asService devenv name = Devenv.asService devenv name - -instance AsService Nix.Nix where - asService nix name = Nix.asService nix name - -instance AsService Mise.Mise where - asService mise name = Mise.asService mise name - -instance AsService Pipeline.Pipeline where - asService pipeline name = Pipeline.asService pipeline name - -instance AsService Pixi.Pixi where - asService pixi name = Pixi.asService pixi name - -instance AsService Pkgx.Pkgx where - asService pkgx = Pkgx.asService pkgx - -instance AsService Flox.Flox where - asService flox name = Flox.asService flox name - - -class WaitOn a where - waitOn :: a -> Int -> Int -> Effect a - -instance WaitOn Devbox.Devbox where - waitOn devbox port timeout = Devbox.waitOn devbox port timeout - -instance WaitOn Devenv.Devenv where - waitOn devenv port timeout = Devenv.waitOn devenv port timeout - -instance WaitOn Nix.Nix where - waitOn nix port timeout = Nix.waitOn nix port timeout - -instance WaitOn Mise.Mise where - waitOn mise port timeout = Mise.waitOn mise port timeout - -instance WaitOn Pipeline.Pipeline where - waitOn pipeline port timeout = Pipeline.waitOn pipeline port timeout - -instance WaitOn Pixi.Pixi where - waitOn pixi port timeout = Pixi.waitOn pixi port timeout - -instance WaitOn Pkgx.Pkgx where - waitOn pkgx port timeout = Pkgx.waitOn pkgx port timeout - -instance WaitOn Flox.Flox where - waitOn flox port timeout = Flox.waitOn flox port timeout - - -class WithCache a where - withCache :: a -> Cache.Cache -> Effect a - -instance WithCache Devbox.Devbox where - withCache devbox cache = Devbox.withCache devbox cache - -instance WithCache Devenv.Devenv where - withCache devenv cache = Devenv.withCache devenv cache - -instance WithCache Nix.Nix where - withCache nix cache = Nix.withCache nix cache - -instance WithCache Mise.Mise where - withCache mise cache = Mise.withCache mise cache - -instance WithCache Pipeline.Pipeline where - withCache pipeline cache = Pipeline.withCache pipeline cache - -instance WithCache Pixi.Pixi where - withCache pixi cache = Pixi.withCache pixi cache - -instance WithCache Pkgx.Pkgx where - withCache pkgx cache = Pkgx.withCache pkgx cache - -instance WithCache Flox.Flox where - withCache flox cache = Flox.withCache flox cache - -class WithEnvVariable a where - withEnvVariable :: a -> String -> String -> Effect a - -class WithExec a where - withExec :: a -> Array String -> Effect a - -instance WithExec Devbox.Devbox where - withExec devbox args = Devbox.withExec devbox args - -instance WithExec Devenv.Devenv where - withExec devenv args = Devenv.withExec devenv args - -instance WithExec Nix.Nix where - withExec nix args = Nix.withExec nix args - -instance WithExec Mise.Mise where - withExec mise args = Mise.withExec mise args - -instance WithExec Pipeline.Pipeline where - withExec pipeline args = Pipeline.withExec pipeline args - -instance WithExec Pixi.Pixi where - withExec pixi args = Pixi.withExec pixi args - -instance WithExec Pkgx.Pkgx where - withExec pkgx args = Pkgx.withExec pkgx args - -instance WithExec Flox.Flox where - withExec flox args = Flox.withExec flox args - -instance WithExec Directory.Directory where - withExec directory args = Directory.withExec directory args - -class WithSecretVariable a where - withSecretVariable :: a -> String -> Secret.Secret -> Effect a - -instance WithSecretVariable Devbox.Devbox where - withSecretVariable devbox name secret = Devbox.withSecretVariable devbox name secret - -instance WithSecretVariable Devenv.Devenv where - withSecretVariable devenv name secret = Devenv.withSecretVariable devenv name secret - -instance WithSecretVariable Nix.Nix where - withSecretVariable nix name secret = Nix.withSecretVariable nix name secret - -instance WithSecretVariable Mise.Mise where - withSecretVariable mise name secret = Mise.withSecretVariable mise name secret - -instance WithSecretVariable Pipeline.Pipeline where - withSecretVariable pipeline name secret = Pipeline.withSecretVariable pipeline name secret - -instance WithSecretVariable Pixi.Pixi where - withSecretVariable pixi name secret = Pixi.withSecretVariable pixi name secret - -instance WithSecretVariable Pkgx.Pkgx where - withSecretVariable pkgx name secret = Pkgx.withSecretVariable pkgx name secret - -instance WithSecretVariable Flox.Flox where - withSecretVariable flox name secret = Flox.withSecretVariable flox name secret - -class WithService a where - withService :: a -> Service.Service -> Effect a - -instance WithService Devbox.Devbox where - withService devbox service = Devbox.withService devbox service - -instance WithService Devenv.Devenv where - withService devenv service = Devenv.withService devenv service - -instance WithService Nix.Nix where - withService nix service = Nix.withService nix service - -instance WithService Mise.Mise where - withService mise service = Mise.withService mise service - -instance WithService Pipeline.Pipeline where - withService pipeline service = Pipeline.withService pipeline service - -instance WithService Pixi.Pixi where - withService pixi service = Pixi.withService pixi service - -instance WithService Pkgx.Pkgx where - withService pkgx service = Pkgx.withService pkgx service - -instance WithService Flox.Flox where - withService flox service = Flox.withService flox service - - -class WithWorkdir a where - withWorkdir :: a -> String -> Effect a - -instance WithWorkdir Devbox.Devbox where - withWorkdir devbox path = Devbox.withWorkdir devbox path - -instance WithWorkdir Devenv.Devenv where - withWorkdir devenv path = Devenv.withWorkdir devenv path - -instance WithWorkdir Nix.Nix where - withWorkdir nix path = Nix.withWorkdir nix path - -instance WithWorkdir Mise.Mise where - withWorkdir mise path = Mise.withWorkdir mise path - -instance WithWorkdir Pipeline.Pipeline where - withWorkdir pipeline path = Pipeline.withWorkdir pipeline path - -instance WithWorkdir Pixi.Pixi where - withWorkdir pixi path = Pixi.withWorkdir pixi path - -instance WithWorkdir Pkgx.Pkgx where - withWorkdir pkgx path = Pkgx.withWorkdir pkgx path - -instance WithWorkdir Flox.Flox where - withWorkdir flox path = Flox.withWorkdir flox path - -class Devbox a where - devbox :: a -> Effect Devbox.Devbox - -instance Devbox Pipeline.Pipeline where - devbox pipeline = Pipeline.devbox pipeline - -instance Devbox Directory.Directory where - devbox directory = Directory.devbox directory - -class Mise a where - mise :: a -> Effect Mise.Mise - -instance Mise Pipeline.Pipeline where - mise pipeline = Pipeline.mise pipeline - -instance Mise Directory.Directory where - mise directory = Directory.mise directory - -class Nix a where - nix :: a -> NixArgs -> Effect Nix.Nix - -instance Nix Pipeline.Pipeline where - nix pipeline args = Pipeline.nix pipeline args - -instance Nix Directory.Directory where - nix directory args = Directory.nix directory args - -class Pixi a where - pixi :: a -> Effect Pixi.Pixi - -instance Pixi Pipeline.Pipeline where - pixi pipeline = Pipeline.pixi pipeline - -instance Pixi Directory.Directory where - pixi directory = Directory.pixi directory - -class Pkgx a where - pkgx :: a -> Effect Pkgx.Pkgx - -instance Pkgx Pipeline.Pipeline where - pkgx pipeline = Pipeline.pkgx pipeline - -instance Pkgx Directory.Directory where - pkgx directory = Directory.pkgx directory diff --git a/sdk/purescript/demo/src/FluentCI/Client.js b/sdk/purescript/demo/src/FluentCI/Client.js deleted file mode 100644 index 867d368..0000000 --- a/sdk/purescript/demo/src/FluentCI/Client.js +++ /dev/null @@ -1,183 +0,0 @@ -import { dag } from "@fluentci/sdk"; - -export { dag }; - -export function awsSecretsManager(c) { - return function (client) { - return function (region) { - return function (accessKeyId) { - return function (clientSecret) { - return function (tenantId) { - return function (keyvaultName) { - return function (keyvaultUrl) { - return function () { - return c.awsSecretsManager({ - client, - region, - accessKeyId, - clientSecret, - tenantId, - keyvaultName, - keyvaultUrl, - }); - }; - }; - }; - }; - }; - }; - }; - }; -} - -export function azureKeyvault(c) { - return function (clientId) { - return function (clientSecret) { - return function (tenantId) { - return function (keyvaultName) { - return function (keyvaultUrl) { - return function () { - return c.azureKeyvault({ - clientId, - clientSecret, - tenantId, - keyvaultName, - keyvaultUrl, - }); - }; - }; - }; - }; - }; - }; -} - -export function cache(c) { - return function (key) { - return function () { - return c.cache(key); - }; - }; -} - -export function devbox(c) { - return function () { - return c.devbox(); - }; -} - -export function devenv(c) { - return function () { - return c.devenv(); - }; -} - -export function directory(c) { - return function (path) { - return function () { - return c.directory(path); - }; - }; -} - -export function file(c) { - return function (path) { - return function () { - return c.file(path); - }; - }; -} - -export function flox(c) { - return function () { - return c.flox(); - }; -} - -export function git(c) { - return function (url) { - return function () { - return c.git(url); - }; - }; -} - -export function googleCloudSecretManager(c) { - return function (client) { - return function (project) { - return function (googleCredentialsFile) { - return function () { - return c.googleCloudSecretManager({ - client, - project, - googleCredentialsFile, - }); - }; - }; - }; - }; -} - -export function hashicorpVault(c) { - return function (address) { - return function (token) { - return function (cacerts) { - return function () { - return c.hashicorpVault(address, token, cacerts); - }; - }; - }; - }; -} - -export function http(c) { - return function (url) { - return function () { - return c.http(url); - }; - }; -} - -export function mise(c) { - return function () { - return c.mise(); - }; -} - -export function nix(c) { - return function (args) { - return function () { - return c.nix(args); - }; - }; -} - -export function pipeline(c) { - return function (name) { - return function () { - return c.pipeline(name); - }; - }; -} - -export function pixi(c) { - return function () { - return c.pixi(); - }; -} - -export function pkgx(c) { - return function () { - return c.pkgx(); - }; -} - -export function setSecret(c) { - return function (name) { - return function (value) { - return function () { - return c.setSecret(name, value); - }; - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Client.purs b/sdk/purescript/demo/src/FluentCI/Client.purs deleted file mode 100644 index 857f253..0000000 --- a/sdk/purescript/demo/src/FluentCI/Client.purs +++ /dev/null @@ -1,57 +0,0 @@ -module FluentCI.Client where - -import Effect (Effect) -import FluentCI.Cache (Cache) -import FluentCI.Devbox (Devbox) -import FluentCI.Devenv (Devenv) -import FluentCI.Directory (Directory, File) -import FluentCI.Flox (Flox) -import FluentCI.Git (Git) -import FluentCI.Mise (Mise) -import FluentCI.Nix (Nix, NixArgs) -import FluentCI.Pipeline (Pipeline) -import FluentCI.Pixi (Pixi) -import FluentCI.Pkgx (Pkgx) -import FluentCI.Secret (Secret) -import FluentCI.SecretManager (SecretManager) - -data Client - -foreign import dag :: Client - -foreign import awsSecretsManager :: Client -> String -> String -> String -> String -> Effect SecretManager - -foreign import azureKeyvault :: Client -> String -> String -> String -> String -> String -> Effect SecretManager - -foreign import cache :: Client -> String -> Effect Cache - -foreign import devbox :: Client -> Effect Devbox - -foreign import devenv :: Client -> Effect Devenv - -foreign import directory :: Client -> String -> Effect Directory - -foreign import file :: Client -> String -> Effect File - -foreign import flox :: Client -> Effect Flox - -foreign import git :: Client -> String -> Effect Git - -foreign import googleCloudSecretManager :: Client -> String -> String -> Effect SecretManager - -foreign import hashicorpVault :: Client -> String -> String -> String -> String -> Effect SecretManager - -foreign import http :: Client -> String -> Effect File - -foreign import mise :: Client -> Effect Mise - -foreign import nix :: Client -> NixArgs -> Effect Nix - -foreign import pipeline :: Client -> String -> Effect Pipeline - -foreign import pixi :: Client -> Effect Pixi - - -foreign import pkgx :: Client -> Effect Pkgx - -foreign import setSecret :: Client -> String -> String -> Effect Secret diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.js b/sdk/purescript/demo/src/FluentCI/Devbox.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Devbox.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Devbox.purs b/sdk/purescript/demo/src/FluentCI/Devbox.purs deleted file mode 100644 index ce1c73f..0000000 --- a/sdk/purescript/demo/src/FluentCI/Devbox.purs +++ /dev/null @@ -1,45 +0,0 @@ -module FluentCI.Devbox where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - - -data Devbox - -foreign import _id :: Devbox -> EffectFnAff String - -foreign import _stderr :: Devbox -> EffectFnAff String - -foreign import _stdout :: Devbox -> EffectFnAff String - -foreign import asService :: Devbox -> String -> Effect Service - - -id :: Devbox -> Aff String -id devbox = fromEffectFnAff $ _id devbox - -stderr :: Devbox -> Aff String -stderr devbox = fromEffectFnAff $ _stderr devbox - -stdout :: Devbox -> Aff String -stdout devbox = fromEffectFnAff $ _stdout devbox - -foreign import waitOn :: Devbox -> Int -> Int -> Effect Devbox - -foreign import withCache :: Devbox -> Cache -> Effect Devbox - -foreign import withEnvVariable :: Devbox -> String -> String -> Effect Devbox - -foreign import withExec :: Devbox -> Array String -> Effect Devbox - -foreign import withSecretVariable :: Devbox -> String -> Secret -> Effect Devbox - -foreign import withService :: Devbox -> Service -> Effect Devbox - -foreign import withWorkdir :: Devbox -> String -> Effect Devbox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.js b/sdk/purescript/demo/src/FluentCI/Devenv.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Devenv.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Devenv.purs b/sdk/purescript/demo/src/FluentCI/Devenv.purs deleted file mode 100644 index f1998af..0000000 --- a/sdk/purescript/demo/src/FluentCI/Devenv.purs +++ /dev/null @@ -1,44 +0,0 @@ -module FluentCI.Devenv where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - - -data Devenv - -foreign import _id :: Devenv -> EffectFnAff String - -foreign import _stderr :: Devenv -> EffectFnAff String - -foreign import _stdout :: Devenv -> EffectFnAff String - -foreign import asService :: Devenv -> String -> Effect Service - -foreign import waitOn :: Devenv -> Int -> Int -> Effect Devenv - -foreign import withCache :: Devenv -> Cache -> Effect Devenv - -foreign import withEnvVariable :: Devenv -> String -> String -> Effect Devenv - -foreign import withExec :: Devenv -> Array String -> Effect Devenv - -foreign import withSecretVariable :: Devenv -> String -> Secret -> Effect Devenv - -foreign import withService :: Devenv -> Service -> Effect Devenv - -foreign import withWorkdir :: Devenv -> String -> Effect Devenv - -id :: Devenv -> Aff String -id devenv = fromEffectFnAff $ _id devenv - -stderr :: Devenv -> Aff String -stderr devenv = fromEffectFnAff $ _stderr devenv - -stdout :: Devenv -> Aff String -stdout devenv = fromEffectFnAff $ _stdout devenv \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Directory.js b/sdk/purescript/demo/src/FluentCI/Directory.js deleted file mode 100644 index 7dc8b09..0000000 --- a/sdk/purescript/demo/src/FluentCI/Directory.js +++ /dev/null @@ -1,169 +0,0 @@ -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function devbox(d) { - return function () { - return d.devbox(); - }; -} - -export function devenv(d) { - return function () { - return d.devenv(); - }; -} - -export function _entries(d) { - return function (onError, onSuccess) { - d.entries().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function flox(d) { - return function () { - return d.flox(); - }; -} - -export function mise(d) { - return function () { - return d.mise(); - }; -} - -export function nix(d) { - return function (args) { - return function () { - return d.nix(args); - }; - }; -} - -export function pixi(d) { - return function () { - return d.pixi(); - }; -} - -export function pkgx(d) { - return function () { - return d.pkgx(); - }; -} - -export function directory(d) { - return function (path) { - return function () { - return d.directory(path); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (path) { - return function () { - return d.withWorkdir(path); - }; - }; -} - -export function withFile(d) { - return function (path) { - return function () { - return d.withFile(path); - }; - }; -} - -export function zip(d) { - return function () { - return d.zip(); - }; -} - -export function tarCzvf(d) { - return function () { - return d.tarCzvf(); - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Directory.purs b/sdk/purescript/demo/src/FluentCI/Directory.purs deleted file mode 100644 index 814db54..0000000 --- a/sdk/purescript/demo/src/FluentCI/Directory.purs +++ /dev/null @@ -1,78 +0,0 @@ -module FluentCI.Directory where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Devbox (Devbox) -import FluentCI.Devenv (Devenv) -import FluentCI.Flox (Flox) -import FluentCI.Mise (Mise) -import FluentCI.Nix (Nix, NixArgs) -import FluentCI.Pixi (Pixi) -import FluentCI.Pkgx (Pkgx) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - - -data Directory - -data File - -foreign import _id :: Directory -> EffectFnAff String - -foreign import _stderr :: Directory -> EffectFnAff String - -foreign import _stdout :: Directory -> EffectFnAff String - -foreign import _entries :: Directory -> EffectFnAff (Array String) - -id :: Directory -> Aff String -id dir = fromEffectFnAff $ _id dir - -stderr :: Directory -> Aff String -stderr dir = fromEffectFnAff $ _stderr dir - -stdout :: Directory -> Aff String -stdout dir = fromEffectFnAff $ _stdout dir - -entries :: Directory -> Aff (Array String) -entries dir = fromEffectFnAff $ _entries dir - -foreign import devbox :: Directory -> Effect Devbox - -foreign import devenv :: Directory -> Effect Devenv - -foreign import flox :: Directory -> Effect Flox - -foreign import mise :: Directory -> Effect Mise - -foreign import nix :: Directory -> NixArgs -> Effect Nix - -foreign import pixi :: Directory -> Effect Pixi - -foreign import pkgx :: Directory -> Effect Pkgx - -foreign import directory :: Directory -> String -> Aff Directory - -foreign import tarCzvf :: Directory -> Aff File - -foreign import waitOn :: Directory -> Int -> Int -> Aff Directory - -foreign import withCache :: Directory -> Cache -> Aff Directory - -foreign import withEnvVariable :: Directory -> String -> String -> Aff Directory - -foreign import withExec :: Directory -> Array String -> Effect Directory - -foreign import withFile :: Directory -> String -> Aff Directory - -foreign import withSecretVariable :: Directory -> String -> Secret -> Aff Directory - -foreign import withService :: Directory -> Service -> Aff Directory - -foreign import withWorkdir :: Directory -> String -> Aff Directory - -foreign import zip :: Directory -> Aff File \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.js b/sdk/purescript/demo/src/FluentCI/Envhub.js deleted file mode 100644 index 5281f2a..0000000 --- a/sdk/purescript/demo/src/FluentCI/Envhub.js +++ /dev/null @@ -1,104 +0,0 @@ -export function _id(e) { - return function (onError, onSuccess) { - e.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _stderr(e) { - return function (onError, onSuccess) { - e.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(e) { - return function (onError, onSuccess) { - e.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function use(e) { - return function (environement) { - return function () { - return e.use(environement); - }; - }; -} - -export function waitOn(e) { - return function (port) { - return function (timeout) { - return function () { - return e.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(e) { - return function (cache) { - return function () { - return e.withCache(cache); - }; - }; -} - -export function withEnvVariable(e) { - return function (name) { - return function (value) { - return function () { - return e.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(e) { - return function (command) { - return function () { - return e.withExec(command); - }; - }; -} - -export function withSecretVariable(e) { - return function (name) { - return function (secret) { - return function () { - return e.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(e) { - return function (service) { - return function () { - return e.withService(service); - }; - }; -} - -export function withWorkdir(e) { - return function (path) { - return function () { - return e.withWorkdir(path); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Envhub.purs b/sdk/purescript/demo/src/FluentCI/Envhub.purs deleted file mode 100644 index 958506b..0000000 --- a/sdk/purescript/demo/src/FluentCI/Envhub.purs +++ /dev/null @@ -1,46 +0,0 @@ -module FluentCI.Envhub where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - - -data Envhub - -foreign import _id :: Envhub -> EffectFnAff String - -foreign import _stderr :: Envhub -> EffectFnAff String - -foreign import _stdout :: Envhub -> EffectFnAff String - -id :: Envhub -> Aff String -id envhub = fromEffectFnAff $ _id envhub - -stderr :: Envhub -> Aff String -stderr envhub = fromEffectFnAff $ _stderr envhub - -stdout :: Envhub -> Aff String -stdout envhub = fromEffectFnAff $ _stdout envhub - -foreign import use :: Envhub -> String -> Aff Envhub - -foreign import asService :: Envhub -> String-> Effect Service - -foreign import waitOn :: Envhub -> Int -> Int -> Aff Envhub - -foreign import withCache :: Envhub -> Cache -> Aff Envhub - -foreign import withEnvVariable :: Envhub -> String -> String -> Aff Envhub - -foreign import withExec :: Envhub -> Array String -> Aff Envhub - -foreign import withSecretVariable :: Envhub -> String -> Secret -> Aff Envhub - -foreign import withService :: Envhub -> Service -> Aff Envhub - -foreign import withWorkdir :: Envhub -> String -> Aff Envhub \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/File.js b/sdk/purescript/demo/src/FluentCI/File.js deleted file mode 100644 index 92812ac..0000000 --- a/sdk/purescript/demo/src/FluentCI/File.js +++ /dev/null @@ -1,71 +0,0 @@ -export function _id(f) { - return function (onError, onSuccess) { - f.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _chmod(f) { - return function (mode) { - return function () { - return f.chmod(mode); - }; - }; -} - -export function _md5(f) { - return function (onError, onSuccess) { - f.md5().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _path(f) { - return function (onError, onSuccess) { - f.path().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _sha256(f) { - return function (onError, onSuccess) { - f.sha256().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function tarCzvf(f) { - return function () { - return f.tarCzvf(); - }; -} - -export function tarXzvf(f) { - return function (outputDir) { - return f.tarXzvf(outputDir); - }; -} - -export function unzip(f) { - return function (outputDir) { - return function () { - return f.unzip(outputDir); - }; - }; -} - -export function zip(f) { - return function () { - return function () { - return f.zip(); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/File.purs b/sdk/purescript/demo/src/FluentCI/File.purs deleted file mode 100644 index 9003f59..0000000 --- a/sdk/purescript/demo/src/FluentCI/File.purs +++ /dev/null @@ -1,42 +0,0 @@ -module FluentCI.File where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Directory (Directory, File) - - -foreign import _id :: File -> EffectFnAff String - -foreign import _chmod :: File -> String -> EffectFnAff File - -foreign import _md5 :: File -> EffectFnAff String - -foreign import _path :: File -> EffectFnAff String - -foreign import _sha256 :: File -> EffectFnAff String - -id :: File -> Aff String -id file = fromEffectFnAff $ _id file - -chmod :: File -> String -> Aff File -chmod file mode = fromEffectFnAff $ _chmod file mode - -md5 :: File -> Aff String -md5 file = fromEffectFnAff $ _md5 file - -path :: File -> Aff String -path file = fromEffectFnAff $ _path file - -sha256 :: File -> Aff String -sha256 file = fromEffectFnAff $ _sha256 file - -foreign import tarCzvf :: File -> Effect File - -foreign import tarXzvf :: File -> Effect Directory - -foreign import unzip :: File -> Effect Directory - -foreign import zip :: File -> Effect File diff --git a/sdk/purescript/demo/src/FluentCI/Flox.js b/sdk/purescript/demo/src/FluentCI/Flox.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Flox.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Flox.purs b/sdk/purescript/demo/src/FluentCI/Flox.purs deleted file mode 100644 index 4dd8291..0000000 --- a/sdk/purescript/demo/src/FluentCI/Flox.purs +++ /dev/null @@ -1,44 +0,0 @@ -module FluentCI.Flox where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -data Flox - -foreign import _id :: Flox -> EffectFnAff String - -foreign import _stderr :: Flox -> EffectFnAff String - -foreign import _stdout :: Flox -> EffectFnAff String - -foreign import asService :: Flox -> String -> Effect Service - - -id :: Flox -> Aff String -id flox = fromEffectFnAff $ _id flox - -stderr :: Flox -> Aff String -stderr flox = fromEffectFnAff $ _stderr flox - -stdout :: Flox -> Aff String -stdout flox = fromEffectFnAff $ _stdout flox - -foreign import waitOn :: Flox -> Int -> Int -> Effect Flox - -foreign import withCache :: Flox -> Cache -> Effect Flox - -foreign import withEnvVariable :: Flox -> String -> String -> Effect Flox - -foreign import withExec :: Flox -> Array String -> Effect Flox - -foreign import withSecretVariable :: Flox -> String -> Secret -> Effect Flox - -foreign import withService :: Flox -> Service -> Effect Flox - -foreign import withWorkdir :: Flox -> String -> Effect Flox \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Git.js b/sdk/purescript/demo/src/FluentCI/Git.js deleted file mode 100644 index 0eabec4..0000000 --- a/sdk/purescript/demo/src/FluentCI/Git.js +++ /dev/null @@ -1,31 +0,0 @@ -export function _id(s) { - return function (onError, onSuccess) { - s.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function branch(s) { - return function (name) { - return function () { - return s.branch(name); - }; - }; -} - -export function _commit(s) { - return function (onError, onSuccess) { - s.commit().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function tree(s) { - return function () { - return s.tree(); - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Git.purs b/sdk/purescript/demo/src/FluentCI/Git.purs deleted file mode 100644 index 379a880..0000000 --- a/sdk/purescript/demo/src/FluentCI/Git.purs +++ /dev/null @@ -1,24 +0,0 @@ -module FluentCI.Git where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Directory (Directory) - -data Git - -foreign import _id :: Git -> EffectFnAff String - -foreign import _commit :: Git -> EffectFnAff String - -id :: Git -> Aff String -id git = fromEffectFnAff $ _id git - -commit :: Git -> Aff String -commit git = fromEffectFnAff $ _commit git - -foreign import branch :: Git -> String -> Effect Git - -foreign import tree :: Git -> Effect Directory diff --git a/sdk/purescript/demo/src/FluentCI/Mise.js b/sdk/purescript/demo/src/FluentCI/Mise.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Mise.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Mise.purs b/sdk/purescript/demo/src/FluentCI/Mise.purs deleted file mode 100644 index e2302cf..0000000 --- a/sdk/purescript/demo/src/FluentCI/Mise.purs +++ /dev/null @@ -1,44 +0,0 @@ -module FluentCI.Mise where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -data Mise - -foreign import _id :: Mise -> EffectFnAff String - -foreign import _stderr :: Mise -> EffectFnAff String - -foreign import _stdout :: Mise -> EffectFnAff String - -foreign import asService :: Mise -> String -> Effect Service - - -id :: Mise -> Aff String -id mise = fromEffectFnAff $ _id mise - -stderr :: Mise -> Aff String -stderr mise = fromEffectFnAff $ _stderr mise - -stdout :: Mise -> Aff String -stdout mise = fromEffectFnAff $ _stdout mise - -foreign import waitOn :: Mise -> Int -> Int -> Effect Mise - -foreign import withCache :: Mise -> Cache -> Effect Mise - -foreign import withEnvVariable :: Mise -> String -> String -> Effect Mise - -foreign import withExec :: Mise -> Array String -> Effect Mise - -foreign import withSecretVariable :: Mise -> String -> Secret -> Effect Mise - -foreign import withService :: Mise -> Service -> Effect Mise - -foreign import withWorkdir :: Mise -> String -> Effect Mise \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Nix.js b/sdk/purescript/demo/src/FluentCI/Nix.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Nix.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Nix.purs b/sdk/purescript/demo/src/FluentCI/Nix.purs deleted file mode 100644 index a2e698d..0000000 --- a/sdk/purescript/demo/src/FluentCI/Nix.purs +++ /dev/null @@ -1,46 +0,0 @@ -module FluentCI.Nix where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -type NixArgs = { impure :: Boolean } - -data Nix - -foreign import _id :: Nix -> EffectFnAff String - -foreign import _stderr :: Nix -> EffectFnAff String - -foreign import _stdout :: Nix -> EffectFnAff String - -foreign import asService :: Nix -> String -> Effect Service - - -id :: Nix -> Aff String -id nix = fromEffectFnAff $ _id nix - -stderr :: Nix -> Aff String -stderr nix = fromEffectFnAff $ _stderr nix - -stdout :: Nix -> Aff String -stdout nix = fromEffectFnAff $ _stdout nix - -foreign import waitOn :: Nix -> Int -> Int -> Effect Nix - -foreign import withCache :: Nix -> Cache -> Effect Nix - -foreign import withEnvVariable :: Nix -> String -> String -> Effect Nix - -foreign import withExec :: Nix -> Array String -> Effect Nix - -foreign import withSecretVariable :: Nix -> String -> Secret -> Effect Nix - -foreign import withService :: Nix -> Service -> Effect Nix - -foreign import withWorkdir :: Nix -> String -> Effect Nix \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.js b/sdk/purescript/demo/src/FluentCI/Pipeline.js deleted file mode 100644 index b04e0e5..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pipeline.js +++ /dev/null @@ -1,140 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(s) { - return function (onError, onSuccess) { - s.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function devbox(s) { - return function () { - return s.devbox(); - }; -} - -export function devenv(s) { - return function () { - return s.devenv(); - }; -} - -export function envhub(s) { - return function () { - return s.envhub(); - }; -} - -export function mise(s) { - return function () { - return s.mise(); - }; -} - -export function nix(s) { - return function (args) { - return function () { - return s.nix(); - }; - }; -} - -export function pixi(s) { - return function () { - return s.pixi(); - }; -} - -export function pkgx(s) { - return function () { - return s.pkgx(); - }; -} - -export function _stderr(s) { - return function (onError, onSuccess) { - s.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(s) { - return function (onError, onSuccess) { - s.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(s) { - return function (port) { - return function (timeout) { - return function () { - return s.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(s) { - return function (cache) { - return function () { - return s.withCache(cache); - }; - }; -} - -export function withEnvVariable(s) { - return function (name) { - return function (value) { - return function () { - return s.withEnvVariable(name, value); - }; - }; - }; -} - -export function withSecretVariable(s) { - return function (name) { - return function (secret) { - return function () { - return s.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withExec(s) { - return function (command) { - return function () { - return s.withExec(command); - }; - }; -} - -export function withService(s) { - return function (service) { - return function () { - return s.withService(service); - }; - }; -} - -export function withWorkdir(s) { - return function (path) { - return function () { - return s.withWorkdir(path); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Pipeline.purs b/sdk/purescript/demo/src/FluentCI/Pipeline.purs deleted file mode 100644 index 580dc5c..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pipeline.purs +++ /dev/null @@ -1,64 +0,0 @@ -module FluentCI.Pipeline where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Devbox (Devbox) -import FluentCI.Devenv (Devenv) -import FluentCI.Envhub (Envhub) -import FluentCI.Mise (Mise) -import FluentCI.Nix (Nix, NixArgs) -import FluentCI.Pixi (Pixi) -import FluentCI.Pkgx (Pkgx) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -data Pipeline - -foreign import _id :: Pipeline -> EffectFnAff String - -foreign import _stderr :: Pipeline -> EffectFnAff String - -foreign import _stdout :: Pipeline -> EffectFnAff String - -id :: Pipeline -> Aff String -id pipeline = fromEffectFnAff $ _id pipeline - -stderr :: Pipeline -> Aff String -stderr pipeline = fromEffectFnAff $ _stderr pipeline - -stdout :: Pipeline -> Aff String -stdout pipeline = fromEffectFnAff $ _stdout pipeline - -foreign import asService :: Pipeline -> String -> Effect Service - -foreign import waitOn :: Pipeline -> Int -> Int -> Effect Pipeline - -foreign import devbox :: Pipeline -> Effect Devbox - -foreign import devenv :: Pipeline -> Effect Devenv - -foreign import envhub :: Pipeline -> Effect Envhub - -foreign import mise :: Pipeline -> Effect Mise - -foreign import nix :: Pipeline -> NixArgs -> Effect Nix - -foreign import pixi :: Pipeline -> Effect Pixi - -foreign import pkgx :: Pipeline -> Effect Pkgx - -foreign import withCache :: Pipeline -> Cache -> Effect Pipeline - -foreign import withEnvVariable :: Pipeline -> String -> String -> Effect Pipeline - -foreign import withSecretVariable :: Pipeline -> String -> Secret -> Effect Pipeline - -foreign import withExec :: Pipeline -> Array String -> Effect Pipeline - -foreign import withService :: Pipeline -> Service -> Effect Pipeline - -foreign import withWorkdir :: Pipeline -> String -> Effect Pipeline \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.js b/sdk/purescript/demo/src/FluentCI/Pixi.js deleted file mode 100644 index eefef49..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pixi.js +++ /dev/null @@ -1,96 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Pixi.purs b/sdk/purescript/demo/src/FluentCI/Pixi.purs deleted file mode 100644 index aa5e23b..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pixi.purs +++ /dev/null @@ -1,44 +0,0 @@ -module FluentCI.Pixi where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -data Pixi - -foreign import _id :: Pixi -> EffectFnAff String - -foreign import _stderr :: Pixi -> EffectFnAff String - -foreign import _stdout :: Pixi -> EffectFnAff String - -foreign import asService :: Pixi -> String -> Effect Service - - -id :: Pixi -> Aff String -id pixi = fromEffectFnAff $ _id pixi - -stderr :: Pixi -> Aff String -stderr pixi = fromEffectFnAff $ _stderr pixi - -stdout :: Pixi -> Aff String -stdout pixi = fromEffectFnAff $ _stdout pixi - -foreign import waitOn :: Pixi -> Int -> Int -> Effect Pixi - -foreign import withCache :: Pixi -> Cache -> Effect Pixi - -foreign import withEnvVariable :: Pixi -> String -> String -> Effect Pixi - -foreign import withExec :: Pixi -> Array String -> Effect Pixi - -foreign import withSecretVariable :: Pixi -> String -> Secret -> Effect Pixi - -foreign import withService :: Pixi -> Service -> Effect Pixi - -foreign import withWorkdir :: Pixi -> String -> Effect Pixi \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.js b/sdk/purescript/demo/src/FluentCI/Pkgx.js deleted file mode 100644 index 1cf3d95..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pkgx.js +++ /dev/null @@ -1,104 +0,0 @@ -export function asService(d) { - return function (name) { - return function () { - return d.asService(name); - }; - }; -} - -export function _id(d) { - return function (onError, onSuccess) { - d.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stderr(d) { - return function (onError, onSuccess) { - d.stderr().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _stdout(d) { - return function (onError, onSuccess) { - d.stdout().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function waitOn(d) { - return function (port) { - return function (timeout) { - return function () { - return d.waitOn(port, timeout); - }; - }; - }; -} - -export function withCache(d) { - return function (cache) { - return function () { - return d.withCache(cache); - }; - }; -} - -export function withEnvVariable(d) { - return function (name) { - return function (value) { - return function () { - return d.withEnvVariable(name, value); - }; - }; - }; -} - -export function withExec(d) { - return function (command) { - return function () { - return d.withExec(command); - }; - }; -} - -export function withSecretVariable(d) { - return function (name) { - return function (secret) { - return function () { - return d.withSecretVariable(name, secret); - }; - }; - }; -} - -export function withService(d) { - return function (service) { - return function () { - return d.withService(service); - }; - }; -} - -export function withWorkdir(d) { - return function (workdir) { - return function () { - return d.withWorkdir(workdir); - }; - }; -} - -export function withPackages(d) { - return function (packages) { - return function () { - return d.withPackages(packages); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Pkgx.purs b/sdk/purescript/demo/src/FluentCI/Pkgx.purs deleted file mode 100644 index 249e3ad..0000000 --- a/sdk/purescript/demo/src/FluentCI/Pkgx.purs +++ /dev/null @@ -1,46 +0,0 @@ -module FluentCI.Pkgx where - -import Prelude - -import Effect (Effect) -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) -import FluentCI.Cache (Cache) -import FluentCI.Secret (Secret) -import FluentCI.Service (Service) - -data Pkgx - -foreign import _id :: Pkgx -> EffectFnAff String - -foreign import _stderr :: Pkgx -> EffectFnAff String - -foreign import _stdout :: Pkgx -> EffectFnAff String - -foreign import asService :: Pkgx -> String -> Effect Service - - -id :: Pkgx -> Aff String -id pkgx = fromEffectFnAff $ _id pkgx - -stderr :: Pkgx -> Aff String -stderr pkgx = fromEffectFnAff $ _stderr pkgx - -stdout :: Pkgx -> Aff String -stdout pkgx = fromEffectFnAff $ _stdout pkgx - -foreign import waitOn :: Pkgx -> Int -> Int -> Effect Pkgx - -foreign import withCache :: Pkgx -> Cache -> Effect Pkgx - -foreign import withEnvVariable :: Pkgx -> String -> String -> Effect Pkgx - -foreign import withExec :: Pkgx -> Array String -> Effect Pkgx - -foreign import withSecretVariable :: Pkgx -> String -> Secret -> Effect Pkgx - -foreign import withService :: Pkgx -> Service -> Effect Pkgx - -foreign import withWorkdir :: Pkgx -> String -> Effect Pkgx - -foreign import withPackages :: Pkgx -> Array String -> Effect Pkgx \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Secret.js b/sdk/purescript/demo/src/FluentCI/Secret.js deleted file mode 100644 index d448a91..0000000 --- a/sdk/purescript/demo/src/FluentCI/Secret.js +++ /dev/null @@ -1,35 +0,0 @@ -export function _id(s) { - return function (onError, onSuccess) { - s.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _mount(s) { - return function (onError, onSuccess) { - s.mount().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _name(s) { - return function (onError, onSuccess) { - s.name().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _plaintext(s) { - return function (onError, onSuccess) { - s.plaintext().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Secret.purs b/sdk/purescript/demo/src/FluentCI/Secret.purs deleted file mode 100644 index cd67d5a..0000000 --- a/sdk/purescript/demo/src/FluentCI/Secret.purs +++ /dev/null @@ -1,31 +0,0 @@ -module FluentCI.Secret where - -import Prelude - -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) - - -data Secret - - -foreign import _id :: Secret -> EffectFnAff String - -foreign import _mount :: Secret -> EffectFnAff String - -foreign import _name :: Secret -> EffectFnAff String - -foreign import _plaintext :: Secret -> EffectFnAff String - - -id :: Secret -> Aff String -id secret = fromEffectFnAff $ _id secret - -mount :: Secret -> Aff String -mount secret = fromEffectFnAff $ _mount secret - -name :: Secret -> Aff String -name secret = fromEffectFnAff $ _name secret - -plaintext :: Secret -> Aff String -plaintext secret = fromEffectFnAff $ _plaintext secret \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/SecretManager.js b/sdk/purescript/demo/src/FluentCI/SecretManager.js deleted file mode 100644 index d3f33c2..0000000 --- a/sdk/purescript/demo/src/FluentCI/SecretManager.js +++ /dev/null @@ -1,19 +0,0 @@ -export function _id(s) { - return function (onError, onSuccess) { - s.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} - -export function _getSecret(s) { - return function (name) { - return function (onError, onSuccess) { - s.getSecret(name).then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/SecretManager.purs b/sdk/purescript/demo/src/FluentCI/SecretManager.purs deleted file mode 100644 index 3dbc086..0000000 --- a/sdk/purescript/demo/src/FluentCI/SecretManager.purs +++ /dev/null @@ -1,18 +0,0 @@ -module FluentCI.SecretManager where - -import Prelude - -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) - -data SecretManager - -foreign import _id :: SecretManager -> EffectFnAff String - -foreign import _getSecret :: SecretManager -> String -> EffectFnAff String - -id :: SecretManager -> Aff String -id secretManager = fromEffectFnAff $ _id secretManager - -getSecret :: SecretManager -> String -> Aff String -getSecret secretManager secretName = fromEffectFnAff $ _getSecret secretManager secretName \ No newline at end of file diff --git a/sdk/purescript/demo/src/FluentCI/Service.js b/sdk/purescript/demo/src/FluentCI/Service.js deleted file mode 100644 index de13cb8..0000000 --- a/sdk/purescript/demo/src/FluentCI/Service.js +++ /dev/null @@ -1,8 +0,0 @@ -export function _id(s) { - return function (onError, onSuccess) { - s.id().then(onSuccess).catch(onError); - return function (cancelError, onCancelerError, onCancelerSuccess) { - onCancelerSuccess(); - }; - }; -} diff --git a/sdk/purescript/demo/src/FluentCI/Service.purs b/sdk/purescript/demo/src/FluentCI/Service.purs deleted file mode 100644 index 4746f66..0000000 --- a/sdk/purescript/demo/src/FluentCI/Service.purs +++ /dev/null @@ -1,13 +0,0 @@ -module FluentCI.Service where - -import Prelude - -import Effect.Aff (Aff) -import Effect.Aff.Compat (EffectFnAff, fromEffectFnAff) - -data Service - -foreign import _id :: Service -> EffectFnAff String - -id :: Service -> Aff String -id service = fromEffectFnAff $ _id service \ No newline at end of file