diff --git a/helpers/setup.js b/helpers/setup.js deleted file mode 100644 index 7283f8b..0000000 --- a/helpers/setup.js +++ /dev/null @@ -1,34 +0,0 @@ -const sdk = require('node-appwrite'); -const config = { - project: '5d8fa6deefd05', - endpoint: 'https://localhost/v1', - key: '1589eb89e0c0153892c68867ea44137581a7a91390668ab1966a9c3a30a4d9ace58de90b3eaf61c0eae3f35e886b3d01cc8a674caf630c25a4428021ba0697cca5047b42bafb6710911e88fb1553d2833a221a94d2dc6fb55b7e500bc7873c4f09aab939e47aa959d55a972beacec8f7b86852b6842f4ca606908dea9d1cc7df', -}; - -// Init SDK -const client = new sdk.Client(); - -const database = new sdk.Database(client); - -client - .setSelfSigned(true) - .setProject(config.project) - .setKey(config.key) - // .setJWT('jwt') // set this to authenticate using JWT - .setEndpoint(config.endpoint) -; - -const collectionName = 'tasks'; -const read = ['role:all']; -const write = ['role:all']; - -const promise = database.createCollection(collectionName, read, write); - -promise.then(function(response) { - console.log('success'); - database.createBooleanAttribute(response.$id, 'completed', true, false, false); - database.createStringAttribute(response.$id, 'text', 255, true, '', false); -}, function(error) { - console.log('error', error.type, error.message); -}); - diff --git a/logs.txt b/logs.txt deleted file mode 100644 index 13a2698..0000000 --- a/logs.txt +++ /dev/null @@ -1,182 +0,0 @@ -2022-03-25T14:35:29.515440430Z REALTIME -2022-03-25T14:35:29.515472055Z string(20) "62387717329626ff1d5a" -2022-03-25T14:35:29.515476847Z array(24) { -2022-03-25T14:35:29.515479430Z ["$id"]=> -2022-03-25T14:35:29.515482055Z string(20) "623dd30d4fac1420fe6b" -2022-03-25T14:35:29.515484597Z ["userId"]=> -2022-03-25T14:35:29.515490138Z string(20) "623b66a849afa34b5d4e" -2022-03-25T14:35:29.515492430Z ["expire"]=> -2022-03-25T14:35:29.515494763Z int(1679754893) -2022-03-25T14:35:29.515497097Z ["provider"]=> -2022-03-25T14:35:29.515499388Z string(5) "email" -2022-03-25T14:35:29.515501638Z ["providerUid"]=> -2022-03-25T14:35:29.515503972Z string(16) "demo@example.com" -2022-03-25T14:35:29.515506263Z ["providerAccessToken"]=> -2022-03-25T14:35:29.515508597Z string(0) "" -2022-03-25T14:35:29.515510805Z ["providerAccessTokenExpiry"]=> -2022-03-25T14:35:29.515513055Z int(0) -2022-03-25T14:35:29.515515263Z ["providerRefreshToken"]=> -2022-03-25T14:35:29.515517513Z NULL -2022-03-25T14:35:29.515519680Z ["ip"]=> -2022-03-25T14:35:29.515521930Z string(10) "172.26.0.1" -2022-03-25T14:35:29.515524430Z ["osCode"]=> -2022-03-25T14:35:29.515526638Z string(3) "MAC" -2022-03-25T14:35:29.515528847Z ["osName"]=> -2022-03-25T14:35:29.515531055Z string(3) "Mac" -2022-03-25T14:35:29.515533263Z ["osVersion"]=> -2022-03-25T14:35:29.515535430Z string(5) "10.15" -2022-03-25T14:35:29.515537680Z ["clientType"]=> -2022-03-25T14:35:29.515539930Z string(7) "browser" -2022-03-25T14:35:29.515551597Z ["clientCode"]=> -2022-03-25T14:35:29.515554138Z string(2) "CH" -2022-03-25T14:35:29.515556430Z ["clientName"]=> -2022-03-25T14:35:29.515558680Z string(6) "Chrome" -2022-03-25T14:35:29.515560888Z ["clientVersion"]=> -2022-03-25T14:35:29.515563138Z string(4) "99.0" -2022-03-25T14:35:29.515565347Z ["clientEngine"]=> -2022-03-25T14:35:29.515567555Z string(5) "Blink" -2022-03-25T14:35:29.515569805Z ["clientEngineVersion"]=> -2022-03-25T14:35:29.515572013Z string(0) "" -2022-03-25T14:35:29.515574180Z ["deviceName"]=> -2022-03-25T14:35:29.515576388Z string(7) "desktop" -2022-03-25T14:35:29.515578680Z ["deviceBrand"]=> -2022-03-25T14:35:29.515580972Z string(5) "Apple" -2022-03-25T14:35:29.515583222Z ["deviceModel"]=> -2022-03-25T14:35:29.515585430Z string(0) "" -2022-03-25T14:35:29.515587638Z ["countryCode"]=> -2022-03-25T14:35:29.515589805Z string(2) "--" -2022-03-25T14:35:29.515592013Z ["countryName"]=> -2022-03-25T14:35:29.515594180Z string(7) "Unknown" -2022-03-25T14:35:29.515596388Z ["current"]=> -2022-03-25T14:35:29.515598638Z bool(true) -2022-03-25T14:35:29.515604138Z } -2022-03-25T14:35:29.515606555Z string(23) "account.sessions.delete" -2022-03-25T14:35:29.515608847Z array(2) { -2022-03-25T14:35:29.515611013Z [0]=> -2022-03-25T14:35:29.515613347Z string(7) "account" -2022-03-25T14:35:29.515615597Z [1]=> -2022-03-25T14:35:29.515676013Z string(28) "account.623b66a849afa34b5d4e" -2022-03-25T14:35:29.515682680Z } -2022-03-25T14:35:29.515686430Z array(1) { -2022-03-25T14:35:29.515690680Z [0]=> -2022-03-25T14:35:29.515693222Z string(25) "user:623b66a849afa34b5d4e" -2022-03-25T14:35:29.515695638Z } -2022-03-25T14:35:29.515697888Z array(2) { -2022-03-25T14:35:29.515700180Z ["permissionsChanged"]=> -2022-03-25T14:35:29.515702597Z bool(false) -2022-03-25T14:35:29.515704805Z ["userId"]=> -2022-03-25T14:35:29.515707180Z string(20) "623b66a849afa34b5d4e" -2022-03-25T14:35:29.515709680Z } - - -2022-03-25T14:35:45.111851132Z REALTIME -2022-03-25T14:35:45.112172923Z string(20) "62387717329626ff1d5a" -2022-03-25T14:35:45.112189423Z array(2) { -2022-03-25T14:35:45.112192382Z ["total"]=> -2022-03-25T14:35:45.112195048Z int(1) -2022-03-25T14:35:45.112196965Z ["sessions"]=> -2022-03-25T14:35:45.112198965Z array(1) { -2022-03-25T14:35:45.112200757Z [0]=> -2022-03-25T14:35:45.112202590Z array(24) { -2022-03-25T14:35:45.112204382Z ["$id"]=> -2022-03-25T14:35:45.112206298Z string(20) "623dd33bd57896abd469" -2022-03-25T14:35:45.112208173Z ["userId"]=> -2022-03-25T14:35:45.112210007Z string(20) "623b66a849afa34b5d4e" -2022-03-25T14:35:45.112211798Z ["expire"]=> -2022-03-25T14:35:45.112213590Z int(1679754939) -2022-03-25T14:35:45.112215382Z ["provider"]=> -2022-03-25T14:35:45.112217173Z string(5) "email" -2022-03-25T14:35:45.112219007Z ["providerUid"]=> -2022-03-25T14:35:45.112220840Z string(16) "demo@example.com" -2022-03-25T14:35:45.112222757Z ["providerAccessToken"]=> -2022-03-25T14:35:45.112224632Z string(0) "" -2022-03-25T14:35:45.112226423Z ["providerAccessTokenExpiry"]=> -2022-03-25T14:35:45.112229423Z int(0) -2022-03-25T14:35:45.112231423Z ["providerRefreshToken"]=> -2022-03-25T14:35:45.112243507Z NULL -2022-03-25T14:35:45.112246007Z ["ip"]=> -2022-03-25T14:35:45.112247840Z string(10) "172.26.0.1" -2022-03-25T14:35:45.112249673Z ["osCode"]=> -2022-03-25T14:35:45.112253048Z string(3) "MAC" -2022-03-25T14:35:45.112254965Z ["osName"]=> -2022-03-25T14:35:45.112256798Z string(3) "Mac" -2022-03-25T14:35:45.112259090Z ["osVersion"]=> -2022-03-25T14:35:45.112260965Z string(5) "10.15" -2022-03-25T14:35:45.112262757Z ["clientType"]=> -2022-03-25T14:35:45.112264548Z string(7) "browser" -2022-03-25T14:35:45.112266340Z ["clientCode"]=> -2022-03-25T14:35:45.112268132Z string(2) "CH" -2022-03-25T14:35:45.112269965Z ["clientName"]=> -2022-03-25T14:35:45.112271757Z string(6) "Chrome" -2022-03-25T14:35:45.112273840Z ["clientVersion"]=> -2022-03-25T14:35:45.112275632Z string(4) "99.0" -2022-03-25T14:35:45.112277382Z ["clientEngine"]=> -2022-03-25T14:35:45.112279173Z string(5) "Blink" -2022-03-25T14:35:45.112280965Z ["clientEngineVersion"]=> -2022-03-25T14:35:45.112282798Z string(0) "" -2022-03-25T14:35:45.112285882Z ["deviceName"]=> -2022-03-25T14:35:45.112287673Z string(7) "desktop" -2022-03-25T14:35:45.112289548Z ["deviceBrand"]=> -2022-03-25T14:35:45.112291340Z string(5) "Apple" -2022-03-25T14:35:45.112293132Z ["deviceModel"]=> -2022-03-25T14:35:45.112294923Z string(0) "" -2022-03-25T14:35:45.112296715Z ["countryCode"]=> -2022-03-25T14:35:45.112298465Z string(2) "--" -2022-03-25T14:35:45.112300257Z ["countryName"]=> -2022-03-25T14:35:45.112302007Z string(7) "Unknown" -2022-03-25T14:35:45.112303757Z ["current"]=> -2022-03-25T14:35:45.112305548Z bool(true) -2022-03-25T14:35:45.112307298Z } -2022-03-25T14:35:45.112309090Z } -2022-03-25T14:35:45.112310840Z } -2022-03-25T14:35:45.112312590Z string(23) "account.sessions.delete" -2022-03-25T14:35:45.112314465Z array(2) { -2022-03-25T14:35:45.112316215Z [0]=> -2022-03-25T14:35:45.112317965Z string(7) "account" -2022-03-25T14:35:45.112319840Z [1]=> -2022-03-25T14:35:45.112321632Z string(8) "account." -2022-03-25T14:35:45.112323465Z } -2022-03-25T14:35:45.112329715Z array(1) { -2022-03-25T14:35:45.112331632Z [0]=> -2022-03-25T14:35:45.112333423Z string(5) "user:" -2022-03-25T14:35:45.112335173Z } -2022-03-25T14:35:45.112336923Z array(2) { -2022-03-25T14:35:45.112338673Z ["permissionsChanged"]=> -2022-03-25T14:35:45.112340465Z bool(false) -2022-03-25T14:35:45.112342215Z ["userId"]=> -2022-03-25T14:35:45.112344007Z string(20) "623b66a849afa34b5d4e" -2022-03-25T14:35:45.112345840Z } - - - - - - -2022-03-25T15:22:39.752346212Z FROM PAYLOAD - account.sessions.delete -2022-03-25T15:22:39.752380379Z array(2) { -2022-03-25T15:22:39.752385046Z [0]=> -2022-03-25T15:22:39.752387254Z string(7) "account" -2022-03-25T15:22:39.752389254Z [1]=> -2022-03-25T15:22:39.752391129Z string(28) "account.623b66a849afa34b5d4e" -2022-03-25T15:22:39.752393046Z } -2022-03-25T15:22:39.752395171Z array(1) { -2022-03-25T15:22:39.752396962Z [0]=> -2022-03-25T15:22:39.752398754Z string(25) "user:623b66a849afa34b5d4e" -2022-03-25T15:22:39.752400546Z } -2022-03-25T15:22:39.752402254Z bool(false) -2022-03-25T15:22:39.752404046Z NULL - - -2022-03-25T15:22:44.291196339Z FROM PAYLOAD - account.sessions.delete -2022-03-25T15:22:44.291229089Z array(2) { -2022-03-25T15:22:44.291234048Z [0]=> -2022-03-25T15:22:44.291236673Z string(7) "account" -2022-03-25T15:22:44.291239131Z [1]=> -2022-03-25T15:22:44.291241464Z string(8) "account." -2022-03-25T15:22:44.291243714Z } -2022-03-25T15:22:44.291245839Z array(1) { -2022-03-25T15:22:44.291248006Z [0]=> -2022-03-25T15:22:44.291250173Z string(5) "user:" -2022-03-25T15:22:44.291252339Z } -2022-03-25T15:22:44.291254381Z bool(false) -2022-03-25T15:22:44.291256506Z NULL \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f086270..90b501d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "appwrite": "^8.0.1", + "appwrite": "10.0.1", "express": "^4.18.1", - "node-appwrite": "5.0.0" + "node-appwrite": "8.0.0" } }, "node_modules/accepts": { @@ -27,9 +27,9 @@ } }, "node_modules/appwrite": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-8.0.1.tgz", - "integrity": "sha512-nrslHlEgzESjeFWpqkh4fKWLRh5NROIj6emNibO5Nx9UIZA1RXP3QbPn3hKtRUSIQERypFUJnGIGXfvM46K9Yg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-10.0.1.tgz", + "integrity": "sha512-gG44Uj71t9s9NuUvS7ShzAj5jVDCVgdtDzA9gfM8r3d+U+mYQdCMR/yUShQmj1E3wo2d/FKdIY4zSX7WjdVszw==", "dependencies": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" @@ -46,11 +46,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", - "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "dependencies": { - "follow-redirects": "^1.14.7" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" } }, "node_modules/body-parser": { @@ -265,9 +266,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "funding": [ { "type": "individual", @@ -477,11 +478,11 @@ } }, "node_modules/node-appwrite": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-5.0.0.tgz", - "integrity": "sha512-VJ9e5+ra+ycQS17C0aJMbVXK4Gcja6at+f2EzlRlsjxAzTMetb79QJBOO6ktMtmVrUkAieMnaMZcV1hPppERmg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-8.0.0.tgz", + "integrity": "sha512-jNxVB/CG6aEJUHPq2/T0nuhavnX5E1OY5lJaB6nCYtAZ0OobR5+v6zzkScCjfhbTzZkzKn5GGP9duSuVWk12Dw==", "dependencies": { - "axios": "^0.25.0", + "axios": "^0.27.2", "form-data": "^4.0.0" } }, @@ -751,9 +752,9 @@ } }, "appwrite": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-8.0.1.tgz", - "integrity": "sha512-nrslHlEgzESjeFWpqkh4fKWLRh5NROIj6emNibO5Nx9UIZA1RXP3QbPn3hKtRUSIQERypFUJnGIGXfvM46K9Yg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/appwrite/-/appwrite-10.0.1.tgz", + "integrity": "sha512-gG44Uj71t9s9NuUvS7ShzAj5jVDCVgdtDzA9gfM8r3d+U+mYQdCMR/yUShQmj1E3wo2d/FKdIY4zSX7WjdVszw==", "requires": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" @@ -770,11 +771,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz", - "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==", + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", "requires": { - "follow-redirects": "^1.14.7" + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" } }, "body-parser": { @@ -945,9 +947,9 @@ } }, "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" }, "form-data": { "version": "4.0.0", @@ -1091,11 +1093,11 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "node-appwrite": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-5.0.0.tgz", - "integrity": "sha512-VJ9e5+ra+ycQS17C0aJMbVXK4Gcja6at+f2EzlRlsjxAzTMetb79QJBOO6ktMtmVrUkAieMnaMZcV1hPppERmg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-8.0.0.tgz", + "integrity": "sha512-jNxVB/CG6aEJUHPq2/T0nuhavnX5E1OY5lJaB6nCYtAZ0OobR5+v6zzkScCjfhbTzZkzKn5GGP9duSuVWk12Dw==", "requires": { - "axios": "^0.25.0", + "axios": "^0.27.2", "form-data": "^4.0.0" } }, diff --git a/package.json b/package.json index 05fb15b..16c0dac 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ }, "homepage": "https://github.com/appwrite/playground-for-js#readme", "dependencies": { - "appwrite": "^8.0.1", + "appwrite": "10.0.1", "express": "^4.18.1", - "node-appwrite": "5.0.0" + "node-appwrite": "8.0.0" } } diff --git a/public/index.html b/public/index.html index 65a6111..d28e1d4 100644 --- a/public/index.html +++ b/public/index.html @@ -3,14 +3,14 @@ - + Appwrite Playground - - + + - - + integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"/> + +