diff --git a/package-lock.json b/package-lock.json index bbe42e93..c180486b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "monday-sdk-js", - "version": "0.4.0-beta", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "monday-sdk-js", - "version": "0.4.0-beta", + "version": "0.4.1", "license": "MIT", "dependencies": { "node-fetch": "^2.6.0" @@ -4250,8 +4250,6 @@ }, "node_modules/fsevents/node_modules/abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -4259,8 +4257,6 @@ }, "node_modules/fsevents/node_modules/ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "inBundle": true, "license": "MIT", @@ -4271,8 +4267,6 @@ }, "node_modules/fsevents/node_modules/aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "inBundle": true, "license": "ISC", @@ -4280,8 +4274,6 @@ }, "node_modules/fsevents/node_modules/are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "inBundle": true, "license": "ISC", @@ -4293,8 +4285,6 @@ }, "node_modules/fsevents/node_modules/balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "inBundle": true, "license": "MIT", @@ -4302,8 +4292,6 @@ }, "node_modules/fsevents/node_modules/brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "inBundle": true, "license": "MIT", @@ -4322,8 +4310,6 @@ }, "node_modules/fsevents/node_modules/code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "inBundle": true, "license": "MIT", @@ -4334,8 +4320,6 @@ }, "node_modules/fsevents/node_modules/concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "inBundle": true, "license": "MIT", @@ -4343,8 +4327,6 @@ }, "node_modules/fsevents/node_modules/console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "inBundle": true, "license": "ISC", @@ -4352,8 +4334,6 @@ }, "node_modules/fsevents/node_modules/core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "inBundle": true, "license": "MIT", @@ -4361,8 +4341,6 @@ }, "node_modules/fsevents/node_modules/debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "inBundle": true, "license": "MIT", @@ -4373,8 +4351,6 @@ }, "node_modules/fsevents/node_modules/deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "inBundle": true, "license": "MIT", @@ -4385,8 +4361,6 @@ }, "node_modules/fsevents/node_modules/delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "inBundle": true, "license": "MIT", @@ -4394,8 +4368,6 @@ }, "node_modules/fsevents/node_modules/detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "inBundle": true, "license": "Apache-2.0", @@ -4419,8 +4391,6 @@ }, "node_modules/fsevents/node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "inBundle": true, "license": "ISC", @@ -4428,8 +4398,6 @@ }, "node_modules/fsevents/node_modules/gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "inBundle": true, "license": "ISC", @@ -4465,8 +4433,6 @@ }, "node_modules/fsevents/node_modules/has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "inBundle": true, "license": "ISC", @@ -4474,8 +4440,6 @@ }, "node_modules/fsevents/node_modules/iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "inBundle": true, "license": "MIT", @@ -4489,8 +4453,6 @@ }, "node_modules/fsevents/node_modules/ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -4501,8 +4463,6 @@ }, "node_modules/fsevents/node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "inBundle": true, "license": "ISC", @@ -4521,8 +4481,6 @@ }, "node_modules/fsevents/node_modules/ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "inBundle": true, "license": "ISC", @@ -4533,8 +4491,6 @@ }, "node_modules/fsevents/node_modules/is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "inBundle": true, "license": "MIT", @@ -4548,8 +4504,6 @@ }, "node_modules/fsevents/node_modules/isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "inBundle": true, "license": "MIT", @@ -4557,8 +4511,6 @@ }, "node_modules/fsevents/node_modules/minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "inBundle": true, "license": "ISC", @@ -4572,8 +4524,6 @@ }, "node_modules/fsevents/node_modules/minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "inBundle": true, "license": "MIT", @@ -4602,8 +4552,6 @@ }, "node_modules/fsevents/node_modules/mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "inBundle": true, "license": "MIT", @@ -4642,8 +4590,6 @@ }, "node_modules/fsevents/node_modules/node-pre-gyp": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "inBundle": true, "license": "BSD-3-Clause", @@ -4666,8 +4612,6 @@ }, "node_modules/fsevents/node_modules/nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "inBundle": true, "license": "ISC", @@ -4682,8 +4626,6 @@ }, "node_modules/fsevents/node_modules/npm-bundled": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "inBundle": true, "license": "ISC", @@ -4702,8 +4644,6 @@ }, "node_modules/fsevents/node_modules/npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "inBundle": true, "license": "ISC", @@ -4717,8 +4657,6 @@ }, "node_modules/fsevents/node_modules/number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "inBundle": true, "license": "MIT", @@ -4729,8 +4667,6 @@ }, "node_modules/fsevents/node_modules/object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "inBundle": true, "license": "MIT", @@ -4741,8 +4677,6 @@ }, "node_modules/fsevents/node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "inBundle": true, "license": "ISC", @@ -4753,8 +4687,6 @@ }, "node_modules/fsevents/node_modules/os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "inBundle": true, "license": "MIT", @@ -4765,8 +4697,6 @@ }, "node_modules/fsevents/node_modules/os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "inBundle": true, "license": "MIT", @@ -4777,8 +4707,6 @@ }, "node_modules/fsevents/node_modules/osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "inBundle": true, "license": "ISC", @@ -4790,8 +4718,6 @@ }, "node_modules/fsevents/node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "inBundle": true, "license": "MIT", @@ -4809,8 +4735,6 @@ }, "node_modules/fsevents/node_modules/rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "inBundle": true, "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", @@ -4834,8 +4758,6 @@ }, "node_modules/fsevents/node_modules/readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "inBundle": true, "license": "MIT", @@ -4852,8 +4774,6 @@ }, "node_modules/fsevents/node_modules/rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "inBundle": true, "license": "ISC", @@ -4867,8 +4787,6 @@ }, "node_modules/fsevents/node_modules/safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "inBundle": true, "license": "MIT", @@ -4876,8 +4794,6 @@ }, "node_modules/fsevents/node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "inBundle": true, "license": "MIT", @@ -4885,8 +4801,6 @@ }, "node_modules/fsevents/node_modules/sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "inBundle": true, "license": "ISC", @@ -4894,8 +4808,6 @@ }, "node_modules/fsevents/node_modules/semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "inBundle": true, "license": "ISC", @@ -4906,8 +4818,6 @@ }, "node_modules/fsevents/node_modules/set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "inBundle": true, "license": "ISC", @@ -4915,8 +4825,6 @@ }, "node_modules/fsevents/node_modules/signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "inBundle": true, "license": "ISC", @@ -4924,8 +4832,6 @@ }, "node_modules/fsevents/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "inBundle": true, "license": "MIT", @@ -4936,8 +4842,6 @@ }, "node_modules/fsevents/node_modules/string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "inBundle": true, "license": "MIT", @@ -4953,8 +4857,6 @@ }, "node_modules/fsevents/node_modules/strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "inBundle": true, "license": "MIT", @@ -4968,8 +4870,6 @@ }, "node_modules/fsevents/node_modules/strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "inBundle": true, "license": "MIT", @@ -4999,8 +4899,6 @@ }, "node_modules/fsevents/node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "inBundle": true, "license": "MIT", @@ -5008,8 +4906,6 @@ }, "node_modules/fsevents/node_modules/wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "inBundle": true, "license": "ISC", @@ -5020,8 +4916,6 @@ }, "node_modules/fsevents/node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "inBundle": true, "license": "ISC", @@ -5029,8 +4923,6 @@ }, "node_modules/fsevents/node_modules/yallist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "dev": true, "inBundle": true, "license": "ISC", diff --git a/package.json b/package.json index 2851fec5..e24f0184 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monday-sdk-js", - "version": "0.4.0", + "version": "0.4.1", "private": false, "repository": "https://github.com/mondaycom/monday-sdk-js", "main": "src/index.js", @@ -47,6 +47,7 @@ "precommit": "yarn lint && yarn style-check", "lint": "eslint './src/**/*.*'", "style-check": "prettier --check './src/**/*.js'", + "style-fix": "prettier --write './src/**/*.js'", "compile-types": "tsc --noEmit" } } diff --git a/src/client.js b/src/client.js index a2f7cd91..62318c7a 100644 --- a/src/client.js +++ b/src/client.js @@ -6,6 +6,11 @@ const { initBackgroundTracking } = require("./services/background-tracking-servi const EMPTY_ARRAY = []; +const STORAGE_SEGMENT_KINDS = { + GLOBAL: "v2", + INSTANCE: "instance" +}; + class MondayClientSdk { constructor(options = {}) { this._clientId = options.clientId; @@ -26,6 +31,9 @@ class MondayClientSdk { this._receiveMessage = this._receiveMessage.bind(this); this.storage = { + setItem: this.setStorageItem.bind(this), + getItem: this.getStorageItem.bind(this), + deleteItem: this.deleteStorageItem.bind(this), instance: { setItem: this.setStorageInstanceItem.bind(this), getItem: this.getStorageInstanceItem.bind(this), @@ -110,16 +118,28 @@ class MondayClientSdk { window.location = url; } + setStorageItem(key, value, options = {}) { + return this._localApi("storage", { method: "set", key, value, options, segment: STORAGE_SEGMENT_KINDS.GLOBAL }); + } + + getStorageItem(key, options = {}) { + return this._localApi("storage", { method: "get", key, options, segment: STORAGE_SEGMENT_KINDS.GLOBAL }); + } + + deleteStorageItem(key, options = {}) { + return this._localApi("storage", { method: "delete", key, options, segment: STORAGE_SEGMENT_KINDS.GLOBAL }); + } + setStorageInstanceItem(key, value, options = {}) { - return this._localApi("storage", { method: "set", key, value, options, segment: "instance" }); + return this._localApi("storage", { method: "set", key, value, options, segment: STORAGE_SEGMENT_KINDS.INSTANCE }); } getStorageInstanceItem(key, options = {}) { - return this._localApi("storage", { method: "get", key, options, segment: "instance" }); + return this._localApi("storage", { method: "get", key, options, segment: STORAGE_SEGMENT_KINDS.INSTANCE }); } deleteStorageInstanceItem(key, options = {}) { - return this._localApi("storage", { method: "delete", key, options, segment: "instance" }); + return this._localApi("storage", { method: "delete", key, options, segment: STORAGE_SEGMENT_KINDS.INSTANCE }); } _localApi(method, args) { diff --git a/types/client-data.interface.ts b/types/client-data.interface.ts index 5c1fd155..a3d3b8e1 100644 --- a/types/client-data.interface.ts +++ b/types/client-data.interface.ts @@ -17,7 +17,7 @@ interface GetResponse { interface DeleteResponse { data: { success: boolean; - value: any; + value: any; }; errorMessage?: string | undefined; method: string; @@ -70,7 +70,7 @@ export interface ClientData { * @param params object containing the data you want to update */ set( - type: SettableTypes, + type: SettableTypes, params: object, ): Promise; @@ -84,26 +84,50 @@ export interface ClientData { * Apps cannot share storage across accounts or even across apps installed in the same location. */ storage: { + /** + * Returns a stored value from the database under `key` for the app (**without any reference to the instance**) + * @param {string} key - Used to access to stored data + */ + getItem(key: string): Promise; + + /** + * Deletes a stored value from the database under `key` for the app (**without any reference to the instance**) + * @param {string} key - Used to delete the stored data + */ + deleteItem(key: string): Promise; + + /** + * Stores `value` under `key` in the database for the app (**without any reference to the instance**) + * @param {string} key - Used to delete the stored data + * @param {any} value - The value to store + * @param {object=} options + * @param {string=} options.previous_version - Use the new version of the storage (instance-less) + */ + setItem(key: string, value: any, options?: { previous_version?: string }): Promise; + /*** + * The instance storage is a key-value database that is scoped to a specific app instance. + * **Does not work** for instance-less apps. + */ instance: { /** - * Returns a stored value from the database under `key` + * Returns a stored value from the database under `key` for a specific app instance * @param key */ getItem(key: string): Promise; - + /** - * Deletes a stored value from the database under `key` + * Deletes a stored value from the database under `key` for a specific app instance * @param key */ deleteItem(key: string): Promise; - + /** - * Stores `value` under `key` in the database + * Stores `value` under `key` in the database for a specific app instance * @param key * @param value * @param options */ setItem(key: string, value: any, options?: { previous_version?: string }): Promise; }; - }; + }; }